Resolve for "Day mode by default #825"

This commit is contained in:
mebr1416 2017-08-04 18:40:22 +03:00
parent ece14bd86a
commit 0c303298b2
5 changed files with 5 additions and 5 deletions

View file

@ -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);
} }
} }

View file

@ -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));

View file

@ -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);

View file

@ -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();

View file

@ -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 {