From a380adea1052d39f23c9c4d432a9380ce347d6c4 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 24 Dec 2018 00:27:25 -0500 Subject: 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 --- .../kotlin/ca/allanwang/kau/mediapicker/MediaItem.kt | 2 +- .../ca/allanwang/kau/mediapicker/MediaItemBasic.kt | 2 +- .../kotlin/ca/allanwang/kau/mediapicker/MediaModel.kt | 6 +++--- .../allanwang/kau/mediapicker/MediaPickerActivityBase.kt | 6 +++--- .../kau/mediapicker/MediaPickerActivityOverlayBase.kt | 2 +- .../ca/allanwang/kau/mediapicker/MediaPickerCore.kt | 16 ++++++++-------- .../kotlin/ca/allanwang/kau/mediapicker/MediaUtils.kt | 2 +- .../res/layout-v21/kau_activity_image_picker_overlay.xml | 2 +- .../src/main/res/layout/kau_activity_image_picker.xml | 16 ++++++++-------- 9 files changed, 27 insertions(+), 27 deletions(-) (limited to 'mediapicker') 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>( 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>( private fun onPickerResult(data: Intent?) { val items = mutableListOf() 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 diff --git a/mediapicker/src/main/res/layout-v21/kau_activity_image_picker_overlay.xml b/mediapicker/src/main/res/layout-v21/kau_activity_image_picker_overlay.xml index a0ce301..d7447b0 100644 --- a/mediapicker/src/main/res/layout-v21/kau_activity_image_picker_overlay.xml +++ b/mediapicker/src/main/res/layout-v21/kau_activity_image_picker_overlay.xml @@ -7,7 +7,7 @@ app:dragDismissDistance="@dimen/kau_drag_dismiss_distance_large" app:dragDismissScale="0.95"> - - - - - + - + - - - \ No newline at end of file + \ No newline at end of file -- cgit v1.2.3