Browse Source

Fixed a bug where sometimes opening browser from recents opened recent tab, removed extra view

Also increased strictmode scope
master
Anthony Restaino 9 years ago
parent
commit
c8d06f8ce6
  1. 15
      app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java
  2. 8
      app/src/main/res/layout/activity_main.xml

15
app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java

@ -154,8 +154,8 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
// Toolbar Views // Toolbar Views
@Bind(R.id.toolbar) Toolbar mToolbar;
private View mSearchBackground; private View mSearchBackground;
private Toolbar mToolbar;
private SearchView mSearch; private SearchView mSearch;
private ImageView mArrowImage; private ImageView mArrowImage;
@ -236,14 +236,11 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectDiskReads() .detectAll()
.detectDiskWrites()
.detectNetwork()
.penaltyLog() .penaltyLog()
.build()); .build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedClosableObjects() .detectAll()
.detectLeakedSqlLiteObjects()
.penaltyLog() .penaltyLog()
.build()); .build());
} }
@ -272,7 +269,6 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
} }
private synchronized void initialize(Bundle savedInstanceState) { private synchronized void initialize(Bundle savedInstanceState) {
mToolbar = (Toolbar) findViewById(R.id.toolbar);
initializeToolbarHeight(getResources().getConfiguration()); initializeToolbarHeight(getResources().getConfiguration());
setSupportActionBar(mToolbar); setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar(); ActionBar actionBar = getSupportActionBar();
@ -415,10 +411,15 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
Intent intent = savedInstanceState == null ? getIntent() : null; Intent intent = savedInstanceState == null ? getIntent() : null;
boolean launchedFromHistory = intent != null && (intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0;
if (isPanicTrigger(intent)) { if (isPanicTrigger(intent)) {
setIntent(null); setIntent(null);
panicClean(); panicClean();
} else { } else {
if (launchedFromHistory) {
intent = null;
}
mPresenter.setupTabs(intent); mPresenter.setupTabs(intent);
setIntent(null); setIntent(null);
mProxyUtils.checkForProxy(BrowserActivity.this); mProxyUtils.checkForProxy(BrowserActivity.this);

8
app/src/main/res/layout/activity_main.xml

@ -7,13 +7,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".activity.BrowserActivity"> tools:context=".activity.BrowserActivity">
<LinearLayout
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@null"
android:orientation="vertical">
<android.support.v4.widget.DrawerLayout <android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -53,5 +46,4 @@
</android.support.v4.widget.DrawerLayout> </android.support.v4.widget.DrawerLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>
Loading…
Cancel
Save