Skip to content

Commit

Permalink
Merge pull request #217 from terrakok/dev
Browse files Browse the repository at this point in the history
Fix iOS gestures
  • Loading branch information
Hiebeler authored Feb 17, 2025
2 parents fee4aa3 + a486ae5 commit 46a7aa2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
16 changes: 14 additions & 2 deletions app/src/commonMain/kotlin/com/daniebeler/pfpixelix/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,20 @@ fun App(
startDestination = Destinations.FirstLogin.route,
enterTransition = { fadeIn() },
exitTransition = { ExitTransition.None },
popEnterTransition = { EnterTransition.None },
popExitTransition = { scaleOut(targetScale = 0.9f) },
popExitTransition = {
slideOutOfContainer(
towards = AnimatedContentTransitionScope.SlideDirection.End,
animationSpec = tween(durationMillis = 500),
targetOffset = { fullOffset -> (fullOffset * 0.25f).toInt() }
)
},
popEnterTransition = {
slideIntoContainer(
towards = AnimatedContentTransitionScope.SlideDirection.End,
animationSpec = tween(durationMillis = 500),
initialOffset = { fullOffset -> (fullOffset * 0.25f).toInt() }
)
},
builder = {
navigationGraph(
navController,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.daniebeler.pfpixelix.ui.composables.settings.preferences

import androidx.compose.foundation.OverscrollEffect
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.WindowInsets
Expand All @@ -23,9 +24,12 @@ import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.input.nestedscroll.NestedScrollSource
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Velocity
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.daniebeler.pfpixelix

import androidx.compose.foundation.ComposeFoundationFlags
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.window.ComposeUIViewController
import coil3.SingletonImageLoader
Expand All @@ -14,7 +16,11 @@ class IosUrlCallback {
var onRedirect: (String) -> Unit = {}
}

@OptIn(ExperimentalFoundationApi::class)
fun AppViewController(urlCallback: IosUrlCallback): UIViewController {
//https://youtrack.jetbrains.com/issue/CMP-7623 iOS - Gesture handling is incorrect in 1.8.0-alpha03
ComposeFoundationFlags.DragGesturePickUpEnabled = false

var viewController: UIViewController? = null
val context = object : KmpContext() {
override val viewController: UIViewController
Expand Down

0 comments on commit 46a7aa2

Please sign in to comment.