Merge pull request #833 from mebr1416/master

Day mode by default #825
This commit is contained in:
neslihanturan 2017-08-05 12:55:01 +03:00 committed by GitHub
commit 8ca35c7653
6 changed files with 6 additions and 6 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 {

View file

@ -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"
/> />