Favourites

This commit is contained in:
Koitharu
2020-02-04 21:53:41 +02:00
parent 738d1cb50e
commit bbe28f769d
21 changed files with 405 additions and 32 deletions

View File

@@ -28,7 +28,7 @@
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
<androidx.fragment.app.FragmentContainerView
android:id="@id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@@ -4,6 +4,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:paddingTop="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@@ -16,16 +17,21 @@
android:scrollbars="vertical"
tools:listitem="@layout/item_caegory_checkable" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:listDivider" />
<TextView
android:id="@+id/textView_add"
android:layout_width="match_parent"
android:layout_height="?listPreferredItemHeightSmall"
android:background="?selectableItemBackground"
android:layout_height="?android:listPreferredItemHeightSmall"
android:background="?android:selectableItemBackground"
android:gravity="start|center_vertical"
android:paddingStart="?listPreferredItemPaddingStart"
android:paddingEnd="?listPreferredItemPaddingEnd"
android:paddingStart="?android:listPreferredItemPaddingStart"
android:paddingEnd="?android:listPreferredItemPaddingEnd"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
android:textColor="?android:textColorPrimary"
android:text="" />
android:text="@string/add_new_category" />
</LinearLayout>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
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="wrap_content"
android:paddingStart="14dp"
android:paddingTop="8dp"
android:paddingEnd="14dp">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/inputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:boxBackgroundMode="filled">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/inputEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:maxLines="1"
tools:text="@tools:sample/lorem[2]" />
</com.google.android.material.textfield.TextInputLayout>
</FrameLayout>

View File

@@ -27,8 +27,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:maxLines="3"
android:layout_marginEnd="8dp"
android:maxLines="3"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textColor="?android:textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
@@ -41,9 +41,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:maxLines="2"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="?android:textColorSecondary"
android:maxLines="2"
app:layout_constraintEnd_toEndOf="@id/textView_title"
app:layout_constraintStart_toStartOf="@id/textView_title"
app:layout_constraintTop_toBottomOf="@id/textView_title"
@@ -63,19 +63,34 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/button_read"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:enabled="false"
android:text="@string/read"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
app:icon="@drawable/ic_read"
app:iconPadding="12dp"
android:enabled="false"
android:layout_marginEnd="4dp"
app:layout_constraintBottom_toBottomOf="@id/imageView_cover"
app:layout_constraintEnd_toEndOf="@id/textView_title"
app:layout_constraintTop_toBottomOf="@id/ratingBar"
app:layout_constraintVertical_bias="1" />
<ImageView
android:id="@+id/imageView_favourite"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginEnd="4dp"
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/add_to_favourites"
android:scaleType="center"
android:src="@drawable/ic_favourites"
android:tint="?colorAccent"
app:layout_constraintBottom_toBottomOf="@id/button_read"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toStartOf="@id/button_read"
app:layout_constraintTop_toTopOf="@id/button_read" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_title"
android:layout_width="wrap_content"

View File

@@ -4,12 +4,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/checkedTextView"
android:layout_width="match_parent"
android:layout_height="?listPreferredItemHeightSmall"
android:background="?selectableItemBackground"
android:layout_height="?android:listPreferredItemHeightSmall"
android:background="?android:selectableItemBackground"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:gravity="start|center_vertical"
android:paddingStart="?listPreferredItemPaddingStart"
android:paddingEnd="?listPreferredItemPaddingEnd"
android:paddingStart="?android:listPreferredItemPaddingStart"
android:paddingEnd="?android:listPreferredItemPaddingEnd"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
android:textColor="?android:textColorPrimary"
tools:checked="true"

View File

@@ -3,6 +3,11 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:cardElevation="0dp"
app:strokeColor="?android:textColorPrimary"
app:strokeWidth="1px"
app:cardBackgroundColor="?android:windowBackground"
android:layout_height="@dimen/manga_list_details_item_height">
<RelativeLayout

View File

@@ -26,4 +26,8 @@
<string name="continue_">Continue</string>
<string name="add_bookmark">Add bookmark</string>
<string name="you_have_not_favourites_yet">You have not favourites yet</string>
<string name="add_to_favourites">Add to favourites</string>
<string name="add_new_category">Add new category</string>
<string name="add">Add</string>
<string name="enter_category_name">Enter category name</string>
</resources>