Small layout improvement

pull/171/head
M66B 5 years ago
parent d2ce5308a4
commit aadcce757d

@ -25,6 +25,7 @@ import android.content.DialogInterface;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
@ -35,6 +36,7 @@ import android.view.ViewGroup;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.Button; import android.widget.Button;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.SeekBar; import android.widget.SeekBar;
@ -658,6 +660,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
} }
public static class FragmentDialogTheme extends FragmentDialogBase { public static class FragmentDialogTheme extends FragmentDialogBase {
private ImageButton itten;
private RadioGroup rgTheme; private RadioGroup rgTheme;
private SwitchCompat swReverse; private SwitchCompat swReverse;
private SwitchCompat swDark; private SwitchCompat swDark;
@ -688,6 +691,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
@Override @Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_theme, null); View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_theme, null);
itten = dview.findViewById(R.id.itten);
rgTheme = dview.findViewById(R.id.rgTheme); rgTheme = dview.findViewById(R.id.rgTheme);
swReverse = dview.findViewById(R.id.swReverse); swReverse = dview.findViewById(R.id.swReverse);
swDark = dview.findViewById(R.id.swDark); swDark = dview.findViewById(R.id.swDark);
@ -696,6 +700,14 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
String theme = prefs.getString("theme", "light"); String theme = prefs.getString("theme", "light");
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);
}
});
swReverse.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swReverse.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

@ -18,6 +18,17 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="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:src="@drawable/farbkreis_itten_1961"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- source: https://commons.wikimedia.org/wiki/File:Farbkreis_Itten_1961.svg -->
<RadioGroup <RadioGroup
android:id="@+id/rgTheme" android:id="@+id/rgTheme"
android:layout_width="0dp" android:layout_width="0dp"

Loading…
Cancel
Save