From 48213d0b427c478865c75fee912ff1ae8bbaffb5 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 31 Jul 2017 23:02:01 -0700 Subject: Major update to core and kotterknife; create mediapicker (#15) * Readme * Fix kau direction bits * Truly support transparent ripples * Update changelog * Test rect as base * Replace fab transition with generic fade scale transition * Add scalexy func * Add scaleXY * Add arguments to fadeScaleTransition * Clean up ink indicator * Create setOnSingleTapListener * Fix lint and add rndColor * Create kotterknife resettables * Add readme and missing object * Create lazy resettable registered * Update core docs * Opt for separate class for resettable registry * Clean up resettable registry * Rename functions * Add ripple callback listener * Adjust kprefactivity desc color * Add more transitions * Add delete keys option * Add instrumentation tests * switch id * Revert automatic instrumental tests * Generify imagepickercore and prepare video alternative * Create working video picker * Address possible null issue * Update searchview * Make layouts public * Add changelog test * Update logo link * Add custom color gif --- .../kau/ui/widgets/ElasticDragDismissFrameLayout.kt | 12 +++--------- .../kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java | 11 +++++------ 2 files changed, 8 insertions(+), 15 deletions(-) (limited to 'core-ui/src/main/kotlin/ca/allanwang') 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(); -- cgit v1.2.3