2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

Bug 1820130 - Use compose foundation insets over accompanist insets

This commit is contained in:
rahulsainani 2023-03-03 11:31:20 +01:00 committed by mergify[bot]
parent 0a34b4b1da
commit a8447fc586
6 changed files with 26 additions and 36 deletions

View File

@ -492,7 +492,6 @@ dependencies {
implementation FenixDependencies.androidx_constraintlayout
implementation FenixDependencies.androidx_coordinatorlayout
implementation FenixDependencies.google_accompanist_drawablepainter
implementation FenixDependencies.google_accompanist_insets
implementation FenixDependencies.sentry

View File

@ -13,7 +13,6 @@ import android.view.ViewGroup
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.fragment.app.DialogFragment
import com.google.accompanist.insets.ProvideWindowInsets
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.onboarding.view.NotificationPermissionDialogScreen
@ -43,16 +42,14 @@ class HomeNotificationPermissionDialogFragment : DialogFragment() {
): View = ComposeView(requireContext()).apply {
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
setContent {
ProvideWindowInsets {
FirefoxTheme {
NotificationPermissionDialogScreen(
onDismiss = ::onDismiss,
grantNotificationPermission = {
ensureMarketingChannelExists(context.applicationContext)
onDismiss()
},
)
}
FirefoxTheme {
NotificationPermissionDialogScreen(
onDismiss = ::onDismiss,
grantNotificationPermission = {
ensureMarketingChannelExists(context.applicationContext)
onDismiss()
},
)
}
}
}

View File

@ -14,7 +14,6 @@ import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.fragment.app.DialogFragment
import androidx.navigation.fragment.findNavController
import com.google.accompanist.insets.ProvideWindowInsets
import mozilla.components.lib.state.ext.observeAsComposableState
import org.mozilla.fenix.R
import org.mozilla.fenix.components.components
@ -47,23 +46,21 @@ class HomeOnboardingDialogFragment : DialogFragment() {
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
setContent {
ProvideWindowInsets {
FirefoxTheme {
val account =
components.backgroundServices.syncStore.observeAsComposableState { state -> state.account }
FirefoxTheme {
val account =
components.backgroundServices.syncStore.observeAsComposableState { state -> state.account }
UpgradeOnboarding(
isSyncSignIn = account.value != null,
onDismiss = ::onDismiss,
onSignInButtonClick = {
findNavController().nav(
R.id.homeOnboardingDialogFragment,
HomeOnboardingDialogFragmentDirections.actionGlobalTurnOnSync(),
)
onDismiss()
},
)
}
UpgradeOnboarding(
isSyncSignIn = account.value != null,
onDismiss = ::onDismiss,
onSignInButtonClick = {
findNavController().nav(
R.id.homeOnboardingDialogFragment,
HomeOnboardingDialogFragmentDirections.actionGlobalTurnOnSync(),
)
onDismiss()
},
)
}
}
}

View File

@ -4,11 +4,11 @@
package org.mozilla.fenix.onboarding.view
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.google.accompanist.insets.navigationBarsPadding
import com.google.accompanist.insets.statusBarsPadding
import mozilla.components.service.glean.private.NoExtras
import org.mozilla.fenix.GleanMetrics.Onboarding
import org.mozilla.fenix.R

View File

@ -14,8 +14,10 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.runtime.Composable
@ -31,8 +33,6 @@ import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import com.google.accompanist.insets.navigationBarsPadding
import com.google.accompanist.insets.statusBarsPadding
import mozilla.telemetry.glean.private.NoExtras
import org.mozilla.fenix.R
import org.mozilla.fenix.compose.annotation.LightDarkPreview

View File

@ -42,7 +42,6 @@ object FenixVersions {
const val androidx_datastore = "1.0.0"
const val google_material = "1.2.1"
const val accompanist_drawablepainter = "0.23.1"
const val accompanist_insets = "0.23.1"
const val adjust = "4.33.0"
const val installreferrer = "2.2"
@ -113,8 +112,6 @@ object FenixDependencies {
const val google_material = "com.google.android.material:material:${FenixVersions.google_material}"
const val google_accompanist_drawablepainter =
"com.google.accompanist:accompanist-drawablepainter:${FenixVersions.accompanist_drawablepainter}"
const val google_accompanist_insets =
"com.google.accompanist:accompanist-insets:${FenixVersions.accompanist_drawablepainter}"
const val protobuf_javalite = "com.google.protobuf:protobuf-javalite:${FenixVersions.protobuf}"
const val protobuf_compiler = "com.google.protobuf:protoc:${FenixVersions.protobuf}"