Finished Part 1 of new auto source migration

(cherry picked from commit 10206ae7b30fbd521308a6d725e107e708b97dd0)
This commit is contained in:
jobobby04
2020-04-16 21:27:46 -04:00
committed by Jobobby04
parent e7b39f29f2
commit 52ad282492
35 changed files with 1137 additions and 51 deletions

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M8.59,16.34l4.58,-4.59 -4.58,-4.59L10,5.75l6,6 -6,6z"/>
</vector>

View File

@@ -114,30 +114,6 @@
android:gravity="start|center_vertical"
android:text="@string/use_intelligent_search"
android:clickable="true"
app:layout_constraintBottom_toTopOf="@+id/copy_manga"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/prioritize_chapter_count"
android:focusable="true" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/copy_manga"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="@+id/textView"
app:layout_constraintTop_toTopOf="@+id/copy_manga_desc" />
<TextView
android:id="@+id/copy_manga_desc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:gravity="start|center_vertical"
android:text="@string/keep_old_manga"
android:clickable="true"
app:layout_constraintBottom_toTopOf="@+id/extra_search_param"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/prioritize_chapter_count"
@@ -202,6 +178,6 @@
android:id="@+id/options_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="migration_mode,use_smart_search,fuzzy_search,copy_manga,extra_search_param_desc,mig_tracking,textView,mig_chapters,copy_manga_desc,textView2,prioritize_chapter_count,mig_categories,extra_search_param" />
app:constraint_referenced_ids="migration_mode,use_smart_search,fuzzy_search,action_copy_manga,extra_search_param_desc,mig_tracking,textView,mig_chapters,copy_manga_desc,textView2,prioritize_chapter_count,mig_categories,extra_search_param" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,16 @@
<?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="match_parent"
android:animateLayoutChanges="true">
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:id="@+id/recycler"
tools:listitem="@layout/migration_new_process_item" />
</FrameLayout>

View File

@@ -0,0 +1,123 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?selectable_library_drawable">
<FrameLayout
android:id="@+id/card"
android:layout_width="wrap_content"
android:layout_height="220dp"
android:background="?attr/colorSurface"
app:layout_constraintDimensionRatio="0.75"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_min="100dp"
app:layout_constraintHeight_min="100dp">
<ImageView
android:id="@+id/thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/colorBackground"
tools:background="?android:attr/colorBackground"
tools:ignore="ContentDescription"
tools:src="@mipmap/ic_launcher" />
<View
android:id="@+id/gradient"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/gradient_shape" />
<ProgressBar
android:id="@+id/loading_group"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_gravity="center" />
<TextView
android:id="@+id/manga_chapters"
style="@style/TextAppearance.Regular.Caption.Light"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/md_teal_500"
android:paddingBottom="1dp"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:paddingTop="1dp"
android:visibility="gone"
tools:visibility="visible"
android:text="101"
android:layout_marginStart="4dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="4dp"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
style="@style/TextAppearance.Regular.Body1.Light"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:ellipsize="end"
android:lineSpacingExtra="-4dp"
android:maxLines="2"
android:padding="8dp"
android:shadowColor="@color/textColorPrimaryLight"
android:shadowDx="0"
android:shadowDy="0"
android:shadowRadius="4"
tools:text="Sample name" />
<ProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone" />
</FrameLayout>
<LinearLayout
android:id="@+id/card_scroll_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:paddingBottom="20dp"
android:gravity="start"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/card"
app:layout_constraintStart_toStartOf="@id/card"
app:layout_constraintTop_toBottomOf="@id/card">
<TextView
android:id="@+id/manga_source_label"
style="@style/TextAppearance.Medium.Body2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="false"
android:textIsSelectable="false"
app:layout_constraintLeft_toLeftOf="parent"
android:ellipsize="end"
android:maxLines="1"
tools:layout_editor_absoluteY="57dp" />
<TextView
android:id="@+id/manga_last_chapter_label"
style="@style/TextAppearance.Regular.Body1.Secondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="false"
android:textIsSelectable="false" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,79 @@
<?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:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center|start">
<include
android:id="@+id/migration_manga_card_from"
layout="@layout/migration_new_manga_card"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_max="450dp" />
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_marginStart="-10dp"
android:layout_marginEnd="-10dp"
android:layout_marginBottom="30dp"
android:adjustViewBounds="true"
android:contentDescription="migrating to"
android:scaleType="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/migration_manga_card_from"
app:srcCompat="@drawable/ic_keyboard_arrow_right_black_24dp" />
<include
android:id="@+id/migration_manga_card_to"
layout="@layout/migration_new_manga_card"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView"
app:layout_constraintWidth_max="450dp" />
<ImageView
android:id="@+id/migration_menu"
android:layout_width="48dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginBottom="30dp"
android:contentDescription="@string/description_cover"
android:paddingTop="30dp"
android:paddingBottom="30dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_more_vert_24dp" />
<ImageView
android:id="@+id/skip_manga"
android:layout_width="48dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginBottom="30dp"
android:contentDescription="@string/description_cover"
android:paddingTop="30dp"
android:paddingBottom="30dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_close_24dp"
android:visibility="gone"/>
</LinearLayout>

View File

@@ -0,0 +1,15 @@
<?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_copy_manga"
android:icon="@drawable/ic_copy"
android:title="@string/copy"
app:showAsAction="always" />
<item
android:id="@+id/action_migrate_manga"
android:icon="@drawable/ic_done_all"
android:title="@string/migrate"
app:showAsAction="always" />
</menu>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/action_search_manually"
android:title="@string/action_search_manually"
android:visible="false" />
<item
android:id="@+id/action_skip"
android:title="@string/action_skip_manga"
android:visible="true"/>
<item android:id="@+id/action_migrate_now"
android:title="@string/action_migrate_now"
android:visible="false" />
<item android:id="@+id/action_copy_now"
android:title="@string/action_copy_now"
android:visible="false" />
</menu>

View File

@@ -49,6 +49,7 @@
<string name="action_sort_drag_and_drop">Drag &amp; Drop</string>
<string name="action_search">Search</string>
<string name="action_global_search">Global search</string>
<string name="action_skip_manga">Skip manga</string>
<string name="action_select_all">Select all</string>
<string name="action_select_inverse">Select inverse</string>
<string name="action_mark_as_read">Mark as read</string>
@@ -112,6 +113,9 @@
<string name="action_webview_back">Back</string>
<string name="action_webview_forward">Forward</string>
<string name="action_webview_refresh">Refresh</string>
<string name="action_search_manually">Search manually</string>
<string name="action_migrate_now">Migrate now</string>
<string name="action_copy_now">Copy now</string>
<!-- Operations -->
<string name="loading">Loading…</string>
@@ -482,6 +486,10 @@
<string name="download_unread">Unread</string>
<string name="confirm_delete_chapters">Are you sure you want to delete the selected chapters?</string>
<string name="invalid_download_dir">Invalid download location</string>
<string name="confirm_migration">Migrate %1$d%2$s mangas?</string>
<string name="confirm_copy">Copy %1$d%2$s mangas?</string>
<string name="skipping_x">(skipping %1$d)</string>
<string name="no_migrations">No manga migrated</string>
<!-- Tracking Screen -->
<string name="manga_tracking_tab">Tracking</string>
@@ -557,6 +565,8 @@
<string name="select">Select</string>
<string name="migrate">Migrate</string>
<string name="copy">Copy</string>
<string name="migrating">Migrating…</string>
<string name="latest_x">Latest: %1$s</string>
<!-- Downloads activity and service -->
<string name="download_queue_error">Could not download chapters. You can try again in the downloads section</string>