redesign library and search fragment
* library/search now use a grid view with 2 columns * media is now represented as card * media details: poster and episodes have now rounded corners
This commit is contained in:
@ -7,13 +7,16 @@
|
||||
android:background="#f5f5f5"
|
||||
tools:context=".ui.library.LibraryFragment">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/list_library"
|
||||
<GridView
|
||||
android:id="@+id/grid_media_library"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:clipToPadding="false"
|
||||
android:horizontalSpacing="7dp"
|
||||
android:numColumns="2"
|
||||
android:padding="5dp"
|
||||
android:verticalSpacing="7dp"
|
||||
tools:layout_editor_absoluteX="5dp"
|
||||
tools:layout_editor_absoluteY="5dp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -33,9 +33,8 @@
|
||||
<ImageView
|
||||
android:id="@+id/image_poster"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center"
|
||||
android:minHeight="200dp"
|
||||
android:src="@drawable/ic_launcher_background" />
|
||||
|
||||
</FrameLayout>
|
||||
|
@ -10,11 +10,8 @@
|
||||
<SearchView
|
||||
android:id="@+id/search_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="0dp"
|
||||
android:iconifiedByDefault="false"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:queryHint="@string/search_hint"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@ -23,13 +20,16 @@
|
||||
|
||||
</SearchView>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/list_search"
|
||||
<GridView
|
||||
android:id="@+id/grid_media_search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:clipToPadding="false"
|
||||
android:horizontalSpacing="7dp"
|
||||
android:numColumns="2"
|
||||
android:padding="5dp"
|
||||
android:verticalSpacing="7dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/search_text" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -19,7 +19,7 @@
|
||||
android:layout_width="128dp"
|
||||
android:layout_height="72dp"
|
||||
android:contentDescription="@string/component_poster_desc"
|
||||
app:srcCompat="@drawable/ic_baseline_account_box_24" />
|
||||
app:srcCompat="@color/md_disabled_text_dark_theme" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_episode_title"
|
36
app/src/main/res/layout/item_media.xml
Normal file
36
app/src/main/res/layout/item_media.xml
Normal file
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView 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="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="7dp"
|
||||
app:cardElevation="4dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image_poster"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="112.5dp"
|
||||
android:contentDescription="@string/media_poster_desc"
|
||||
android:maxWidth="200dp"
|
||||
android:scaleType="fitXY"
|
||||
app:srcCompat="@color/md_disabled_text_dark_theme" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_title"
|
||||
android:layout_width="match_parent"
|
||||
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" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:id="@+id/linear_media"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="7dp"
|
||||
android:paddingTop="3dp"
|
||||
android:paddingEnd="7dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView"
|
||||
android:textAlignment="center"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image_poster"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="223dp"
|
||||
tools:srcCompat="@drawable/ic_launcher_background" />
|
||||
</LinearLayout>
|
@ -7,6 +7,7 @@
|
||||
|
||||
<!-- search fragment -->
|
||||
<string name="search_hint">Search for movies and series</string>
|
||||
<string name="media_poster_desc" translatable="false">poster</string>
|
||||
|
||||
<!-- media fragment -->
|
||||
<string name="button_play">Play</string>
|
||||
|
Reference in New Issue
Block a user