Revision control
Copy as Markdown
<?xml version="1.0" encoding="utf-8"?>
<data>
<variable
name="isPreferred"
type="boolean" />
<variable
name="isFirst"
type="boolean" />
<variable
name="isLast"
type="boolean" />
<variable
name="language"
type="org.mozilla.vrbrowser.ui.adapters.Language" />
</data>
<RelativeLayout
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:gravity="center"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:soundEffectsEnabled="false">
<LinearLayout
android:id="@+id/addRemoveButtons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:clickable="false"
android:duplicateParentState="true"
android:orientation="horizontal">
<FrameLayout
android:layout_width="@dimen/language_row_icon_size"
android:layout_height="@dimen/language_row_icon_size"
android:duplicateParentState="true">
<ImageView
android:id="@+id/add"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:clickable="false"
android:contentDescription="TODO"
android:duplicateParentState="true"
android:soundEffectsEnabled="false"
android:src="@drawable/ic_icon_language_add"
android:tint="@color/fog"
app:srcCompat="@drawable/ic_icon_language_add"
app:visibleGone="@{!isPreferred && !language.isPreferred}" />
<ImageView
android:id="@+id/added"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:clickable="false"
android:contentDescription="TODO"
android:duplicateParentState="true"
android:soundEffectsEnabled="false"
android:src="@drawable/ic_icon_check"
android:tint="@color/fog"
app:srcCompat="@drawable/ic_icon_check"
app:visibleGone="@{!isPreferred && language.isPreferred}" />
<ImageView
android:id="@+id/delete"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:clickable="false"
android:contentDescription="Preferred language delete button"
android:duplicateParentState="true"
android:soundEffectsEnabled="false"
android:src="@{@drawable/ic_icon_language_delete}"
android:tint="@color/fog"
app:srcCompat="@drawable/ic_icon_language_delete"
app:visibleGone="@{isPreferred}" />
</FrameLayout>
</LinearLayout>
<!-- This shouldn't be necessary but there is a visual glitch when using fading edge in a
view inside the RecyclerView.
We use a custom FadingFrameLayout to overcome this limitation. You can change the
FadingFrameLayout for a FrameLayout or remove it and move the fading attributes
to the TextView to see the glitched result. -->
<org.mozilla.vrbrowser.ui.views.FadingFrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/addRemoveButtons"
android:requiresFadingEdge="horizontal"
android:fadingEdgeLength="@dimen/language_row_fade_size">
<TextView
android:id="@+id/title"
style="@style/settingsText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="none"
android:gravity="center_vertical"
android:paddingStart="5dp"
android:singleLine="true"
android:text="@{language.displayName}"
tool:text="Language Item" />
</org.mozilla.vrbrowser.ui.views.FadingFrameLayout>
<LinearLayout
android:id="@+id/moveButtons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:clickable="false"
android:duplicateParentState="true"
android:orientation="horizontal">
<FrameLayout
android:layout_width="@dimen/language_row_icon_size"
android:layout_height="@dimen/language_row_icon_size"
android:duplicateParentState="true"
android:layout_marginEnd="10dp">
<ImageView
android:id="@+id/up"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:contentDescription="TODO"
android:duplicateParentState="true"
android:soundEffectsEnabled="false"
android:src="@drawable/ic_icon_language_move_up"
android:tint="@color/fog"
app:srcCompat="@drawable/ic_icon_language_move_up"
app:visibleGone="@{isPreferred && !isFirst}" />
</FrameLayout>
<FrameLayout
android:layout_width="@dimen/language_row_icon_size"
android:layout_height="@dimen/language_row_icon_size"
android:duplicateParentState="true">
<ImageView
android:id="@+id/down"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:contentDescription="TODO"
android:duplicateParentState="true"
android:soundEffectsEnabled="false"
android:src="@drawable/ic_icon_language_move_down"
android:tint="@color/fog"
app:srcCompat="@drawable/ic_icon_language_move_down"
app:visibleGone="@{isPreferred && !isLast}" />
</FrameLayout>
</LinearLayout>
</RelativeLayout>
</layout>