mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
Remove holo theme
This commit is contained in:
@@ -89,7 +89,7 @@ public class FontManager {
|
||||
// Colors and font weight
|
||||
switch (type) {
|
||||
case FontManager.TEXT_TYPE_PRIMARY:
|
||||
boolean isNight = ThemeManager.getTheme() == ThemeManager.Theme.GREY ||
|
||||
boolean isNight = ThemeManager.getTheme() == ThemeManager.Theme.DARK ||
|
||||
ThemeManager.getTheme() == ThemeManager.Theme.BLACK;
|
||||
int id = isNight ? R.color.text_primary_dark : R.color.text_primary_light;
|
||||
return context.getResources().getColorStateList(id);
|
||||
|
||||
@@ -41,11 +41,11 @@ public class NightModeAutoReceiver extends BroadcastReceiver {
|
||||
(calendar.get(Calendar.HOUR_OF_DAY) == day.get(Calendar.HOUR_OF_DAY) && calendar.get(Calendar.MINUTE) <= day.get(Calendar.MINUTE))) {
|
||||
Log.i(TAG, "Switching to night mode");
|
||||
prefs.edit().putString(SettingsFragment.BACKGROUND, ThemeManager.Theme.PREF_GREY).apply();
|
||||
ThemeManager.setTheme(ThemeManager.Theme.GREY);
|
||||
ThemeManager.setTheme(ThemeManager.Theme.DARK);
|
||||
} else {
|
||||
Log.i(TAG, "Switching to day mode");
|
||||
prefs.edit().putString(SettingsFragment.BACKGROUND, ThemeManager.Theme.PREF_OFFWHITE).apply();
|
||||
ThemeManager.setTheme(ThemeManager.Theme.OFFWHITE);
|
||||
ThemeManager.setTheme(ThemeManager.Theme.LIGHT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,29 +39,25 @@ public class ThemeManager {
|
||||
public static final int TRANSITION_LENGTH = 500;
|
||||
|
||||
public enum Theme {
|
||||
WHITE,
|
||||
OFFWHITE,
|
||||
GREY,
|
||||
LIGHT,
|
||||
DARK,
|
||||
BLACK;
|
||||
|
||||
public static final String PREF_WHITE = "white";
|
||||
public static final String PREF_OFFWHITE = "offwhite";
|
||||
public static final String PREF_OFFWHITE = "light";
|
||||
public static final String PREF_GREY = "grey";
|
||||
public static final String PREF_BLACK = "black";
|
||||
|
||||
public static Theme fromString(String color) {
|
||||
switch (color) {
|
||||
case PREF_WHITE:
|
||||
return WHITE;
|
||||
case PREF_OFFWHITE:
|
||||
return OFFWHITE;
|
||||
return LIGHT;
|
||||
case PREF_GREY:
|
||||
return GREY;
|
||||
return DARK;
|
||||
case PREF_BLACK:
|
||||
return BLACK;
|
||||
default:
|
||||
Log.w(TAG, "Tried to set theme with invalid string: " + color);
|
||||
return OFFWHITE;
|
||||
return LIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -300,13 +296,10 @@ public class ThemeManager {
|
||||
mTheme = theme;
|
||||
|
||||
switch (theme) {
|
||||
case WHITE:
|
||||
mBackgroundColor = mResources.getColor(R.color.white_pure);
|
||||
break;
|
||||
case OFFWHITE:
|
||||
case LIGHT:
|
||||
mBackgroundColor = mResources.getColor(R.color.grey_light_mega_ultra);
|
||||
break;
|
||||
case GREY:
|
||||
case DARK:
|
||||
mBackgroundColor = mResources.getColor(R.color.grey_material);
|
||||
break;
|
||||
case BLACK:
|
||||
@@ -315,13 +308,12 @@ public class ThemeManager {
|
||||
}
|
||||
|
||||
switch (mTheme) {
|
||||
case WHITE:
|
||||
case OFFWHITE:
|
||||
case LIGHT:
|
||||
mTextOnBackgroundPrimary = mResources.getColor(R.color.theme_light_text_primary);
|
||||
mtextOnBackgroundSecondary = mResources.getColor(R.color.theme_light_text_secondary);
|
||||
mRippleBackground = mResources.getDrawable(R.drawable.button_background_transparent);
|
||||
break;
|
||||
case GREY:
|
||||
case DARK:
|
||||
case BLACK:
|
||||
mTextOnBackgroundPrimary = mResources.getColor(R.color.theme_dark_text_primary);
|
||||
mtextOnBackgroundSecondary = mResources.getColor(R.color.theme_dark_text_secondary);
|
||||
@@ -459,17 +451,14 @@ public class ThemeManager {
|
||||
}
|
||||
|
||||
switch (mTheme) {
|
||||
case WHITE:
|
||||
return mResources.getColor(R.color.grey_light_mega_ultra);
|
||||
|
||||
case OFFWHITE:
|
||||
return mResources.getColor(R.color.white_pure);
|
||||
|
||||
case GREY:
|
||||
case DARK:
|
||||
return mResources.getColor(R.color.grey_dark);
|
||||
|
||||
default:
|
||||
case BLACK:
|
||||
return mResources.getColor(R.color.grey_material);
|
||||
|
||||
default:
|
||||
return mResources.getColor(R.color.white_pure);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -490,7 +479,7 @@ public class ThemeManager {
|
||||
}
|
||||
|
||||
public static boolean isNightMode() {
|
||||
return mTheme == Theme.GREY || mTheme == Theme.BLACK;
|
||||
return mTheme == Theme.DARK || mTheme == Theme.BLACK;
|
||||
}
|
||||
|
||||
public static void showColorPickerDialog(final QKActivity context) {
|
||||
|
||||
@@ -101,12 +101,11 @@ public abstract class QKActivity extends AppCompatActivity {
|
||||
LiveViewManager.registerView(QKPreference.BACKGROUND, this, key -> {
|
||||
setTheme(getThemeRes());
|
||||
switch (ThemeManager.getTheme()) {
|
||||
case WHITE:
|
||||
case OFFWHITE:
|
||||
case LIGHT:
|
||||
mToolbar.setPopupTheme(R.style.PopupThemeLight);
|
||||
break;
|
||||
|
||||
case GREY:
|
||||
case DARK:
|
||||
case BLACK:
|
||||
mToolbar.setPopupTheme(R.style.PopupTheme);
|
||||
break;
|
||||
@@ -263,13 +262,7 @@ public abstract class QKActivity extends AppCompatActivity {
|
||||
|
||||
protected int getThemeRes() {
|
||||
switch (ThemeManager.getTheme()) {
|
||||
case WHITE:
|
||||
return R.style.AppThemeWhite;
|
||||
|
||||
case OFFWHITE:
|
||||
return R.style.AppThemeLight;
|
||||
|
||||
case GREY:
|
||||
case DARK:
|
||||
return R.style.AppThemeDark;
|
||||
|
||||
case BLACK:
|
||||
|
||||
@@ -41,13 +41,7 @@ public abstract class QKPopupActivity extends QKActivity {
|
||||
@Override
|
||||
protected int getThemeRes() {
|
||||
switch (ThemeManager.getTheme()) {
|
||||
case WHITE:
|
||||
return R.style.AppThemeWhiteDialog;
|
||||
|
||||
case OFFWHITE:
|
||||
return R.style.AppThemeLightDialog;
|
||||
|
||||
case GREY:
|
||||
case DARK:
|
||||
return R.style.AppThemeDarkDialog;
|
||||
|
||||
case BLACK:
|
||||
|
||||
@@ -63,11 +63,11 @@ public class WelcomeNightFragment extends BaseWelcomeFragment implements BaseWel
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.getId() == R.id.welcome_night_hint) {
|
||||
boolean night = ThemeManager.getTheme() == ThemeManager.Theme.OFFWHITE;
|
||||
boolean night = ThemeManager.getTheme() == ThemeManager.Theme.LIGHT;
|
||||
|
||||
int backgroundColor = mContext.getResources().getColor(night ? R.color.grey_light_mega_ultra : R.color.grey_material);
|
||||
int newBackgroundColor = mContext.getResources().getColor(night ? R.color.grey_material : R.color.grey_light_mega_ultra);
|
||||
ThemeManager.setTheme(night ? ThemeManager.Theme.GREY : ThemeManager.Theme.OFFWHITE);
|
||||
ThemeManager.setTheme(night ? ThemeManager.Theme.DARK : ThemeManager.Theme.LIGHT);
|
||||
|
||||
ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), backgroundColor, newBackgroundColor);
|
||||
colorAnimation.setDuration(ThemeManager.TRANSITION_LENGTH);
|
||||
|
||||
@@ -469,7 +469,6 @@
|
||||
<item>Odstranit zprávu</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>Slet besked</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>Hvid</item>
|
||||
<item>Hvidligt</item>
|
||||
<item>Mørk grå</item>
|
||||
<item>Sort</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>Nachricht löschen</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>Weiß</item>
|
||||
<item>Grau</item>
|
||||
<item>Dunkelgrau</item>
|
||||
<item>Schwarz</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>Eliminar mensaje</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>Blanco</item>
|
||||
<item>Off-white</item>
|
||||
<item>Gris oscuro</item>
|
||||
<item>Negro</item>
|
||||
|
||||
@@ -467,7 +467,6 @@
|
||||
<item>Delete message</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>Poista viesti</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>Valkoinen</item>
|
||||
<item>Luonnonvalkoinen</item>
|
||||
<item>Tummanharmaa</item>
|
||||
<item>Musta</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>Supprimer le message</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>Blanc</item>
|
||||
<item>Blanc cassé</item>
|
||||
<item>Gris foncé</item>
|
||||
<item>Noir</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>संदेश हटाएं</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -467,7 +467,6 @@
|
||||
<item>Hapus pesan</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>Putih</item>
|
||||
<item>Off-white</item>
|
||||
<item>Abu-abu gelap</item>
|
||||
<item>Hitam</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>Elimina il messaggio</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>Bianco</item>
|
||||
<item>Bianco sporco</item>
|
||||
<item>Grigio scuro</item>
|
||||
<item>Nero</item>
|
||||
|
||||
@@ -473,7 +473,6 @@
|
||||
<item>מחק הודעה</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -467,7 +467,6 @@
|
||||
<item>メッセージを削除</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>白</item>
|
||||
<item>オフホワイト</item>
|
||||
<item>ダークグレー</item>
|
||||
<item>黒</item>
|
||||
|
||||
@@ -467,7 +467,6 @@
|
||||
<item>메시지 삭제</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -469,7 +469,6 @@
|
||||
<item>Ištrinti žinutę</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>Delete message</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>Bericht verwijderen</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>Wit</item>
|
||||
<item>Gebroken wit</item>
|
||||
<item>Donkergrijs</item>
|
||||
<item>Zwart</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>Slett melding</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -469,7 +469,6 @@
|
||||
<item>Usuń wiadomość</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>Biały</item>
|
||||
<item>Złamana biel</item>
|
||||
<item>Ciemnoszary</item>
|
||||
<item>Czarny</item>
|
||||
|
||||
@@ -470,7 +470,6 @@ Plural form: Conversas serão excluídas.</item>
|
||||
<item>Excluir mensagem</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>Apagar mensagem</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>Branco</item>
|
||||
<item>Branco (off)</item>
|
||||
<item>Cinzento</item>
|
||||
<item>Preto</item>
|
||||
|
||||
@@ -469,7 +469,6 @@
|
||||
<item>Ştergeţi mesajul</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -470,7 +470,6 @@
|
||||
<item>Удалить сообщение</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -469,7 +469,6 @@
|
||||
<item>Odstrániť správu</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -469,7 +469,6 @@
|
||||
<item>Избриши поруку</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>Бела</item>
|
||||
<item>Беличаста</item>
|
||||
<item>Тамно-сива</item>
|
||||
<item>Црна</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>Ta bort meddelande</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>Vit</item>
|
||||
<item>Av-vit</item>
|
||||
<item>Mörkgrå</item>
|
||||
<item>Svart</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>Burahin ang mensahe</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
<item>Mesajı sil</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>Beyaz</item>
|
||||
<item>Kirli beyaz</item>
|
||||
<item>Koyu gri</item>
|
||||
<item>Siyah</item>
|
||||
|
||||
@@ -467,7 +467,6 @@
|
||||
<item>删除信息</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>白</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>黑</item>
|
||||
|
||||
@@ -470,7 +470,6 @@
|
||||
<item>刪除訊息</item>
|
||||
</string-array>
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Black</item>
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
<string name="app_name">QKSMS</string>
|
||||
|
||||
<string-array name="background_values">
|
||||
<item>white</item>
|
||||
<item>offwhite</item>
|
||||
<item>light</item>
|
||||
<item>grey</item>
|
||||
<item>black</item>
|
||||
</string-array>
|
||||
|
||||
@@ -744,9 +744,8 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="background_titles">
|
||||
<item>White</item>
|
||||
<item>Off-white</item>
|
||||
<item>Dark grey</item>
|
||||
<item>Material Light</item>
|
||||
<item>Material Dark</item>
|
||||
<item>Black</item>
|
||||
</string-array>
|
||||
|
||||
|
||||
@@ -1,18 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- WHITE THEME -->
|
||||
|
||||
<style name="AppThemeWhite" parent="AppBaseThemeLight">
|
||||
<item name="android:windowBackground">@color/white_pure</item>
|
||||
<item name="backgroundColor">@color/grey_light_mega_ultra</item>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeWhiteDialog" parent="AppThemeLightDialog">
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="backgroundColor">@color/white_pure</item>
|
||||
</style>
|
||||
|
||||
<!-- LIGHT THEME -->
|
||||
|
||||
<style name="AppThemeLight" parent="AppBaseThemeLight" />
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
android:summary="@string/pref_icon_summary"
|
||||
android:title="@string/pref_icon" />
|
||||
<ListPreference
|
||||
android:defaultValue="#FFEEEEEE"
|
||||
android:defaultValue="light"
|
||||
android:entries="@array/background_titles"
|
||||
android:entryValues="@array/background_values"
|
||||
android:key="pref_key_background"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
android:summary="@string/pref_theme_summary_alt"
|
||||
android:title="@string/pref_theme" />
|
||||
<ListPreference
|
||||
android:defaultValue="#FFEEEEEE"
|
||||
android:defaultValue="light"
|
||||
android:entries="@array/background_titles"
|
||||
android:entryValues="@array/background_values"
|
||||
android:key="pref_key_background"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
android:summary="@string/pref_icon_summary"
|
||||
android:title="@string/pref_icon" />
|
||||
<ListPreference
|
||||
android:defaultValue="#FFEEEEEE"
|
||||
android:defaultValue="light"
|
||||
android:entries="@array/background_titles"
|
||||
android:entryValues="@array/background_values"
|
||||
android:key="pref_key_background"
|
||||
|
||||
Reference in New Issue
Block a user