diff --git a/app/src/main/java/at/shockbytes/dante/ui/activity/MainActivity.kt b/app/src/main/java/at/shockbytes/dante/ui/activity/MainActivity.kt index 0f9341f8..4b3d9a7f 100644 --- a/app/src/main/java/at/shockbytes/dante/ui/activity/MainActivity.kt +++ b/app/src/main/java/at/shockbytes/dante/ui/activity/MainActivity.kt @@ -2,7 +2,6 @@ package at.shockbytes.dante.ui.activity import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProvider -import androidx.lifecycle.ViewModelProviders import android.content.Context import android.content.Intent import android.net.Uri @@ -37,6 +36,7 @@ import at.shockbytes.dante.flagging.FeatureFlag import at.shockbytes.dante.navigation.Destination import at.shockbytes.dante.ui.fragment.AnnouncementFragment import at.shockbytes.dante.util.toggleVisibility +import at.shockbytes.dante.util.viewModelOf import at.shockbytes.util.AppUtils import com.leinardi.android.speeddial.SpeedDialActionItem import io.reactivex.android.schedulers.AndroidSchedulers @@ -67,7 +67,7 @@ class MainActivity : BaseActivity(), ViewPager.OnPageChangeListener { setContentView(R.layout.activity_main) setSupportActionBar(toolbar) - viewModel = ViewModelProviders.of(this, vmFactory)[MainViewModel::class.java] + viewModel = viewModelOf(vmFactory) tabId = savedInstanceState?.getInt("tabId") ?: R.id.menu_navigation_current handleIntentExtras() @@ -116,8 +116,8 @@ class MainActivity : BaseActivity(), ViewPager.OnPageChangeListener { setupFabMenu() } - override fun onDestroy() { - super.onDestroy() + override fun onStop() { + super.onStop() DanteAppWidgetManager.refresh(this) } @@ -388,10 +388,8 @@ class MainActivity : BaseActivity(), ViewPager.OnPageChangeListener { danteSettings .observeDarkModeEnabled() - .subscribe { isDarkModeEnabled -> - enableDarkMode(isDarkModeEnabled) - } - .addTo(compositeDisposable) + .subscribe(::enableDarkMode) + .addTo(compositeDisposable) } private fun enableDarkMode(isEnabled: Boolean) { diff --git a/core/src/debug/res/values/strings.xml b/core/src/debug/res/values/strings.xml index a382d494..15c3e52c 100644 --- a/core/src/debug/res/values/strings.xml +++ b/core/src/debug/res/values/strings.xml @@ -2,6 +2,6 @@ Dante Debug - 3.8 (Debug Build) + 3.8.2 (Debug Build) \ No newline at end of file