Using image button where possible

instead of image view
This commit is contained in:
Jay 2020-05-21 16:07:33 -04:00
parent 88ceefecf3
commit a1bd3402ff
5 changed files with 39 additions and 30 deletions

View File

@ -118,9 +118,9 @@
app:layout_constraintTop_toTopOf="@id/category_title" app:layout_constraintTop_toTopOf="@id/category_title"
tools:text="Drag and Drop" /> tools:text="Drag and Drop" />
<ImageView <ImageButton
android:id="@+id/update_button" android:id="@+id/update_button"
style="@style/Theme.Widget.CustomImageButton" style="@style/Theme.Widget.ImageBorderless"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"

View File

@ -154,21 +154,21 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clipToPadding="false" android:clipToPadding="false"
android:requiresFadingEdge="horizontal"
android:scrollbars="none"
app:layout_constraintBottom_toTopOf="@id/manga_summary_label" app:layout_constraintBottom_toTopOf="@id/manga_summary_label"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/bottom_line" app:layout_constraintTop_toBottomOf="@id/bottom_line">
android:requiresFadingEdge="horizontal"
android:scrollbars="none">
<LinearLayout <LinearLayout
android:id="@+id/button_layout" android:id="@+id/button_layout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="14dp" android:layout_marginTop="14dp"
android:orientation="horizontal"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp">
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/favorite_button" android:id="@+id/favorite_button"

View File

@ -18,12 +18,13 @@
android:clickable="true" android:clickable="true"
android:focusable="true"> android:focusable="true">
<ImageView <ImageButton
android:id="@+id/up_category" android:id="@+id/up_category"
style="@style/Theme.Widget.CustomImageButton" style="@style/Theme.Widget.ImageBorderless"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:contentDescription="@string/previous"
android:padding="8dp" android:padding="8dp"
android:src="@drawable/ic_expand_less_24dp" android:src="@drawable/ic_expand_less_24dp"
android:tint="@android:color/white" android:tint="@android:color/white"
@ -32,11 +33,12 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageButton
android:id="@+id/category_button" android:id="@+id/category_button"
style="@style/Theme.Widget.CustomImageButton" style="@style/Theme.Widget.ImageBorderless"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/categories"
android:padding="8dp" android:padding="8dp"
android:src="@drawable/ic_label_outline_24dp" android:src="@drawable/ic_label_outline_24dp"
android:tint="@android:color/white" android:tint="@android:color/white"
@ -45,12 +47,13 @@
app:layout_constraintStart_toEndOf="@id/up_category" app:layout_constraintStart_toEndOf="@id/up_category"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageButton
android:id="@+id/down_category" android:id="@+id/down_category"
style="@style/Theme.Widget.CustomImageButton" style="@style/Theme.Widget.ImageBorderless"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:contentDescription="@string/next"
android:padding="8dp" android:padding="8dp"
android:src="@drawable/ic_expand_more_24dp" android:src="@drawable/ic_expand_more_24dp"
android:tint="@android:color/white" android:tint="@android:color/white"

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -18,9 +17,9 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="end|center" android:layout_gravity="end|center"
android:gravity="center"
android:layout_marginEnd="21dp" android:layout_marginEnd="21dp"
android:contentDescription="@string/cancel" android:contentDescription="@string/cancel"
android:gravity="center"
android:src="@drawable/ic_close_24dp" android:src="@drawable/ic_close_24dp"
android:text="@string/hide" android:text="@string/hide"
android:textColor="@color/md_white_1000" /> android:textColor="@color/md_white_1000" />
@ -67,10 +66,10 @@
android:id="@+id/title" android:id="@+id/title"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:paddingStart="0dp" android:paddingStart="0dp"
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:ellipsize="end"
android:textColor="?android:textColorPrimary" android:textColor="?android:textColorPrimary"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/source_latest" app:layout_constraintEnd_toStartOf="@+id/source_latest"
@ -81,28 +80,29 @@
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/source_latest" android:id="@+id/source_latest"
style="@style/Theme.Widget.Button.TextButton" style="@style/Theme.Widget.Button.TextButton"
android:textColor="?colorAccent"
android:layout_marginEnd="4dp"
android:textAllCaps="false"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:letterSpacing="0.0"
android:text="@string/latest"
android:minWidth="50dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="4dp"
android:letterSpacing="0.0"
android:minWidth="50dp"
android:text="@string/latest"
android:textAllCaps="false"
android:textColor="?colorAccent"
app:layout_constraintEnd_toStartOf="@id/source_pin" /> app:layout_constraintEnd_toStartOf="@id/source_pin" />
<ImageButton <ImageButton
android:id="@+id/source_pin" android:id="@+id/source_pin"
android:layout_marginEnd="8dp" style="@style/Theme.Widget.ImageBorderless"
style="@style/Theme.Widget.CustomImageButton"
android:src="@drawable/ic_pin_24dp"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_margin="10dp" android:layout_margin="10dp"
android:layout_marginEnd="8dp"
android:src="@drawable/ic_pin_24dp"
android:tint="?colorAccent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1" app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout> </FrameLayout>

View File

@ -248,6 +248,12 @@
<item name="android:textColor">?colorAccent</item> <item name="android:textColor">?colorAccent</item>
</style> </style>
<style name="Theme.Widget.ImageBorderless" parent="Widget.AppCompat.ImageButton">
<item name="android:background">?selectableItemBackgroundBorderless</item>
<item name="android:tint">?colorAccent</item>
<item name="rippleColor">@color/fullRippleColor</item>
</style>
<style name="Theme.Widget.CustomImageButton"> <style name="Theme.Widget.CustomImageButton">
<item name="android:background">@drawable/round_ripple</item> <item name="android:background">@drawable/round_ripple</item>
<item name="android:clickable">true</item> <item name="android:clickable">true</item>