Skip to content

Commit

Permalink
fix: script engine
Browse files Browse the repository at this point in the history
  • Loading branch information
jing332 committed Aug 12, 2024
1 parent f2f3c34 commit 0fd1bdf
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ fun LoadingAnimation(
animationSpec = infiniteRepeatable(
animation = keyframes {
durationMillis = 1200
0.0f at 0 with LinearOutSlowInEasing
1.0f at 300 with LinearOutSlowInEasing
0.0f at 600 with LinearOutSlowInEasing
0.0f at 1200 with LinearOutSlowInEasing
0.0f at 0 using LinearOutSlowInEasing
1.0f at 300 using LinearOutSlowInEasing
0.0f at 600 using LinearOutSlowInEasing
0.0f at 1200 using LinearOutSlowInEasing
},
repeatMode = RepeatMode.Restart
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fun ProgressIndicatorLoading(progressIndicatorSize: Dp, progressIndicatorColor:
)

CircularProgressIndicator(
progress = 1f,
progress = { 1f },
modifier = Modifier
.size(progressIndicatorSize)
.rotate(angle)
Expand All @@ -62,8 +62,8 @@ fun ProgressIndicatorLoading(progressIndicatorSize: Dp, progressIndicatorColor:
),
shape = CircleShape
),
color = Color.Transparent,
strokeWidth = 1.dp,
color = Color.Transparent
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ fun LongClickIconButton(
content: @Composable () -> Unit
) {
val stateLayerSize = 40.0.dp
val context = LocalContext.current
val view = LocalView.current
Box(
modifier = modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ import androidx.compose.animation.core.tween
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Send
import androidx.compose.material.icons.automirrored.filled.Send
import androidx.compose.material.icons.filled.Stop
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.FloatingActionButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.graphics.graphicsLayer
Expand All @@ -28,7 +27,7 @@ import com.github.jing332.compose.R
@Composable
fun SwitchFloatingButton(modifier: Modifier, switch: Boolean, onSwitchChange: (Boolean) -> Unit) {
val targetIcon =
if (switch) Icons.Filled.Stop else Icons.Filled.Send
if (switch) Icons.Filled.Stop else Icons.AutoMirrored.Filled.Send
val rotationAngle by animateFloatAsState(targetValue = if (switch) 360f else 0f, label = "")

val color =
Expand Down
6 changes: 6 additions & 0 deletions lib-script-engine/consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-keep class javax.script.** { *; }
-keep class com.sun.script.javascript.** { *; }
-keep class org.mozilla.javascript.** { *; }
-keep class com.script.javascript.** { *; }

-keep class com.github.jing332.script_engine.** { *; }
7 changes: 0 additions & 7 deletions lib-script-engine/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,3 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-keep class javax.script.** { *; }
-keep class com.sun.script.javascript.** { *; }
-keep class org.mozilla.javascript.** { *; }
-keep class com.script.javascript.** { *; }

-keep class com.github.jing332.script_engine.** { *; }

0 comments on commit 0fd1bdf

Please sign in to comment.