diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/clock/activities/SettingsActivity.kt index 8cf0071..73e5251 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/activities/SettingsActivity.kt @@ -35,7 +35,6 @@ class SettingsActivity : SimpleActivity() { setupVibrate() setupTimerMaxReminder() setupIncreaseVolumeGradually() - setupUseTextShadow() setupCustomizeWidgetColors() updateTextColors(settings_holder) @@ -46,7 +45,6 @@ class SettingsActivity : SimpleActivity() { settings_alarm_tab_label, settings_stopwatch_tab_label, settings_timer_tab_label, - settings_widgets_label ).forEach { it.setTextColor(getProperPrimaryColor()) } @@ -58,7 +56,6 @@ class SettingsActivity : SimpleActivity() { settings_alarm_tab_holder, settings_stopwatch_tab_holder, settings_timer_tab_holder, - settings_widgets_holder ).forEach { it.background.applyColorFilter(getProperBackgroundColor().getContrastColor()) } @@ -200,15 +197,6 @@ class SettingsActivity : SimpleActivity() { } } - private fun setupUseTextShadow() { - settings_use_text_shadow.isChecked = config.useTextShadow - settings_use_text_shadow_holder.setOnClickListener { - settings_use_text_shadow.toggle() - config.useTextShadow = settings_use_text_shadow.isChecked - updateWidgets() - } - } - private fun updateSnoozeText() { settings_snooze_time.text = formatMinutesToTimeString(config.snoozeTime) } diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/activities/WidgetDateTimeConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/clock/activities/WidgetDateTimeConfigureActivity.kt index eab2ef7..3af3a13 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/activities/WidgetDateTimeConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/activities/WidgetDateTimeConfigureActivity.kt @@ -73,11 +73,8 @@ class WidgetDateTimeConfigureActivity : SimpleActivity() { val calendar = Calendar.getInstance() config_time.text = getFormattedTime(getPassedSeconds(), false, false).toString() config_date.text = getFormattedDate(calendar) - - if (config.useTextShadow) { - config_time.setShadowLayer(1f, 0f, 1f, Color.BLACK) - config_date.setShadowLayer(1f, 0f, 1f, Color.BLACK) - } + config_time.setShadowLayer(1f, 0f, 1f, Color.BLACK) + config_date.setShadowLayer(1f, 0f, 1f, Color.BLACK) } private fun saveConfig() { diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt index 3fb71c7..edc0418 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt @@ -66,10 +66,6 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getInt(ALARM_MAX_REMINDER_SECS, DEFAULT_MAX_ALARM_REMINDER_SECS) set(alarmMaxReminderSecs) = prefs.edit().putInt(ALARM_MAX_REMINDER_SECS, alarmMaxReminderSecs).apply() - var useTextShadow: Boolean - get() = prefs.getBoolean(USE_TEXT_SHADOW, true) - set(useTextShadow) = prefs.edit().putBoolean(USE_TEXT_SHADOW, useTextShadow).apply() - var increaseVolumeGradually: Boolean get() = prefs.getBoolean(INCREASE_VOLUME_GRADUALLY, true) set(increaseVolumeGradually) = prefs.edit().putBoolean(INCREASE_VOLUME_GRADUALLY, increaseVolumeGradually).apply() diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt index 531ab78..28f4016 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt @@ -21,7 +21,6 @@ const val TIMER_MAX_REMINDER_SECS = "timer_max_reminder_secs" const val ALARM_MAX_REMINDER_SECS = "alarm_max_reminder_secs" const val ALARM_LAST_CONFIG = "alarm_last_config" const val TIMER_LAST_CONFIG = "timer_last_config" -const val USE_TEXT_SHADOW = "use_text_shadow" const val INCREASE_VOLUME_GRADUALLY = "increase_volume_gradually" const val ALARMS_SORT_BY = "alarms_sort_by" diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/MyWidgetDateTimeProvider.kt b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/MyWidgetDateTimeProvider.kt index 36a321f..77149d7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/MyWidgetDateTimeProvider.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/MyWidgetDateTimeProvider.kt @@ -31,7 +31,7 @@ class MyWidgetDateTimeProvider : AppWidgetProvider() { private fun performUpdate(context: Context) { val appWidgetManager = AppWidgetManager.getInstance(context) ?: return appWidgetManager.getAppWidgetIds(getComponentName(context)).forEach { - RemoteViews(context.packageName, getProperLayout(context)).apply { + RemoteViews(context.packageName, R.layout.widget_date_time).apply { updateTexts(context, this) updateColors(context, this) setupAppOpenIntent(context, this) @@ -40,12 +40,6 @@ class MyWidgetDateTimeProvider : AppWidgetProvider() { } } - private fun getProperLayout(context: Context) = if (context.config.useTextShadow) { - R.layout.widget_date_time_with_shadow - } else { - R.layout.widget_date_time - } - private fun updateTexts(context: Context, views: RemoteViews) { val timeText = context.getFormattedTime(getPassedSeconds(), false, false).toString() val nextAlarm = getFormattedNextAlarm(context) @@ -67,12 +61,8 @@ class MyWidgetDateTimeProvider : AppWidgetProvider() { setTextColor(R.id.widget_date, widgetTextColor) setTextColor(R.id.widget_next_alarm, widgetTextColor) - if (context.config.useTextShadow) { - val bitmap = getMultiplyColoredBitmap(R.drawable.ic_clock_shadowed, widgetTextColor, context) - setImageViewBitmap(R.id.widget_next_alarm_image, bitmap) - } else { - setImageViewBitmap(R.id.widget_next_alarm_image, context.resources.getColoredBitmap(R.drawable.ic_alarm_vector, widgetTextColor)) - } + val bitmap = getMultiplyColoredBitmap(R.drawable.ic_clock_shadowed, widgetTextColor, context) + setImageViewBitmap(R.id.widget_next_alarm_image, bitmap) } } diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 5b8b48d..fb182c2 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -354,37 +354,5 @@ - - - - - - - - - - - diff --git a/app/src/main/res/layout/widget_date_time.xml b/app/src/main/res/layout/widget_date_time.xml index 926e4ec..0ba9fa5 100644 --- a/app/src/main/res/layout/widget_date_time.xml +++ b/app/src/main/res/layout/widget_date_time.xml @@ -36,6 +36,9 @@ android:gravity="center" android:includeFontPadding="false" android:maxLines="1" + android:shadowColor="@android:color/black" + android:shadowDy="1" + android:shadowRadius="1" android:textSize="@dimen/normal_text_size" tools:text="00:00" /> @@ -50,6 +53,9 @@ android:gravity="center" android:includeFontPadding="false" android:maxLines="1" + android:shadowColor="@android:color/black" + android:shadowDy="1" + android:shadowRadius="1" android:textSize="@dimen/normal_text_size" tools:text="Mon, 1 January" /> @@ -77,6 +83,9 @@ android:includeFontPadding="false" android:maxLines="1" android:paddingStart="@dimen/small_margin" + android:shadowColor="@android:color/black" + android:shadowDy="1" + android:shadowRadius="1" android:textSize="@dimen/normal_text_size" tools:text="Tue, 18:30" /> diff --git a/app/src/main/res/layout/widget_date_time_with_shadow.xml b/app/src/main/res/layout/widget_date_time_with_shadow.xml deleted file mode 100644 index 0ba9fa5..0000000 --- a/app/src/main/res/layout/widget_date_time_with_shadow.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - -