Theme refactoring

pull/171/head
M66B 5 years ago
parent f594860050
commit 37f526ec21

@ -46,7 +46,7 @@
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppThemeLight">
android:theme="@style/AppThemeBlueOrangeLight">
<!-- do not contact Google servers -->
<meta-data

@ -85,13 +85,13 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
String theme = prefs.getString("theme", "light");
if ("dark".equals(theme))
setTheme(R.style.AppThemeDark);
setTheme(R.style.AppThemeBlueOrangeDark);
else if ("black".equals(theme))
setTheme(R.style.AppThemeBlack);
else if ("grey_light".equals(theme))
setTheme(R.style.AppThemeGreyLight);
setTheme(R.style.AppThemeGreySteelBlueLight);
else if ("grey_dark".equals(theme))
setTheme(R.style.AppThemeGreyDark);
setTheme(R.style.AppThemeGreySteelBlueDark);
else if ("system".equals(theme)) {
int uiMode = getResources().getConfiguration().uiMode;
Log.i("UI mode=" + uiMode);
@ -101,9 +101,9 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
int uiMode = getResources().getConfiguration().uiMode;
Log.i("UI mode=" + uiMode);
if ((uiMode & Configuration.UI_MODE_NIGHT_YES) != 0)
setTheme(R.style.AppThemeGreyDark);
setTheme(R.style.AppThemeGreySteelBlueDark);
else
setTheme(R.style.AppThemeGreyLight);
setTheme(R.style.AppThemeGreySteelBlueLight);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {

@ -38,7 +38,7 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
getSupportFragmentManager().addOnBackStackChangedListener(this);
if (!Log.isSupportedDevice() && Helper.isPlayStoreInstall()) {
setTheme(R.style.AppThemeLight);
setTheme(R.style.AppThemeBlueOrangeLight);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_unsupported);
return;
@ -163,7 +163,7 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
if (!getResources().getConfiguration().isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE))
prefs.edit().putBoolean("compact", true).apply();
setTheme(R.style.AppThemeLight);
setTheme(R.style.AppThemeBlueOrangeLight);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

@ -143,6 +143,6 @@
android:layout_margin="@dimen/fab_padding"
android:tint="?attr/colorFabForeground"
android:tooltipText="@string/title_compose"
app:backgroundTint="@color/colorError"
app:backgroundTint="?attr/colorWarning"
app:srcCompat="@drawable/baseline_warning_24" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

@ -84,7 +84,7 @@
android:layout_height="wrap_content"
android:contentDescription="@string/title_legend_auth"
android:padding="12dp"
android:tint="@color/colorError"
android:tint="?attr/colorWarning"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivDraft"
app:srcCompat="@drawable/baseline_flag_24" />
@ -108,7 +108,7 @@
android:layout_height="wrap_content"
android:contentDescription="@string/title_legend_priority"
android:padding="12dp"
android:tint="@color/colorError"
android:tint="?attr/colorWarning"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivAuth"
app:srcCompat="@drawable/baseline_priority_high_24" />

@ -357,6 +357,6 @@
android:layout_margin="@dimen/fab_padding"
android:tint="?attr/colorFabForeground"
android:tooltipText="@string/title_compose"
app:backgroundTint="@color/colorError"
app:backgroundTint="?attr/colorWarning"
app:srcCompat="@drawable/baseline_warning_24" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

@ -352,7 +352,7 @@
android:layout_width="21dp"
android:layout_height="21dp"
android:contentDescription="@string/title_legend_auth"
android:tint="@color/colorError"
android:tint="?attr/colorWarning"
app:layout_constraintBottom_toBottomOf="@+id/swAuthentication"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/swAuthentication"

@ -64,7 +64,7 @@
android:layout_marginStart="6dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_legend_auth"
android:tint="@color/colorError"
android:tint="?attr/colorWarning"
app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
app:layout_constraintStart_toEndOf="@id/ibAvatar"
app:layout_constraintTop_toTopOf="@+id/tvFrom"
@ -76,7 +76,7 @@
android:layout_height="21dp"
android:layout_marginStart="6dp"
android:contentDescription="@string/title_legend_priority"
android:tint="@color/colorError"
android:tint="?attr/colorWarning"
app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
app:layout_constraintStart_toEndOf="@id/ibAuth"
app:layout_constraintTop_toTopOf="@+id/tvFrom"

@ -63,7 +63,7 @@
android:layout_marginStart="6dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_legend_auth"
android:tint="@color/colorError"
android:tint="?attr/colorWarning"
app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
app:layout_constraintStart_toEndOf="@id/ibAvatar"
app:layout_constraintTop_toTopOf="@+id/tvFrom"
@ -75,7 +75,7 @@
android:layout_height="21dp"
android:layout_marginStart="6dp"
android:contentDescription="@string/title_legend_priority"
android:tint="@color/colorError"
android:tint="?attr/colorWarning"
app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
app:layout_constraintStart_toEndOf="@id/ibAuth"
app:layout_constraintTop_toTopOf="@+id/tvFrom"

@ -68,7 +68,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:tint="@color/colorError"
android:tint="?attr/colorWarning"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"

@ -8,8 +8,6 @@
<color name="colorAccent">#ffb300</color>
<color name="colorAccentDark">#c68400</color>
<color name="colorError">#ff0000</color>
<color name="colorReadLight">#b3000000</color>
<color name="colorUnreadLight">#ff000000</color>

@ -19,21 +19,17 @@
<attr name="colorToastBackground" format="reference" />
<attr name="activatableItemBackground" format="reference" />
<style name="AppThemeLight" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<style name="AppThemeBaseLight" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<item name="themeName">light</item>
<item name="android:windowDisablePreview">true</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorRead">@color/colorReadLight</item>
<item name="colorUnread">@color/colorUnreadLight</item>
<item name="colorUnreadHighlight">@color/colorAccentDark</item>
<item name="colorEncrypt">@color/colorEncryptLight</item>
<item name="colorSeparator">@color/lightColorSeparator</item>
<item name="colorWarning">@color/lightColorWarning</item>
<item name="colorDrawerScrim">@color/lightColorDrawerScrim</item>
@ -47,14 +43,9 @@
<item name="colorActionBackground">@color/lightActionBackground</item>
<item name="colorFabForeground">@color/white</item>
<item name="colorFabBackground">@color/colorAccent</item>
<item name="colorToastForeground">@color/white</item>
<item name="colorToastBackground">@color/colorPrimaryDark</item>
<item name="activatableItemBackground">@drawable/activatable_item_background_light</item>
<item name="android:textColorLink">@color/colorAccentDark</item>
<item name="android:checkboxStyle">@style/checkboxStyle</item>
<item name="android:buttonStyle">@style/buttonStyle</item>
<item name="android:buttonStyleSmall">@style/buttonStyleSmall</item>
@ -66,23 +57,19 @@
<item name="android:scrollbarTrackVertical">@drawable/scroll_track</item>
</style>
<style name="AppThemeDark" parent="Base.Theme.AppCompat">
<style name="AppThemeBaseDark" parent="Base.Theme.AppCompat">
<item name="themeName">dark</item>
<item name="android:windowDisablePreview">true</item>
<item name="android:navigationBarColor">@color/black</item>
<item name="colorPrimary">@color/darkPrimary</item>
<item name="colorPrimaryDark">@color/darkPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorRead">@color/colorReadDark</item>
<item name="colorUnread">@color/colorUnreadDark</item>
<item name="colorUnreadHighlight">@color/colorAccent</item>
<item name="colorEncrypt">@color/colorEncryptDark</item>
<item name="colorSeparator">@color/darkColorSeparator</item>
<item name="colorWarning">@color/darkColorWarning</item>
<item name="colorDrawerScrim">@color/darkColorDrawerScrim</item>
@ -96,10 +83,6 @@
<item name="colorActionBackground">@color/darkActionBackground</item>
<item name="colorFabForeground">@color/white</item>
<item name="colorFabBackground">@color/colorAccent</item>
<item name="colorToastForeground">@color/white</item>
<item name="colorToastBackground">@color/darkPrimaryLight</item>
<item name="activatableItemBackground">@drawable/activatable_item_background_dark</item>
@ -114,15 +97,44 @@
<item name="android:scrollbarTrackVertical">@drawable/scroll_track</item>
</style>
<style name="AppThemeBlack" parent="AppThemeDark">
<style name="AppThemeBlueOrangeLight" parent="AppThemeBaseLight">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorUnreadHighlight">@color/colorAccentDark</item>
<item name="colorFabBackground">@color/colorAccent</item>
<item name="colorToastForeground">@color/white</item>
<item name="colorToastBackground">@color/colorPrimaryDark</item>
<item name="android:textColorLink">@color/colorAccentDark</item>
</style>
<style name="AppThemeBlueOrangeDark" parent="AppThemeBaseDark">
<item name="colorPrimary">@color/darkPrimary</item>
<item name="colorPrimaryDark">@color/darkPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorUnreadHighlight">@color/colorAccent</item>
<item name="colorWarning">@color/colorAccent</item>
<item name="colorFabBackground">@color/colorAccent</item>
<item name="colorToastForeground">@color/white</item>
<item name="colorToastBackground">@color/darkPrimaryLight</item>
</style>
<style name="AppThemeBlack" parent="AppThemeBlueOrangeDark">
<item name="themeName">black</item>
<item name="android:windowBackground">@color/black</item>
<item name="colorDrawerBackground">@color/black</item>
</style>
<style name="AppThemeGreyLight" parent="AppThemeLight">
<item name="themeName">light</item>
<style name="AppThemeGreySteelBlueLight" parent="AppThemeBaseLight">
<item name="colorPrimary">@color/greyPrimary</item>
<item name="colorPrimaryDark">@color/greyPrimaryDark</item>
<item name="colorAccent">@color/greyAccent</item>
@ -137,7 +149,7 @@
<item name="colorToastBackground">@color/greyAccent</item>
</style>
<style name="AppThemeGreyDark" parent="AppThemeBlack">
<style name="AppThemeGreySteelBlueDark" parent="AppThemeBlack">
<item name="colorPrimary">@color/greyPrimary</item>
<item name="colorPrimaryDark">@color/greyPrimaryDark</item>
<item name="colorAccent">@color/greyAccent</item>

Loading…
Cancel
Save