Cleaning up from the previous commit
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.vitorpamplona.amethyst.ui
|
package com.vitorpamplona.amethyst.ui
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.ConnectivityManager
|
import android.net.ConnectivityManager
|
||||||
import android.net.Network
|
import android.net.Network
|
||||||
@@ -43,7 +44,7 @@ import kotlinx.coroutines.launch
|
|||||||
|
|
||||||
@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
|
@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun prepareSharedViewModel(act: MainActivity): SharedPreferencesViewModel {
|
fun prepareSharedViewModel(act: Activity): SharedPreferencesViewModel {
|
||||||
val sharedPreferencesViewModel: SharedPreferencesViewModel = viewModel()
|
val sharedPreferencesViewModel: SharedPreferencesViewModel = viewModel()
|
||||||
|
|
||||||
val displayFeatures = calculateDisplayFeatures(act)
|
val displayFeatures = calculateDisplayFeatures(act)
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import androidx.activity.enableEdgeToEdge
|
|||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.runtime.mutableStateOf
|
|
||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
import com.vitorpamplona.amethyst.debugState
|
import com.vitorpamplona.amethyst.debugState
|
||||||
import com.vitorpamplona.amethyst.model.LocalCache
|
import com.vitorpamplona.amethyst.model.LocalCache
|
||||||
@@ -62,10 +61,6 @@ import java.net.URLEncoder
|
|||||||
import java.nio.charset.StandardCharsets
|
import java.nio.charset.StandardCharsets
|
||||||
|
|
||||||
class MainActivity : AppCompatActivity() {
|
class MainActivity : AppCompatActivity() {
|
||||||
val isOnMobileDataState = mutableStateOf(false)
|
|
||||||
|
|
||||||
private var shouldPauseService = true
|
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.R)
|
@RequiresApi(Build.VERSION_CODES.R)
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
@@ -106,23 +101,13 @@ class MainActivity : AppCompatActivity() {
|
|||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
Log.d("Lifetime Event", "MainActivity.onPause")
|
Log.d("Lifetime Event", "MainActivity.onPause")
|
||||||
|
|
||||||
GlobalScope.launch(Dispatchers.IO) {
|
GlobalScope.launch(Dispatchers.IO) { LanguageTranslatorService.clear() }
|
||||||
LanguageTranslatorService.clear()
|
|
||||||
}
|
|
||||||
|
|
||||||
// if (BuildConfig.DEBUG) {
|
|
||||||
GlobalScope.launch(Dispatchers.IO) { debugState(this@MainActivity) }
|
GlobalScope.launch(Dispatchers.IO) { debugState(this@MainActivity) }
|
||||||
// }
|
|
||||||
|
|
||||||
super.onPause()
|
super.onPause()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStart() {
|
|
||||||
super.onStart()
|
|
||||||
|
|
||||||
Log.d("Lifetime Event", "MainActivity.onStart")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onStop() {
|
override fun onStop() {
|
||||||
super.onStop()
|
super.onStop()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user