|
@@ -8,13 +8,12 @@ import android.text.format.DateUtils
|
|
|
import android.view.InputDevice
|
|
import android.view.InputDevice
|
|
|
import android.view.KeyEvent
|
|
import android.view.KeyEvent
|
|
|
import android.view.MotionEvent
|
|
import android.view.MotionEvent
|
|
|
|
|
+import androidx.activity.compose.BackHandler
|
|
|
import androidx.compose.animation.AnimatedContentTransitionScope
|
|
import androidx.compose.animation.AnimatedContentTransitionScope
|
|
|
import androidx.compose.animation.ExperimentalSharedTransitionApi
|
|
import androidx.compose.animation.ExperimentalSharedTransitionApi
|
|
|
import androidx.compose.animation.SharedTransitionLayout
|
|
import androidx.compose.animation.SharedTransitionLayout
|
|
|
import androidx.compose.animation.core.FastOutSlowInEasing
|
|
import androidx.compose.animation.core.FastOutSlowInEasing
|
|
|
import androidx.compose.animation.core.LinearOutSlowInEasing
|
|
import androidx.compose.animation.core.LinearOutSlowInEasing
|
|
|
-import androidx.compose.animation.EnterTransition
|
|
|
|
|
-import androidx.compose.animation.ExitTransition
|
|
|
|
|
import androidx.compose.animation.core.tween
|
|
import androidx.compose.animation.core.tween
|
|
|
import androidx.compose.animation.fadeIn
|
|
import androidx.compose.animation.fadeIn
|
|
|
import androidx.compose.animation.fadeOut
|
|
import androidx.compose.animation.fadeOut
|
|
@@ -298,18 +297,14 @@ open class MainActivity : BaseComposeActivity(), VariableDialog.Callback {
|
|
|
) + fadeOut(animationSpec = tween(durationMillis = 360)))
|
|
) + fadeOut(animationSpec = tween(durationMillis = 360)))
|
|
|
},
|
|
},
|
|
|
predictivePopTransitionSpec = { _ ->
|
|
predictivePopTransitionSpec = { _ ->
|
|
|
- if (!AppConfig.isPredictiveBackEnabled) {
|
|
|
|
|
- EnterTransition.None togetherWith ExitTransition.None
|
|
|
|
|
- } else {
|
|
|
|
|
- (slideIntoContainer(
|
|
|
|
|
- towards = AnimatedContentTransitionScope.SlideDirection.Start,
|
|
|
|
|
- animationSpec = tween(easing = FastOutSlowInEasing),
|
|
|
|
|
- initialOffset = { fullWidth -> -fullWidth / 4 }
|
|
|
|
|
- ) + fadeIn(animationSpec = tween(easing = LinearOutSlowInEasing))) togetherWith (scaleOut(
|
|
|
|
|
- targetScale = 0.8f,
|
|
|
|
|
- animationSpec = tween(easing = FastOutSlowInEasing)
|
|
|
|
|
- ) + fadeOut(animationSpec = tween()))
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ (slideIntoContainer(
|
|
|
|
|
+ towards = AnimatedContentTransitionScope.SlideDirection.Start,
|
|
|
|
|
+ animationSpec = tween(easing = FastOutSlowInEasing),
|
|
|
|
|
+ initialOffset = { fullWidth -> -fullWidth / 4 }
|
|
|
|
|
+ ) + fadeIn(animationSpec = tween(easing = LinearOutSlowInEasing))) togetherWith (scaleOut(
|
|
|
|
|
+ targetScale = 0.8f,
|
|
|
|
|
+ animationSpec = tween(easing = FastOutSlowInEasing)
|
|
|
|
|
+ ) + fadeOut(animationSpec = tween()))
|
|
|
},
|
|
},
|
|
|
onBack = { MainNavigator.navigateBack(this@MainActivity, backStack) },
|
|
onBack = { MainNavigator.navigateBack(this@MainActivity, backStack) },
|
|
|
entryProvider = mainEntryProvider(
|
|
entryProvider = mainEntryProvider(
|
|
@@ -326,6 +321,9 @@ open class MainActivity : BaseComposeActivity(), VariableDialog.Callback {
|
|
|
onRegisterVariableSetter = { setter -> bookInfoVariableSetter = setter }
|
|
onRegisterVariableSetter = { setter -> bookInfoVariableSetter = setter }
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
|
|
+ BackHandler(enabled = !AppConfig.isPredictiveBackEnabled) {
|
|
|
|
|
+ MainNavigator.navigateBack(this@MainActivity, backStack)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|