Add close all tabs button

This commit is contained in:
Abdul Wadood 2018-08-05 21:17:41 +05:30 committed by Isaac Hutt
parent ee77d61518
commit 86e62ea7ca
3 changed files with 20 additions and 0 deletions

View File

@ -1079,6 +1079,13 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
return false;
}
@OnClick(R.id.tab_switcher_close_all_tabs)
void closeAllTabs() {
webViewList.clear();
tabsAdapter.notifyDataSetChanged();
updateTabSwitcherIcon();
}
@OnClick(R.id.bottom_toolbar_bookmark)
public void toggleBookmark() {
//Check maybe need refresh

View File

@ -12,4 +12,16 @@
android:layout_height="match_parent"
android:orientation="horizontal"
app:layoutManager="android.support.v7.widget.LinearLayoutManager" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/tab_switcher_close_all_tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:contentDescription="@string/close_all_tabs"
app:backgroundTint="@android:color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/ic_clear_white_24dp" />
</android.support.constraint.ConstraintLayout>

View File

@ -239,4 +239,5 @@
<string name="new_tab">New tab</string>
<string name="switch_tabs">Switch tabs</string>
<string name="smiling_face">:D</string>
<string name="close_all_tabs">Close all tabs</string>
</resources>