Class WeatherWarnings

java.lang.Object
de.kaffeemitkoffein.tinyweatherforecastgermany.WeatherWarnings

public class WeatherWarnings extends Object
  • Field Details

  • Constructor Details

    • WeatherWarnings

      public WeatherWarnings()
  • Method Details

    • writeWarningsToDatabase

      public static void writeWarningsToDatabase(Context context, ArrayList<WeatherWarning> warnings)
    • getCurrentWarnings

      public static ArrayList<WeatherWarning> getCurrentWarnings(Context context, boolean initPolygons)
    • cleanWeatherWarningsDatabase

      public static void cleanWeatherWarningsDatabase(Context context)
    • getWarningsForLocation

      public static ArrayList<WeatherWarning> getWarningsForLocation(Context context, ArrayList<WeatherWarning> warnings, Weather.WeatherLocation location)
    • isMoreThan24hAway

      public static boolean isMoreThan24hAway(long start)
    • getTimeMiniString

      public static String getTimeMiniString(long time)
    • getOnsetMiniString

      public static String getOnsetMiniString(Context context, WeatherWarning weatherWarning)
    • getExpiresMiniString

      public static String getExpiresMiniString(Context context, WeatherWarning weatherWarning)
    • getMiniWarningsString

      public static SpannableStringBuilder getMiniWarningsString(Context context, ArrayList<WeatherWarning> applicableWarnings, long itemStartTime, long itemStopTime, boolean multiLine, int textType)
    • addToNotified

      public static long addToNotified(Context context, WeatherWarnings.WarningNotification warningNotification)
    • addToNotified

      public static long addToNotified(Context context, WeatherWarning warning, int id)
    • getNotificationElements

      public static ArrayList<WeatherWarnings.WarningNotification> getNotificationElements(Context context)
    • getNotificationIdFromWeatherWarning

      public static Integer getNotificationIdFromWeatherWarning(ArrayList<WeatherWarnings.WarningNotification> warningNotifications, WeatherWarning weatherWarning)
    • getExpiredWarningIds

      public static ArrayList<Integer> getExpiredWarningIds(Context context)
    • alreadyNotified

      public static boolean alreadyNotified(Context context, WeatherWarning weatherWarning)
    • clearNotified

      public static int clearNotified(Context context)
    • clearAllNotified

      public static int clearAllNotified(Context context)
    • getFirstNotificationCancelTimeInMillis

      public static long getFirstNotificationCancelTimeInMillis(Context context)
    • getFirstWarningPosition

      public static int getFirstWarningPosition(ArrayList<WeatherWarning> fullList, ArrayList<WeatherWarning> applyingList)
      Determines first position in fullList that corresponds to the items in applyingList, defined by "identifier". As both warning lists are sorted by serverity, it also returns the 1st item of the highest severity. If more than one item has the highest severity, simply the first one found is retured. Both lists may not be null! Returns 0 if no warnings are found.
      Parameters:
      fullList -
      applyingList -
      Returns: