diff options
author | Allan Wang <me@allanwang.ca> | 2018-12-24 00:27:25 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-24 00:27:25 -0500 |
commit | a380adea1052d39f23c9c4d432a9380ce347d6c4 (patch) | |
tree | cdbb6835cdc3c04df24af2323341d765f64ab2e3 /mediapicker/src/main/kotlin | |
parent | 98a7f378399546086e23e25514b705e037068058 (diff) | |
download | kau-a380adea1052d39f23c9c4d432a9380ce347d6c4.tar.gz kau-a380adea1052d39f23c9c4d432a9380ce347d6c4.tar.bz2 kau-a380adea1052d39f23c9c4d432a9380ce347d6c4.zip |
Migrate to androidx (#178)
* Initial refactor
* Remove alpha version usages
* Update test code
* Add tests for checkbox
* Fix invalid card import
* Remove more old support content
* Update kotlin version
* Add back kotterknife with new imports
* Update docs
* Use bold notice
* Add changelog
* Remove deprecation for kotterknife
* Remove unused dependencies
* Update changelog
Diffstat (limited to 'mediapicker/src/main/kotlin')
7 files changed, 18 insertions, 18 deletions
diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaItem.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaItem.kt index c0b7e2d..db4d18b 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaItem.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaItem.kt @@ -1,7 +1,7 @@ package ca.allanwang.kau.mediapicker import android.graphics.drawable.Drawable -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.View import ca.allanwang.kau.iitems.KauIItem import com.bumptech.glide.load.DataSource diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaItemBasic.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaItemBasic.kt index 59202c0..29babe2 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaItemBasic.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaItemBasic.kt @@ -3,7 +3,7 @@ package ca.allanwang.kau.mediapicker import android.annotation.SuppressLint import android.app.Activity import android.graphics.drawable.Drawable -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.View import ca.allanwang.kau.iitems.KauIItem import ca.allanwang.kau.ui.views.MeasuredImageView diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaModel.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaModel.kt index 26736d4..9fc83f9 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaModel.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaModel.kt @@ -6,7 +6,7 @@ import android.net.Uri import android.os.Parcel import android.os.Parcelable import android.provider.MediaStore -import android.support.annotation.NonNull +import androidx.annotation.NonNull import java.io.File @@ -36,8 +36,8 @@ data class MediaModel( ) constructor(parcel: Parcel) : this( - parcel.readString(), - parcel.readString(), + parcel.readString()!!, + parcel.readString()!!, parcel.readLong(), parcel.readLong(), parcel.readString()) 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 37f2373..b915cc8 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityBase.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityBase.kt @@ -2,15 +2,15 @@ package ca.allanwang.kau.mediapicker import android.database.Cursor import android.os.Bundle -import android.support.design.widget.AppBarLayout -import android.support.v4.content.Loader -import android.support.v7.widget.LinearLayoutManager +import androidx.loader.content.Loader +import androidx.recyclerview.widget.LinearLayoutManager import ca.allanwang.kau.adapters.selectedItems import ca.allanwang.kau.adapters.selectionSize import ca.allanwang.kau.utils.hideOnDownwardsScroll import ca.allanwang.kau.utils.setIcon import ca.allanwang.kau.utils.toDrawable import ca.allanwang.kau.utils.toast +import com.google.android.material.appbar.AppBarLayout import com.mikepenz.google_material_typeface_library.GoogleMaterial import kotlinx.android.synthetic.main.kau_activity_image_picker.* diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityOverlayBase.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityOverlayBase.kt index 122838b..2700780 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityOverlayBase.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityOverlayBase.kt @@ -2,7 +2,7 @@ package ca.allanwang.kau.mediapicker import android.os.Build import android.os.Bundle -import android.support.annotation.RequiresApi +import androidx.annotation.RequiresApi import ca.allanwang.kau.utils.toast import kotlinx.android.synthetic.main.kau_activity_image_picker_overlay.* 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 6e38d14..1092158 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt @@ -13,11 +13,11 @@ import android.os.Bundle import android.provider.BaseColumns import android.provider.DocumentsContract import android.provider.MediaStore -import android.support.v4.app.LoaderManager -import android.support.v4.content.CursorLoader -import android.support.v4.content.Loader -import android.support.v7.widget.GridLayoutManager -import android.support.v7.widget.RecyclerView +import androidx.loader.app.LoaderManager +import androidx.loader.content.CursorLoader +import androidx.loader.content.Loader +import androidx.recyclerview.widget.GridLayoutManager +import androidx.recyclerview.widget.RecyclerView import ca.allanwang.kau.adapters.fastAdapter import ca.allanwang.kau.animators.FadeScaleAnimatorAdd import ca.allanwang.kau.animators.KauAnimator @@ -274,7 +274,7 @@ abstract class MediaPickerCore<T : IItem<*, *>>( f = File(tempPath) tempPath = null } else if (data?.data != null) { - f = File(data.data.path) + f = File(data.data!!.path) } else { KL.d { "Media camera no file found" } return @@ -291,8 +291,8 @@ abstract class MediaPickerCore<T : IItem<*, *>>( private fun onPickerResult(data: Intent?) { val items = mutableListOf<Uri>() if (data?.data != null) { - KL.v { "Media picker data uri: ${data.data.path}" } - items.add(data.data) + KL.v { "Media picker data uri: ${data.data!!.path}" } + items.add(data.data!!) } else if (data != null) { val clip = data.clipData if (clip != null) { diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaUtils.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaUtils.kt index f37be75..1976172 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaUtils.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaUtils.kt @@ -6,7 +6,7 @@ import android.content.Context import android.content.Intent import android.net.Uri import android.os.Environment -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import ca.allanwang.kau.utils.buildIsLollipopAndUp import java.io.File import java.io.IOException |