Fix small issues with the pure black theme

pull/1033/head
Alinson S. Xavier 4 years ago
parent 33468bfc1c
commit 2fe3b15806
No known key found for this signature in database
GPG Key ID: DCA0DAD4D2F58624

@ -3,6 +3,7 @@
## [2.0.3] - [Unreleased] ## [2.0.3] - [Unreleased]
### Fixed ### Fixed
- Improve automatic checkmarks for monthly habits (@iSoron, 947) - Improve automatic checkmarks for monthly habits (@iSoron, 947)
- Fix small issues with the pure black theme (@iSoron)
## [2.0.2] - 2021-05-23 ## [2.0.2] - 2021-05-23

@ -30,6 +30,7 @@ import org.isoron.uhabits.core.preferences.Preferences
import org.isoron.uhabits.core.ui.ThemeSwitcher import org.isoron.uhabits.core.ui.ThemeSwitcher
import org.isoron.uhabits.core.ui.views.DarkTheme import org.isoron.uhabits.core.ui.views.DarkTheme
import org.isoron.uhabits.core.ui.views.LightTheme import org.isoron.uhabits.core.ui.views.LightTheme
import org.isoron.uhabits.core.ui.views.PureBlackTheme
import org.isoron.uhabits.core.ui.views.Theme import org.isoron.uhabits.core.ui.views.Theme
import org.isoron.uhabits.inject.ActivityContext import org.isoron.uhabits.inject.ActivityContext
import org.isoron.uhabits.inject.ActivityScope import org.isoron.uhabits.inject.ActivityScope
@ -66,7 +67,7 @@ constructor(
} }
override fun applyPureBlackTheme() { override fun applyPureBlackTheme() {
currentTheme = DarkTheme() currentTheme = PureBlackTheme()
context.setTheme(R.style.AppBaseThemeDark_PureBlack) context.setTheme(R.style.AppBaseThemeDark_PureBlack)
(context as Activity).window.navigationBarColor = (context as Activity).window.navigationBarColor =
ContextCompat.getColor(context, R.color.black) ContextCompat.getColor(context, R.color.black)

@ -27,6 +27,9 @@ import android.os.Build.VERSION
import android.os.Bundle import android.os.Bundle
import android.provider.Settings import android.provider.Settings
import android.util.Log import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.preference.ListPreference import androidx.preference.ListPreference
import androidx.preference.Preference import androidx.preference.Preference
import androidx.preference.PreferenceCategory import androidx.preference.PreferenceCategory
@ -43,6 +46,7 @@ import org.isoron.uhabits.core.ui.NotificationTray
import org.isoron.uhabits.core.utils.DateUtils.Companion.getLongWeekdayNames import org.isoron.uhabits.core.utils.DateUtils.Companion.getLongWeekdayNames
import org.isoron.uhabits.notifications.AndroidNotificationTray.Companion.createAndroidNotificationChannel import org.isoron.uhabits.notifications.AndroidNotificationTray.Companion.createAndroidNotificationChannel
import org.isoron.uhabits.notifications.RingtoneManager import org.isoron.uhabits.notifications.RingtoneManager
import org.isoron.uhabits.utils.StyledResources
import org.isoron.uhabits.widgets.WidgetUpdater import org.isoron.uhabits.widgets.WidgetUpdater
import java.util.Calendar import java.util.Calendar

@ -129,6 +129,7 @@
<item name="selectedBackground">@drawable/selected_box</item> <item name="selectedBackground">@drawable/selected_box</item>
<item name="textColorAlertDialogListItem">@color/grey_100</item> <item name="textColorAlertDialogListItem">@color/grey_100</item>
<item name="windowBackgroundColor">@color/black</item> <item name="windowBackgroundColor">@color/black</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material.PureBlack</item>
</style> </style>
<style name="BaseDialog" parent="Theme.AppCompat.Light.Dialog"> <style name="BaseDialog" parent="Theme.AppCompat.Light.Dialog">
@ -151,6 +152,11 @@
<item name="palette">@array/darkPalette</item> <item name="palette">@array/darkPalette</item>
</style> </style>
<style name="PreferenceThemeOverlay.v14.Material.PureBlack">
<item name="android:background">@color/black</item>
</style>
<style name="WidgetTheme" parent="AppBaseThemeDark"> <style name="WidgetTheme" parent="AppBaseThemeDark">
<item name="cardBgColor">@color/grey_850</item> <item name="cardBgColor">@color/grey_850</item>
<item name="contrast0">@color/white</item> <item name="contrast0">@color/white</item>

@ -109,6 +109,12 @@ open class DarkTheme : Theme() {
} }
} }
class PureBlackTheme : DarkTheme() {
override val appBackgroundColor = Color(0x000000)
override val cardBackgroundColor = Color(0x000000)
override val lowContrastTextColor = Color(0x212121)
}
class WidgetTheme : LightTheme() { class WidgetTheme : LightTheme() {
override val cardBackgroundColor = Color.TRANSPARENT override val cardBackgroundColor = Color.TRANSPARENT
override val highContrastTextColor = Color.WHITE override val highContrastTextColor = Color.WHITE

Loading…
Cancel
Save