[UI] Update dialog NoDisplay theme.

This commit is contained in:
Kuba Szczodrzyński 2020-03-19 20:02:50 +01:00
parent 1e7fe972de
commit 0296c704cb
3 changed files with 51 additions and 54 deletions

View File

@ -62,7 +62,7 @@
android:configChanges="orientation|keyboardHidden"
android:excludeFromRecents="true"
android:noHistory="true"
android:theme="@style/AppTheme.NoDisplay">
android:theme="@style/AppTheme.Dark.NoDisplay">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
@ -84,7 +84,7 @@
android:configChanges="orientation|keyboardHidden"
android:excludeFromRecents="true"
android:noHistory="true"
android:theme="@style/AppTheme.NoDisplay" />
android:theme="@style/AppTheme.Dark.NoDisplay" />
<!-- NOTIFICATIONS -->
<receiver android:name=".ui.widgets.notifications.WidgetNotificationsProvider"
android:label="@string/widget_notifications_title">

View File

@ -1,14 +1,9 @@
package pl.szczodrzynski.edziennik.utils
import android.content.Context
import android.graphics.Color
import androidx.annotation.StringRes
import androidx.annotation.StyleRes
import androidx.core.graphics.ColorUtils
import pl.szczodrzynski.edziennik.R
import pl.szczodrzynski.navlib.getColorFromAttr
object Themes {
@ -49,7 +44,7 @@ object Themes {
val appThemeNoDisplay: Int
get() = if (theme.isDark) R.style.AppThemeDark_NoDisplay else R.style.AppTheme_NoDisplay
get() = if (theme.isDark) R.style.AppTheme_Dark_NoDisplay else R.style.AppTheme_Light_NoDisplay
val appTheme: Int

View File

@ -10,63 +10,65 @@
<item name="android:windowBackground">@drawable/dead_background</item>
</style>
<style name="AppTheme.NoDisplay" parent="Theme.MaterialComponents.Light.Dialog">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorSection">@color/colorSection</item>
<style name="AppTheme.Light.NoDisplay" parent="AppTheme.Light">
<item name="android:colorBackground">?attr/colorBackgroundFloating</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:textColor">@color/primaryTextLight</item>
<item name="android:textColorPrimary">@color/primaryTextLight</item>
<item name="material_drawer_primary_text">@color/primaryTextLight</item>
<item name="android:textColorSecondary">@color/secondaryTextLight</item>
<item name="material_drawer_secondary_text">@color/secondaryTextLight</item>
<item name="android:textColorTertiary">@color/secondaryTextLight</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowTitleStyle">@style/RtlOverlay.DialogWindowTitle.AppCompat</item>
<item name="android:windowTitleBackgroundStyle">@style/Base.DialogWindowTitleBackground.AppCompat</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowDisablePreview">true</item>
<item name="android:windowNoTitle">true</item>
<item name="md_dark_theme">false</item>
<item name="md_title_color">?android:textColorPrimary</item>
<item name="md_content_color">?android:textColorPrimary</item>
<item name="md_link_color">?colorAccent</item>
<item name="md_item_color">?android:textColorPrimary</item>
<item name="windowActionBar">false</item>
<item name="windowActionModeOverlay">true</item>
<item name="listPreferredItemPaddingLeft">24dip</item>
<item name="listPreferredItemPaddingRight">24dip</item>
<item name="android:listDivider">@null</item>
<item name="android:buttonBarStyle">@style/Widget.AppCompat.ButtonBar.AlertDialog</item>
<item name="android:borderlessButtonStyle">@style/Widget.AppCompat.Button.Borderless</item>
<item name="android:windowCloseOnTouchOutside">true</item>
<item name="android:popupBackground">@color/windowBackgroundLight</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowDisablePreview">true</item>
<item name="android:windowNoTitle">true</item>
</style>
<style name="AppThemeDark.NoDisplay" parent="Theme.MaterialComponents.Dialog">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorSection">@color/colorSection</item>
<item name="android:textColor">@color/primaryTextDark</item>
<item name="android:textColorPrimary">@color/primaryTextDark</item>
<item name="material_drawer_primary_text">@color/primaryTextDark</item>
<item name="android:textColorSecondary">@color/secondaryTextDark</item>
<item name="material_drawer_secondary_text">@color/secondaryTextDark</item>
<item name="android:textColorTertiary">@color/secondaryTextDark</item>
<item name="md_dark_theme">true</item>
<item name="md_title_color">?android:textColorPrimary</item>
<item name="md_content_color">?android:textColorPrimary</item>
<item name="md_link_color">?colorAccent</item>
<item name="md_item_color">?android:textColorPrimary</item>
<item name="android:popupBackground">@color/windowBackgroundDark</item>
<style name="AppTheme.Dark.NoDisplay" parent="AppTheme.Dark">
<item name="android:colorBackground">?attr/colorBackgroundFloating</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowTitleStyle">@style/RtlOverlay.DialogWindowTitle.AppCompat</item>
<item name="android:windowTitleBackgroundStyle">@style/Base.DialogWindowTitleBackground.AppCompat</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowDisablePreview">true</item>
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="windowActionModeOverlay">true</item>
<item name="listPreferredItemPaddingLeft">24dip</item>
<item name="listPreferredItemPaddingRight">24dip</item>
<item name="android:listDivider">@null</item>
<item name="android:buttonBarStyle">@style/Widget.AppCompat.ButtonBar.AlertDialog</item>
<item name="android:borderlessButtonStyle">@style/Widget.AppCompat.Button.Borderless</item>
<item name="android:windowCloseOnTouchOutside">true</item>
<item name="android:popupBackground">@color/windowBackgroundDark</item>
</style>
<style name="AppTheme.MaterialAlertDialog" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">