Class WeatherWarnings
java.lang.Object
de.kaffeemitkoffein.tinyweatherforecastgermany.WeatherWarnings
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final SimpleDateFormatstatic final SimpleDateFormat -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longaddToNotified(Context context, WeatherWarning warning, int id) static longaddToNotified(Context context, WeatherWarnings.WarningNotification warningNotification) static booleanalreadyNotified(Context context, WeatherWarning weatherWarning) static voidcleanWeatherWarningsDatabase(Context context) static intclearAllNotified(Context context) static intclearNotified(Context context) static ArrayList<WeatherWarning> getCurrentWarnings(Context context, boolean initPolygons) getExpiredWarningIds(Context context) static StringgetExpiresMiniString(Context context, WeatherWarning weatherWarning) static longgetFirstNotificationCancelTimeInMillis(Context context) static intgetFirstWarningPosition(ArrayList<WeatherWarning> fullList, ArrayList<WeatherWarning> applyingList) Determines first position in fullList that corresponds to the items in applyingList, defined by "identifier".static SpannableStringBuildergetMiniWarningsString(Context context, ArrayList<WeatherWarning> applicableWarnings, long itemStartTime, long itemStopTime, boolean multiLine, int textType) getNotificationElements(Context context) static IntegergetNotificationIdFromWeatherWarning(ArrayList<WeatherWarnings.WarningNotification> warningNotifications, WeatherWarning weatherWarning) static StringgetOnsetMiniString(Context context, WeatherWarning weatherWarning) static StringgetTimeMiniString(long time) static ArrayList<WeatherWarning> getWarningsForLocation(Context context, ArrayList<WeatherWarning> warnings, Weather.WeatherLocation location) static booleanisMoreThan24hAway(long start) static voidwriteWarningsToDatabase(Context context, ArrayList<WeatherWarning> warnings)
-
Field Details
-
COMMUNEUNION_DWD_DIFF
public static final int COMMUNEUNION_DWD_DIFF- See Also:
-
COMMUNEUNION_DWD_STAT
public static final int COMMUNEUNION_DWD_STAT- See Also:
-
simpleDateFormat
-
simpleDateFormat2
-
-
Constructor Details
-
WeatherWarnings
public WeatherWarnings()
-
-
Method Details
-
writeWarningsToDatabase
-
getCurrentWarnings
-
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
-
getOnsetMiniString
-
getExpiresMiniString
-
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
-
getNotificationElements
public static ArrayList<WeatherWarnings.WarningNotification> getNotificationElements(Context context) -
getNotificationIdFromWeatherWarning
public static Integer getNotificationIdFromWeatherWarning(ArrayList<WeatherWarnings.WarningNotification> warningNotifications, WeatherWarning weatherWarning) -
getExpiredWarningIds
-
alreadyNotified
-
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:
-