Class MainActivity


  • public class MainActivity
    extends Activity
    • Field Detail

      • MAINAPP_CUSTOM_REFRESH_ACTION

        public static final java.lang.String MAINAPP_CUSTOM_REFRESH_ACTION
        See Also:
        Constant Field Values
      • MAINAPP_SSL_ERROR

        public static final java.lang.String MAINAPP_SSL_ERROR
        See Also:
        Constant Field Values
      • MAINAPP_SHOW_PROGRESS

        public static final java.lang.String MAINAPP_SHOW_PROGRESS
        See Also:
        Constant Field Values
      • MAINAPP_HIDE_PROGRESS

        public static final java.lang.String MAINAPP_HIDE_PROGRESS
        See Also:
        Constant Field Values
      • MAINAPP_AREADB_PROGRESS

        public static final java.lang.String MAINAPP_AREADB_PROGRESS
        See Also:
        Constant Field Values
      • MAINAPP_AREADB_READY

        public static final java.lang.String MAINAPP_AREADB_READY
        See Also:
        Constant Field Values
      • EXTRA_AREADB_PROGRESS_VALUE

        public static final java.lang.String EXTRA_AREADB_PROGRESS_VALUE
        See Also:
        Constant Field Values
      • EXTRA_AREADB_PROGRESS_TEXT

        public static final java.lang.String EXTRA_AREADB_PROGRESS_TEXT
        See Also:
        Constant Field Values
      • EXTRA_ISFIRSTAPPLAUNCH

        public static final java.lang.String EXTRA_ISFIRSTAPPLAUNCH
        See Also:
        Constant Field Values
      • PERMISSION_CALLBACK_ALL

        public static final int PERMISSION_CALLBACK_ALL
        See Also:
        Constant Field Values
      • PERMISSION_CALLBACK_LOCATION

        public static final int PERMISSION_CALLBACK_LOCATION
        See Also:
        Constant Field Values
      • PERMISSION_CALLBACK_LOCATION_BEFORE_BACKGROUND

        public static final int PERMISSION_CALLBACK_LOCATION_BEFORE_BACKGROUND
        See Also:
        Constant Field Values
      • PERMISSION_CALLBACK_BACKGROUND_LOCATION

        public static final int PERMISSION_CALLBACK_BACKGROUND_LOCATION
        See Also:
        Constant Field Values
      • PERMISSION_CALLBACK_POST_NOTIFICATIONS

        public static final int PERMISSION_CALLBACK_POST_NOTIFICATIONS
        See Also:
        Constant Field Values
      • DUMMY_ACCOUNT_NAME

        public static final java.lang.String DUMMY_ACCOUNT_NAME
        See Also:
        Constant Field Values
      • DUMMY_ACCOUNT_PASS

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

      • MainActivity

        public MainActivity()
    • Method Detail

      • onPause

        protected void onPause()
      • onSaveInstanceState

        public void onSaveInstanceState​(Bundle savedInstanceState)
      • onRestoreInstanceState

        public void onRestoreInstanceState​(Bundle restoreInstanceState)
      • onStart

        protected void onStart()
      • onResume

        protected void onResume()
      • onStop

        protected void onStop()
      • onDestroy

        protected void onDestroy()
      • onCreate

        protected void onCreate​(Bundle savedInstanceState)
      • getEstimatedAdapterLayoutTimeInMillis

        public static long getEstimatedAdapterLayoutTimeInMillis​(Context context)
      • loadStationsData

        public void loadStationsData()
      • displayUpdateTime

        public void displayUpdateTime​(CurrentWeatherInfo currentWeatherInfo)
      • displayWeatherForecast

        public void displayWeatherForecast()
      • forcedOverallUpdate

        public void forcedOverallUpdate()
      • getColorFromResource

        public static int getColorFromResource​(Context context,
                                               int id)
      • setOverflowMenuItemColor

        public static void setOverflowMenuItemColor​(Context context,
                                                    Menu menu,
                                                    int id,
                                                    int string_id)
      • onCreateOptionsMenu

        public boolean onCreateOptionsMenu​(Menu menu)
      • onMenuOpened

        public boolean onMenuOpened​(int featureID,
                                    Menu menu)
      • onOptionsMenuClosed

        public void onOptionsMenuClosed​(Menu menu)
      • onOptionsItemSelected

        public boolean onOptionsItemSelected​(MenuItem mi)
      • showAboutDialog

        public void showAboutDialog()
      • showWhatsNewDialog

        public void showWhatsNewDialog()
      • deleteAreaDatabase

        public static void deleteAreaDatabase​(Context context)
      • prepareAreaDatabase

        public static boolean prepareAreaDatabase​(Context context)
      • askDialog

        public static void askDialog​(Context context,
                                     java.lang.Integer icon,
                                     java.lang.String title,
                                     java.lang.String[] text,
                                     DialogInterface.OnClickListener positiveListener)
      • popupHint

        public void popupHint()
      • requestPermissionsAndShowHints

        public void requestPermissionsAndShowHints()
      • onRequestPermissionsResult

        public void onRequestPermissionsResult​(int permRequestCode,
                                               java.lang.String[] perms,
                                               int[] grantRes)
      • onTrimMemory

        public void onTrimMemory​(int level)
      • standardizeGeo

        public java.lang.String standardizeGeo​(java.lang.String s)
      • isIgnoringBatteryOptimizations

        public static boolean isIgnoringBatteryOptimizations​(Context context)
        Checks if battery optimizations are ignored. Returns true if ignored or not in place (api below 23), returns false if in place or powerManager not accessible.
        Parameters:
        context -
        Returns:
      • isDataSaverActive

        public static boolean isDataSaverActive​(Context context)
      • checkForBatteryOptimizationForLocation

        public boolean checkForBatteryOptimizationForLocation​(Context context)
      • updateAppViews

        public static void updateAppViews​(Context context,
                                          CurrentWeatherInfo weatherCard)
      • getWeatherAccount

        public static Account getWeatherAccount​(Context context)
      • isSyncAccountEnabled

        public static boolean isSyncAccountEnabled​(Context context)
      • setSyncAccountEnabled

        public static void setSyncAccountEnabled​(Context context,
                                                 Account account,
                                                 boolean enable)
      • registerSyncAdapter

        public static void registerSyncAdapter​(Context context)
      • getManualSyncRequest

        public static SyncRequest getManualSyncRequest​(Context context,
                                                       int updateFlags)
      • showMainappProgress

        public void showMainappProgress()
      • hideMainappProgress

        public void hideMainappProgress()