make MediaItem width fully dynamic, based on the parents width (50% of parent width) and update SearchFragment to use MediaItemListAdapter and remove now unused MediaItemAdapter
This commit is contained in:
		@ -1,71 +1,82 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
    xmlns:tools="http://schemas.android.com/tools"
 | 
			
		||||
    android:layout_width="wrap_content"
 | 
			
		||||
    android:layout_height="wrap_content"
 | 
			
		||||
    android:backgroundTint="?themeSecondary"
 | 
			
		||||
    app:cardCornerRadius="7dp"
 | 
			
		||||
    app:cardElevation="4dp">
 | 
			
		||||
    android:layout_width="match_parent"
 | 
			
		||||
    android:layout_height="wrap_content">
 | 
			
		||||
 | 
			
		||||
    <androidx.constraintlayout.widget.ConstraintLayout
 | 
			
		||||
        android:layout_width="wrap_content"
 | 
			
		||||
        android:layout_height="wrap_content">
 | 
			
		||||
    <com.google.android.material.card.MaterialCardView
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:backgroundTint="?themeSecondary"
 | 
			
		||||
        app:cardCornerRadius="7dp"
 | 
			
		||||
        app:cardElevation="4dp"
 | 
			
		||||
        app:layout_constrainedWidth="true"
 | 
			
		||||
        app:layout_constraintBottom_toBottomOf="parent"
 | 
			
		||||
        app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
        app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
        app:layout_constraintTop_toTopOf="parent"
 | 
			
		||||
        app:layout_constraintWidth_default="percent"
 | 
			
		||||
        app:layout_constraintWidth_percent="0.96">
 | 
			
		||||
 | 
			
		||||
        <FrameLayout
 | 
			
		||||
            android:id="@+id/frame_image_progress"
 | 
			
		||||
            android:layout_width="wrap_content"
 | 
			
		||||
            android:layout_height="0dp"
 | 
			
		||||
            app:layout_constraintDimensionRatio="H,16:9"
 | 
			
		||||
            app:layout_constraintBottom_toTopOf="@+id/text_title"
 | 
			
		||||
            app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
            app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
            app:layout_constraintTop_toTopOf="parent"
 | 
			
		||||
            app:layout_constrainedWidth="true"
 | 
			
		||||
            app:layout_constraintWidth_max="195dp">
 | 
			
		||||
        <androidx.constraintlayout.widget.ConstraintLayout
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="wrap_content">
 | 
			
		||||
 | 
			
		||||
            <ImageView
 | 
			
		||||
                android:id="@+id/image_poster"
 | 
			
		||||
                android:layout_width="wrap_content"
 | 
			
		||||
            <FrameLayout
 | 
			
		||||
                android:id="@+id/frame_image_progress"
 | 
			
		||||
                android:layout_width="0dp"
 | 
			
		||||
                android:layout_height="0dp"
 | 
			
		||||
                app:layout_constraintBottom_toTopOf="@+id/text_title"
 | 
			
		||||
                app:layout_constraintDimensionRatio="H,16:9"
 | 
			
		||||
                app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
                app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                app:layout_constraintTop_toTopOf="parent">
 | 
			
		||||
 | 
			
		||||
                <ImageView
 | 
			
		||||
                    android:id="@+id/image_poster"
 | 
			
		||||
                    android:layout_width="wrap_content"
 | 
			
		||||
                    android:layout_height="wrap_content"
 | 
			
		||||
                    android:contentDescription="@string/media_poster_desc"
 | 
			
		||||
                    android:scaleType="fitCenter"
 | 
			
		||||
                    tools:srcCompat="@drawable/placeholder_image" />
 | 
			
		||||
 | 
			
		||||
                <ImageView
 | 
			
		||||
                    android:id="@+id/image_episode_play"
 | 
			
		||||
                    android:layout_width="wrap_content"
 | 
			
		||||
                    android:layout_height="wrap_content"
 | 
			
		||||
                    android:layout_gravity="center"
 | 
			
		||||
                    android:background="@drawable/bg_circle__black_transparent_24dp"
 | 
			
		||||
                    android:contentDescription="@string/button_play"
 | 
			
		||||
                    app:srcCompat="@drawable/ic_baseline_play_arrow_24"
 | 
			
		||||
                    app:tint="#FFFFFF" />
 | 
			
		||||
 | 
			
		||||
                <com.google.android.material.progressindicator.LinearProgressIndicator
 | 
			
		||||
                    android:id="@+id/progress_playhead"
 | 
			
		||||
                    android:layout_width="match_parent"
 | 
			
		||||
                    android:layout_height="wrap_content"
 | 
			
		||||
                    android:layout_gravity="bottom"
 | 
			
		||||
                    android:max="100"
 | 
			
		||||
                    app:trackColor="#00FFFFFF"
 | 
			
		||||
                    app:trackThickness="2dp" />
 | 
			
		||||
            </FrameLayout>
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/text_title"
 | 
			
		||||
                android:layout_width="0dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:contentDescription="@string/media_poster_desc"
 | 
			
		||||
                android:scaleType="fitCenter"
 | 
			
		||||
                tools:srcCompat="@drawable/placeholder_image"/>
 | 
			
		||||
                android:gravity="center"
 | 
			
		||||
                android:lines="2"
 | 
			
		||||
                android:maxLines="2"
 | 
			
		||||
                android:padding="3dp"
 | 
			
		||||
                android:text="@string/text_title_ex"
 | 
			
		||||
                android:textAlignment="center"
 | 
			
		||||
                android:textSize="15sp"
 | 
			
		||||
                app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
                app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                app:layout_constraintTop_toBottomOf="@+id/frame_image_progress" />
 | 
			
		||||
        </androidx.constraintlayout.widget.ConstraintLayout>
 | 
			
		||||
 | 
			
		||||
            <ImageView
 | 
			
		||||
                android:id="@+id/image_episode_play"
 | 
			
		||||
                android:layout_width="wrap_content"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_gravity="center"
 | 
			
		||||
                android:background="@drawable/bg_circle__black_transparent_24dp"
 | 
			
		||||
                android:contentDescription="@string/button_play"
 | 
			
		||||
                app:srcCompat="@drawable/ic_baseline_play_arrow_24"
 | 
			
		||||
                app:tint="#FFFFFF" />
 | 
			
		||||
    </com.google.android.material.card.MaterialCardView>
 | 
			
		||||
 | 
			
		||||
            <com.google.android.material.progressindicator.LinearProgressIndicator
 | 
			
		||||
                android:id="@+id/progress_playhead"
 | 
			
		||||
                android:layout_width="match_parent"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_gravity="bottom"
 | 
			
		||||
                android:max="100"
 | 
			
		||||
                app:trackColor="#00FFFFFF"
 | 
			
		||||
                app:trackThickness="2dp" />
 | 
			
		||||
        </FrameLayout>
 | 
			
		||||
 | 
			
		||||
        <TextView
 | 
			
		||||
            android:id="@+id/text_title"
 | 
			
		||||
            android:layout_width="0dp"
 | 
			
		||||
            android:layout_height="wrap_content"
 | 
			
		||||
            android:gravity="center"
 | 
			
		||||
            android:lines="2"
 | 
			
		||||
            android:maxLines="2"
 | 
			
		||||
            android:padding="3dp"
 | 
			
		||||
            android:text="@string/text_title_ex"
 | 
			
		||||
            android:textAlignment="center"
 | 
			
		||||
            android:textSize="15sp"
 | 
			
		||||
            app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
            app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
            app:layout_constraintTop_toBottomOf="@+id/frame_image_progress" />
 | 
			
		||||
    </androidx.constraintlayout.widget.ConstraintLayout>
 | 
			
		||||
 | 
			
		||||
</com.google.android.material.card.MaterialCardView>
 | 
			
		||||
</androidx.constraintlayout.widget.ConstraintLayout>
 | 
			
		||||
 | 
			
		||||
@ -1,50 +1,62 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
    xmlns:tools="http://schemas.android.com/tools"
 | 
			
		||||
    android:layout_width="wrap_content"
 | 
			
		||||
    android:layout_height="wrap_content"
 | 
			
		||||
    android:layout_marginStart="4dp"
 | 
			
		||||
    android:layout_marginEnd="3dp"
 | 
			
		||||
    android:backgroundTint="?themeSecondary"
 | 
			
		||||
    app:cardCornerRadius="7dp"
 | 
			
		||||
    app:cardElevation="4dp">
 | 
			
		||||
    android:layout_width="match_parent"
 | 
			
		||||
    android:layout_height="wrap_content">
 | 
			
		||||
 | 
			
		||||
    <androidx.constraintlayout.widget.ConstraintLayout
 | 
			
		||||
    <com.google.android.material.card.MaterialCardView
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="match_parent"
 | 
			
		||||
        app:layout_constraintWidth_max="195dp">
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:layout_marginStart="4dp"
 | 
			
		||||
        android:layout_marginEnd="3dp"
 | 
			
		||||
        android:backgroundTint="?themeSecondary"
 | 
			
		||||
        app:cardCornerRadius="7dp"
 | 
			
		||||
        app:cardElevation="4dp"
 | 
			
		||||
        app:layout_constrainedWidth="true"
 | 
			
		||||
        app:layout_constraintBottom_toBottomOf="parent"
 | 
			
		||||
        app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
        app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
        app:layout_constraintTop_toTopOf="parent"
 | 
			
		||||
        app:layout_constraintWidth_default="percent"
 | 
			
		||||
        app:layout_constraintWidth_percent="0.96">
 | 
			
		||||
 | 
			
		||||
        <FrameLayout
 | 
			
		||||
            android:id="@+id/frame_image_progress"
 | 
			
		||||
            android:layout_width="0dp"
 | 
			
		||||
            android:layout_height="0dp"
 | 
			
		||||
            app:layout_constraintDimensionRatio="H,16:9"
 | 
			
		||||
            app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
            app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
            app:layout_constraintTop_toTopOf="parent"
 | 
			
		||||
            app:layout_constraintWidth="195dp">
 | 
			
		||||
        <androidx.constraintlayout.widget.ConstraintLayout
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="wrap_content"
 | 
			
		||||
            app:layout_constraintWidth_max="195dp">
 | 
			
		||||
 | 
			
		||||
            <FrameLayout
 | 
			
		||||
                android:id="@+id/frame_image_progress"
 | 
			
		||||
                android:layout_width="0dp"
 | 
			
		||||
                android:layout_height="0dp"
 | 
			
		||||
                app:layout_constraintDimensionRatio="H,16:9"
 | 
			
		||||
                app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
                app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                app:layout_constraintTop_toTopOf="parent">
 | 
			
		||||
 | 
			
		||||
                <ImageView
 | 
			
		||||
                    android:id="@+id/image_poster"
 | 
			
		||||
                    android:layout_width="match_parent"
 | 
			
		||||
                    android:layout_height="match_parent"
 | 
			
		||||
                    android:background="?shapeTextBackground"
 | 
			
		||||
                    tools:ignore="ContentDescription" />
 | 
			
		||||
 | 
			
		||||
            </FrameLayout>
 | 
			
		||||
 | 
			
		||||
            <ImageView
 | 
			
		||||
                android:id="@+id/image_poster"
 | 
			
		||||
                android:layout_width="match_parent"
 | 
			
		||||
                android:layout_height="match_parent"
 | 
			
		||||
                android:background="?shapeTextBackground"
 | 
			
		||||
                android:id="@+id/image_dummy_text"
 | 
			
		||||
                android:layout_width="128dp"
 | 
			
		||||
                android:layout_height="19dp"
 | 
			
		||||
                android:layout_margin="11dp"
 | 
			
		||||
                app:layout_constraintBottom_toBottomOf="parent"
 | 
			
		||||
                app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
                app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                app:layout_constraintTop_toBottomOf="@+id/frame_image_progress"
 | 
			
		||||
                app:srcCompat="@drawable/shape_rounded_corner"
 | 
			
		||||
                tools:ignore="ContentDescription" />
 | 
			
		||||
        </androidx.constraintlayout.widget.ConstraintLayout>
 | 
			
		||||
 | 
			
		||||
        </FrameLayout>
 | 
			
		||||
    </com.google.android.material.card.MaterialCardView>
 | 
			
		||||
 | 
			
		||||
        <ImageView
 | 
			
		||||
            android:id="@+id/image_dummy_text"
 | 
			
		||||
            android:layout_width="128dp"
 | 
			
		||||
            android:layout_height="19dp"
 | 
			
		||||
            android:layout_margin="11dp"
 | 
			
		||||
            app:layout_constraintBottom_toBottomOf="parent"
 | 
			
		||||
            app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
            app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
            app:layout_constraintTop_toBottomOf="@+id/frame_image_progress"
 | 
			
		||||
            app:srcCompat="@drawable/shape_rounded_corner"
 | 
			
		||||
            tools:ignore="ContentDescription" />
 | 
			
		||||
    </androidx.constraintlayout.widget.ConstraintLayout>
 | 
			
		||||
 | 
			
		||||
</com.google.android.material.card.MaterialCardView>
 | 
			
		||||
</androidx.constraintlayout.widget.ConstraintLayout>
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user