Various small changes

This commit is contained in:
topjohnwu
2017-01-10 22:30:05 +08:00
parent fa73b41fa7
commit 742055c43b
11 changed files with 36 additions and 53 deletions

View File

@@ -1,7 +1,6 @@
package com.topjohnwu.magisk;
import android.Manifest;
import android.app.AlertDialog;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.Intent;
@@ -25,7 +24,6 @@ import android.view.MenuItem;
import android.view.View;
import com.topjohnwu.magisk.utils.CallbackHandler;
import com.topjohnwu.magisk.utils.Logger;
import com.topjohnwu.magisk.utils.Shell;
import com.topjohnwu.magisk.utils.Utils;
@@ -35,8 +33,6 @@ import butterknife.ButterKnife;
public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener, CallbackHandler.EventListener {
public static AlertDialog.Builder alertBuilder = null;
private static final String SELECTED_ITEM_ID = "SELECTED_ITEM_ID";
private final Handler mDrawerHandler = new Handler();
@@ -54,13 +50,8 @@ public class MainActivity extends AppCompatActivity
prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
String theme = prefs.getString("theme", "");
Logger.dev("MainActivity: Theme is " + theme);
if (Utils.isDarkTheme(theme, this)) {
if (Utils.isDarkTheme) {
setTheme(R.style.AppTheme_dh);
alertBuilder = new AlertDialog.Builder(this, R.style.AlertDialog_dh);
} else {
alertBuilder = new AlertDialog.Builder(this);
}
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
@@ -116,7 +107,6 @@ public class MainActivity extends AppCompatActivity
protected void onDestroy() {
super.onDestroy();
CallbackHandler.unRegister(StatusFragment.updateCheckDone, this);
alertBuilder = null;
}
@Override