Merge branch 'release/5.0.1' into main

This commit is contained in:
Rafał Kobyłko 2023-11-05 15:36:55 +01:00
commit ce45d16601
3 changed files with 34 additions and 3 deletions

View File

@ -17,8 +17,8 @@ android {
defaultConfig {
applicationId = "com.twofasapp"
versionName = "5.0.0"
versionCode = 5000003
versionName = "5.0.1"
versionCode = 5000004
val versionCodeOffset = 5000000

View File

@ -9,11 +9,14 @@ android {
}
dependencies {
implementation(project(":base"))
implementation(project(":prefs"))
implementation(project(":core:common"))
implementation(project(":core:android"))
implementation(project(":core:locale"))
implementation(project(":core:designsystem"))
implementation(project(":data:services"))
implementation(project(":data:session"))
implementation(libs.bundles.viewModel)
implementation(libs.bundles.glance)

View File

@ -6,11 +6,27 @@ import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import com.twofasapp.base.AuthTracker
import com.twofasapp.base.lifecycle.AuthAware
import com.twofasapp.base.lifecycle.AuthLifecycle
import com.twofasapp.data.session.SettingsRepository
import com.twofasapp.designsystem.MainAppTheme
import com.twofasapp.designsystem.activity.ActivityHelper
import org.koin.android.ext.android.get
import org.koin.android.ext.android.inject
import org.koin.core.parameter.parametersOf
class WidgetSettingsActivity : ComponentActivity() {
class WidgetSettingsActivity : ComponentActivity(), AuthAware {
private val settingsRepository: SettingsRepository by inject()
private val authTracker: AuthTracker by inject()
override fun onCreate(savedInstanceState: Bundle?) {
ActivityHelper.onCreate(
activity = this,
selectedTheme = settingsRepository.getAppSettings().selectedTheme,
allowScreenshots = settingsRepository.getAppSettings().allowScreenshots,
)
super.onCreate(savedInstanceState)
val appWidgetId = intent?.extras?.getInt(
AppWidgetManager.EXTRA_APPWIDGET_ID,
@ -20,6 +36,16 @@ class WidgetSettingsActivity : ComponentActivity() {
val resultValue = Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)
setResult(Activity.RESULT_CANCELED, resultValue)
authTracker.onWidgetSettingsScreen()
lifecycle.addObserver(
AuthLifecycle(
authTracker = get(),
navigator = get { parametersOf(this) },
authAware = this as? AuthAware
)
)
setContent {
MainAppTheme {
WidgetSettingsScreen(
@ -31,4 +57,6 @@ class WidgetSettingsActivity : ComponentActivity() {
}
}
}
override fun onAuthenticated() = Unit
}