mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-09 15:27:55 -04:00
Fix zoom level color bug
This commit is contained in:
parent
9d0a3f6f5e
commit
da6ed6d375
@ -26,9 +26,7 @@ import android.view.View;
|
|||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import org.kiwix.kiwixmobile.R;
|
import org.kiwix.kiwixmobile.R;
|
||||||
|
import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil;
|
||||||
import static org.kiwix.kiwixmobile.utils.Constants.PREF_NIGHTMODE;
|
|
||||||
import static org.kiwix.kiwixmobile.utils.Constants.PREF_ZOOM_ENABLED;
|
|
||||||
|
|
||||||
public class SliderPreference extends DialogPreference {
|
public class SliderPreference extends DialogPreference {
|
||||||
|
|
||||||
@ -171,15 +169,17 @@ public class SliderPreference extends DialogPreference {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setGrayState(View view) {
|
private void setGrayState(View view) {
|
||||||
boolean enabled = getPreferenceManager().getSharedPreferences().getBoolean(PREF_ZOOM_ENABLED, false);
|
SharedPreferenceUtil sharedPreferenceUtil = new SharedPreferenceUtil(getContext());
|
||||||
boolean Nightmode = getPreferenceManager().getSharedPreferences().getBoolean(PREF_NIGHTMODE, false);
|
boolean enabled = sharedPreferenceUtil.getPrefZoomEnabled();
|
||||||
|
boolean nightMode = sharedPreferenceUtil.nightMode();
|
||||||
|
|
||||||
TextView titleView = view.findViewById(android.R.id.title);
|
TextView titleView = view.findViewById(android.R.id.title);
|
||||||
TextView summaryTV = view.findViewById(android.R.id.summary);
|
TextView summaryTV = view.findViewById(android.R.id.summary);
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
titleView.setTextColor(Color.GRAY);
|
titleView.setTextColor(Color.GRAY);
|
||||||
summaryTV.setTextColor(Color.GRAY);
|
summaryTV.setTextColor(Color.GRAY);
|
||||||
} else {
|
} else {
|
||||||
if (Nightmode) {
|
if (nightMode) {
|
||||||
titleView.setTextColor(Color.WHITE);
|
titleView.setTextColor(Color.WHITE);
|
||||||
summaryTV.setTextColor(Color.WHITE);
|
summaryTV.setTextColor(Color.WHITE);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user