From: Soren Stoutner Date: Tue, 30 Apr 2019 22:49:02 +0000 (-0700) Subject: Expand the app bar when a tab is closed. https://redmine.stoutner.com/issues/419 X-Git-Tag: v3.0.1~3 X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff_plain;h=7bd8c6b4d64d3073dda17bd03aed5d9aaa8d51df;ds=sidebyside Expand the app bar when a tab is closed. https://redmine.stoutner.com/issues/419 --- diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index 807d1484..5356c420 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -2077,7 +2077,8 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook // Run the commands that correspond to the selected menu item. switch (menuItemId) { case R.id.close_tab: - // Get a handle for the tab layout and the view pager. + // Get handles for the views. + AppBarLayout appBarLayout = findViewById(R.id.appbar_layout); TabLayout tabLayout = findViewById(R.id.tablayout); ViewPager webViewPager = findViewById(R.id.webviewpager); @@ -2091,6 +2092,9 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook if (webViewPagerAdapter.deletePage(currentTabNumber, webViewPager)) { setCurrentWebView(currentTabNumber); } + + // Expand the app bar if it is currently collapsed. + appBarLayout.setExpanded(true); break; case R.id.clear_and_exit: