Gix switcher, update glance, add glance order, add ampm toggle
This commit is contained in:
@ -2,6 +2,7 @@ package com.tommasoberlose.anotherwidget.helpers
|
||||
|
||||
import android.content.Context
|
||||
import com.tommasoberlose.anotherwidget.R
|
||||
import com.tommasoberlose.anotherwidget.db.EventRepository
|
||||
import com.tommasoberlose.anotherwidget.global.Constants
|
||||
import com.tommasoberlose.anotherwidget.global.Preferences
|
||||
import com.tommasoberlose.anotherwidget.models.GlanceProvider
|
||||
@ -37,40 +38,47 @@ object GlanceProviderHelper {
|
||||
Constants.GlanceProviderId.NEXT_CLOCK_ALARM -> {
|
||||
GlanceProvider(providerId.id,
|
||||
context.getString(R.string.settings_show_next_alarm_title),
|
||||
R.drawable.round_alarm,
|
||||
context.getString(R.string.settings_show_next_alarm_subtitle)
|
||||
R.drawable.round_alarm
|
||||
)
|
||||
}
|
||||
Constants.GlanceProviderId.PLAYING_SONG -> {
|
||||
GlanceProvider(providerId.id,
|
||||
context.getString(R.string.settings_show_music_title),
|
||||
R.drawable.round_music_note,
|
||||
context.getString(R.string.settings_show_music_enabled_subtitle)
|
||||
R.drawable.round_music_note
|
||||
)
|
||||
}
|
||||
Constants.GlanceProviderId.CUSTOM_INFO -> {
|
||||
GlanceProvider(providerId.id,
|
||||
context.getString(R.string.settings_custom_notes_title),
|
||||
R.drawable.round_notes
|
||||
)
|
||||
}
|
||||
// Constants.GlanceProviderId.CUSTOM_INFO -> {
|
||||
// GlanceProvider(providerId.id,
|
||||
// context.getString(R.string.settings_show_next_alarm_title),
|
||||
// R.drawable.round_event_note
|
||||
// )
|
||||
// }
|
||||
// Constants.GlanceProviderId.BATTERY_LEVEL_LOW -> {
|
||||
// GlanceProvider(providerId.id,
|
||||
// context.getString(R.string.settings_show_next_alarm_title),
|
||||
// context.getString(R.string.settings_low_battery_level_title),
|
||||
// R.drawable.round_battery_charging_full
|
||||
// )
|
||||
// }
|
||||
// Constants.GlanceProviderId.GOOGLE_FIT_STEPS -> {
|
||||
// GlanceProvider(providerId.id,
|
||||
// context.getString(R.string.settings_show_next_alarm_title),
|
||||
// context.getString(R.string.settings_daily_steps_title),
|
||||
// R.drawable.round_directions_walk
|
||||
// )
|
||||
// }
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
fun saveGlanceProviderOrder(list: ArrayList<Constants.GlanceProviderId>) {
|
||||
Preferences.enabledGlanceProviderOrder = list.joinToString(separator = ",")
|
||||
}
|
||||
|
||||
fun showSpecialWeather(context: Context): Boolean {
|
||||
return EventRepository(context).getEventsCount() == 0 && (
|
||||
(Preferences.showNextAlarm && AlarmHelper.getNextAlarm(context) != "") ||
|
||||
(MediaPlayerHelper.isSomeonePlaying(context)) ||
|
||||
(Preferences.isBatteryLevelLow) ||
|
||||
(Preferences.customNotes.isNotEmpty()) ||
|
||||
(Preferences.googleFitSteps > 0)
|
||||
)
|
||||
}
|
||||
}
|
@ -53,11 +53,4 @@ object WidgetHelper {
|
||||
width to second * factor
|
||||
}
|
||||
}
|
||||
|
||||
fun showSpecialWeather(context: Context): Boolean {
|
||||
return EventRepository(context).getEventsCount() == 0 && (
|
||||
(Preferences.showNextAlarm && AlarmHelper.getNextAlarm(context) != "") ||
|
||||
(MediaPlayerHelper.isSomeonePlaying(context))
|
||||
)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user