Replace MotionLayout with full screen dialog (#5806)
* Remove MotionLayout and add full screen dialog for enlarged cover * Address some of the review comments
This commit is contained in:
10
app/src/main/res/drawable/ic_save_24dp.xml
Normal file
10
app/src/main/res/drawable/ic_save_24dp.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z"/>
|
||||
</vector>
|
||||
@@ -1,11 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.motion.widget.MotionLayout 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="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layoutDescription="@xml/manga_info_header_scene_sw720dp"
|
||||
tools:context=".ui.browse.source.browse.BrowseSourceController">
|
||||
|
||||
<ImageView
|
||||
@@ -288,4 +287,4 @@
|
||||
|
||||
</androidx.constraintlayout.motion.widget.MotionLayout>
|
||||
|
||||
</androidx.constraintlayout.motion.widget.MotionLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
35
app/src/main/res/layout/manga_full_cover_dialog.xml
Normal file
35
app/src/main/res/layout/manga_full_cover_dialog.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="?attr/actionBarTheme"
|
||||
app:contentInsetStartWithNavigation="0dp"
|
||||
app:menu="@menu/full_cover"
|
||||
app:navigationIcon="@drawable/ic_close_24dp" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
|
||||
android:id="@+id/full_cover"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/appbar" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,11 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.motion.widget.MotionLayout 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="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layoutDescription="@xml/manga_info_header_scene"
|
||||
tools:context=".ui.browse.source.browse.BrowseSourceController">
|
||||
|
||||
<ImageView
|
||||
@@ -178,9 +177,10 @@
|
||||
android:id="@+id/manga_summary_section"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layoutDescription="@xml/manga_summary_section_scene"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/manga_actions"
|
||||
app:layoutDescription="@xml/manga_summary_section_scene">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/manga_summary_text"
|
||||
@@ -285,4 +285,4 @@
|
||||
|
||||
</androidx.constraintlayout.motion.widget.MotionLayout>
|
||||
|
||||
</androidx.constraintlayout.motion.widget.MotionLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
24
app/src/main/res/menu/full_cover.xml
Normal file
24
app/src/main/res/menu/full_cover.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_share_cover"
|
||||
android:icon="@drawable/ic_share_24dp"
|
||||
android:title="@string/action_share"
|
||||
app:iconTint="?attr/colorOnToolbar"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
android:id="@+id/action_save_cover"
|
||||
android:icon="@drawable/ic_save_24dp"
|
||||
android:title="@string/action_save"
|
||||
app:iconTint="?attr/colorOnToolbar"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_edit_cover"
|
||||
android:icon="@drawable/ic_edit_24dp"
|
||||
android:title="@string/action_edit"
|
||||
app:iconTint="?attr/colorOnToolbar"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
</menu>
|
||||
@@ -37,23 +37,6 @@
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:id="@+id/cover_group"
|
||||
android:title="@string/manga_cover"
|
||||
app:showAsAction="never">
|
||||
<menu>
|
||||
<item
|
||||
android:id="@+id/action_share_cover"
|
||||
android:title="@string/action_share" />
|
||||
<item
|
||||
android:id="@+id/action_save_cover"
|
||||
android:title="@string/action_save" />
|
||||
<item
|
||||
android:id="@+id/action_edit_cover"
|
||||
android:title="@string/action_edit" />
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_edit_categories"
|
||||
android:title="@string/action_edit_categories"
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:motion="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<Transition
|
||||
motion:constraintSetEnd="@+id/end"
|
||||
motion:constraintSetStart="@id/start"
|
||||
android:id="@+id/manga_info_header_transition"
|
||||
motion:duration="@android:integer/config_mediumAnimTime">
|
||||
<KeyFrameSet></KeyFrameSet>
|
||||
<OnClick motion:targetId="@+id/manga_cover" />
|
||||
</Transition>
|
||||
|
||||
<ConstraintSet android:id="@+id/start">
|
||||
<Constraint
|
||||
android:id="@+id/manga_summary_section"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
motion:layout_constraintEnd_toEndOf="parent"
|
||||
motion:layout_constraintStart_toStartOf="parent"
|
||||
motion:layout_constraintTop_toBottomOf="@id/manga_actions"
|
||||
motion:visibilityMode="ignore" />
|
||||
</ConstraintSet>
|
||||
|
||||
<ConstraintSet android:id="@+id/end">
|
||||
<Constraint
|
||||
android:id="@+id/backdrop"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="-8dp"
|
||||
android:alpha="0"
|
||||
motion:layout_constraintBottom_toBottomOf="@+id/manga_cover"
|
||||
motion:layout_constraintEnd_toEndOf="parent"
|
||||
motion:layout_constraintStart_toStartOf="parent"
|
||||
motion:layout_constraintTop_toTopOf="parent"
|
||||
motion:transitionEasing="cubic(0,1,0,1)" />
|
||||
<Constraint
|
||||
android:id="@+id/backdrop_overlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="160dp"
|
||||
android:layout_marginBottom="-16dp"
|
||||
android:alpha="0"
|
||||
motion:layout_constraintBottom_toBottomOf="@+id/backdrop"
|
||||
motion:transitionEasing="cubic(0,1,0,1)" />
|
||||
<Constraint
|
||||
android:id="@+id/manga_cover"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginTop="0dp"
|
||||
motion:layout_constraintDimensionRatio="2:3"
|
||||
motion:layout_constraintEnd_toEndOf="parent"
|
||||
motion:layout_constraintStart_toStartOf="parent"
|
||||
motion:layout_constraintTop_toTopOf="parent" />
|
||||
<Constraint
|
||||
android:id="@+id/btn_favorite"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
motion:layout_constraintEnd_toStartOf="@+id/btn_tracking"
|
||||
motion:layout_constraintHorizontal_bias="0.5"
|
||||
motion:layout_constraintStart_toStartOf="parent"
|
||||
motion:layout_constraintTop_toBottomOf="@id/manga_detail"
|
||||
android:layout_marginStart="16dp" />
|
||||
<Constraint
|
||||
android:id="@+id/manga_detail"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
motion:layout_constraintEnd_toEndOf="parent"
|
||||
motion:layout_constraintStart_toStartOf="parent"
|
||||
motion:layout_constraintTop_toBottomOf="@id/manga_cover" />
|
||||
<Constraint
|
||||
android:id="@+id/btn_tracking"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
motion:layout_constraintEnd_toStartOf="@+id/btn_webview"
|
||||
motion:layout_constraintHorizontal_bias="0.5"
|
||||
motion:layout_constraintStart_toEndOf="@+id/btn_favorite"
|
||||
motion:layout_constraintTop_toTopOf="@+id/btn_favorite"
|
||||
motion:visibilityMode="ignore" />
|
||||
<Constraint
|
||||
android:id="@+id/btn_tracking"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
motion:layout_constraintEnd_toStartOf="@+id/btn_webview"
|
||||
motion:layout_constraintHorizontal_bias="0.5"
|
||||
motion:layout_constraintStart_toEndOf="@+id/btn_favorite"
|
||||
motion:layout_constraintTop_toTopOf="@+id/btn_favorite"
|
||||
motion:visibilityMode="ignore" />
|
||||
<Constraint
|
||||
android:id="@+id/btn_webview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
motion:layout_constraintEnd_toEndOf="parent"
|
||||
motion:layout_constraintHorizontal_bias="0.5"
|
||||
motion:layout_constraintStart_toEndOf="@+id/btn_tracking"
|
||||
motion:layout_constraintTop_toTopOf="@+id/btn_favorite"
|
||||
motion:visibilityMode="ignore"
|
||||
android:layout_marginEnd="16dp" />
|
||||
<Constraint
|
||||
android:id="@+id/manga_summary_section"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
motion:layout_constraintEnd_toEndOf="parent"
|
||||
motion:layout_constraintStart_toStartOf="parent"
|
||||
motion:layout_constraintTop_toBottomOf="@id/manga_actions"
|
||||
motion:visibilityMode="ignore" />
|
||||
<Constraint
|
||||
android:id="@+id/manga_actions"
|
||||
motion:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
motion:layout_constraintTop_toBottomOf="@id/manga_detail"
|
||||
motion:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp" />
|
||||
</ConstraintSet>
|
||||
</MotionScene>
|
||||
@@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:motion="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<Transition
|
||||
motion:constraintSetEnd="@+id/end"
|
||||
motion:constraintSetStart="@id/start"
|
||||
android:id="@+id/manga_info_header_transition"
|
||||
motion:duration="@android:integer/config_mediumAnimTime">
|
||||
<KeyFrameSet></KeyFrameSet>
|
||||
<OnClick motion:targetId="@+id/manga_cover" />
|
||||
</Transition>
|
||||
|
||||
<ConstraintSet android:id="@+id/start">
|
||||
<Constraint
|
||||
android:id="@+id/manga_summary_section"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
motion:layout_constraintEnd_toEndOf="parent"
|
||||
motion:layout_constraintStart_toStartOf="parent"
|
||||
motion:layout_constraintTop_toBottomOf="@id/manga_actions"
|
||||
motion:visibilityMode="ignore" />
|
||||
</ConstraintSet>
|
||||
|
||||
<ConstraintSet android:id="@+id/end">
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/manga_summary_section"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
motion:layout_constraintEnd_toEndOf="parent"
|
||||
motion:layout_constraintStart_toStartOf="parent"
|
||||
motion:layout_constraintTop_toBottomOf="@id/manga_actions"
|
||||
motion:visibilityMode="ignore" />
|
||||
<Constraint
|
||||
android:id="@+id/manga_detail"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
motion:layout_constraintEnd_toEndOf="parent"
|
||||
motion:layout_constraintStart_toStartOf="parent"
|
||||
motion:layout_constraintTop_toBottomOf="@+id/manga_cover" />
|
||||
<Constraint
|
||||
motion:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_marginStart="0dp"
|
||||
motion:layout_constraintTop_toTopOf="parent"
|
||||
motion:layout_constraintStart_toStartOf="parent"
|
||||
motion:layout_constraintDimensionRatio="w,3:2"
|
||||
android:layout_marginTop="0dp"
|
||||
android:id="@+id/manga_cover" />
|
||||
</ConstraintSet>
|
||||
</MotionScene>
|
||||
Reference in New Issue
Block a user