More colors

pull/194/head
M66B 4 years ago
parent b9144a3b3f
commit 61604e4408

@ -3,7 +3,7 @@ package eu.faircode.email;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.net.Uri;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@ -25,6 +25,7 @@ public class FragmentDialogTheme extends FragmentDialogBase {
private RadioGroup rgThemeOptions;
private SwitchCompat swBlack;
private TextView tvSystem;
private TextView tvMore;
private void eval() {
int checkedId = rgTheme.getCheckedRadioButtonId();
@ -50,24 +51,16 @@ public class FragmentDialogTheme extends FragmentDialogBase {
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_theme, null);
itten = dview.findViewById(R.id.itten);
rgTheme = dview.findViewById(R.id.rgTheme);
swReverse = dview.findViewById(R.id.swReverse);
rgThemeOptions = dview.findViewById(R.id.rgThemeOptions);
swBlack = dview.findViewById(R.id.swBlack);
tvSystem = dview.findViewById(R.id.tvSystem);
tvMore = dview.findViewById(R.id.tvMore);
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
String theme = prefs.getString("theme", "blue_orange_system");
itten.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri uri = Uri.parse("https://en.wikipedia.org/wiki/Johannes_Itten");
Helper.view(getContext(), uri, false);
}
});
rgTheme.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
@ -169,6 +162,14 @@ public class FragmentDialogTheme extends FragmentDialogBase {
break;
}
tvMore.setPaintFlags(tvMore.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
tvMore.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.viewFAQ(v.getContext(), 164);
}
});
return new AlertDialog.Builder(getContext())
.setView(dview)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fadeScrollbars="false"
android:padding="24dp"
android:scrollbarStyle="outsideOverlay">
@ -19,18 +20,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/itten"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:scaleType="fitCenter"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/farbkreis_itten_1961" />
<!-- source: https://commons.wikimedia.org/wiki/File:Farbkreis_Itten_1961.svg -->
<RadioGroup
android:id="@+id/rgTheme"
android:layout_width="0dp"
@ -155,5 +144,16 @@
android:textStyle="italic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swBlack" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvMore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_setup_theme_more_colors"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorLink"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSystem" />
</androidx.constraintlayout.widget.ConstraintLayout>
</eu.faircode.email.ScrollViewEx>

@ -258,6 +258,7 @@
<string name="title_setup_theme_black_background">Black background</string>
<string name="title_setup_theme_system_hint">This will automatically switch to a light/dark theme on day/night mode, if supported by Android</string>
<string name="title_setup_theme_more_colors">I want more colors</string>
<string name="title_setup_advanced">Advanced</string>

Loading…
Cancel
Save