mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Merge remote-tracking branch 'refs/remotes/commons-app/master' into fix-login-3
This commit is contained in:
commit
8b947241b9
12 changed files with 22 additions and 10 deletions
|
|
@ -24,7 +24,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
|
||||||
getDelegate().installViewFactory();
|
getDelegate().installViewFactory();
|
||||||
getDelegate().onCreate(savedInstanceState);
|
getDelegate().onCreate(savedInstanceState);
|
||||||
// Check prefs on every activity starts
|
// Check prefs on every activity starts
|
||||||
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false)) {
|
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true)) {
|
||||||
setTheme(R.style.DarkAppTheme);
|
setTheme(R.style.DarkAppTheme);
|
||||||
}else {
|
}else {
|
||||||
setTheme(R.style.LightAppTheme); // default
|
setTheme(R.style.LightAppTheme); // default
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ public class BaseActivity extends Activity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false)) {
|
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true)) {
|
||||||
currentTheme = true;
|
currentTheme = true;
|
||||||
setTheme(R.style.DarkAppTheme);
|
setTheme(R.style.DarkAppTheme);
|
||||||
}else {
|
}else {
|
||||||
|
|
@ -26,7 +26,7 @@ public class BaseActivity extends Activity {
|
||||||
@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",false);
|
boolean newTheme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true);
|
||||||
if(currentTheme!=newTheme){ // is activity theme changed
|
if(currentTheme!=newTheme){ // is activity theme changed
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
finish();
|
finish();
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ public class BaseAppCompatActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false)) {
|
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true)) {
|
||||||
currentTheme = true;
|
currentTheme = true;
|
||||||
setTheme(R.style.DarkAppTheme);
|
setTheme(R.style.DarkAppTheme);
|
||||||
}else {
|
}else {
|
||||||
|
|
@ -25,7 +25,7 @@ public class BaseAppCompatActivity 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",false);
|
boolean newTheme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true);
|
||||||
if(currentTheme!=newTheme){ //is activity theme changed
|
if(currentTheme!=newTheme){ //is activity theme changed
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
finish();
|
finish();
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,8 @@
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
android:gravity="start"/>
|
android:gravity="start"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,8 @@
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
android:gravity="start"/>
|
android:gravity="start"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,8 @@
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
android:gravity="start"/>
|
android:gravity="start"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
android:gravity="center_horizontal"/>
|
android:gravity="center_horizontal"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -74,5 +74,6 @@
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -53,5 +53,6 @@
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -39,5 +39,6 @@
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -37,5 +37,6 @@
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:title="@string/preference_theme"
|
android:title="@string/preference_theme"
|
||||||
android:defaultValue="false"
|
android:defaultValue="true"
|
||||||
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