Browse Source

improve theming 2

master
DF1E 10 years ago
parent
commit
aedf76e3ae
  1. 9
      src/acr/browser/lightning/BrowserActivity.java
  2. 16
      src/acr/browser/lightning/MainActivity.java

9
src/acr/browser/lightning/BrowserActivity.java

@ -55,7 +55,6 @@ import android.webkit.*; @@ -55,7 +55,6 @@ import android.webkit.*;
import android.webkit.WebChromeClient.CustomViewCallback;
import android.webkit.WebView.HitTestResult;
import android.widget.*;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v7.graphics.Palette;
import android.support.v7.widget.Toolbar;
@ -72,7 +71,7 @@ import java.net.URL; @@ -72,7 +71,7 @@ import java.net.URL;
import java.net.URLEncoder;
import java.util.*;
public class BrowserActivity extends ActionBarActivity implements BrowserController, OnClickListener {
public class BrowserActivity extends ThemableActivity implements BrowserController, OnClickListener {
private DrawerLayout mDrawerLayout;
private ListView mDrawerListLeft, mDrawerListRight;
@ -642,12 +641,6 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl @@ -642,12 +641,6 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
mBrowserFrame.removeView(mToolbarLayout);
mUiLayout.addView(mToolbarLayout, 0);
}
if (mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
switch (mPreferences.getInt(PreferenceConstants.SEARCH, 1)) {
case 0:

16
src/acr/browser/lightning/MainActivity.java

@ -13,16 +13,11 @@ public class MainActivity extends BrowserActivity { @@ -13,16 +13,11 @@ public class MainActivity extends BrowserActivity {
SharedPreferences mPreferences;
CookieManager mCookieManager;
private boolean mDark;
@Override
protected void onCreate(Bundle savedInstanceState) {
mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0);
mDark = mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false);
if (mDark) {
this.setTheme(R.style.Theme_DarkTheme);
}
super.onCreate(savedInstanceState);
mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0);
}
@Override
@ -62,15 +57,6 @@ public class MainActivity extends BrowserActivity { @@ -62,15 +57,6 @@ public class MainActivity extends BrowserActivity {
saveOpenTabs();
}
@Override
protected void onResume() {
super.onResume();
if (mPreferences != null
&& mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false) != mDark) {
this.recreate();
}
}
@Override
public void updateHistory(String title, String url) {
super.updateHistory(title, url);

Loading…
Cancel
Save