Commit f3b9280e authored by Simon Chae's avatar Simon Chae
Browse files

Closes #7158: Add right chevron arrow in ParentBrowserMenuItem

parent d21bcf74
......@@ -64,6 +64,10 @@ class ParentBrowserMenuItem(
setImageResource(imageResource)
setTintResource(iconTintColorResource)
}
val overflowView = view.findViewById<AppCompatImageView>(R.id.overflowImage)
with(overflowView) {
setTintResource(iconTintColorResource)
}
}
private fun bindBackPress(menu: BrowserMenu, view: View) {
......
......@@ -2,32 +2,47 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/Mozac.Browser.Menu.Item.Container"
android:layout_width="match_parent"
android:orientation="horizontal"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
tools:ignore="UseCompoundDrawables">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/Mozac.Browser.Menu.Item.Container"
android:layout_width="match_parent"
android:orientation="horizontal"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
tools:ignore="UseCompoundDrawables">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
style="@style/Mozac.Browser.Menu.Item.ImageText.Icon"
android:clickable="false"
android:background="@android:color/transparent"
android:importantForAccessibility="no"
tools:src="@android:drawable/screen_background_dark"/>
android:id="@+id/image"
style="@style/Mozac.Browser.Menu.Item.ImageText.Icon"
android:clickable="false"
android:background="@android:color/transparent"
android:importantForAccessibility="no"
tools:src="@android:drawable/screen_background_dark"/>
<TextView
android:id="@+id/text"
style="@style/Mozac.Browser.Menu.Item.ImageText.Label"
android:clickable="false"
android:focusable="false"
android:background="@android:color/transparent"
android:gravity="center_vertical"
tools:text="Item"
android:importantForAccessibility="no"/>
android:id="@+id/text"
style="@style/Mozac.Browser.Menu.Item.ImageText.Label"
android:clickable="false"
android:focusable="false"
android:background="@android:color/transparent"
android:gravity="center_vertical"
tools:text="Item"
android:importantForAccessibility="no"/>
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/overflowImage"
android:layout_width="16dp"
android:layout_height="16dp"
android:clickable="false"
android:background="@android:color/transparent"
android:importantForAccessibility="no"
app:srcCompat="@drawable/mozac_ic_arrowhead_right"/>
</LinearLayout>
......@@ -46,10 +46,12 @@ class ParentBrowserMenuItemTest {
parentMenuItem.bind(nestedMenu, view)
val textView = view.findViewById<TextView>(R.id.text)
val imageView = view.findViewById<AppCompatImageView>(R.id.image)
val overflowView = view.findViewById<AppCompatImageView>(R.id.overflowImage)
assertEquals("label", textView.text)
assertNotNull(imageView.drawable)
assertNotNull(imageView.imageTintList)
assertNotNull(overflowView.imageTintList)
}
@Test
......
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path android:fillColor="@color/mozac_ui_icons_fill"
android:pathData="M6 14a1 1 0 0 1-0.707-1.707L9.586 8 5.293 3.707a1 1 0 0 1 1.414-1.414l5 5a1 1 0 0 1 0 1.414l-5 5A1 1 0 0 1 6 14z"/>
</vector>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment