Fix lot of things haha
This commit is contained in:
parent
a81536ab9a
commit
4197fde140
54 changed files with 250 additions and 125 deletions
|
@ -6,7 +6,9 @@ import code.name.monkey.retromusic.mvp.BaseView
|
|||
|
||||
interface HomeContract {
|
||||
|
||||
interface HomeView : BaseView<ArrayList<Home>>
|
||||
interface HomeView : BaseView<ArrayList<Home>> {
|
||||
fun showEmpty()
|
||||
}
|
||||
|
||||
interface HomePresenter : BasePresenter<HomeView> {
|
||||
|
||||
|
|
|
@ -41,11 +41,13 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home
|
|||
if (favoritePlaylist.isNotEmpty()) homes.add(Home(R.string.favorites, 0, favoritePlaylist, PLAYLISTS))
|
||||
if (genres.isNotEmpty() && PreferenceUtil.getInstance().isGenreShown) homes.add(Home(R.string.genres, 0, genres, GENRES))
|
||||
homes
|
||||
}).subscribe { homes ->
|
||||
}).subscribe({ homes ->
|
||||
if (homes.isNotEmpty()) {
|
||||
view.showData(homes as ArrayList<Home>)
|
||||
}
|
||||
}
|
||||
}, {
|
||||
view.showEmpty()
|
||||
}, { })
|
||||
}
|
||||
|
||||
override fun subscribe() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue