mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Add banner at top of library when downloaded only mode is enabled
This commit is contained in:
		| @@ -35,6 +35,7 @@ import eu.kanade.tachiyomi.ui.main.MainActivity | ||||
| import eu.kanade.tachiyomi.ui.manga.MangaController | ||||
| import eu.kanade.tachiyomi.util.system.getResourceColor | ||||
| import eu.kanade.tachiyomi.util.system.toast | ||||
| import eu.kanade.tachiyomi.util.view.visible | ||||
| import java.io.IOException | ||||
| import kotlinx.android.synthetic.main.main_activity.tabs | ||||
| import kotlinx.coroutines.flow.filter | ||||
| @@ -172,6 +173,10 @@ class LibraryController( | ||||
|                 is LibrarySettingsSheet.Display.BadgeGroup -> onDownloadBadgeChanged() | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         if (preferences.downloadedOnly().get()) { | ||||
|             binding.downloadedOnly.visible() | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) { | ||||
|   | ||||
| @@ -4,10 +4,34 @@ | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent"> | ||||
|  | ||||
|     <androidx.viewpager.widget.ViewPager | ||||
|         android:id="@+id/library_pager" | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="match_parent" /> | ||||
|         android:layout_height="match_parent" | ||||
|         android:orientation="vertical"> | ||||
|  | ||||
|         <FrameLayout | ||||
|             android:id="@+id/downloaded_only" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:background="?attr/colorSecondary" | ||||
|             android:visibility="gone"> | ||||
|  | ||||
|             <TextView | ||||
|                 android:layout_width="wrap_content" | ||||
|                 android:layout_height="wrap_content" | ||||
|                 android:layout_gravity="center" | ||||
|                 android:padding="4dp" | ||||
|                 android:text="@string/label_downloaded_only" | ||||
|                 android:textColor="?attr/colorOnSecondary" /> | ||||
|  | ||||
|         </FrameLayout> | ||||
|  | ||||
|         <androidx.viewpager.widget.ViewPager | ||||
|             android:id="@+id/library_pager" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" /> | ||||
|  | ||||
|     </LinearLayout> | ||||
|  | ||||
|     <eu.kanade.tachiyomi.widget.ActionToolbar | ||||
|         android:id="@+id/action_toolbar" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user