mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +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) {
|
||||
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);
|
||||
});
|
||||
if (PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("theme",true)) {
|
||||
if (PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("theme",false)) {
|
||||
mapView.setStyleUrl(getResources().getString(R.string.map_theme_dark));
|
||||
} else {
|
||||
mapView.setStyleUrl(getResources().getString(R.string.map_theme_light));
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public class SettingsActivity extends NavigationBaseActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// Check prefs on every activity starts
|
||||
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true)) {
|
||||
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false)) {
|
||||
setTheme(R.style.DarkAppTheme);
|
||||
} else {
|
||||
setTheme(R.style.LightAppTheme);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class BaseActivity extends AppCompatActivity {
|
|||
@Override
|
||||
protected void onResume() {
|
||||
// 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
|
||||
Intent intent = getIntent();
|
||||
finish();
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public class SingleUploadFragment extends Fragment {
|
|||
Timber.d(license);
|
||||
|
||||
ArrayAdapter<String> adapter;
|
||||
if (PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("theme",true)) {
|
||||
if (PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("theme",false)) {
|
||||
// dark theme
|
||||
adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, licenseItems);
|
||||
}else {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
<CheckBoxPreference
|
||||
android:title="@string/preference_theme"
|
||||
android:defaultValue="true"
|
||||
android:defaultValue="false"
|
||||
android:summary="@string/preference_theme_summary"
|
||||
android:key="theme"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue