mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-28 22:13:01 +00:00
set default value to VERSION_CODE and removed useless blocks
This commit is contained in:
parent
b9820468c6
commit
d7dfb27ca5
1 changed files with 11 additions and 11 deletions
|
@ -62,18 +62,18 @@ class HomeFragment : BindingFragment<FragmentHomeBinding>() {
|
|||
isFetching.observe(viewLifecycleOwner) { homeRefresh.isRefreshing = it }
|
||||
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
if (prefs.contains("LastVersionCode")) {
|
||||
if (prefs.getInt("LastVersionCode", -1) < VERSION_CODE) {
|
||||
showDialog(
|
||||
AppInfoDialog.newInstance(
|
||||
appName = getString(R.string.app_name),
|
||||
appIcon = R.mipmap.ic_launcher,
|
||||
changelog = manager.value?.string("changelog")
|
||||
)
|
||||
if (prefs.getInt("LastVersionCode", VERSION_CODE) < VERSION_CODE) {
|
||||
showDialog(
|
||||
AppInfoDialog.newInstance(
|
||||
appName = getString(R.string.app_name),
|
||||
appIcon = R.mipmap.ic_launcher,
|
||||
changelog = manager.value?.string("changelog")
|
||||
)
|
||||
prefs.edit().putInt("LastVersionCode", VERSION_CODE).apply()
|
||||
}
|
||||
} else prefs.edit().putInt("LastVersionCode", VERSION_CODE).apply()
|
||||
)
|
||||
prefs.edit().putInt("LastVersionCode", VERSION_CODE).apply()
|
||||
} else {
|
||||
prefs.edit().putInt("LastVersionCode", VERSION_CODE).apply()
|
||||
}
|
||||
|
||||
recyclerAppList.apply {
|
||||
layoutManager = LinearLayoutManager(requireActivity())
|
||||
|
|
Loading…
Reference in a new issue