diff --git a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java b/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java index 3f1d7d3..b70ec36 100644 --- a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java +++ b/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java @@ -828,7 +828,8 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements quit.setOnClickListener(this); } - private void showCloseDialog(final int position) { + @Override + public void showCloseDialog(final int position) { if (position < 0) { return; } diff --git a/app/src/main/java/acr/browser/lightning/controller/UIController.java b/app/src/main/java/acr/browser/lightning/controller/UIController.java index 2dbafd2..19a080a 100644 --- a/app/src/main/java/acr/browser/lightning/controller/UIController.java +++ b/app/src/main/java/acr/browser/lightning/controller/UIController.java @@ -51,4 +51,6 @@ public interface UIController { void closeEmptyTab(); + void showCloseDialog(int position); + } diff --git a/app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java b/app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java index d2f391a..566c71d 100644 --- a/app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java +++ b/app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java @@ -167,6 +167,9 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View @Override public void onClick(@NonNull View v) { switch (v.getId()) { + case R.id.tab_header_button: + mUiController.showCloseDialog(tabsManager.indexOfCurrentTab()); + break; case R.id.new_tab_button: mBus.post(new TabEvents.NewTab()); break;