mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
commit
8ca35c7653
6 changed files with 6 additions and 6 deletions
|
|
@ -277,6 +277,6 @@ public class Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isDarkTheme(Context context) {
|
public static boolean isDarkTheme(Context context) {
|
||||||
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("theme",true);
|
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("theme",false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
|
||||||
|
|
||||||
addCurrentLocationMarker(mapboxMap);
|
addCurrentLocationMarker(mapboxMap);
|
||||||
});
|
});
|
||||||
if (PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("theme",true)) {
|
if (PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("theme",false)) {
|
||||||
mapView.setStyleUrl(getResources().getString(R.string.map_theme_dark));
|
mapView.setStyleUrl(getResources().getString(R.string.map_theme_dark));
|
||||||
} else {
|
} else {
|
||||||
mapView.setStyleUrl(getResources().getString(R.string.map_theme_light));
|
mapView.setStyleUrl(getResources().getString(R.string.map_theme_light));
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ public class SettingsActivity extends NavigationBaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
// Check prefs on every activity starts
|
// Check prefs on every activity starts
|
||||||
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true)) {
|
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false)) {
|
||||||
setTheme(R.style.DarkAppTheme);
|
setTheme(R.style.DarkAppTheme);
|
||||||
} else {
|
} else {
|
||||||
setTheme(R.style.LightAppTheme);
|
setTheme(R.style.LightAppTheme);
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ public class BaseActivity extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
// Restart activity if theme is changed
|
// Restart activity if theme is changed
|
||||||
boolean newTheme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true);
|
boolean newTheme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false);
|
||||||
if(currentTheme!=newTheme){ //is activity theme changed
|
if(currentTheme!=newTheme){ //is activity theme changed
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
finish();
|
finish();
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ public class SingleUploadFragment extends Fragment {
|
||||||
Timber.d(license);
|
Timber.d(license);
|
||||||
|
|
||||||
ArrayAdapter<String> adapter;
|
ArrayAdapter<String> adapter;
|
||||||
if (PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("theme",true)) {
|
if (PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("theme",false)) {
|
||||||
// dark theme
|
// dark theme
|
||||||
adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, licenseItems);
|
adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, licenseItems);
|
||||||
}else {
|
}else {
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:title="@string/preference_theme"
|
android:title="@string/preference_theme"
|
||||||
android:defaultValue="true"
|
android:defaultValue="false"
|
||||||
android:summary="@string/preference_theme_summary"
|
android:summary="@string/preference_theme_summary"
|
||||||
android:key="theme"
|
android:key="theme"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue