Apply reviews

This commit is contained in:
Neslihan 2017-03-18 12:04:49 +03:00
parent 85d0ce2c30
commit e094101e58
4 changed files with 10 additions and 17 deletions

View file

@ -4,7 +4,6 @@ import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.util.Log;
import fr.free.nrw.commons.R;
@ -19,17 +18,16 @@ public class BaseActivity extends Activity {
setTheme(R.style.DarkAppTheme);
}else {
currentTheme = false;
setTheme(R.style.LightAppTheme); //default
setTheme(R.style.LightAppTheme); // default
}
super.onCreate(savedInstanceState);
}
@Override
protected void onResume() {
//Restart activity if theme is changed
Log.d("deneme","onResume Base");
// Restart activity if theme is changed
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();
finish();
startActivity(intent);

View file

@ -4,7 +4,6 @@ import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import fr.free.nrw.commons.R;
@ -18,15 +17,14 @@ public class BaseAppCompatActivity extends AppCompatActivity {
setTheme(R.style.DarkAppTheme);
}else {
currentTheme = false;
setTheme(R.style.LightAppTheme); //default
setTheme(R.style.LightAppTheme); // default
}
super.onCreate(savedInstanceState);
}
@Override
protected void onResume() {
//Restart activity if theme is changed
Log.d("deneme","onResume Base");
// Restart activity if theme is changed
boolean newTheme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",false);
if(currentTheme!=newTheme){ //is activity theme changed
Intent intent = getIntent();