Class ClassicWidget
AppWidgetProvider
de.kaffeemitkoffein.tinyweatherforecastgermany.ClassicWidget
- Direct Known Subclasses:
BoldWidget,ChartWidget,ClockWidget
public class ClassicWidget extends AppWidgetProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis class provides some methods to determine the approximate current size of a widget in pixels. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic floatGetFontSize(float maxReferenceWidth, float maxReferenceHeight, String STRING_TEMPLATE) voidonAppWidgetOptionsChanged(Context c, AppWidgetManager awm, int appWidgetID, Bundle newOptions) voidonDeleted(Context c, int[] ints) voidonDisabled(Context c) voidonEnabled(Context c) This is called when the widget gets enabled.voidonReceive(Context c, Intent i) This overrides the onReceive method to filter the call to simply update the display of the widgets.voidonRestored(Context c, int[] ints, int[] ints2) voidonUpdate(Context c, AppWidgetManager awm, int[] widget_instances) voidsetAlarmText(Context context, RemoteViews remoteViews) voidsetClassicWidgetItems(RemoteViews remoteViews, CurrentWeatherInfo weatherCard, Context c) voidsetClassicWidgetItems(RemoteViews remoteViews, CurrentWeatherInfo weatherCard, Context c, boolean shorten_text) voidsetClouds(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo) voidsetConditionIcon(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo) voidsetConditionText(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo) voidsetDateText(Context context, RemoteViews remoteViews) voidsetHumidity(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo) voidsetLocationText(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo, boolean shorten_text) voidsetPrecipitation(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo) voidsetPressure(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo) Updates the display of the wigdgets.voidsetTemperature5cm(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo) voidsetVisibility(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo, int display_distance_unit) voidsetWarningIcon(Context context, RemoteViews remoteViews, int imageViewId) voidsetWarningTextAndIcon(Context context, RemoteViews remoteViews, int containerID, int imageViewId, int textViewId, int moreID) voidupdateWidgetDisplay(Context c, AppWidgetManager awm, int[] widget_instances, int source) voidwidgetRefreshAction(Context c, Intent i, int source)
-
Field Details
-
WIDGET_CUSTOM_REFRESH_ACTION
- See Also:
-
NOT_AVAILABLE
- See Also:
-
-
Constructor Details
-
ClassicWidget
public ClassicWidget()
-
-
Method Details
-
onEnabled
public void onEnabled(Context c) This is called when the widget gets enabled. -
onDisabled
public void onDisabled(Context c) -
onDeleted
public void onDeleted(Context c, int[] ints) -
onRestored
public void onRestored(Context c, int[] ints, int[] ints2) -
onAppWidgetOptionsChanged
public void onAppWidgetOptionsChanged(Context c, AppWidgetManager awm, int appWidgetID, Bundle newOptions) -
onUpdate
public void onUpdate(Context c, AppWidgetManager awm, int[] widget_instances) -
onReceive
public void onReceive(Context c, Intent i) This overrides the onReceive method to filter the call to simply update the display of the widgets. The broadcast is sent by the DataFetcher after a successful data update from the api.- Parameters:
c-i-
-
setPressure
Updates the display of the wigdgets. -
setPrecipitation
public void setPrecipitation(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo) -
setVisibility
public void setVisibility(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo, int display_distance_unit) -
setClouds
-
setTemperature5cm
public void setTemperature5cm(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo) -
setHumidity
-
setDateText
public void setDateText(Context context, RemoteViews remoteViews) -
setAlarmText
public void setAlarmText(Context context, RemoteViews remoteViews) -
setConditionText
public void setConditionText(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo) -
setConditionIcon
public void setConditionIcon(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo) -
setLocationText
public void setLocationText(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo, boolean shorten_text) -
setWarningTextAndIcon
public void setWarningTextAndIcon(Context context, RemoteViews remoteViews, int containerID, int imageViewId, int textViewId, int moreID) -
setWarningIcon
public void setWarningIcon(Context context, RemoteViews remoteViews, int imageViewId) -
setClassicWidgetItems
public void setClassicWidgetItems(RemoteViews remoteViews, CurrentWeatherInfo weatherCard, Context c, boolean shorten_text) -
setClassicWidgetItems
public void setClassicWidgetItems(RemoteViews remoteViews, CurrentWeatherInfo weatherCard, Context c) -
updateWidgetDisplay
public void updateWidgetDisplay(Context c, AppWidgetManager awm, int[] widget_instances, int source) -
widgetRefreshAction
public void widgetRefreshAction(Context c, Intent i, int source) -
GetFontSize
public static float GetFontSize(float maxReferenceWidth, float maxReferenceHeight, String STRING_TEMPLATE)
-