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 class
ClassicWidget.WidgetDimensionManager
This 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.String
NOT_AVAILABLE
static java.lang.String
WIDGET_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 float
getMaxPossibleFontsize(java.lang.String string, float max_width, float max_height, java.lang.Float offset)
void
onAppWidgetOptionsChanged(Context c, AppWidgetManager awm, int appWidgetID, Bundle newOptions)
void
onDeleted(Context c, int[] ints)
void
onDisabled(Context c)
void
onEnabled(Context c)
This is called when the widget gets enabled.void
onReceive(Context c, Intent i)
This overrides the onReceive method to filter the call to simply update the display of the widgets.void
onRestored(Context c, int[] ints, int[] ints2)
void
onUpdate(Context c, AppWidgetManager awm, int[] widget_instances)
void
setAlarmText(Context context, RemoteViews remoteViews)
void
setClassicWidgetItems(RemoteViews remoteViews, CurrentWeatherInfo weatherCard, Context c)
void
setClassicWidgetItems(RemoteViews remoteViews, CurrentWeatherInfo weatherCard, Context c, boolean shorten_text)
void
setClouds(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo)
void
setConditionIcon(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo)
void
setConditionText(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo)
void
setDateText(Context context, RemoteViews remoteViews)
void
setHumidity(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo)
void
setLocationText(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo, boolean shorten_text)
void
setPrecipitation(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo)
void
setPressure(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo)
Updates the display of the wigdgets.void
setTemperature5cm(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo)
void
setVisibility(Context context, RemoteViews remoteViews, CurrentWeatherInfo weatherInfo, int display_distance_unit)
void
setWarningIcon(Context context, RemoteViews remoteViews, int imageViewId)
void
setWarningTextAndIcon(Context context, RemoteViews remoteViews, int containerID, int imageViewId, int textViewId, int moreID)
void
updateWidgetDisplay(Context c, AppWidgetManager awm, int[] widget_instances, int source)
void
widgetRefreshAction(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)
-
getMaxPossibleFontsize
public static float getMaxPossibleFontsize(java.lang.String string, float max_width, float max_height, java.lang.Float offset)
-
-