mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Add feature to clear database manga by source (#6241)
* Implement feature to selectively clear manga from database based on it's source * Code cleanup and refactoring
This commit is contained in:
		
							
								
								
									
										32
									
								
								app/src/main/res/layout/clear_database_controller.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								app/src/main/res/layout/clear_database_controller.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <FrameLayout 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="match_parent"> | ||||
|  | ||||
|     <androidx.recyclerview.widget.RecyclerView | ||||
|         android:id="@+id/recycler" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="match_parent" | ||||
|         android:choiceMode="multipleChoice" | ||||
|         android:clipToPadding="false" | ||||
|         android:paddingBottom="@dimen/fab_list_padding" | ||||
|         tools:listitem="@layout/clear_database_source_item" /> | ||||
|  | ||||
|     <eu.kanade.tachiyomi.widget.MaterialFastScroll | ||||
|         android:id="@+id/fast_scroller" | ||||
|         android:layout_width="wrap_content" | ||||
|         android:layout_height="match_parent" | ||||
|         android:layout_gravity="end" | ||||
|         app:fastScrollerBubbleEnabled="false" | ||||
|         tools:visibility="visible" /> | ||||
|  | ||||
|     <eu.kanade.tachiyomi.widget.EmptyView | ||||
|         android:id="@+id/empty_view" | ||||
|         android:layout_width="wrap_content" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:layout_gravity="center" | ||||
|         android:visibility="gone" /> | ||||
|  | ||||
| </FrameLayout> | ||||
							
								
								
									
										68
									
								
								app/src/main/res/layout/clear_database_source_item.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								app/src/main/res/layout/clear_database_source_item.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,68 @@ | ||||
| <?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="match_parent" | ||||
|     android:layout_height="56dp" | ||||
|     android:background="@drawable/list_item_selector_background" | ||||
|     android:paddingStart="8dp" | ||||
|     android:paddingEnd="16dp"> | ||||
|  | ||||
|  | ||||
|     <ImageView | ||||
|         android:id="@+id/thumbnail" | ||||
|         android:layout_width="0dp" | ||||
|         android:layout_height="0dp" | ||||
|         android:paddingHorizontal="8dp" | ||||
|         app:layout_constraintDimensionRatio="1:1" | ||||
|         app:layout_constraintStart_toStartOf="parent" | ||||
|         app:layout_constraintTop_toTopOf="parent" | ||||
|         app:layout_constraintBottom_toBottomOf="parent" | ||||
|         tools:ignore="ContentDescription" | ||||
|         tools:src="@mipmap/ic_launcher" /> | ||||
|  | ||||
|     <TextView | ||||
|         android:id="@+id/title" | ||||
|         style="?attr/textAppearanceBodyMedium" | ||||
|         android:layout_width="0dp" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:paddingStart="0dp" | ||||
|         android:paddingEnd="8dp" | ||||
|         android:ellipsize="middle" | ||||
|         android:maxLines="1" | ||||
|         app:layout_constraintStart_toEndOf="@+id/thumbnail" | ||||
|         app:layout_constraintEnd_toStartOf="@id/checkbox" | ||||
|         app:layout_constraintTop_toTopOf="parent" | ||||
|         app:layout_constraintBottom_toTopOf="@id/description" | ||||
|         app:layout_constraintVertical_chainStyle="packed" | ||||
|         tools:text="Source Name (LN)" /> | ||||
|  | ||||
|     <TextView | ||||
|         android:id="@+id/description" | ||||
|         style="?attr/textAppearanceBodySmall" | ||||
|         android:layout_width="0dp" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:ellipsize="end" | ||||
|         android:maxLines="1" | ||||
|         app:layout_constraintStart_toEndOf="@+id/thumbnail" | ||||
|         app:layout_constraintEnd_toStartOf="@id/checkbox" | ||||
|         app:layout_constraintTop_toBottomOf="@id/title" | ||||
|         app:layout_constraintBottom_toBottomOf="parent" | ||||
|         tools:text="999 non-library manga in database" /> | ||||
|  | ||||
|     <CheckBox | ||||
|         android:id="@+id/checkbox" | ||||
|         android:layout_width="0dp" | ||||
|         android:layout_height="match_parent" | ||||
|         android:paddingStart="16dp" | ||||
|         android:paddingEnd="16dp" | ||||
|         android:clickable="false" | ||||
|         android:background="@android:color/transparent" | ||||
|         android:longClickable="false" | ||||
|         app:layout_constraintEnd_toEndOf="parent" | ||||
|         app:layout_constraintTop_toTopOf="parent" | ||||
|         app:layout_constraintBottom_toBottomOf="parent" | ||||
|         app:layout_constraintDimensionRatio="1:2" | ||||
|         /> | ||||
|  | ||||
| </androidx.constraintlayout.widget.ConstraintLayout> | ||||
| @@ -461,8 +461,10 @@ | ||||
|     <string name="pref_auto_clear_chapter_cache">Clear chapter cache on app close</string> | ||||
|     <string name="pref_clear_database">Clear database</string> | ||||
|     <string name="pref_clear_database_summary">Delete history for manga that are not saved in your library</string> | ||||
|     <string name="clear_database_source_item_count">%1$d non-library manga in database</string> | ||||
|     <string name="clear_database_confirmation">Are you sure? Read chapters and progress of non-library manga will be lost</string> | ||||
|     <string name="clear_database_completed">Entries deleted</string> | ||||
|     <string name="database_clean">Database clean</string> | ||||
|     <string name="pref_refresh_library_covers">Refresh library manga covers</string> | ||||
|     <string name="pref_refresh_library_tracking">Refresh tracking</string> | ||||
|     <string name="pref_refresh_library_tracking_summary">Updates status, score and last chapter read from the tracking services</string> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user