Skip to content

Commit

Permalink
Merge branch 'release/5.0.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rafakob committed Nov 5, 2023
2 parents 392fad7 + 2fc471f commit ce45d16
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {

defaultConfig {
applicationId = "com.twofasapp"
versionName = "5.0.0"
versionCode = 5000003
versionName = "5.0.1"
versionCode = 5000004

val versionCodeOffset = 5000000

Expand Down
3 changes: 3 additions & 0 deletions feature/widget/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand All @@ -31,4 +57,6 @@ class WidgetSettingsActivity : ComponentActivity() {
}
}
}

override fun onAuthenticated() = Unit
}

0 comments on commit ce45d16

Please sign in to comment.