mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-11 08:27:50 -04:00
feat: Close tab switcher on clicking again
This commit is contained in:
parent
6c9794f70f
commit
c952779e80
@ -1526,7 +1526,14 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
|||||||
View tabSwitcher = menu.findItem(R.id.menu_tab_switcher).getActionView();
|
View tabSwitcher = menu.findItem(R.id.menu_tab_switcher).getActionView();
|
||||||
tabSwitcherIcon = tabSwitcher.findViewById(R.id.ic_tab_switcher_text);
|
tabSwitcherIcon = tabSwitcher.findViewById(R.id.ic_tab_switcher_text);
|
||||||
updateTabSwitcherIcon();
|
updateTabSwitcherIcon();
|
||||||
tabSwitcher.setOnClickListener(v -> showTabSwitcher());
|
tabSwitcher.setOnClickListener(v -> {
|
||||||
|
if (tabSwitcherRoot.getVisibility() == View.VISIBLE) {
|
||||||
|
hideTabSwitcher();
|
||||||
|
selectTab(currentWebViewIndex);
|
||||||
|
} else {
|
||||||
|
showTabSwitcher();
|
||||||
|
}
|
||||||
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user