diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 2c00d248..aa50c796 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -17,8 +17,8 @@ android { defaultConfig { applicationId = "com.twofasapp" - versionName = "5.0.0" - versionCode = 5000003 + versionName = "5.0.1" + versionCode = 5000004 val versionCodeOffset = 5000000 diff --git a/feature/widget/build.gradle.kts b/feature/widget/build.gradle.kts index d021d058..9a228aa7 100644 --- a/feature/widget/build.gradle.kts +++ b/feature/widget/build.gradle.kts @@ -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) diff --git a/feature/widget/src/main/java/com/twofasapp/feature/widget/ui/settings/WidgetSettingsActivity.kt b/feature/widget/src/main/java/com/twofasapp/feature/widget/ui/settings/WidgetSettingsActivity.kt index 4c08d3cf..05d20dfa 100644 --- a/feature/widget/src/main/java/com/twofasapp/feature/widget/ui/settings/WidgetSettingsActivity.kt +++ b/feature/widget/src/main/java/com/twofasapp/feature/widget/ui/settings/WidgetSettingsActivity.kt @@ -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 } \ No newline at end of file