aboutsummaryrefslogtreecommitdiff
path: root/core-ui/src/main/kotlin/ca/allanwang
diff options
context:
space:
mode:
Diffstat (limited to 'core-ui/src/main/kotlin/ca/allanwang')
-rw-r--r--core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/ElasticDragDismissFrameLayout.kt12
-rw-r--r--core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java11
2 files changed, 8 insertions, 15 deletions
diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/ElasticDragDismissFrameLayout.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/ElasticDragDismissFrameLayout.kt
index 5cdfc92..3c477c1 100644
--- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/ElasticDragDismissFrameLayout.kt
+++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/ElasticDragDismissFrameLayout.kt
@@ -119,8 +119,7 @@ class ElasticDragDismissFrameLayout @JvmOverloads constructor(
} else { // settle back to natural position
animate()
.translationY(0f)
- .scaleX(1f)
- .scaleY(1f)
+ .scaleXY(1f)
.setDuration(200L)
.setInterpolator(AnimHolder.fastOutSlowInInterpolator(context))
.setListener(null)
@@ -176,11 +175,7 @@ class ElasticDragDismissFrameLayout @JvmOverloads constructor(
}
translationY = dragTo
- if (shouldScale) {
- val scale = 1 - (1 - dragDismissScale) * dragFraction
- scaleX = scale
- scaleY = scale
- }
+ if (shouldScale) scaleXY = 1 - (1 - dragDismissScale) * dragFraction
// if we've reversed direction and gone past the settle point then clear the flags to
// allow the list to get the scroll events & reset any transforms
@@ -191,8 +186,7 @@ class ElasticDragDismissFrameLayout @JvmOverloads constructor(
draggingUp = false
draggingDown = draggingUp
translationY = 0f
- scaleX = 1f
- scaleY = 1f
+ scaleXY = 1f
}
dispatchDragCallback(dragFraction, dragTo,
Math.min(1f, Math.abs(totalDrag) / dragDismissDistance), totalDrag)
diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java
index cad6997..65eb5b7 100644
--- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java
+++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java
@@ -36,6 +36,7 @@ import android.view.animation.Interpolator;
import java.util.Arrays;
+import ca.allanwang.kau.logging.KL;
import ca.allanwang.kau.ui.R;
import ca.allanwang.kau.utils.AnimHolder;
import ca.allanwang.kau.utils.ColorUtilsKt;
@@ -384,7 +385,7 @@ public class InkPageIndicator extends View implements ViewPager.OnPageChangeList
if ((joiningFraction == 0f || joiningFraction == INVALID_FRACTION)
&& dotRevealFraction == 0f
- && !(page == currentPage && selectedDotInPosition == true)) {
+ && !(page == currentPage && selectedDotInPosition)) {
// case #1 – At rest
unselectedDotPath.addCircle(dotCenterX[page], dotCenterY, dotRadius, Path.Direction.CW);
@@ -632,8 +633,8 @@ public class InkPageIndicator extends View implements ViewPager.OnPageChangeList
});
// slightly delay the start to give the joins a chance to run
// unless dot isn't in position yet – then don't delay!
- moveSelected.setStartDelay(selectedDotInPosition ? animDuration / 4l : 0l);
- moveSelected.setDuration(animDuration * 3l / 4l);
+ moveSelected.setStartDelay(selectedDotInPosition ? animDuration / 4L : 0L);
+ moveSelected.setDuration(animDuration * 3L / 4L);
moveSelected.setInterpolator(interpolator);
return moveSelected;
}
@@ -641,9 +642,7 @@ public class InkPageIndicator extends View implements ViewPager.OnPageChangeList
private void setJoiningFraction(int leftDot, float fraction) {
if (leftDot < joiningFractions.length) {
- if (leftDot == 1) {
- Log.d("PageIndicator", "dot 1 fraction:\t" + fraction);
- }
+ if (leftDot == 1) KL.INSTANCE.v("PageIndicator dot 1 fraction:\t$fraction");
joiningFractions[leftDot] = fraction;
postInvalidateOnAnimation();