From 50ad7f0ae89fc52ce57fe03328f4221fb57f2eac Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 23 Jul 2017 23:26:34 -0700 Subject: Fully implement imagepicker and create play store showcase (#12) * Update changelog * Add uri to imagemodel * Revamp image pickers * Prepare play store showcase * Add encrypted files * Test showcase * Clean elastic recycler activity --- .../kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt | 1 - .../kau/ui/widgets/ElasticDragDismissFrameLayout.kt | 14 ++++++++++++++ core-ui/src/main/res-public/values/styles.xml | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'core-ui') diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt index ebb6397..5db5eaa 100644 --- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt +++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt @@ -3,7 +3,6 @@ package ca.allanwang.kau.ui.views import android.content.Context import android.support.v7.widget.AppCompatImageView import android.util.AttributeSet -import android.widget.ImageView /** * Created by Allan Wang on 2017-07-14. 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 995ccab..5cdfc92 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 @@ -21,9 +21,12 @@ import android.content.Context import android.graphics.Color import android.os.Build import android.support.annotation.RequiresApi +import android.support.v7.widget.RecyclerView +import android.transition.TransitionInflater import android.util.AttributeSet import android.view.View import android.widget.FrameLayout +import ca.allanwang.kau.logging.KL import ca.allanwang.kau.ui.R import ca.allanwang.kau.utils.* @@ -237,4 +240,15 @@ class ElasticDragDismissFrameLayout @JvmOverloads constructor( } } + fun addExitListener(activity: Activity, transitionBottom: Int = R.transition.kau_exit_slide_bottom, transitionTop: Int = R.transition.kau_exit_slide_top) { + addListener(object : ElasticDragDismissFrameLayout.SystemChromeFader(activity) { + override fun onDragDismissed() { + KL.d("New transition") + activity.window.returnTransition = TransitionInflater.from(activity) + .inflateTransition(if (translationY > 0) transitionBottom else transitionTop) + activity.finishAfterTransition() + } + }) + } + } diff --git a/core-ui/src/main/res-public/values/styles.xml b/core-ui/src/main/res-public/values/styles.xml index 583ede7..31c5b74 100644 --- a/core-ui/src/main/res-public/values/styles.xml +++ b/core-ui/src/main/res-public/values/styles.xml @@ -1,5 +1,6 @@ + + +