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 --- core-ui/build.gradle | 1 - .../ui/widgets/ElasticDragDismissFrameLayout.kt | 12 ++--- .../allanwang/kau/ui/widgets/InkPageIndicator.java | 11 +++-- .../layout/kau_elastic_recycler_activity.xml | 51 ++++++++++++++++++++++ .../layout/kau_recycler_detached_background.xml | 27 ++++++++++++ .../res-public/layout/kau_recycler_textslider.xml | 34 +++++++++++++++ core-ui/src/main/res-public/values/public.xml | 3 ++ .../res/layout/kau_elastic_recycler_activity.xml | 51 ---------------------- .../layout/kau_recycler_detached_background.xml | 27 ------------ .../main/res/layout/kau_recycler_textslider.xml | 34 --------------- 10 files changed, 123 insertions(+), 128 deletions(-) create mode 100644 core-ui/src/main/res-public/layout/kau_elastic_recycler_activity.xml create mode 100644 core-ui/src/main/res-public/layout/kau_recycler_detached_background.xml create mode 100644 core-ui/src/main/res-public/layout/kau_recycler_textslider.xml delete mode 100644 core-ui/src/main/res/layout/kau_elastic_recycler_activity.xml delete mode 100644 core-ui/src/main/res/layout/kau_recycler_detached_background.xml delete mode 100644 core-ui/src/main/res/layout/kau_recycler_textslider.xml (limited to 'core-ui') diff --git a/core-ui/build.gradle b/core-ui/build.gradle index c4dcc72..da6715c 100644 --- a/core-ui/build.gradle +++ b/core-ui/build.gradle @@ -3,7 +3,6 @@ ext.kauSubModuleMinSdk = project.CORE_MIN_SDK apply from: '../android-lib.gradle' dependencies { - compile project(':core') compile project(':adapter') 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(); diff --git a/core-ui/src/main/res-public/layout/kau_elastic_recycler_activity.xml b/core-ui/src/main/res-public/layout/kau_elastic_recycler_activity.xml new file mode 100644 index 0000000..055d61d --- /dev/null +++ b/core-ui/src/main/res-public/layout/kau_elastic_recycler_activity.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core-ui/src/main/res-public/layout/kau_recycler_detached_background.xml b/core-ui/src/main/res-public/layout/kau_recycler_detached_background.xml new file mode 100644 index 0000000..7295d66 --- /dev/null +++ b/core-ui/src/main/res-public/layout/kau_recycler_detached_background.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + diff --git a/core-ui/src/main/res-public/layout/kau_recycler_textslider.xml b/core-ui/src/main/res-public/layout/kau_recycler_textslider.xml new file mode 100644 index 0000000..eacd5be --- /dev/null +++ b/core-ui/src/main/res-public/layout/kau_recycler_textslider.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + diff --git a/core-ui/src/main/res-public/values/public.xml b/core-ui/src/main/res-public/values/public.xml index 59e34a6..aed5f9f 100644 --- a/core-ui/src/main/res-public/values/public.xml +++ b/core-ui/src/main/res-public/values/public.xml @@ -1,5 +1,8 @@ + + + diff --git a/core-ui/src/main/res/layout/kau_elastic_recycler_activity.xml b/core-ui/src/main/res/layout/kau_elastic_recycler_activity.xml deleted file mode 100644 index 055d61d..0000000 --- a/core-ui/src/main/res/layout/kau_elastic_recycler_activity.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core-ui/src/main/res/layout/kau_recycler_detached_background.xml b/core-ui/src/main/res/layout/kau_recycler_detached_background.xml deleted file mode 100644 index 7295d66..0000000 --- a/core-ui/src/main/res/layout/kau_recycler_detached_background.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - diff --git a/core-ui/src/main/res/layout/kau_recycler_textslider.xml b/core-ui/src/main/res/layout/kau_recycler_textslider.xml deleted file mode 100644 index eacd5be..0000000 --- a/core-ui/src/main/res/layout/kau_recycler_textslider.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - -- cgit v1.2.3