Browse Source

Allow close dialog to be shown when tabs icon is pressed

master
Anthony Restaino 9 years ago
parent
commit
000ecbdc25
  1. 3
      app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java
  2. 2
      app/src/main/java/acr/browser/lightning/controller/UIController.java
  3. 3
      app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java

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

@ -828,7 +828,8 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
quit.setOnClickListener(this); quit.setOnClickListener(this);
} }
private void showCloseDialog(final int position) { @Override
public void showCloseDialog(final int position) {
if (position < 0) { if (position < 0) {
return; return;
} }

2
app/src/main/java/acr/browser/lightning/controller/UIController.java

@ -51,4 +51,6 @@ public interface UIController {
void closeEmptyTab(); void closeEmptyTab();
void showCloseDialog(int position);
} }

3
app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java

@ -167,6 +167,9 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View
@Override @Override
public void onClick(@NonNull View v) { public void onClick(@NonNull View v) {
switch (v.getId()) { switch (v.getId()) {
case R.id.tab_header_button:
mUiController.showCloseDialog(tabsManager.indexOfCurrentTab());
break;
case R.id.new_tab_button: case R.id.new_tab_button:
mBus.post(new TabEvents.NewTab()); mBus.post(new TabEvents.NewTab());
break; break;

Loading…
Cancel
Save