mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-23 19:15:58 +00:00
optimize CubicBezierEasing
This commit is contained in:
@@ -253,7 +253,7 @@ private fun UserCtrlDisabledPkg(pkgName:String){
|
||||
Text(text = stringResource(R.string.ucd_desc))
|
||||
Spacer(Modifier.padding(vertical = 5.dp))
|
||||
Text(text = stringResource(R.string.app_list_is))
|
||||
SelectionContainer(modifier = Modifier.horizontalScroll(rememberScrollState()).animateContentSize(Animations().animateListSize)){
|
||||
SelectionContainer(modifier = Modifier.horizontalScroll(rememberScrollState()).animateContentSize()){
|
||||
Text(text = if(listText==""){stringResource(R.string.none)}else{listText})
|
||||
}
|
||||
Spacer(Modifier.padding(vertical = 5.dp))
|
||||
@@ -437,7 +437,7 @@ private fun CrossProfilePkg(pkgName: String){
|
||||
}
|
||||
LaunchedEffect(Unit){refresh()}
|
||||
Text(text = stringResource(R.string.app_list_is))
|
||||
SelectionContainer(modifier = Modifier.horizontalScroll(rememberScrollState()).animateContentSize(Animations().animateListSize)){
|
||||
SelectionContainer(modifier = Modifier.horizontalScroll(rememberScrollState()).animateContentSize()){
|
||||
Text(text = if(list==""){stringResource(R.string.none)}else{list})
|
||||
}
|
||||
Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween){
|
||||
@@ -485,7 +485,7 @@ private fun CrossProfileWidget(pkgName: String){
|
||||
Text(text = stringResource(R.string.cross_profile_widget), style = typography.headlineLarge)
|
||||
Spacer(Modifier.padding(vertical = 5.dp))
|
||||
Text(text = stringResource(R.string.app_list_is))
|
||||
SelectionContainer(modifier = Modifier.horizontalScroll(rememberScrollState()).animateContentSize(Animations().animateListSize)){
|
||||
SelectionContainer(modifier = Modifier.horizontalScroll(rememberScrollState()).animateContentSize()){
|
||||
Text(text = if(list==""){stringResource(R.string.none)}else{list})
|
||||
}
|
||||
Spacer(Modifier.padding(vertical = 5.dp))
|
||||
@@ -611,7 +611,7 @@ private fun PermittedAccessibility(pkgName: String){
|
||||
}
|
||||
Spacer(Modifier.padding(vertical = 5.dp))
|
||||
Text(text = stringResource(R.string.app_list_is))
|
||||
SelectionContainer(modifier = Modifier.horizontalScroll(rememberScrollState()).animateContentSize(Animations().animateListSize)){
|
||||
SelectionContainer(modifier = Modifier.horizontalScroll(rememberScrollState()).animateContentSize()){
|
||||
Text(text = if(listText==""){stringResource(R.string.none)}else{listText})
|
||||
}
|
||||
Spacer(Modifier.padding(vertical = 5.dp))
|
||||
|
||||
@@ -547,7 +547,7 @@ private fun LockTaskFeatures(){
|
||||
}
|
||||
LaunchedEffect(Unit){refreshWhitelist()}
|
||||
Text(text = stringResource(R.string.whitelist_app), style = typography.titleLarge)
|
||||
SelectionContainer(modifier = Modifier.animateContentSize(Animations().animateListSize)){
|
||||
SelectionContainer(modifier = Modifier.animateContentSize()){
|
||||
Text(text = if(listText==""){ stringResource(R.string.none) }else{listText})
|
||||
}
|
||||
OutlinedTextField(
|
||||
|
||||
@@ -3,18 +3,15 @@ package com.bintianqi.owndroid.ui
|
||||
import androidx.compose.animation.*
|
||||
import androidx.compose.animation.core.*
|
||||
import androidx.compose.ui.unit.IntOffset
|
||||
import androidx.compose.ui.unit.IntSize
|
||||
import androidx.navigation.NavBackStackEntry
|
||||
|
||||
class Animations{
|
||||
val animateListSize:FiniteAnimationSpec<IntSize> = spring(stiffness = Spring.StiffnessMediumLow, visibilityThreshold = IntSize.VisibilityThreshold)
|
||||
|
||||
private val initialOffsetValue = 96
|
||||
private val targetOffsetValue = 96
|
||||
|
||||
private val bezier = CubicBezierEasing(0.3f, 0f, 0f, 1f)
|
||||
private val bezier = CubicBezierEasing(0.4f, 0f, 0f, 1f)
|
||||
|
||||
private val tween: FiniteAnimationSpec<IntOffset> = tween(450, easing = bezier)
|
||||
private val tween: FiniteAnimationSpec<IntOffset> = tween(400, easing = bezier)
|
||||
|
||||
val navHostEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = {
|
||||
fadeIn(tween(83, easing = LinearEasing)) +
|
||||
@@ -26,6 +23,7 @@ class Animations{
|
||||
}
|
||||
|
||||
val navHostExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = {
|
||||
fadeOut(tween(83, easing = LinearEasing)) +
|
||||
slideOutOfContainer(
|
||||
animationSpec = tween,
|
||||
towards = AnimatedContentTransitionScope.SlideDirection.Start,
|
||||
@@ -34,6 +32,7 @@ class Animations{
|
||||
}
|
||||
|
||||
val navHostPopEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = {
|
||||
fadeIn(tween(83, easing = LinearEasing)) +
|
||||
slideIntoContainer(
|
||||
animationSpec = tween,
|
||||
towards = AnimatedContentTransitionScope.SlideDirection.End,
|
||||
|
||||
Reference in New Issue
Block a user