Fix not showing empty state
This commit is contained in:
parent
911e18bf89
commit
69c76556a2
13 changed files with 234 additions and 205 deletions
|
@ -27,9 +27,7 @@ import code.name.monkey.retromusic.adapter.ContributorAdapter
|
|||
import code.name.monkey.retromusic.model.Contributor
|
||||
import code.name.monkey.retromusic.util.NavigationUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import com.afollestad.materialdialogs.LayoutMode
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.afollestad.materialdialogs.bottomsheets.BottomSheet
|
||||
import com.afollestad.materialdialogs.list.listItems
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
|
@ -121,7 +119,7 @@ class AboutActivity : AbsBaseActivity(), View.OnClickListener {
|
|||
R.id.donateLink -> NavigationUtil.goToSupportDevelopment(this)
|
||||
R.id.instagramLink -> openUrl(APP_INSTAGRAM_LINK)
|
||||
R.id.twitterLink -> openUrl(APP_TWITTER_LINK)
|
||||
R.id.changelog -> showChangeLogOptions()
|
||||
R.id.changelog -> openUrl(TELEGRAM_CHANGE_LOG)
|
||||
R.id.openSource -> NavigationUtil.goToOpenSource(this)
|
||||
R.id.bugReportLink -> NavigationUtil.bugReport(this)
|
||||
}
|
||||
|
|
|
@ -183,7 +183,7 @@ public class MainActivity extends AbsSlidingMusicPanelActivity
|
|||
mToolbar = findViewById(R.id.toolbar);
|
||||
mAppBarLayout = findViewById(R.id.appBarLayout);
|
||||
|
||||
checkShowChangelog();
|
||||
//checkShowChangelog();
|
||||
AppRater.appLaunched(this);
|
||||
setupToolbar();
|
||||
checkUpdate();
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
package code.name.monkey.retromusic.activities
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.os.AsyncTask
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.MenuItem
|
||||
import android.widget.Toast
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.MaterialUtil
|
||||
import code.name.monkey.retromusic.App
|
||||
import code.name.monkey.retromusic.BuildConfig
|
||||
|
@ -26,18 +28,18 @@ class PurchaseActivity : AbsBaseActivity(), BillingProcessor.IBillingHandler {
|
|||
setDrawUnderStatusBar()
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_pro_version)
|
||||
setStatusbarColorAuto()
|
||||
setNavigationbarColorAuto()
|
||||
setLightNavigationBar(true)
|
||||
toolbar.setBackgroundColor(ATHUtil.resolveColor(this, R.attr.colorSurface))
|
||||
setSupportActionBar(toolbar)
|
||||
setStatusbarColor(Color.TRANSPARENT)
|
||||
setLightStatusbar(false)
|
||||
setNavigationbarColor(Color.BLACK)
|
||||
setLightNavigationBar(false)
|
||||
toolbar.navigationIcon?.setTint(Color.WHITE)
|
||||
toolbar.setNavigationOnClickListener { onBackPressed() }
|
||||
|
||||
restoreButton.isEnabled = false
|
||||
purchaseButton.isEnabled = false
|
||||
|
||||
billingProcessor = BillingProcessor(this, BuildConfig.GOOGLE_PLAY_LICENSING_KEY, this)
|
||||
|
||||
MaterialUtil.setTint(restoreButton, false)
|
||||
MaterialUtil.setTint(purchaseButton, true)
|
||||
|
||||
restoreButton.setOnClickListener {
|
||||
|
@ -49,6 +51,8 @@ class PurchaseActivity : AbsBaseActivity(), BillingProcessor.IBillingHandler {
|
|||
purchaseButton.setOnClickListener {
|
||||
billingProcessor.purchase(this@PurchaseActivity, App.PRO_VERSION_PRODUCT_ID)
|
||||
}
|
||||
bannerContainer.backgroundTintList =
|
||||
ColorStateList.valueOf(ThemeStore.accentColor(this))
|
||||
}
|
||||
|
||||
private fun restorePurchase() {
|
||||
|
|
|
@ -20,6 +20,8 @@ class AlbumViewModel(application: Application) : AndroidViewModel(application) {
|
|||
val result = RepositoryImpl(getApplication()).allAlbums()
|
||||
if (result is Result.Success) {
|
||||
albums.value = result.data
|
||||
}else {
|
||||
albums.value = listOf()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,6 +20,8 @@ class ArtistViewModel(application: Application) : AndroidViewModel(application)
|
|||
val result = RepositoryImpl(getApplication()).allArtists()
|
||||
if (result is Result.Success) {
|
||||
artists.value = result.data
|
||||
} else {
|
||||
artists.value = listOf()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,6 +20,8 @@ class GenreViewModel(application: Application) : AndroidViewModel(application) {
|
|||
val result = RepositoryImpl(getApplication()).allGenres()
|
||||
if (result is Success) {
|
||||
genres.value = result.data
|
||||
}else {
|
||||
genres.value = listOf()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,7 +10,7 @@ import code.name.monkey.retromusic.providers.RepositoryImpl
|
|||
import kotlinx.coroutines.launch
|
||||
|
||||
class PlaylistViewModel(application: Application) : AndroidViewModel(application) {
|
||||
lateinit var playlists: MutableLiveData<List<Playlist>>
|
||||
var playlists = MutableLiveData<List<Playlist>>()
|
||||
|
||||
init {
|
||||
loadPlaylist()
|
||||
|
@ -19,7 +19,9 @@ class PlaylistViewModel(application: Application) : AndroidViewModel(application
|
|||
fun loadPlaylist() = viewModelScope.launch {
|
||||
val result = RepositoryImpl(getApplication()).allPlaylists()
|
||||
if (result is Result.Success) {
|
||||
playlists = MutableLiveData(result.data)
|
||||
playlists.value = result.data
|
||||
} else {
|
||||
playlists.value = listOf()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,6 +20,8 @@ class SongsViewModel(application: Application) : AndroidViewModel(application) {
|
|||
val result = RepositoryImpl(getApplication()).allSongs()
|
||||
if (result is Success) {
|
||||
songs.value = result.data
|
||||
} else {
|
||||
songs.value = listOf()
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue