From 7bd8c6b4d64d3073dda17bd03aed5d9aaa8d51df Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Tue, 30 Apr 2019 15:49:02 -0700 Subject: [PATCH] Expand the app bar when a tab is closed. https://redmine.stoutner.com/issues/419 --- .../privacybrowser/activities/MainWebViewActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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: -- 2.45.2