blob: 9c8d97234ffd6f5819c5e5e311dfb3879cd076d3 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019, The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/item_container"
android:layout_width="match_parent"
android:layout_height="@dimen/media_browse_list_item_height"
android:paddingStart="@dimen/media_browse_list_item_icon_margin_start"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/thumbnail"
android:layout_width="@dimen/media_browse_list_icons_item_art_size"
android:layout_height="@dimen/media_browse_list_icons_item_art_size"
android:scaleType="centerCrop"
android:layout_marginBottom="@dimen/media_browse_list_item_thumbnail_margin_bottom"
android:layout_marginStart="@dimen/media_browse_list_icons_item_art_margin_start"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
/>
<!-- This guideline is necessary because there are icons preceding the text which typically have
visibility GONE, which prevents margins applied to the leftmost view from applying to the
TextViews constrained to that chain -->
<androidx.constraintlayout.widget.Guideline
android:id="@+id/text_start_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="@dimen/media_browse_list_icons_item_text_margin_x"/>
<ImageView
android:id="@+id/download_icon_with_title"
android:layout_width="@dimen/media_browse_indicator_size"
android:layout_height="@dimen/media_browse_indicator_size"
android:src="@drawable/ic_file_download_done_black"
android:tint="@color/icon_tint"
app:layout_constraintStart_toEndOf="@+id/text_start_guideline"
app:layout_constraintEnd_toStartOf="@+id/explicit_icon_with_title"
app:layout_constraintTop_toTopOf="@+id/title"
app:layout_constraintBottom_toBottomOf="@+id/title"/>
<ImageView
android:id="@+id/explicit_icon_with_title"
android:layout_width="@dimen/media_browse_indicator_size"
android:layout_height="@dimen/media_browse_indicator_size"
android:src="@drawable/ic_explicit_black"
android:tint="@color/icon_tint"
app:layout_constraintStart_toEndOf="@+id/download_icon_with_title"
app:layout_constraintEnd_toStartOf="@+id/title"
app:layout_constraintTop_toTopOf="@+id/title"
app:layout_constraintBottom_toBottomOf="@+id/title"/>
<TextView
android:id="@+id/title"
style="@style/BrowseListTitleStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:singleLine="true"
android:includeFontPadding="false"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/subtitle"
app:layout_constraintStart_toEndOf="@+id/explicit_icon_with_title"
app:layout_constraintEnd_toStartOf="@+id/right_arrow"/>
<ImageView
android:id="@+id/download_icon_with_subtitle"
android:layout_width="@dimen/media_browse_indicator_size"
android:layout_height="@dimen/media_browse_indicator_size"
android:src="@drawable/ic_file_download_done_black"
android:tint="@color/icon_tint"
app:layout_constraintStart_toStartOf="@+id/download_icon_with_title"
app:layout_constraintEnd_toStartOf="@+id/explicit_icon_with_subtitle"
app:layout_constraintTop_toTopOf="@+id/subtitle"
app:layout_constraintBottom_toBottomOf="@+id/subtitle"/>
<ImageView
android:id="@+id/explicit_icon_with_subtitle"
android:layout_width="@dimen/media_browse_indicator_size"
android:layout_height="@dimen/media_browse_indicator_size"
android:src="@drawable/ic_explicit_black"
android:tint="@color/icon_tint"
app:layout_constraintStart_toEndOf="@+id/download_icon_with_subtitle"
app:layout_constraintEnd_toStartOf="@+id/subtitle"
app:layout_constraintTop_toTopOf="@+id/subtitle"
app:layout_constraintBottom_toBottomOf="@+id/subtitle"/>
<TextView
android:id="@+id/subtitle"
style="@style/BrowseListSubtitleStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:singleLine="true"
app:layout_constraintTop_toBottomOf="@+id/title"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/explicit_icon_with_subtitle"
app:layout_constraintEnd_toStartOf="@+id/right_arrow"/>
<ImageView
android:id="@+id/right_arrow"
android:src="@drawable/ic_chevron_right"
android:layout_width="@dimen/media_browse_list_item_arrow_size"
android:layout_height="@dimen/media_browse_list_item_arrow_size"
android:layout_marginTop="@dimen/media_browse_subtitle_margin_top"
android:layout_gravity="center_vertical"
android:scaleType="centerCrop"
android:includeFontPadding="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/title"/>
</androidx.constraintlayout.widget.ConstraintLayout>