Class ClassicWidget
- java.lang.Object
-
- AppWidgetProvider
-
- de.kaffeemitkoffein.tinyweatherforecastgermany.ClassicWidget
-
- Direct Known Subclasses:
BoldWidget,ChartWidget,ClockWidget
public class ClassicWidget extends AppWidgetProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClassicWidget.WidgetDimensionManagerThis class provides some methods to determine the approximate current size of a widget in pixels.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNOT_AVAILABLEstatic java.lang.StringWIDGET_CUSTOM_REFRESH_ACTION
-
Constructor Summary
Constructors Constructor Description ClassicWidget()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static floatGetFontSize(float maxReferenceWidth, float maxReferenceHeight, java.lang.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 Detail
-
WIDGET_CUSTOM_REFRESH_ACTION
public static final java.lang.String WIDGET_CUSTOM_REFRESH_ACTION
- See Also:
- Constant Field Values
-
NOT_AVAILABLE
public static final java.lang.String NOT_AVAILABLE
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public void setPressure(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo)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
public void setClouds(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo)
-
setTemperature5cm
public void setTemperature5cm(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo)
-
setHumidity
public void setHumidity(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo)
-
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, java.lang.String STRING_TEMPLATE)
-
-