Skip to content

Commit a997184

Browse files
authored
Merge pull request commons-app#447 from neslihanturan/fixNewThemeIssues
Fix new theme issue (number 3)
2 parents e12253c + 5ecc48f commit a997184

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

app/src/main/java/fr/free/nrw/commons/SettingsActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected void onCreate(Bundle savedInstanceState) {
2424
getDelegate().installViewFactory();
2525
getDelegate().onCreate(savedInstanceState);
2626
// Check prefs on every activity starts
27-
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false)) {
27+
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true)) {
2828
setTheme(R.style.DarkAppTheme);
2929
}else {
3030
setTheme(R.style.LightAppTheme); // default

app/src/main/java/fr/free/nrw/commons/theme/BaseActivity.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class BaseActivity extends Activity {
1313

1414
@Override
1515
protected void onCreate(Bundle savedInstanceState) {
16-
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false)) {
16+
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true)) {
1717
currentTheme = true;
1818
setTheme(R.style.DarkAppTheme);
1919
}else {
@@ -26,7 +26,7 @@ protected void onCreate(Bundle savedInstanceState) {
2626
@Override
2727
protected void onResume() {
2828
// Restart activity if theme is changed
29-
boolean newTheme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false);
29+
boolean newTheme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true);
3030
if(currentTheme!=newTheme){ // is activity theme changed
3131
Intent intent = getIntent();
3232
finish();

app/src/main/java/fr/free/nrw/commons/theme/BaseAppCompatActivity.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class BaseAppCompatActivity extends AppCompatActivity {
1212

1313
@Override
1414
protected void onCreate(Bundle savedInstanceState) {
15-
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false)) {
15+
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true)) {
1616
currentTheme = true;
1717
setTheme(R.style.DarkAppTheme);
1818
}else {
@@ -25,7 +25,7 @@ protected void onCreate(Bundle savedInstanceState) {
2525
@Override
2626
protected void onResume() {
2727
// Restart activity if theme is changed
28-
boolean newTheme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false);
28+
boolean newTheme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true);
2929
if(currentTheme!=newTheme){ //is activity theme changed
3030
Intent intent = getIntent();
3131
finish();

app/src/main/res/xml/preferences.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<CheckBoxPreference
2323
android:title="@string/preference_theme"
24-
android:defaultValue="false"
24+
android:defaultValue="true"
2525
android:summary="@string/preference_theme_summary"
2626
android:key="theme" />
2727

0 commit comments

Comments
 (0)