diff options
| author | Clyhtsuriva <aimeric@adjutor.xyz> | 2021-02-16 11:37:58 +0100 | 
|---|---|---|
| committer | Clyhtsuriva <aimeric@adjutor.xyz> | 2021-02-16 11:37:58 +0100 | 
| commit | 7288d5ae154f895d71727acc92828aa555e8108b (patch) | |
| tree | 367d04058f951c24a1bc4778b85873df89bf67f8 /app/src/main/res/layout | |
| parent | 97ff499413e5dae958ac3741616e2ee84a188871 (diff) | |
Starting to work on recycler view feature
Diffstat (limited to 'app/src/main/res/layout')
| -rw-r--r-- | app/src/main/res/layout/activity_main.xml | 3 | ||||
| -rw-r--r-- | app/src/main/res/layout/item_layout.xml | 63 | ||||
| -rw-r--r-- | app/src/main/res/layout/row_layout.xml | 47 | ||||
| -rw-r--r-- | app/src/main/res/layout/top_manga_page.xml | 21 | 
4 files changed, 123 insertions, 11 deletions
| diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index b0826f8..12a61d8 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,6 @@  <?xml version="1.0" encoding="utf-8"?> -<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.coordinatorlayout.widget.CoordinatorLayout +    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" diff --git a/app/src/main/res/layout/item_layout.xml b/app/src/main/res/layout/item_layout.xml new file mode 100644 index 0000000..e03e874 --- /dev/null +++ b/app/src/main/res/layout/item_layout.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.cardview.widget.CardView +    xmlns:android="http://schemas.android.com/apk/res/android" +    xmlns:app="http://schemas.android.com/apk/res-auto" +    android:id="@+id/cv_cardView" +    android:layout_width="match_parent" +    android:layout_height="wrap_content" +    android:layout_margin="4dp" +    android:clickable="true" +    android:focusable="true" +    android:foreground="?selectableItemBackground" +    app:cardCornerRadius="10dp" +    > + +    <RelativeLayout +        android:id="@+id/rl_wrapper" +        android:layout_width="match_parent" +        android:layout_height="match_parent" +        android:padding="20dp" +        > + +        <ImageView +            android:id="@+id/iv_image" +            android:layout_width="wrap_content" +            android:layout_height="wrap_content" +            android:layout_centerVertical="true" +            android:layout_margin="10dp" +            android:src="@mipmap/ic_launcher_round" +            android:contentDescription="@string/rv_image" /> + +        <LinearLayout +            android:layout_width="match_parent" +            android:layout_height="match_parent" +            android:layout_alignTop="@id/iv_image" +            android:layout_alignBottom="@id/iv_image" +            android:layout_toEndOf="@id/iv_image" +            android:orientation="vertical" +            > + +            <TextView +                android:id="@+id/tv_title" +                android:layout_width="wrap_content" +                android:layout_height="wrap_content" +                android:layout_marginStart="10dp" +                android:text="@string/rv_title" +                android:textColor="@color/strong_pink" +                android:textSize="20sp"/> + +            <TextView +                android:id="@+id/tv_description" +                android:layout_width="wrap_content" +                android:layout_height="wrap_content" +                android:layout_marginStart="10dp" +                android:text="@string/rv_description" +                android:textColor="@color/slightly_desaturated_magenta" +                android:textSize="20sp" +                /> + +        </LinearLayout> + + +    </RelativeLayout> +</androidx.cardview.widget.CardView>
\ No newline at end of file diff --git a/app/src/main/res/layout/row_layout.xml b/app/src/main/res/layout/row_layout.xml new file mode 100644 index 0000000..1c74476 --- /dev/null +++ b/app/src/main/res/layout/row_layout.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout +    xmlns:android="http://schemas.android.com/apk/res/android" +    xmlns:tools="http://schemas.android.com/tools" +    xmlns:app="http://schemas.android.com/apk/res-auto" +    android:layout_width="match_parent" +    android:layout_height="?android:attr/listPreferredItemHeight" +    android:layout_marginStart="?android:attr/listPreferredItemPaddingLeft" +    android:layout_marginEnd="?android:attr/listPreferredItemPaddingRight" +    android:gravity="center_vertical" +    android:padding="6dip"> + +<ImageView +    android:id="@+id/icon" +    android:layout_width="wrap_content" +    android:layout_height="fill_parent" +    android:layout_alignParentBottom="true" +    android:layout_alignParentTop="true" +    android:layout_marginEnd="6dip" +    android:contentDescription="@string/rv_image" +    android:src="@mipmap/ic_launcher" +    tools:ignore="MissingConstraints" /> + +<TextView +    android:id="@+id/secondLine" +    android:layout_height="26dip" +    android:ellipsize="marquee" +    android:text="@string/rv_description" +    android:textSize="12sp" +    app:layout_constraintStart_toEndOf="@id/icon" +    app:layout_constraintTop_toBottomOf="@id/firstLine" +    android:layout_width="0dp" /> + +<TextView +    android:id="@+id/firstLine" +    android:layout_height="wrap_content" +    android:layout_toEndOf="@id/icon" +    android:gravity="center_vertical" +    android:text="@string/rv_title" +    android:textSize="16sp" +    app:layout_constraintStart_toEndOf="@id/icon" +    app:layout_constraintEnd_toEndOf="parent" +    android:layout_width="0dp" +    tools:ignore="MissingConstraints" /> + + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/layout/top_manga_page.xml b/app/src/main/res/layout/top_manga_page.xml index 6a2f86b..f8d2510 100644 --- a/app/src/main/res/layout/top_manga_page.xml +++ b/app/src/main/res/layout/top_manga_page.xml @@ -5,17 +5,17 @@      android:layout_width="match_parent"      android:layout_height="match_parent"      tools:context=".TopMangaPage" -    android:background="@color/very_dark_purple" -    > +    android:background="@color/very_dark_purple"> -    <TextView -        android:id="@+id/textview_second" -        android:layout_width="wrap_content" -        android:layout_height="wrap_content" -        app:layout_constraintBottom_toTopOf="@id/home" -        app:layout_constraintEnd_toEndOf="parent" +    <androidx.recyclerview.widget.RecyclerView +        android:id="@+id/recycler_view" +        android:layout_width="0dp" +        android:layout_height="0dp" +        app:layout_constraintTop_toTopOf="parent"          app:layout_constraintStart_toStartOf="parent" -        app:layout_constraintTop_toTopOf="parent" /> +        app:layout_constraintEnd_toEndOf="parent" +        app:layout_constraintBottom_toTopOf="@+id/home" +        tools:listitem="@layout/item_layout" />      <Button          android:id="@+id/home" @@ -25,5 +25,6 @@          app:layout_constraintBottom_toBottomOf="parent"          app:layout_constraintEnd_toEndOf="parent"          app:layout_constraintStart_toStartOf="parent" -        app:layout_constraintTop_toBottomOf="@id/textview_second" /> +        /> +  </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file | 
