chore: Update targetSdk to 35.

- Update `AddAccountActivity` for edge-to-edge.
This commit is contained in:
Mateusz Armatys
2025-07-03 15:00:52 +02:00
parent 02297aa87e
commit 2c67e64400
48 changed files with 152 additions and 88 deletions
@@ -39,6 +39,7 @@ import me.proton.core.auth.presentation.onOnSignUpResult
import me.proton.core.auth.presentation.viewmodel.AddAccountViewModel
import me.proton.core.presentation.ui.ProtonViewBindingActivity
import me.proton.core.presentation.utils.addOnBackPressedCallback
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.inTransaction
import javax.inject.Inject
@@ -58,6 +59,7 @@ class AddAccountActivity :
private val viewModel by viewModels<AddAccountViewModel>()
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
authOrchestrator.register(this)
authOrchestrator.onLoginResult {
@@ -97,8 +99,8 @@ class AddAccountActivity :
}
}
private fun updateView(action: () -> Unit){
if (!activityInForeground){
private fun updateView(action: () -> Unit) {
if (!activityInForeground) {
foregroundCall = action
} else {
action.invoke()
@@ -122,7 +124,7 @@ class AddAccountActivity :
}
}
private fun FragmentManager.showAddAccountFragment(input: AddAccountInput): () -> Unit = {
private fun FragmentManager.showAddAccountFragment(input: AddAccountInput): () -> Unit = {
inTransaction {
replace(R.id.fragment_container, AddAccountFragment(input))
setTransition(TRANSIT_FRAGMENT_FADE)
@@ -20,7 +20,12 @@ package me.proton.core.auth.presentation.ui
import android.os.Bundle
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.os.bundleOf
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsCompat.Type
import androidx.core.view.updateLayoutParams
import dagger.hilt.android.AndroidEntryPoint
import me.proton.core.auth.presentation.R
import me.proton.core.auth.presentation.databinding.FragmentAddAccountBinding
@@ -81,6 +86,15 @@ internal class AddAccountFragment :
binding.signUp.onClick {
authOrchestrator?.startSignupWorkflow()
}
ViewCompat.setOnApplyWindowInsetsListener(binding.footer) { v, windowInsets ->
val gap = resources.getDimensionPixelSize(R.dimen.gap_large_plus)
val insets = windowInsets.getInsets(Type.navigationBars())
v.updateLayoutParams<ConstraintLayout.LayoutParams> {
bottomMargin = gap + insets.bottom
}
WindowInsetsCompat.CONSUMED
}
}
companion object {
@@ -32,6 +32,7 @@ import me.proton.core.auth.presentation.entity.AuthHelpResult
import me.proton.core.devicemigration.domain.usecase.IsEasyDeviceMigrationAvailable
import me.proton.core.devicemigration.presentation.StartMigrationFromTargetDevice
import me.proton.core.devicemigration.presentation.TargetDeviceMigrationResult
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.onClick
import javax.inject.Inject
@@ -51,6 +52,7 @@ class AuthHelpActivity : AuthActivity<ActivityAuthHelpBinding>(ActivityAuthHelpB
private lateinit var targetDeviceMigrationLauncher: ActivityResultLauncher<Unit>
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
targetDeviceMigrationLauncher =
@@ -29,9 +29,9 @@ import me.proton.core.auth.presentation.R
import me.proton.core.auth.presentation.compose.DeviceApprovalRoutes.Route
import me.proton.core.auth.presentation.compose.DeviceApprovalRoutes.addMemberApprovalScreen
import me.proton.core.compose.theme.AppTheme
import me.proton.core.compose.theme.ProtonTheme
import me.proton.core.domain.entity.UserId
import me.proton.core.presentation.ui.ProtonActivity
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.errorToast
import javax.inject.Inject
@@ -48,6 +48,7 @@ class DeviceApprovalActivity : ProtonActivity() {
get() = UserId(requireNotNull(intent.getStringExtra(KEY_USER_ID)))
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
setContent {
@@ -39,6 +39,7 @@ import me.proton.core.compose.theme.AppTheme
import me.proton.core.domain.entity.UserId
import me.proton.core.presentation.ui.ProtonActivity
import me.proton.core.presentation.utils.addOnBackPressedCallback
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.errorToast
import javax.inject.Inject
@@ -59,6 +60,7 @@ class DeviceSecretActivity : ProtonActivity() {
}
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
addOnBackPressedCallback { emitAction(DeviceSecretAction.Close) }
@@ -44,6 +44,7 @@ import me.proton.core.auth.presentation.viewmodel.LoginViewModel
import me.proton.core.domain.entity.UserId
import me.proton.core.presentation.utils.addOnBackPressedCallback
import me.proton.core.network.presentation.util.getUserMessage
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.hideKeyboard
import me.proton.core.presentation.utils.normToast
import me.proton.core.presentation.utils.onClick
@@ -117,6 +118,7 @@ class LoginActivity : AuthActivity<ActivityLoginBinding>(ActivityLoginBinding::i
override val shouldShowQrLoginHelpOption: Boolean get() = true
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
binding.apply {
setActionBarAuthMenu(toolbar)
@@ -52,6 +52,7 @@ import me.proton.core.network.presentation.util.getUserMessage
import me.proton.core.observability.domain.metrics.LoginScreenViewTotal
import me.proton.core.network.presentation.ui.ProtonWebViewActivity.Companion.ResultContract
import me.proton.core.network.presentation.ui.ProtonWebViewActivity.Result
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.hideKeyboard
import me.proton.core.presentation.utils.launchOnScreenView
import me.proton.core.presentation.utils.onClick
@@ -151,6 +152,7 @@ class LoginSsoActivity : AuthActivity<ActivityLoginSsoBinding>(ActivityLoginSsoB
}
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
bindCustomTabService(this)
binding.apply {
@@ -59,6 +59,7 @@ import me.proton.core.observability.domain.metrics.LoginSsoIdentityProviderResul
import me.proton.core.observability.domain.metrics.LoginSsoIdentityProviderResultTotal.Status
import me.proton.core.presentation.utils.SnackbarLength
import me.proton.core.presentation.utils.addOnBackPressedCallback
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.errorSnack
import me.proton.core.presentation.utils.errorToast
import me.proton.core.presentation.utils.openBrowserLink
@@ -153,6 +154,7 @@ class LoginTwoStepActivity : WebPageListenerActivity(), ProductMetricsDelegateOw
}
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
authHelpLauncher = registerForActivityResult(StartAuthHelp()) { result ->
@@ -49,6 +49,7 @@ import me.proton.core.auth.presentation.viewmodel.SecondFactorViewModel
import me.proton.core.domain.entity.UserId
import me.proton.core.network.presentation.util.getUserMessage
import me.proton.core.observability.domain.metrics.LoginScreenViewTotal
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.errorSnack
import me.proton.core.presentation.utils.errorToast
import me.proton.core.presentation.utils.hideKeyboard
@@ -85,6 +86,7 @@ class SecondFactorActivity : AuthActivity<Activity2faBinding>(Activity2faBinding
lateinit var performTwoFaWithSecurityKey: Optional<PerformTwoFaWithSecurityKey<ActivityResultCaller, Activity>>
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
performTwoFaWithSecurityKey.getOrNull()?.register(this, this::onTwoFaWithSecurityKeyResult)
@@ -37,6 +37,7 @@ import me.proton.core.auth.presentation.entity.TwoPassModeResult
import me.proton.core.auth.presentation.viewmodel.TwoPassModeViewModel
import me.proton.core.domain.entity.UserId
import me.proton.core.network.presentation.util.getUserMessage
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.hideKeyboard
import me.proton.core.presentation.utils.onClick
import me.proton.core.presentation.utils.onFailure
@@ -64,6 +65,7 @@ class TwoPassModeActivity : AuthActivity<ActivityMailboxLoginBinding>(ActivityMa
private val viewModel by viewModels<TwoPassModeViewModel>()
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
binding.apply {
@@ -49,6 +49,7 @@ import me.proton.core.auth.presentation.viewmodel.LoginViewModel
import me.proton.core.auth.presentation.viewmodel.signup.SignupViewModel
import me.proton.core.domain.entity.Product
import me.proton.core.domain.entity.UserId
import me.proton.core.network.presentation.util.getUserMessage
import me.proton.core.observability.domain.metrics.SignupLoginTotal
import me.proton.core.observability.domain.metrics.SignupUnlockUserTotalV1
import me.proton.core.observability.domain.metrics.SignupUserCheckTotalV1
@@ -61,7 +62,7 @@ import me.proton.core.plan.presentation.ui.BasePlansFragment.Companion.KEY_PLAN_
import me.proton.core.plan.presentation.ui.hasPlanSignupFragment
import me.proton.core.plan.presentation.ui.removePlansSignup
import me.proton.core.plan.presentation.ui.showPlansSignup
import me.proton.core.network.presentation.util.getUserMessage
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.telemetry.domain.entity.TelemetryPriority
import me.proton.core.telemetry.presentation.ProductMetricsDelegate
import me.proton.core.telemetry.presentation.UiComponentProductMetricsDelegateOwner
@@ -102,6 +103,7 @@ class SignupActivity : AuthActivity<ActivitySignupBinding>(ActivitySignupBinding
}
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
signUpViewModel.register(this)
@@ -21,12 +21,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -62,8 +62,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/auth_content_top_margin"
android:visibility="gone"
android:text="@string/auth_2fa_subtitle" />
android:text="@string/auth_2fa_subtitle"
android:visibility="gone" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
@@ -75,8 +75,8 @@
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:text="@string/auth_2fa_tab_security_key" />
android:text="@string/auth_2fa_tab_security_key"
android:visibility="gone" />
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
@@ -21,12 +21,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -21,12 +21,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -94,8 +94,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/gap_large"
android:descendantFocusability="blocksDescendants"
android:inputType="none"
android:enabled="false"
android:inputType="none"
app:label="@string/auth_signup_domain"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -21,12 +21,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -21,12 +21,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -21,12 +21,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -17,10 +17,11 @@
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground"
xmlns:app="http://schemas.android.com/apk/res-auto">
android:fitsSystemWindows="true">
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/lottieProgress"
@@ -48,7 +48,8 @@
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
android:fillViewport="true"
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
@@ -144,8 +145,8 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/gap_large_plus"
android:text="@string/auth_sign_in"
app:backgroundTint="@color/btn_secondary_background_selector"
android:textColor="?attr/proton_text_norm" />
android:textColor="?attr/proton_text_norm"
app:backgroundTint="@color/btn_secondary_background_selector" />
<TextView
android:id="@+id/terms"
@@ -20,12 +20,12 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -20,12 +20,12 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -102,11 +102,11 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="@dimen/gap_large_plus"
android:layout_marginBottom="16dp"
android:background="@color/separator_norm"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/nextButton"
android:layout_marginBottom="16dp"
android:background="@color/separator_norm" />
app:layout_constraintTop_toBottomOf="@id/nextButton" />
<me.proton.core.presentation.ui.view.ProtonButton
android:id="@+id/switchButton"
@@ -130,7 +130,7 @@
android:text="@string/auth_signup_external_footnote"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/switchButton"/>
app:layout_constraintTop_toBottomOf="@id/switchButton" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -21,12 +21,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -85,7 +85,7 @@
android:text="@string/auth_one_account_all_services"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/titleText"/>
app:layout_constraintTop_toBottomOf="@id/titleText" />
<me.proton.core.challenge.presentation.ProtonMetadataInput
android:id="@+id/usernameInput"
@@ -131,11 +131,11 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="@dimen/gap_large_plus"
android:layout_marginBottom="16dp"
android:background="@color/separator_norm"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/nextButton"
android:layout_marginBottom="16dp"
android:background="@color/separator_norm" />
app:layout_constraintTop_toBottomOf="@id/nextButton" />
<me.proton.core.presentation.ui.view.ProtonButton
android:id="@+id/switchButton"
@@ -159,7 +159,7 @@
android:text="@string/auth_signup_internal_footnote"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/switchButton"/>
app:layout_constraintTop_toBottomOf="@id/switchButton" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -21,12 +21,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -21,12 +21,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -20,7 +20,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<TextView
android:id="@+id/titleText"
@@ -25,12 +25,12 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<me.proton.core.presentation.ui.view.ProtonMaterialToolbar
@@ -20,12 +20,12 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -19,8 +19,6 @@
<resources>
<style name="ProtonTheme.AddAccount">
<!-- ProtonTheme override -->
<item name="android:windowTranslucentStatus">true</item>
<!-- ProtonTheme.AddAccount attributes override -->
<item name="add_account_illustration">@drawable/welcome_header_mail</item>
<item name="add_account_title">@string/welcome_title</item>
@@ -30,8 +28,6 @@
</style>
<style name="ProtonTheme.Mail.AddAccount">
<!-- ProtonTheme override -->
<item name="android:windowTranslucentStatus">true</item>
<!-- ProtonTheme.AddAccount attributes override -->
<item name="add_account_illustration">@drawable/welcome_header_mail</item>
<item name="add_account_subtitle">@string/welcome_subtitle_mail_alt</item>
@@ -40,8 +36,6 @@
</style>
<style name="ProtonTheme.Calendar.AddAccount">
<!-- ProtonTheme override -->
<item name="android:windowTranslucentStatus">true</item>
<!-- ProtonTheme.AddAccount attributes override -->
<item name="add_account_illustration">@drawable/welcome_header_calendar</item>
<item name="add_account_subtitle">@string/welcome_subtitle_calendar_alt</item>
@@ -50,8 +44,6 @@
</style>
<style name="ProtonTheme.Drive.AddAccount">
<!-- ProtonTheme override -->
<item name="android:windowTranslucentStatus">true</item>
<!-- ProtonTheme.AddAccount attributes override -->
<item name="add_account_illustration">@drawable/welcome_header_drive</item>
<item name="add_account_subtitle">@string/welcome_subtitle_drive_alt</item>
@@ -60,8 +52,6 @@
</style>
<style name="ProtonTheme.Vpn.AddAccount">
<!-- ProtonTheme override -->
<item name="android:windowTranslucentStatus">true</item>
<!-- ProtonTheme.AddAccount attributes override -->
<item name="add_account_illustration">@drawable/welcome_header_vpn</item>
<item name="add_account_subtitle">@string/welcome_subtitle_vpn_alt</item>
@@ -70,8 +60,6 @@
</style>
<style name="ProtonTheme.Pass.AddAccount">
<!-- ProtonTheme override -->
<item name="android:windowTranslucentStatus">true</item>
<!-- ProtonTheme.AddAccount attributes override -->
<item name="add_account_illustration">@drawable/welcome_header_pass</item>
<item name="add_account_subtitle">@string/welcome_subtitle_pass_alt</item>
@@ -25,6 +25,11 @@ import android.widget.Button
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.viewModels
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsCompat.Type
import androidx.core.view.setPadding
import androidx.core.view.updatePadding
import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import dagger.hilt.android.AndroidEntryPoint
@@ -65,6 +70,7 @@ import me.proton.core.notification.presentation.deeplink.DeeplinkManager
import me.proton.core.notification.presentation.deeplink.onActivityCreate
import me.proton.core.presentation.ui.ProtonViewBindingActivity
import me.proton.core.presentation.ui.alert.ForceUpdateActivity
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.onClick
import me.proton.core.presentation.utils.showToast
import me.proton.core.presentation.utils.successSnack
@@ -103,6 +109,7 @@ class MainActivity : ProtonViewBindingActivity<ActivityMainBinding>(ActivityMain
installSplashScreen().setKeepOnScreenCondition {
accountViewModel.state.value !is AccountViewModel.State.AccountList
}
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
deeplinkManager.onActivityCreate(this, savedInstanceState)
@@ -118,6 +125,18 @@ class MainActivity : ProtonViewBindingActivity<ActivityMainBinding>(ActivityMain
showToast("TargetDeviceMigrationActivity result: $result")
}
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, windowInsets ->
val gap = resources.getDimensionPixelSize(R.dimen.parent_padding)
val insets = windowInsets.getInsets(Type.systemBars())
v.updatePadding(
left = gap + insets.left,
top = gap + insets.top,
right = gap + insets.right,
bottom = gap + insets.bottom
)
WindowInsetsCompat.CONSUMED
}
with(binding) {
customViews.onClick { startActivity(Intent(this@MainActivity, CustomViewsActivity::class.java)) }
composeUi.onClick { startActivity(Intent(this@MainActivity, ComposeViewsActivity::class.java)) }
@@ -21,6 +21,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?proton_background_norm"
android:fitsSystemWindows="true"
android:paddingStart="@dimen/countries_list_margin"
android:paddingTop="@dimen/countries_list_margin"
android:paddingEnd="@dimen/countries_list_margin"
@@ -30,6 +30,7 @@ import me.proton.core.humanverification.presentation.ui.common.RESULT_HUMAN_VERI
import me.proton.core.humanverification.presentation.utils.HumanVerificationVersion
import me.proton.core.humanverification.presentation.utils.showHumanVerification
import me.proton.core.presentation.ui.ProtonActivity
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.telemetry.domain.entity.TelemetryPriority
import me.proton.core.telemetry.presentation.UiComponentProductMetricsDelegateOwner
import me.proton.core.telemetry.presentation.annotation.ProductMetrics
@@ -63,6 +64,7 @@ class HumanVerificationActivity : ProtonActivity(), UiComponentProductMetricsDel
}
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
supportFragmentManager.setFragmentResultListener(REQUEST_KEY, this) { _, bundle ->
@@ -21,13 +21,13 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?proton_background_norm">
android:background="?proton_background_norm"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
@@ -43,11 +43,11 @@
<me.proton.core.presentation.ui.webview.ProtonWebView
android:id="@+id/humanVerificationWebView"
android:nestedScrollingEnabled="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible" />
android:nestedScrollingEnabled="true"
android:visibility="invisible"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<!-- this should be replaced with a Proton loader animation -->
<ProgressBar
@@ -21,12 +21,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?proton_background_norm">
android:background="?proton_background_norm"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -39,6 +39,7 @@ import me.proton.core.network.domain.client.ExtraHeaderProvider
import me.proton.core.network.presentation.ui.webview.ProtonWebViewClient
import me.proton.core.presentation.databinding.ProtonWebviewActivityBinding
import me.proton.core.presentation.ui.ProtonSecureActivity
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import okhttp3.HttpUrl
import okhttp3.HttpUrl.Companion.toHttpUrl
import java.io.ByteArrayInputStream
@@ -66,6 +67,7 @@ public class ProtonWebViewActivity : ProtonSecureActivity<ProtonWebviewActivityB
private var pageLoadErrorCode: Int? = null
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
binding.toolbar.setNavigationOnClickListener { onCancel() }
@@ -22,6 +22,7 @@ import android.os.Bundle
import dagger.hilt.android.AndroidEntryPoint
import me.proton.core.plan.presentation.databinding.ActivityDynamicSelectPlanBinding
import me.proton.core.presentation.ui.ProtonViewBindingActivity
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
@AndroidEntryPoint
class DynamicSelectPlanActivity : ProtonViewBindingActivity<ActivityDynamicSelectPlanBinding>(
@@ -30,6 +31,7 @@ class DynamicSelectPlanActivity : ProtonViewBindingActivity<ActivityDynamicSelec
private val planSelect by lazy { binding.planSelect.getFragment<DynamicSelectPlanFragment>() }
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
planSelect.setOnBackClicked { finish() }
}
@@ -28,6 +28,7 @@ import me.proton.core.plan.presentation.entity.SelectedPlan
import me.proton.core.plan.presentation.entity.UpgradeResult
import me.proton.core.plan.presentation.entity.DynamicUser
import me.proton.core.presentation.ui.ProtonViewBindingActivity
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
@AndroidEntryPoint
class DynamicUpgradePlanActivity : ProtonViewBindingActivity<ActivityDynamicUpgradePlanBinding>(
@@ -38,6 +39,7 @@ class DynamicUpgradePlanActivity : ProtonViewBindingActivity<ActivityDynamicUpgr
private val input: PlanInput? by lazy { intent?.extras?.getParcelable(ARG_INPUT) }
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
planUpgrade.setOnBackClicked { finish() }
planUpgrade.setOnPlanBilled { plan, result -> setResultAndFinish(plan, result) }
@@ -21,12 +21,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:windowBackground">
android:background="?android:windowBackground"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -20,12 +20,12 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -25,7 +25,7 @@ internal object AndroidDefaults {
const val compileSdk = 35
const val minSdk = 23
const val ndkVersion = "21.4.7075529"
const val targetSdk = 34
const val targetSdk = 35
const val testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
@@ -19,6 +19,8 @@
package me.proton.core.compose.component.appbar
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.systemBars
import androidx.compose.material.TopAppBar
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@@ -37,7 +39,8 @@ fun ProtonTopAppBar(
actions: @Composable RowScope.() -> Unit = {},
backgroundColor: Color = ProtonTheme.colors.backgroundNorm,
contentColor: Color = ProtonTheme.colors.textNorm,
elevation: Dp = 0.dp
elevation: Dp = 0.dp,
windowInsets: WindowInsets = WindowInsets.systemBars
) {
TopAppBar(
title = title,
@@ -46,7 +49,8 @@ fun ProtonTopAppBar(
actions = actions,
backgroundColor = backgroundColor,
contentColor = contentColor,
elevation = elevation
elevation = elevation,
windowInsets = windowInsets
)
}
@@ -21,13 +21,13 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?proton_background_norm">
android:background="?proton_background_norm"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
@@ -43,9 +43,9 @@
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?proton_background_norm"
android:fillViewport="true"
android:nestedScrollingEnabled="true"
android:background="?proton_background_norm"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<me.proton.core.presentation.ui.webview.ProtonWebView
@@ -39,6 +39,7 @@ import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import me.proton.core.presentation.ui.ProtonViewBindingActivity
import me.proton.core.presentation.utils.addOnBackPressedCallback
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.errorSnack
import me.proton.core.presentation.utils.hideKeyboard
import me.proton.core.presentation.utils.showKeyboard
@@ -68,6 +69,7 @@ internal class BugReportActivity : ProtonViewBindingActivity<CoreReportActivityB
private val viewModel by viewModels<BugReportViewModel>()
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
initToolbar()
initForm()
@@ -19,12 +19,12 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
@@ -91,14 +91,14 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<me.proton.core.presentation.ui.view.ProtonCheckbox
<me.proton.core.presentation.ui.view.ProtonCheckbox
android:id="@+id/bug_report_attach_log"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:checked="true"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:checked="true"
android:text="@string/core_report_bug_attach_log" />
<View
@@ -23,6 +23,7 @@ import android.content.Intent
import android.os.Bundle
import dagger.hilt.android.AndroidEntryPoint
import me.proton.core.presentation.ui.ProtonViewBindingActivity
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.successToast
import me.proton.core.usersettings.presentation.R
import me.proton.core.usersettings.presentation.databinding.ActivityPasswordManagementBinding
@@ -40,6 +41,7 @@ class PasswordManagementActivity : ProtonViewBindingActivity<ActivityPasswordMan
}
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
binding.toolbar.title = getString(R.string.settings_password_management_header)
@@ -18,8 +18,6 @@
package me.proton.core.usersettings.presentation.ui
import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.navigation.compose.NavHost
@@ -28,6 +26,7 @@ import dagger.hilt.android.AndroidEntryPoint
import me.proton.core.compose.theme.AppTheme
import me.proton.core.usersettings.presentation.R
import me.proton.core.presentation.ui.ProtonActivity
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.openBrowserLink
import me.proton.core.usersettings.presentation.compose.SecurityKeysRoutes
import me.proton.core.usersettings.presentation.compose.SecurityKeysRoutes.addSecurityKeysScreen
@@ -45,6 +44,7 @@ class SecurityKeysActivity : ProtonActivity() {
}
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
setContent {
appTheme {
@@ -23,6 +23,7 @@ import android.content.Intent
import android.os.Bundle
import dagger.hilt.android.AndroidEntryPoint
import me.proton.core.presentation.ui.ProtonViewBindingActivity
import me.proton.core.presentation.utils.enableProtonEdgeToEdge
import me.proton.core.presentation.utils.successToast
import me.proton.core.usersettings.presentation.R
import me.proton.core.usersettings.presentation.databinding.ActivityUpdateRecoveryEmailBinding
@@ -40,6 +41,7 @@ class UpdateRecoveryEmailActivity : ProtonViewBindingActivity<ActivityUpdateReco
}
override fun onCreate(savedInstanceState: Bundle?) {
enableProtonEdgeToEdge()
super.onCreate(savedInstanceState)
binding.toolbar.title = getString(R.string.settings_recovery_email_header)
@@ -21,6 +21,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:padding="0dp">
<com.google.android.material.appbar.MaterialToolbar
@@ -38,9 +39,9 @@
android:id="@+id/layoutContent"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -21,6 +21,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:padding="0dp">
<com.google.android.material.appbar.MaterialToolbar