From 222709bc15ace77ebf03e5a8e17e0bf026520970 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 24 Oct 2021 17:45:09 -0700 Subject: Many version bumps --- .../kau/mediapicker/MediaPickerActivityBase.kt | 22 +++++++++++----------- .../allanwang/kau/mediapicker/MediaPickerBinder.kt | 11 +++++++---- .../allanwang/kau/mediapicker/MediaPickerCore.kt | 12 +++++++----- 3 files changed, 25 insertions(+), 20 deletions(-) (limited to 'mediapicker/src/main/kotlin/ca/allanwang') diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityBase.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityBase.kt index fe25d97..0bd240b 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityBase.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityBase.kt @@ -54,10 +54,10 @@ abstract class MediaPickerActivityBase( private fun KauActivityImagePickerBinding.init() { kauSelectionCount.setCompoundDrawables( - null, - null, - GoogleMaterial.Icon.gmd_image.toDrawable(this@MediaPickerActivityBase, 18), - null + null, + null, + GoogleMaterial.Icon.gmd_image.toDrawable(this@MediaPickerActivityBase, 18), + null ) setSupportActionBar(kauToolbar) @@ -65,10 +65,10 @@ abstract class MediaPickerActivityBase( setDisplayHomeAsUpEnabled(true) setDisplayShowHomeEnabled(true) setHomeAsUpIndicator( - GoogleMaterial.Icon.gmd_close.toDrawable( - this@MediaPickerActivityBase, - 18 - ) + GoogleMaterial.Icon.gmd_close.toDrawable( + this@MediaPickerActivityBase, + 18 + ) ) } kauToolbar.setNavigationOnClickListener { onBackPressed() } @@ -117,7 +117,7 @@ abstract class MediaPickerActivityBase( val params = kauToolbar.layoutParams as AppBarLayout.LayoutParams if (scrollable) { params.scrollFlags = AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS or - AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL + AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL } else { params.scrollFlags = 0 } @@ -126,8 +126,8 @@ abstract class MediaPickerActivityBase( override fun onLoadFinished(loader: Loader, data: Cursor?) { super.onLoadFinished(loader, data) binding.setToolbarScrollable( - (binding.kauRecyclerview.layoutManager as LinearLayoutManager) - .findLastCompletelyVisibleItemPosition() < adapter.adapterItemCount - 1 + (binding.kauRecyclerview.layoutManager as LinearLayoutManager) + .findLastCompletelyVisibleItemPosition() < adapter.adapterItemCount - 1 ) } diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerBinder.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerBinder.kt index ac43f9f..ca6122b 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerBinder.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerBinder.kt @@ -35,10 +35,13 @@ import com.bumptech.glide.request.RequestOptions * Image picker launchers */ inline fun > Activity.kauLaunchMediaPicker(requestCode: Int) { - startActivityForResult(requestCode, bundleBuilder = { - if (MediaPickerActivityOverlayBase::class.java.isAssignableFrom(T::class.java)) - withSceneTransitionAnimation(this@kauLaunchMediaPicker) - }) + startActivityForResult( + requestCode, + bundleBuilder = { + if (MediaPickerActivityOverlayBase::class.java.isAssignableFrom(T::class.java)) + withSceneTransitionAnimation(this@kauLaunchMediaPicker) + } + ) } /** diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt index e65cab2..4b0e9d6 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt @@ -50,9 +50,9 @@ import com.mikepenz.fastadapter.adapters.ItemAdapter import com.mikepenz.iconics.dsl.iconicsDrawable import com.mikepenz.iconics.typeface.IIcon import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial +import kotlinx.coroutines.CancellationException import java.io.File import kotlin.math.min -import kotlinx.coroutines.CancellationException /** * Created by Allan Wang on 2017-07-23. @@ -324,11 +324,13 @@ abstract class MediaPickerCore( } else if (data != null) { val clip = data.clipData if (clip != null) { - items.addAll((0 until clip.itemCount).map { - clip.getItemAt(it).uri.apply { - KL.v { "Media picker clip uri $path" } + items.addAll( + (0 until clip.itemCount).map { + clip.getItemAt(it).uri.apply { + KL.v { "Media picker clip uri $path" } + } } - }) + ) } } if (items.isEmpty()) return KL.d { "Media picker empty intent" } -- cgit v1.2.3