Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #2834: Delete all Private Tabs redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
jyeontaek committed Aug 19, 2019
1 parent 727457f commit 770bd7c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ class TabHeaderViewHolder(
}
}

share_tabs_button.run {
setOnClickListener {
actionEmitter.onNext(TabAction.ShareTabs)
}
}

close_private_tabs_button.run {
setOnClickListener {
actionEmitter.onNext(TabAction.CloseAll(true))
}
}

tabs_overflow_button.run {
setOnClickListener {
tabsMenu.menuBuilder
Expand All @@ -63,7 +75,9 @@ class TabHeaderViewHolder(
val headerTextResourceId =
if (isPrivate) R.string.tabs_header_private_title else R.string.tab_header_label
view.header_text.text = view.context.getString(headerTextResourceId)
view.tabs_overflow_button.visibility = if (hasTabs) View.VISIBLE else View.GONE
view.share_tabs_button.visibility = if (isPrivate && hasTabs) View.VISIBLE else View.GONE
view.close_private_tabs_button.visibility = if (isPrivate && hasTabs) View.VISIBLE else View.GONE
view.tabs_overflow_button.visibility = if (!isPrivate && hasTabs) View.VISIBLE else View.GONE
}

class TabHeaderMenu(
Expand Down
7 changes: 0 additions & 7 deletions app/src/main/res/layout/private_browsing_description.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:orientation="vertical">
<TextView
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6"
android:textColor="?primaryText"
android:text="@string/private_browsing_title"
android:layout_marginBottom="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/private_session_description"
android:layout_width="match_parent"
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/res/layout/tab_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@
android:contentDescription="@string/add_tab"
android:src="@drawable/ic_new"/>

<ImageButton
android:id="@+id/share_tabs_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_hollow_share"/>

<ImageButton
android:id="@+id/close_private_tabs_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_delete"/>

<ImageButton
android:id="@+id/tabs_overflow_button"
android:layout_width="48dp"
Expand Down

0 comments on commit 770bd7c

Please sign in to comment.