Skip to content

Commit

Permalink
Revert "Added beige switch to theme selection dialog"
Browse files Browse the repository at this point in the history
This reverts commit 921773e.
  • Loading branch information
M66B committed Jul 13, 2024
1 parent dbdefa4 commit 22ab0b0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 42 deletions.
9 changes: 0 additions & 9 deletions app/src/main/java/eu/faircode/email/FragmentDialogTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public class FragmentDialogTheme extends FragmentDialogBase {
private TextView tvYou;
private RadioGroup rgThemeOptions;
private TextView tvSystem;
private SwitchCompat swBeige;
private SwitchCompat swBlack;
private SwitchCompat swHtmlLight;
private SwitchCompat swComposerLight;
Expand Down Expand Up @@ -99,8 +98,6 @@ public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
final Context context = getContext();
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String theme = prefs.getString("theme", "blue_orange_system");
boolean cards = prefs.getBoolean("cards", true);
boolean beige = prefs.getBoolean("beige", true);
boolean default_light = prefs.getBoolean("default_light", false);
boolean composer_light = prefs.getBoolean("composer_light", false);
boolean debug = prefs.getBoolean("debug", false);
Expand All @@ -113,7 +110,6 @@ public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
swReverse = dview.findViewById(R.id.swReverse);
rgThemeOptions = dview.findViewById(R.id.rgThemeOptions);
tvSystem = dview.findViewById(R.id.tvSystem);
swBeige = dview.findViewById(R.id.swBeige);
swBlack = dview.findViewById(R.id.swBlack);
swHtmlLight = dview.findViewById(R.id.swHtmlLight);
swComposerLight = dview.findViewById(R.id.swComposerLight);
Expand Down Expand Up @@ -178,8 +174,6 @@ else if (dark || black)
else
rgThemeOptions.check(R.id.rbThemeLight);

swBeige.setChecked(beige);
swBeige.setVisibility(cards ? View.VISIBLE : View.GONE);
swBlack.setChecked(black);
swHtmlLight.setChecked(default_light);
swComposerLight.setChecked(composer_light);
Expand Down Expand Up @@ -311,7 +305,6 @@ public void onClick(DialogInterface dialog, int which) {
boolean reverse = (swReverse.isEnabled() && swReverse.isChecked());
boolean dark = (rgThemeOptions.isEnabled() && optionId == R.id.rbThemeDark);
boolean system = (rgThemeOptions.isEnabled() && optionId == R.id.rbThemeSystem);
boolean beige = swBeige.isChecked();
boolean black = (swBlack.isEnabled() && swBlack.isChecked());

SharedPreferences.Editor editor = prefs.edit();
Expand Down Expand Up @@ -387,8 +380,6 @@ else if (checkedRadioButtonId == R.id.rbThemeBlackOrWhite) {
(black ? "_black" : dark ? "_dark" : "_light")).apply();
}

editor.putBoolean("beige", beige);

editor.putBoolean("default_light", swHtmlLight.isChecked());
editor.putBoolean("composer_light", swComposerLight.isChecked());

Expand Down
12 changes: 1 addition & 11 deletions app/src/main/res/layout-v31/dialog_theme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -366,16 +366,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rgThemeOptions" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swBeige"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_cards_beige"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSystem" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swBlack"
android:layout_width="0dp"
Expand All @@ -384,7 +374,7 @@
android:text="@string/title_setup_theme_black_background"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swBeige" />
app:layout_constraintTop_toBottomOf="@id/tvSystem" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swHtmlLight"
Expand Down
12 changes: 1 addition & 11 deletions app/src/main/res/layout-v34/dialog_theme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -434,16 +434,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rgThemeOptions" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swBeige"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_cards_beige"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSystem" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swBlack"
android:layout_width="0dp"
Expand All @@ -452,7 +442,7 @@
android:text="@string/title_setup_theme_black_background"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swBeige" />
app:layout_constraintTop_toBottomOf="@id/tvSystem" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swHtmlLight"
Expand Down
12 changes: 1 addition & 11 deletions app/src/main/res/layout/dialog_theme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rgThemeOptions" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swBeige"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_cards_beige"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSystem" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swBlack"
android:layout_width="0dp"
Expand All @@ -201,7 +191,7 @@
android:text="@string/title_setup_theme_black_background"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swBeige" />
app:layout_constraintTop_toBottomOf="@id/tvSystem" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swHtmlLight"
Expand Down

0 comments on commit 22ab0b0

Please sign in to comment.