From dc80a5ffbd00a8f8b3e68cd833bcf53ad8dfa775 Mon Sep 17 00:00:00 2001 From: len Date: Wed, 13 Apr 2016 16:42:59 +0200 Subject: [PATCH] Minor XML refactoring --- .../tachiyomi/ui/library/LibraryFragment.kt | 18 +++--------------- .../kanade/tachiyomi/ui/manga/MangaActivity.kt | 1 - app/src/main/res/layout/activity_main.xml | 13 +++++++++++++ app/src/main/res/layout/activity_manga.xml | 9 ++++++++- app/src/main/res/layout/library_tab_layout.xml | 13 ------------- app/src/main/res/layout/tab_layout.xml | 10 ---------- app/src/main/res/xml/pref_general.xml | 16 ++++++++-------- 7 files changed, 32 insertions(+), 48 deletions(-) delete mode 100644 app/src/main/res/layout/library_tab_layout.xml delete mode 100644 app/src/main/res/layout/tab_layout.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt index afe18b30e5..ea6f8c9b2b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt @@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.ui.library import android.app.Activity import android.content.Intent import android.os.Bundle -import android.support.design.widget.AppBarLayout import android.support.design.widget.TabLayout import android.support.v7.view.ActionMode import android.support.v7.widget.SearchView @@ -18,7 +17,6 @@ import eu.kanade.tachiyomi.event.LibraryMangaEvent import eu.kanade.tachiyomi.ui.base.fragment.BaseRxFragment import eu.kanade.tachiyomi.ui.category.CategoryActivity import eu.kanade.tachiyomi.ui.main.MainActivity -import eu.kanade.tachiyomi.util.inflate import eu.kanade.tachiyomi.util.toast import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.fragment_library.* @@ -41,13 +39,8 @@ class LibraryFragment : BaseRxFragment(), ActionMode.Callback /** * TabLayout of the categories. */ - private lateinit var tabs: TabLayout - - /** - * AppBarLayout from [MainActivity]. - */ - private val appbar: AppBarLayout - get() = (activity as MainActivity).appbar + private val tabs: TabLayout + get() = (activity as MainActivity).tabs /** * Position of the active category. @@ -70,7 +63,6 @@ class LibraryFragment : BaseRxFragment(), ActionMode.Callback */ private var selectedCoverManga: Manga? = null - /** * Status of isFilterDownloaded */ @@ -122,10 +114,6 @@ class LibraryFragment : BaseRxFragment(), ActionMode.Callback override fun onViewCreated(view: View, savedState: Bundle?) { setToolbarTitle(getString(R.string.label_library)) - tabs = appbar.inflate(R.layout.library_tab_layout) as TabLayout - - appbar.addView(tabs) - adapter = LibraryAdapter(childFragmentManager) view_pager.adapter = adapter tabs.setupWithViewPager(view_pager) @@ -138,7 +126,7 @@ class LibraryFragment : BaseRxFragment(), ActionMode.Callback } override fun onDestroyView() { - appbar.removeView(tabs) + tabs.visibility = View.GONE super.onDestroyView() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaActivity.kt index 76eb210ee6..0e963db7e3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaActivity.kt @@ -20,7 +20,6 @@ import eu.kanade.tachiyomi.ui.manga.info.MangaInfoFragment import eu.kanade.tachiyomi.ui.manga.myanimelist.MyAnimeListFragment import eu.kanade.tachiyomi.util.SharedData import kotlinx.android.synthetic.main.activity_manga.* -import kotlinx.android.synthetic.main.tab_layout.* import kotlinx.android.synthetic.main.toolbar.* import nucleus.factory.RequiresPresenter diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index a06c3ddee0..f631b1d5e8 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -19,6 +19,19 @@ + + diff --git a/app/src/main/res/layout/activity_manga.xml b/app/src/main/res/layout/activity_manga.xml index 7815e9107c..3f9871b771 100644 --- a/app/src/main/res/layout/activity_manga.xml +++ b/app/src/main/res/layout/activity_manga.xml @@ -12,7 +12,14 @@ - + diff --git a/app/src/main/res/layout/library_tab_layout.xml b/app/src/main/res/layout/library_tab_layout.xml deleted file mode 100644 index a2a298a9b5..0000000000 --- a/app/src/main/res/layout/library_tab_layout.xml +++ /dev/null @@ -1,13 +0,0 @@ - - \ No newline at end of file diff --git a/app/src/main/res/layout/tab_layout.xml b/app/src/main/res/layout/tab_layout.xml deleted file mode 100644 index 5c565cd6ac..0000000000 --- a/app/src/main/res/layout/tab_layout.xml +++ /dev/null @@ -1,10 +0,0 @@ - - \ No newline at end of file diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml index 72584f3bf3..9b2d7251cd 100644 --- a/app/src/main/res/xml/pref_general.xml +++ b/app/src/main/res/xml/pref_general.xml @@ -2,6 +2,14 @@ + + - -