Class ClassicWidget

    • Field Detail

      • WIDGET_CUSTOM_REFRESH_ACTION

        public static final java.lang.String WIDGET_CUSTOM_REFRESH_ACTION
        See Also:
        Constant Field Values
    • Constructor Detail

      • ClassicWidget

        public ClassicWidget()
    • 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)