aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-07-01 13:46:10 -0700
committerAllan Wang <me@allanwang.ca>2019-07-01 13:46:10 -0700
commit8c259e6acc283e50348a8f8825504eed482bf610 (patch)
treed09352964bfae8ba8b7b27b9342ccc653e90c9cd /core
parent1ae6a8c455bbe40ad247a29848432a4fe00459f7 (diff)
downloadkau-8c259e6acc283e50348a8f8825504eed482bf610.tar.gz
kau-8c259e6acc283e50348a8f8825504eed482bf610.tar.bz2
kau-8c259e6acc283e50348a8f8825504eed482bf610.zip
Merge scene transition definitions, resolves #213
Diffstat (limited to 'core')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/utils/BundleUtils.kt12
1 files changed, 1 insertions, 11 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/BundleUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/BundleUtils.kt
index 40c1c72..b857eb0 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/utils/BundleUtils.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/utils/BundleUtils.kt
@@ -89,16 +89,6 @@ fun bundleOf(vararg params: kotlin.Pair<String, Any?>): Bundle {
}
/**
- * Adds transition bundle if context is activity and build is lollipop+
- */
-@SuppressLint("NewApi")
-fun Bundle.withSceneTransitionAnimation(context: Context) {
- if (context !is Activity || !buildIsLollipopAndUp) return
- val options = ActivityOptions.makeSceneTransitionAnimation(context)
- putAll(options.toBundle())
-}
-
-/**
* Given the parent view and map of view ids to tags,
* create a scene transition animation
*/
@@ -112,7 +102,7 @@ fun Bundle.withSceneTransitionAnimation(parent: View, data: Map<Int, String>) =
* create a scene transition animation
*/
@SuppressLint("NewApi")
-fun Bundle.withSceneTransitionAnimation(context: Context, data: Map<out View, String>) {
+fun Bundle.withSceneTransitionAnimation(context: Context, data: Map<out View, String> = emptyMap()) {
if (context !is Activity || !buildIsLollipopAndUp) return
val options = ActivityOptions.makeSceneTransitionAnimation(
context,