mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Reorganize layouts by feature
This commit is contained in:
		| @@ -30,9 +30,8 @@ import eu.kanade.tachiyomi.ui.manga.MangaController | ||||
| import eu.kanade.tachiyomi.util.* | ||||
| import eu.kanade.tachiyomi.widget.AutofitRecyclerView | ||||
| import eu.kanade.tachiyomi.widget.DrawerSwipeCloseListener | ||||
| import kotlinx.android.synthetic.main.activity_main.* | ||||
| import kotlinx.android.synthetic.main.fragment_catalogue.view.* | ||||
| import kotlinx.android.synthetic.main.toolbar.* | ||||
| import kotlinx.android.synthetic.main.main_activity.* | ||||
| import kotlinx.android.synthetic.main.catalogue_controller.view.* | ||||
| import rx.Observable | ||||
| import rx.Subscription | ||||
| import rx.android.schedulers.AndroidSchedulers | ||||
| @@ -117,7 +116,7 @@ open class CatalogueController(bundle: Bundle? = null) : | ||||
|     } | ||||
|  | ||||
|     override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { | ||||
|         return inflater.inflate(R.layout.fragment_catalogue, container, false) | ||||
|         return inflater.inflate(R.layout.catalogue_controller, container, false) | ||||
|     } | ||||
|  | ||||
|     override fun onViewCreated(view: View, savedViewState: Bundle?) { | ||||
| @@ -133,7 +132,7 @@ open class CatalogueController(bundle: Bundle? = null) : | ||||
|  | ||||
|         val spinnerAdapter = ArrayAdapter(themedContext, | ||||
|                 android.R.layout.simple_spinner_item, presenter.sources) | ||||
|         spinnerAdapter.setDropDownViewResource(R.layout.spinner_item) | ||||
|         spinnerAdapter.setDropDownViewResource(R.layout.common_spinner_item) | ||||
|  | ||||
|         val onItemSelected: (Int) -> Unit = { position -> | ||||
|             val source = spinnerAdapter.getItem(position) | ||||
| @@ -232,7 +231,7 @@ open class CatalogueController(bundle: Bundle? = null) : | ||||
|                 addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL)) | ||||
|             } | ||||
|         } else { | ||||
|             (view.catalogue_view.inflate(R.layout.recycler_autofit) as AutofitRecyclerView).apply { | ||||
|             (view.catalogue_view.inflate(R.layout.catalogue_recycler_autofit) as AutofitRecyclerView).apply { | ||||
|                 numColumnsSubscription = getColumnsPreferenceForCurrentOrientation().asObservable() | ||||
|                         .doOnNext { spanCount = it } | ||||
|                         .skip(1) | ||||
| @@ -242,7 +241,7 @@ open class CatalogueController(bundle: Bundle? = null) : | ||||
|                 (layoutManager as GridLayoutManager).spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() { | ||||
|                     override fun getSpanSize(position: Int): Int { | ||||
|                         return when (adapter?.getItemViewType(position)) { | ||||
|                             R.layout.item_catalogue_grid, null -> 1 | ||||
|                             R.layout.catalogue_grid_item, null -> 1 | ||||
|                             else -> spanCount | ||||
|                         } | ||||
|                     } | ||||
|   | ||||
| @@ -6,7 +6,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy | ||||
| import eu.davidea.flexibleadapter.FlexibleAdapter | ||||
| import eu.kanade.tachiyomi.data.database.models.Manga | ||||
| import eu.kanade.tachiyomi.widget.StateImageViewTarget | ||||
| import kotlinx.android.synthetic.main.item_catalogue_grid.view.* | ||||
| import kotlinx.android.synthetic.main.catalogue_grid_item.view.* | ||||
|  | ||||
| /** | ||||
|  * Class used to hold the displayed data of a manga in the catalogue, like the cover or the title. | ||||
|   | ||||
| @@ -11,12 +11,12 @@ import eu.kanade.tachiyomi.R | ||||
| import eu.kanade.tachiyomi.data.database.models.Manga | ||||
| import eu.kanade.tachiyomi.util.inflate | ||||
| import eu.kanade.tachiyomi.widget.AutofitRecyclerView | ||||
| import kotlinx.android.synthetic.main.item_catalogue_grid.view.* | ||||
| import kotlinx.android.synthetic.main.catalogue_grid_item.view.* | ||||
|  | ||||
| class CatalogueItem(val manga: Manga) : AbstractFlexibleItem<CatalogueHolder>() { | ||||
|  | ||||
|     override fun getLayoutRes(): Int { | ||||
|         return R.layout.item_catalogue_grid | ||||
|         return R.layout.catalogue_grid_item | ||||
|     } | ||||
|  | ||||
|     override fun createViewHolder(adapter: FlexibleAdapter<*>, | ||||
| @@ -24,7 +24,7 @@ class CatalogueItem(val manga: Manga) : AbstractFlexibleItem<CatalogueHolder>() | ||||
|                                   parent: ViewGroup): CatalogueHolder { | ||||
|  | ||||
|         if (parent is AutofitRecyclerView) { | ||||
|             val view = parent.inflate(R.layout.item_catalogue_grid).apply { | ||||
|             val view = parent.inflate(R.layout.catalogue_grid_item).apply { | ||||
|                 card.layoutParams = FrameLayout.LayoutParams( | ||||
|                         MATCH_PARENT, parent.itemWidth / 3 * 4) | ||||
|                 gradient.layoutParams = FrameLayout.LayoutParams( | ||||
| @@ -32,7 +32,7 @@ class CatalogueItem(val manga: Manga) : AbstractFlexibleItem<CatalogueHolder>() | ||||
|             } | ||||
|             return CatalogueGridHolder(view, adapter) | ||||
|         } else { | ||||
|             val view = parent.inflate(R.layout.item_catalogue_list) | ||||
|             val view = parent.inflate(R.layout.catalogue_list_item) | ||||
|             return CatalogueListHolder(view, adapter) | ||||
|         } | ||||
|     } | ||||
|   | ||||
| @@ -6,7 +6,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy | ||||
| import eu.davidea.flexibleadapter.FlexibleAdapter | ||||
| import eu.kanade.tachiyomi.data.database.models.Manga | ||||
| import eu.kanade.tachiyomi.util.getResourceColor | ||||
| import kotlinx.android.synthetic.main.item_catalogue_list.view.* | ||||
| import kotlinx.android.synthetic.main.catalogue_list_item.view.* | ||||
|  | ||||
| /** | ||||
|  * Class used to hold the displayed data of a manga in the catalogue, like the cover or the title. | ||||
|   | ||||
| @@ -17,7 +17,7 @@ class ProgressItem : AbstractFlexibleItem<ProgressItem.Holder>() { | ||||
|     var loadMore = true | ||||
|  | ||||
|     override fun getLayoutRes(): Int { | ||||
|         return R.layout.progress_item | ||||
|         return R.layout.catalogue_progress_item | ||||
|     } | ||||
|  | ||||
|     override fun createViewHolder(adapter: FlexibleAdapter<IFlexible<*>>, inflater: LayoutInflater, parent: ViewGroup): Holder { | ||||
|   | ||||
| @@ -30,7 +30,7 @@ open class SelectItem(val filter: Filter.Select<*>) : AbstractFlexibleItem<Selec | ||||
|         spinner.prompt = filter.name | ||||
|         spinner.adapter = ArrayAdapter<Any>(holder.itemView.context, | ||||
|                 android.R.layout.simple_spinner_item, filter.values).apply { | ||||
|             setDropDownViewResource(R.layout.spinner_item) | ||||
|             setDropDownViewResource(R.layout.common_spinner_item) | ||||
|         } | ||||
|         spinner.onItemSelectedListener = IgnoreFirstSpinnerListener { position -> | ||||
|             filter.state = position | ||||
|   | ||||
| @@ -7,7 +7,7 @@ import com.amulyakhare.textdrawable.TextDrawable | ||||
| import com.amulyakhare.textdrawable.util.ColorGenerator | ||||
| import eu.davidea.viewholders.FlexibleViewHolder | ||||
| import eu.kanade.tachiyomi.data.database.models.Category | ||||
| import kotlinx.android.synthetic.main.item_edit_categories.view.* | ||||
| import kotlinx.android.synthetic.main.categories_item.view.* | ||||
|  | ||||
| /** | ||||
|  * Holder used to display category items. | ||||
|   | ||||
| @@ -22,7 +22,7 @@ class CategoryItem(val category: Category) : AbstractFlexibleItem<CategoryHolder | ||||
|      * Returns the layout resource for this item. | ||||
|      */ | ||||
|     override fun getLayoutRes(): Int { | ||||
|         return R.layout.item_edit_categories | ||||
|         return R.layout.categories_item | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -54,7 +54,7 @@ class DownloadAdapter : RecyclerView.Adapter<DownloadHolder>() { | ||||
|      * @return a new view holder for a manga. | ||||
|      */ | ||||
|     override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): DownloadHolder { | ||||
|         val view = parent.inflate(R.layout.item_download) | ||||
|         val view = parent.inflate(R.layout.download_item) | ||||
|         return DownloadHolder(view) | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,7 @@ import eu.kanade.tachiyomi.data.download.DownloadService | ||||
| import eu.kanade.tachiyomi.data.download.model.Download | ||||
| import eu.kanade.tachiyomi.source.model.Page | ||||
| import eu.kanade.tachiyomi.ui.base.controller.NucleusController | ||||
| import kotlinx.android.synthetic.main.activity_download_manager.view.* | ||||
| import kotlinx.android.synthetic.main.download_controller.view.* | ||||
| import rx.Observable | ||||
| import rx.Subscription | ||||
| import rx.android.schedulers.AndroidSchedulers | ||||
| @@ -41,7 +41,7 @@ class DownloadController : NucleusController<DownloadPresenter>() { | ||||
|     } | ||||
|  | ||||
|     override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { | ||||
|         return inflater.inflate(R.layout.activity_download_manager, container, false) | ||||
|         return inflater.inflate(R.layout.download_controller, container, false) | ||||
|     } | ||||
|  | ||||
|     override fun createPresenter(): DownloadPresenter { | ||||
|   | ||||
| @@ -3,11 +3,11 @@ package eu.kanade.tachiyomi.ui.download | ||||
| import android.support.v7.widget.RecyclerView | ||||
| import android.view.View | ||||
| import eu.kanade.tachiyomi.data.download.model.Download | ||||
| import kotlinx.android.synthetic.main.item_download.view.* | ||||
| import kotlinx.android.synthetic.main.download_item.view.* | ||||
|  | ||||
| /** | ||||
|  * Class used to hold the data of a download. | ||||
|  * All the elements from the layout file "item_download" are available in this class. | ||||
|  * All the elements from the layout file "download_item" are available in this class. | ||||
|  * | ||||
|  * @param view the inflated view for this holder. | ||||
|  * @constructor creates a new download holder. | ||||
|   | ||||
| @@ -32,7 +32,7 @@ class LibraryAdapter(private val controller: LibraryController) : RecyclerViewPa | ||||
|      * @return a new view. | ||||
|      */ | ||||
|     override fun createView(container: ViewGroup): View { | ||||
|         val view = container.inflate(R.layout.item_library_category2) as LibraryCategoryView | ||||
|         val view = container.inflate(R.layout.library_category) as LibraryCategoryView | ||||
|         view.onCreate(controller) | ||||
|         return view | ||||
|     } | ||||
|   | ||||
| @@ -16,13 +16,12 @@ import eu.kanade.tachiyomi.util.inflate | ||||
| import eu.kanade.tachiyomi.util.plusAssign | ||||
| import eu.kanade.tachiyomi.util.toast | ||||
| import eu.kanade.tachiyomi.widget.AutofitRecyclerView | ||||
| import kotlinx.android.synthetic.main.item_library_category.view.* | ||||
| import kotlinx.android.synthetic.main.library_category.view.* | ||||
| import rx.subscriptions.CompositeSubscription | ||||
| import uy.kohesive.injekt.injectLazy | ||||
|  | ||||
| /** | ||||
|  * Fragment containing the library manga for a certain category. | ||||
|  * Uses R.layout.fragment_library_category. | ||||
|  */ | ||||
| class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : | ||||
|         FrameLayout(context, attrs), | ||||
|   | ||||
| @@ -36,7 +36,7 @@ import eu.kanade.tachiyomi.ui.manga.MangaController | ||||
| import eu.kanade.tachiyomi.util.inflate | ||||
| import eu.kanade.tachiyomi.util.toast | ||||
| import eu.kanade.tachiyomi.widget.DrawerSwipeCloseListener | ||||
| import kotlinx.android.synthetic.main.activity_main.* | ||||
| import kotlinx.android.synthetic.main.main_activity.* | ||||
| import kotlinx.android.synthetic.main.library_controller.view.* | ||||
| import rx.Subscription | ||||
| import timber.log.Timber | ||||
|   | ||||
| @@ -5,7 +5,7 @@ import com.bumptech.glide.Glide | ||||
| import com.bumptech.glide.load.engine.DiskCacheStrategy | ||||
| import eu.davidea.flexibleadapter.FlexibleAdapter | ||||
| import eu.kanade.tachiyomi.data.database.models.Manga | ||||
| import kotlinx.android.synthetic.main.item_catalogue_grid.view.* | ||||
| import kotlinx.android.synthetic.main.catalogue_grid_item.view.* | ||||
|  | ||||
| /** | ||||
|  * Class used to hold the displayed data of a manga in the library, like the cover or the title. | ||||
|   | ||||
| @@ -12,12 +12,12 @@ import eu.kanade.tachiyomi.R | ||||
| import eu.kanade.tachiyomi.data.database.models.Manga | ||||
| import eu.kanade.tachiyomi.util.inflate | ||||
| import eu.kanade.tachiyomi.widget.AutofitRecyclerView | ||||
| import kotlinx.android.synthetic.main.item_catalogue_grid.view.* | ||||
| import kotlinx.android.synthetic.main.catalogue_grid_item.view.* | ||||
|  | ||||
| class LibraryItem(val manga: Manga) : AbstractFlexibleItem<LibraryHolder>(), IFilterable { | ||||
|  | ||||
|     override fun getLayoutRes(): Int { | ||||
|         return R.layout.item_catalogue_grid | ||||
|         return R.layout.catalogue_grid_item | ||||
|     } | ||||
|  | ||||
|     override fun createViewHolder(adapter: FlexibleAdapter<*>, | ||||
| @@ -25,7 +25,7 @@ class LibraryItem(val manga: Manga) : AbstractFlexibleItem<LibraryHolder>(), IFi | ||||
|                                   parent: ViewGroup): LibraryHolder { | ||||
|  | ||||
|         return if (parent is AutofitRecyclerView) { | ||||
|             val view = parent.inflate(R.layout.item_catalogue_grid).apply { | ||||
|             val view = parent.inflate(R.layout.catalogue_grid_item).apply { | ||||
|                 val coverHeight = parent.itemWidth / 3 * 4 | ||||
|                 card.layoutParams = FrameLayout.LayoutParams(MATCH_PARENT, coverHeight) | ||||
|                 gradient.layoutParams = FrameLayout.LayoutParams( | ||||
| @@ -33,7 +33,7 @@ class LibraryItem(val manga: Manga) : AbstractFlexibleItem<LibraryHolder>(), IFi | ||||
|             } | ||||
|             LibraryGridHolder(view, adapter) | ||||
|         } else { | ||||
|             val view = parent.inflate(R.layout.item_catalogue_list) | ||||
|             val view = parent.inflate(R.layout.catalogue_list_item) | ||||
|             LibraryListHolder(view, adapter) | ||||
|         } | ||||
|     } | ||||
|   | ||||
| @@ -5,7 +5,7 @@ import com.bumptech.glide.Glide | ||||
| import com.bumptech.glide.load.engine.DiskCacheStrategy | ||||
| import eu.davidea.flexibleadapter.FlexibleAdapter | ||||
| import eu.kanade.tachiyomi.data.database.models.Manga | ||||
| import kotlinx.android.synthetic.main.item_catalogue_list.view.* | ||||
| import kotlinx.android.synthetic.main.catalogue_list_item.view.* | ||||
|  | ||||
| /** | ||||
|  * Class used to hold the displayed data of a manga in the library, like the cover or the title. | ||||
|   | ||||
| @@ -25,8 +25,7 @@ import eu.kanade.tachiyomi.ui.manga.MangaController | ||||
| import eu.kanade.tachiyomi.ui.recent_updates.RecentChaptersController | ||||
| import eu.kanade.tachiyomi.ui.recently_read.RecentlyReadController | ||||
| import eu.kanade.tachiyomi.ui.setting.SettingsMainController | ||||
| import kotlinx.android.synthetic.main.activity_main.* | ||||
| import kotlinx.android.synthetic.main.toolbar.* | ||||
| import kotlinx.android.synthetic.main.main_activity.* | ||||
| import uy.kohesive.injekt.injectLazy | ||||
|  | ||||
|  | ||||
| @@ -64,7 +63,7 @@ class MainActivity : BaseActivity() { | ||||
|             return | ||||
|         } | ||||
|  | ||||
|         setContentView(R.layout.activity_main) | ||||
|         setContentView(R.layout.main_activity) | ||||
|  | ||||
|         setSupportActionBar(toolbar) | ||||
|  | ||||
|   | ||||
| @@ -30,7 +30,7 @@ import eu.kanade.tachiyomi.ui.manga.chapter.ChaptersController | ||||
| import eu.kanade.tachiyomi.ui.manga.info.MangaInfoController | ||||
| import eu.kanade.tachiyomi.ui.manga.track.TrackController | ||||
| import eu.kanade.tachiyomi.util.toast | ||||
| import kotlinx.android.synthetic.main.activity_main.* | ||||
| import kotlinx.android.synthetic.main.main_activity.* | ||||
| import kotlinx.android.synthetic.main.manga_controller.view.* | ||||
| import uy.kohesive.injekt.Injekt | ||||
| import uy.kohesive.injekt.api.get | ||||
|   | ||||
| @@ -6,7 +6,7 @@ import eu.davidea.viewholders.FlexibleViewHolder | ||||
| import eu.kanade.tachiyomi.R | ||||
| import eu.kanade.tachiyomi.data.database.models.Manga | ||||
| import eu.kanade.tachiyomi.data.download.model.Download | ||||
| import kotlinx.android.synthetic.main.item_chapter.view.* | ||||
| import kotlinx.android.synthetic.main.chapters_item.view.* | ||||
| import java.util.* | ||||
|  | ||||
| class ChapterHolder( | ||||
|   | ||||
| @@ -24,7 +24,7 @@ class ChapterItem(val chapter: Chapter, val manga: Manga) : AbstractFlexibleItem | ||||
|         get() = status == Download.DOWNLOADED | ||||
|  | ||||
|     override fun getLayoutRes(): Int { | ||||
|         return R.layout.item_chapter | ||||
|         return R.layout.chapters_item | ||||
|     } | ||||
|  | ||||
|     override fun createViewHolder(adapter: FlexibleAdapter<*>, | ||||
|   | ||||
| @@ -25,7 +25,7 @@ import eu.kanade.tachiyomi.ui.reader.ReaderActivity | ||||
| import eu.kanade.tachiyomi.util.getCoordinates | ||||
| import eu.kanade.tachiyomi.util.snack | ||||
| import eu.kanade.tachiyomi.util.toast | ||||
| import kotlinx.android.synthetic.main.fragment_manga_chapters.view.* | ||||
| import kotlinx.android.synthetic.main.chapters_controller.view.* | ||||
| import timber.log.Timber | ||||
|  | ||||
| class ChaptersController : NucleusController<ChaptersPresenter>(), | ||||
| @@ -65,7 +65,7 @@ class ChaptersController : NucleusController<ChaptersPresenter>(), | ||||
|     } | ||||
|  | ||||
|     override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { | ||||
|         return inflater.inflate(R.layout.fragment_manga_chapters, container, false) | ||||
|         return inflater.inflate(R.layout.chapters_controller, container, false) | ||||
|     } | ||||
|  | ||||
|     override fun onViewCreated(view: View, savedViewState: Bundle?) { | ||||
|   | ||||
| @@ -32,7 +32,7 @@ import jp.wasabeef.glide.transformations.CropCircleTransformation | ||||
| import jp.wasabeef.glide.transformations.CropSquareTransformation | ||||
| import jp.wasabeef.glide.transformations.MaskTransformation | ||||
| import jp.wasabeef.glide.transformations.RoundedCornersTransformation | ||||
| import kotlinx.android.synthetic.main.fragment_manga_info.view.* | ||||
| import kotlinx.android.synthetic.main.manga_info_controller.view.* | ||||
| import rx.Observable | ||||
| import rx.android.schedulers.AndroidSchedulers | ||||
| import rx.schedulers.Schedulers | ||||
| @@ -42,7 +42,7 @@ import java.text.DecimalFormat | ||||
|  | ||||
| /** | ||||
|  * Fragment that shows manga information. | ||||
|  * Uses R.layout.fragment_manga_info. | ||||
|  * Uses R.layout.manga_info_controller. | ||||
|  * UI related actions should be called from here. | ||||
|  */ | ||||
| class MangaInfoController : NucleusController<MangaInfoPresenter>(), | ||||
| @@ -65,7 +65,7 @@ class MangaInfoController : NucleusController<MangaInfoPresenter>(), | ||||
|     } | ||||
|  | ||||
|     override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { | ||||
|         return inflater.inflate(R.layout.fragment_manga_info, container, false) | ||||
|         return inflater.inflate(R.layout.manga_info_controller, container, false) | ||||
|     } | ||||
|  | ||||
|     override fun onViewCreated(view: View, savedViewState: Bundle?) { | ||||
|   | ||||
| @@ -36,7 +36,7 @@ class SetTrackChaptersDialog<T> : DialogController | ||||
|  | ||||
|         val dialog = MaterialDialog.Builder(activity!!) | ||||
|                 .title(R.string.chapters) | ||||
|                 .customView(R.layout.dialog_track_chapters, false) | ||||
|                 .customView(R.layout.track_chapters_dialog, false) | ||||
|                 .positiveText(android.R.string.ok) | ||||
|                 .negativeText(android.R.string.cancel) | ||||
|                 .onPositive { dialog, _ -> | ||||
|   | ||||
| @@ -36,7 +36,7 @@ class SetTrackScoreDialog<T> : DialogController | ||||
|  | ||||
|         val dialog = MaterialDialog.Builder(activity!!) | ||||
|                 .title(R.string.score) | ||||
|                 .customView(R.layout.dialog_track_score, false) | ||||
|                 .customView(R.layout.track_score_dialog, false) | ||||
|                 .positiveText(android.R.string.ok) | ||||
|                 .negativeText(android.R.string.cancel) | ||||
|                 .onPositive { dialog, _ -> | ||||
|   | ||||
| @@ -26,7 +26,7 @@ class TrackAdapter(controller: TrackController) : RecyclerView.Adapter<TrackHold | ||||
|     } | ||||
|  | ||||
|     override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TrackHolder { | ||||
|         val view = parent.inflate(R.layout.item_track) | ||||
|         val view = parent.inflate(R.layout.track_item) | ||||
|         return TrackHolder(view, this) | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.data.database.models.Track | ||||
| import eu.kanade.tachiyomi.ui.base.controller.NucleusController | ||||
| import eu.kanade.tachiyomi.ui.manga.MangaController | ||||
| import eu.kanade.tachiyomi.util.toast | ||||
| import kotlinx.android.synthetic.main.fragment_track.view.* | ||||
| import kotlinx.android.synthetic.main.track_controller.view.* | ||||
|  | ||||
| class TrackController : NucleusController<TrackPresenter>(), | ||||
|         TrackAdapter.OnRowClickListener, | ||||
| @@ -26,7 +26,7 @@ class TrackController : NucleusController<TrackPresenter>(), | ||||
|     } | ||||
|  | ||||
|     override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { | ||||
|         return inflater.inflate(R.layout.fragment_track, container, false) | ||||
|         return inflater.inflate(R.layout.track_controller, container, false) | ||||
|     } | ||||
|  | ||||
|     override fun onViewCreated(view: View, savedViewState: Bundle?) { | ||||
|   | ||||
| @@ -4,7 +4,7 @@ import android.annotation.SuppressLint | ||||
| import android.support.v7.widget.RecyclerView | ||||
| import android.view.View | ||||
| import eu.kanade.tachiyomi.R | ||||
| import kotlinx.android.synthetic.main.item_track.view.* | ||||
| import kotlinx.android.synthetic.main.track_item.view.* | ||||
|  | ||||
| class TrackHolder(view: View, adapter: TrackAdapter) : RecyclerView.ViewHolder(view) { | ||||
|      | ||||
|   | ||||
| @@ -7,11 +7,11 @@ import android.widget.ArrayAdapter | ||||
| import eu.kanade.tachiyomi.R | ||||
| import eu.kanade.tachiyomi.data.database.models.Track | ||||
| import eu.kanade.tachiyomi.util.inflate | ||||
| import kotlinx.android.synthetic.main.item_track_search.view.* | ||||
| import kotlinx.android.synthetic.main.track_search_item.view.* | ||||
| import java.util.* | ||||
|  | ||||
| class TrackSearchAdapter(context: Context) | ||||
| : ArrayAdapter<Track>(context, R.layout.item_track_search, ArrayList<Track>()) { | ||||
| : ArrayAdapter<Track>(context, R.layout.track_search_item, ArrayList<Track>()) { | ||||
|  | ||||
|     override fun getView(position: Int, view: View?, parent: ViewGroup): View { | ||||
|         var v = view | ||||
| @@ -20,7 +20,7 @@ class TrackSearchAdapter(context: Context) | ||||
|         // Check if an existing view is being reused, otherwise inflate the view | ||||
|         val holder: TrackSearchHolder // view lookup cache stored in tag | ||||
|         if (v == null) { | ||||
|             v = parent.inflate(R.layout.item_track_search) | ||||
|             v = parent.inflate(R.layout.track_search_item) | ||||
|             holder = TrackSearchHolder(v) | ||||
|             v.tag = holder | ||||
|         } else { | ||||
|   | ||||
| @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.data.track.TrackManager | ||||
| import eu.kanade.tachiyomi.data.track.TrackService | ||||
| import eu.kanade.tachiyomi.ui.base.controller.DialogController | ||||
| import eu.kanade.tachiyomi.util.plusAssign | ||||
| import kotlinx.android.synthetic.main.dialog_track_search.view.* | ||||
| import kotlinx.android.synthetic.main.track_search_dialog.view.* | ||||
| import rx.Subscription | ||||
| import rx.android.schedulers.AndroidSchedulers | ||||
| import rx.subscriptions.CompositeSubscription | ||||
| @@ -51,7 +51,7 @@ class TrackSearchDialog : DialogController { | ||||
|  | ||||
|     override fun onCreateDialog(savedState: Bundle?): Dialog { | ||||
|         val dialog = MaterialDialog.Builder(activity!!) | ||||
|                 .customView(R.layout.dialog_track_search, false) | ||||
|                 .customView(R.layout.track_search_dialog, false) | ||||
|                 .positiveText(android.R.string.ok) | ||||
|                 .negativeText(android.R.string.cancel) | ||||
|                 .onPositive { _, _ -> onPositiveButtonClick() } | ||||
|   | ||||
| @@ -33,7 +33,7 @@ import eu.kanade.tachiyomi.util.plusAssign | ||||
| import eu.kanade.tachiyomi.util.toast | ||||
| import eu.kanade.tachiyomi.widget.SimpleAnimationListener | ||||
| import eu.kanade.tachiyomi.widget.SimpleSeekBarListener | ||||
| import kotlinx.android.synthetic.main.activity_reader.* | ||||
| import kotlinx.android.synthetic.main.reader_activity.* | ||||
| import me.zhanghai.android.systemuihelper.SystemUiHelper | ||||
| import me.zhanghai.android.systemuihelper.SystemUiHelper.* | ||||
| import nucleus.factory.RequiresPresenter | ||||
| @@ -92,7 +92,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() { | ||||
|  | ||||
|     override fun onCreate(savedState: Bundle?) { | ||||
|         super.onCreate(savedState) | ||||
|         setContentView(R.layout.activity_reader) | ||||
|         setContentView(R.layout.reader_activity) | ||||
|  | ||||
|         if (savedState == null && SharedData.get(ReaderEvent::class.java) == null) { | ||||
|             finish() | ||||
|   | ||||
| @@ -13,7 +13,7 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper | ||||
| import eu.kanade.tachiyomi.data.preference.getOrDefault | ||||
| import eu.kanade.tachiyomi.util.plusAssign | ||||
| import eu.kanade.tachiyomi.widget.SimpleSeekBarListener | ||||
| import kotlinx.android.synthetic.main.dialog_reader_custom_filter.view.* | ||||
| import kotlinx.android.synthetic.main.reader_custom_filter_dialog.view.* | ||||
| import rx.Subscription | ||||
| import rx.android.schedulers.AndroidSchedulers | ||||
| import rx.subscriptions.CompositeSubscription | ||||
| @@ -65,7 +65,7 @@ class ReaderCustomFilterDialog : DialogFragment() { | ||||
|      */ | ||||
|     override fun onCreateDialog(savedState: Bundle?): Dialog { | ||||
|         val dialog = MaterialDialog.Builder(activity) | ||||
|                 .customView(R.layout.dialog_reader_custom_filter, false) | ||||
|                 .customView(R.layout.reader_custom_filter_dialog, false) | ||||
|                 .positiveText(android.R.string.ok) | ||||
|                 .build() | ||||
|  | ||||
|   | ||||
| @@ -10,7 +10,7 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper | ||||
| import eu.kanade.tachiyomi.data.preference.getOrDefault | ||||
| import eu.kanade.tachiyomi.util.plusAssign | ||||
| import eu.kanade.tachiyomi.widget.IgnoreFirstSpinnerListener | ||||
| import kotlinx.android.synthetic.main.dialog_reader_settings.view.* | ||||
| import kotlinx.android.synthetic.main.reader_settings_dialog.view.* | ||||
| import rx.Observable | ||||
| import rx.android.schedulers.AndroidSchedulers | ||||
| import rx.subscriptions.CompositeSubscription | ||||
| @@ -26,7 +26,7 @@ class ReaderSettingsDialog : DialogFragment() { | ||||
|     override fun onCreateDialog(savedState: Bundle?): Dialog { | ||||
|         val dialog = MaterialDialog.Builder(activity) | ||||
|                 .title(R.string.label_settings) | ||||
|                 .customView(R.layout.dialog_reader_settings, true) | ||||
|                 .customView(R.layout.reader_settings_dialog, true) | ||||
|                 .positiveText(android.R.string.ok) | ||||
|                 .build() | ||||
|  | ||||
|   | ||||
| @@ -6,7 +6,7 @@ import android.view.View | ||||
| import eu.kanade.tachiyomi.R | ||||
| import eu.kanade.tachiyomi.source.model.Page | ||||
| import eu.kanade.tachiyomi.ui.reader.ReaderActivity | ||||
| import kotlinx.android.synthetic.main.page_decode_error.view.* | ||||
| import kotlinx.android.synthetic.main.reader_page_decode_error.view.* | ||||
|  | ||||
| class PageDecodeErrorLayout( | ||||
|         val view: View, | ||||
|   | ||||
| @@ -16,8 +16,7 @@ import eu.kanade.tachiyomi.ui.reader.viewer.base.PageDecodeErrorLayout | ||||
| import eu.kanade.tachiyomi.ui.reader.viewer.pager.horizontal.RightToLeftReader | ||||
| import eu.kanade.tachiyomi.ui.reader.viewer.pager.vertical.VerticalReader | ||||
| import eu.kanade.tachiyomi.util.inflate | ||||
| import kotlinx.android.synthetic.main.chapter_image.view.* | ||||
| import kotlinx.android.synthetic.main.item_pager_reader.view.* | ||||
| import kotlinx.android.synthetic.main.reader_pager_item.view.* | ||||
| import rx.Observable | ||||
| import rx.Subscription | ||||
| import rx.android.schedulers.AndroidSchedulers | ||||
| @@ -259,7 +258,7 @@ class PageView @JvmOverloads constructor(context: Context, attrs: AttributeSet? | ||||
|  | ||||
|         val activity = reader.activity as ReaderActivity | ||||
|  | ||||
|         val layout = inflate(R.layout.page_decode_error) | ||||
|         val layout = inflate(R.layout.reader_page_decode_error) | ||||
|         PageDecodeErrorLayout(layout, page, activity.readerTheme, { | ||||
|             if (reader.isAdded) { | ||||
|                 activity.presenter.retryPage(page) | ||||
|   | ||||
| @@ -23,7 +23,7 @@ class PagerReaderAdapter(private val reader: PagerReader) : ViewPagerAdapter() { | ||||
|         } | ||||
|  | ||||
|     override fun createView(container: ViewGroup, position: Int): View { | ||||
|         val view = container.inflate(R.layout.item_pager_reader) as PageView | ||||
|         val view = container.inflate(R.layout.reader_pager_item) as PageView | ||||
|         view.initialize(reader, pages[position]) | ||||
|         return view | ||||
|     } | ||||
|   | ||||
| @@ -51,7 +51,7 @@ class WebtoonAdapter(val fragment: WebtoonReader) : RecyclerView.Adapter<Webtoon | ||||
|      * @return a new view holder for a manga. | ||||
|      */ | ||||
|     override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): WebtoonHolder { | ||||
|         val v = parent.inflate(R.layout.item_webtoon_reader) | ||||
|         val v = parent.inflate(R.layout.reader_webtoon_item) | ||||
|         return WebtoonHolder(v, this) | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -14,8 +14,7 @@ import eu.kanade.tachiyomi.source.model.Page | ||||
| import eu.kanade.tachiyomi.ui.reader.ReaderActivity | ||||
| import eu.kanade.tachiyomi.ui.reader.viewer.base.PageDecodeErrorLayout | ||||
| import eu.kanade.tachiyomi.util.inflate | ||||
| import kotlinx.android.synthetic.main.chapter_image.view.* | ||||
| import kotlinx.android.synthetic.main.item_webtoon_reader.view.* | ||||
| import kotlinx.android.synthetic.main.reader_webtoon_item.view.* | ||||
| import rx.Observable | ||||
| import rx.Subscription | ||||
| import rx.android.schedulers.AndroidSchedulers | ||||
| @@ -25,7 +24,7 @@ import java.util.concurrent.TimeUnit | ||||
|  | ||||
| /** | ||||
|  * Holder for webtoon reader for a single page of a chapter. | ||||
|  * All the elements from the layout file "item_webtoon_reader" are available in this class. | ||||
|  * All the elements from the layout file "reader_webtoon_item" are available in this class. | ||||
|  * | ||||
|  * @param view the inflated view for this holder. | ||||
|  * @param adapter the adapter handling this holder. | ||||
| @@ -287,7 +286,7 @@ class WebtoonHolder(private val view: View, private val adapter: WebtoonAdapter) | ||||
|         val page = page ?: return | ||||
|         if (decodeErrorLayout != null || !webtoonReader.isAdded) return | ||||
|  | ||||
|         val layout = (view as ViewGroup).inflate(R.layout.page_decode_error) | ||||
|         val layout = (view as ViewGroup).inflate(R.layout.reader_page_decode_error) | ||||
|         PageDecodeErrorLayout(layout, page, readerActivity.readerTheme, { | ||||
|             if (webtoonReader.isAdded) { | ||||
|                 readerActivity.presenter.retryPage(page) | ||||
|   | ||||
| @@ -14,7 +14,7 @@ import java.util.* | ||||
| class DateItem(val date: Date) : AbstractHeaderItem<DateItem.Holder>() { | ||||
|  | ||||
|     override fun getLayoutRes(): Int { | ||||
|         return R.layout.item_recent_chapter_section | ||||
|         return R.layout.recent_chapters_section_item | ||||
|     } | ||||
|  | ||||
|     override fun createViewHolder(adapter: FlexibleAdapter<*>, inflater: LayoutInflater, parent: ViewGroup): Holder { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import eu.kanade.tachiyomi.R | ||||
| import eu.kanade.tachiyomi.data.download.model.Download | ||||
| import eu.kanade.tachiyomi.util.getResourceColor | ||||
| import jp.wasabeef.glide.transformations.CropCircleTransformation | ||||
| import kotlinx.android.synthetic.main.item_recent_chapters.view.* | ||||
| import kotlinx.android.synthetic.main.recent_chapters_item.view.* | ||||
|  | ||||
| /** | ||||
|  * Holder that contains chapter item | ||||
|   | ||||
| @@ -24,7 +24,7 @@ class RecentChapterItem(val chapter: Chapter, val manga: Manga, header: DateItem | ||||
|         get() = status == Download.DOWNLOADED | ||||
|  | ||||
|     override fun getLayoutRes(): Int { | ||||
|         return R.layout.item_recent_chapters | ||||
|         return R.layout.recent_chapters_item | ||||
|     } | ||||
|  | ||||
|     override fun createViewHolder(adapter: FlexibleAdapter<*>, | ||||
|   | ||||
| @@ -21,12 +21,12 @@ import eu.kanade.tachiyomi.ui.base.controller.popControllerWithTag | ||||
| import eu.kanade.tachiyomi.ui.manga.MangaController | ||||
| import eu.kanade.tachiyomi.ui.reader.ReaderActivity | ||||
| import eu.kanade.tachiyomi.util.toast | ||||
| import kotlinx.android.synthetic.main.fragment_recent_chapters.view.* | ||||
| import kotlinx.android.synthetic.main.recent_chapters_controller.view.* | ||||
| import timber.log.Timber | ||||
|  | ||||
| /** | ||||
|  * Fragment that shows recent chapters. | ||||
|  * Uses [R.layout.fragment_recent_chapters]. | ||||
|  * Uses [R.layout.recent_chapters_controller]. | ||||
|  * UI related actions should be called from here. | ||||
|  */ | ||||
| class RecentChaptersController : NucleusController<RecentChaptersPresenter>(), | ||||
| @@ -58,7 +58,7 @@ class RecentChaptersController : NucleusController<RecentChaptersPresenter>(), | ||||
|     } | ||||
|  | ||||
|     override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { | ||||
|         return inflater.inflate(R.layout.fragment_recent_chapters, container, false) | ||||
|         return inflater.inflate(R.layout.recent_chapters_controller, container, false) | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,7 +16,7 @@ import eu.kanade.tachiyomi.ui.base.controller.NucleusController | ||||
| import eu.kanade.tachiyomi.ui.manga.MangaController | ||||
| import eu.kanade.tachiyomi.ui.reader.ReaderActivity | ||||
| import eu.kanade.tachiyomi.util.toast | ||||
| import kotlinx.android.synthetic.main.fragment_recently_read.view.* | ||||
| import kotlinx.android.synthetic.main.recently_read_controller.view.* | ||||
|  | ||||
| /** | ||||
|  * Fragment that shows recently read manga. | ||||
| @@ -45,7 +45,7 @@ class RecentlyReadController : NucleusController<RecentlyReadPresenter>(), | ||||
|     } | ||||
|  | ||||
|     override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { | ||||
|         return inflater.inflate(R.layout.fragment_recently_read, container, false) | ||||
|         return inflater.inflate(R.layout.recently_read_controller, container, false) | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -6,7 +6,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy | ||||
| import eu.davidea.viewholders.FlexibleViewHolder | ||||
| import eu.kanade.tachiyomi.R | ||||
| import eu.kanade.tachiyomi.data.database.models.MangaChapterHistory | ||||
| import kotlinx.android.synthetic.main.item_recently_read.view.* | ||||
| import kotlinx.android.synthetic.main.recently_read_item.view.* | ||||
| import java.util.* | ||||
|  | ||||
| /** | ||||
|   | ||||
| @@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.util.inflate | ||||
| class RecentlyReadItem(val mch: MangaChapterHistory) : AbstractFlexibleItem<RecentlyReadHolder>() { | ||||
|  | ||||
|     override fun getLayoutRes(): Int { | ||||
|         return R.layout.item_recently_read | ||||
|         return R.layout.recently_read_item | ||||
|     } | ||||
|  | ||||
|     override fun createViewHolder(adapter: FlexibleAdapter<*>, | ||||
|   | ||||
| @@ -24,7 +24,7 @@ class CustomLayoutFilePickerFragment : FilePickerFragment() { | ||||
|     override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { | ||||
|         when (viewType) { | ||||
|             LogicHandler.VIEWTYPE_DIR -> { | ||||
|                 val view = parent.inflate(R.layout.listitem_dir) | ||||
|                 val view = parent.inflate(R.layout.common_listitem_dir) | ||||
|                 return DirViewHolder(view) | ||||
|             } | ||||
|             else -> return super.onCreateViewHolder(parent, viewType) | ||||
|   | ||||
| @@ -6,13 +6,13 @@ import android.util.AttributeSet | ||||
| import android.widget.LinearLayout | ||||
| import eu.kanade.tachiyomi.R | ||||
| import eu.kanade.tachiyomi.util.inflate | ||||
| import kotlinx.android.synthetic.main.dialog_with_checkbox.view.* | ||||
| import kotlinx.android.synthetic.main.common_dialog_with_checkbox.view.* | ||||
|  | ||||
| class DialogCheckboxView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : | ||||
|         LinearLayout(context, attrs) { | ||||
|  | ||||
|     init { | ||||
|         addView(inflate(R.layout.dialog_with_checkbox)) | ||||
|         addView(inflate(R.layout.common_dialog_with_checkbox)) | ||||
|     } | ||||
|  | ||||
|     fun setDescription(@StringRes id: Int){ | ||||
|   | ||||
| @@ -7,13 +7,13 @@ import android.widget.RelativeLayout | ||||
| import eu.kanade.tachiyomi.R | ||||
| import eu.kanade.tachiyomi.util.getResourceColor | ||||
| import eu.kanade.tachiyomi.util.setVectorCompat | ||||
| import kotlinx.android.synthetic.main.view_empty.view.* | ||||
| import kotlinx.android.synthetic.main.common_view_empty.view.* | ||||
|  | ||||
| class EmptyView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : | ||||
|         RelativeLayout (context, attrs) { | ||||
|  | ||||
|     init { | ||||
|         inflate(context, R.layout.view_empty, this) | ||||
|         inflate(context, R.layout.common_view_empty, this) | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -5,13 +5,13 @@ import android.support.v7.preference.Preference | ||||
| import android.support.v7.preference.PreferenceViewHolder | ||||
| import android.util.AttributeSet | ||||
| import eu.kanade.tachiyomi.R | ||||
| import kotlinx.android.synthetic.main.preference_widget_imageview.view.* | ||||
| import kotlinx.android.synthetic.main.pref_widget_imageview.view.* | ||||
|  | ||||
| class LoginPreference @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : | ||||
|         Preference(context, attrs) { | ||||
|  | ||||
|     init { | ||||
|         widgetLayoutResource = R.layout.preference_widget_imageview | ||||
|         widgetLayoutResource = R.layout.pref_widget_imageview | ||||
|     } | ||||
|  | ||||
|     override fun onBindViewHolder(holder: PreferenceViewHolder) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user