Revision control
Copy as Markdown
<?xml version="1.0" encoding="utf-8"?>
<data>
<import type="android.widget.LinearLayout"/>
<variable
name="item"
type="org.mozilla.vrbrowser.ui.adapters.Bookmark" />
<variable
name="callback"
type="org.mozilla.vrbrowser.ui.callbacks.BookmarkItemCallback" />
<variable
name="isNarrow"
type="boolean" />
<variable
name="isHovered"
type="boolean" />
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="@dimen/library_item_row_height"
app:layout_height="@{isNarrow ? @dimen/library_item_row_height_narrow : @dimen/library_item_row_height}"
app:startMargin="@{item.level*100}"
android:layout_marginEnd="20dp"
android:background="@color/void_color">
<RelativeLayout
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/library_item_background_color"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:onClick="@{(view) -> callback.onClick(view, item)}"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:soundEffectsEnabled="false"
android:addStatesFromChildren="true">
<LinearLayout
android:id="@+id/title_url"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:gravity="center_vertical"
android:layout_toStartOf="@id/buttons_container"
android:addStatesFromChildren="true"
android:orientation="@{isNarrow ? LinearLayout.VERTICAL : LinearLayout.HORIZONTAL}">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="middle"
android:paddingEnd="20dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="@{item.title}"
android:textColor="@color/library_panel_title_text_color"
android:textSize="@dimen/library_item_title_text_size"
android:textStyle="bold"
tools:text="Item Title" />
<TextView
android:id="@+id/url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="middle"
android:paddingEnd="20dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="@{item.url}"
android:textColor="@color/library_panel_description_color"
android:textSize="@dimen/library_item_url_text_size"
android:visibility="visible"/>
</LinearLayout>
<LinearLayout
android:id="@+id/buttons_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_gravity="end"
android:orientation="horizontal"
app:visibleInvisible="@{isHovered}"
android:addStatesFromChildren="true">
<ImageView
android:id="@+id/trash"
android:layout_width="@dimen/library_item_row_height"
android:layout_height="@dimen/library_item_row_height"
android:layout_gravity="center_vertical|end"
android:padding="@dimen/library_icon_padding_max"
android:soundEffectsEnabled="false"
android:src="@drawable/ic_icon_trash"
android:tint="@color/library_panel_icon_color"
app:srcCompat="@drawable/ic_icon_trash" />
<ImageView
android:id="@+id/more"
android:layout_width="@dimen/library_item_row_height"
android:layout_height="@dimen/library_item_row_height"
android:layout_gravity="center_vertical|end"
android:padding="@dimen/library_icon_padding_max"
android:soundEffectsEnabled="false"
android:src="@drawable/ic_icon_more_options"
android:tint="@color/library_panel_icon_color"
app:srcCompat="@drawable/ic_icon_more_options" />
</LinearLayout>
</RelativeLayout>
</FrameLayout>
</layout>