From 2873b996bc4852749d4b710bbe7b8f50edbcfe72 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 5 Oct 2018 22:42:21 +0200 Subject: [PATCH] updating support libraries to AndroidX --- app/build.gradle | 12 ++++++------ app/src/main/AndroidManifest.xml | 2 +- .../kotlin/com/simplemobiletools/gallery/App.kt | 2 +- .../gallery/activities/EditActivity.kt | 2 +- .../gallery/activities/MainActivity.kt | 11 ++++++----- .../gallery/activities/MediaActivity.kt | 13 +++++++------ .../gallery/activities/PhotoVideoActivity.kt | 2 +- .../gallery/activities/ViewPagerActivity.kt | 2 +- .../gallery/adapters/DirectoryAdapter.kt | 2 +- .../gallery/adapters/FiltersAdapter.kt | 2 +- .../gallery/adapters/MyPagerAdapter.kt | 8 ++++---- .../gallery/databases/GalleryDatabase.kt | 6 +++--- .../gallery/dialogs/ChangeGroupingDialog.kt | 2 +- .../gallery/dialogs/ChangeSortingDialog.kt | 2 +- .../gallery/dialogs/DeleteWithRememberDialog.kt | 2 +- .../gallery/dialogs/ExcludeFolderDialog.kt | 2 +- .../gallery/dialogs/FilterMediaDialog.kt | 2 +- .../gallery/dialogs/ManageBottomActionsDialog.kt | 2 +- .../gallery/dialogs/ManageExtendedDetailsDialog.kt | 2 +- .../gallery/dialogs/PickDirectoryDialog.kt | 8 ++++---- .../gallery/dialogs/PickMediumDialog.kt | 6 +++--- .../gallery/dialogs/ResizeDialog.kt | 2 +- .../gallery/dialogs/SaveAsDialog.kt | 2 +- .../gallery/dialogs/SlideshowDialog.kt | 2 +- .../gallery/extensions/Activity.kt | 2 +- .../gallery/fragments/ViewPagerFragment.kt | 2 +- .../gallery/interfaces/DirectoryDao.kt | 8 ++++---- .../gallery/interfaces/MediumDao.kt | 10 +++++----- .../simplemobiletools/gallery/models/Directory.kt | 8 ++++---- .../com/simplemobiletools/gallery/models/Medium.kt | 8 ++++---- app/src/main/res/layout/activity_main.xml | 4 ++-- app/src/main/res/layout/activity_media.xml | 4 ++-- app/src/main/res/layout/bottom_actions.xml | 4 ++-- .../main/res/layout/bottom_actions_aspect_ratio.xml | 4 ++-- .../layout/bottom_editor_crop_rotate_actions.xml | 4 ++-- .../res/layout/bottom_editor_primary_actions.xml | 4 ++-- .../res/layout/bottom_set_wallpaper_actions.xml | 4 ++-- app/src/main/res/menu/menu_media.xml | 2 +- 38 files changed, 84 insertions(+), 82 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 70df61ba1..1141d8232 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,12 +43,12 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:4.8.8' + implementation 'com.simplemobiletools:commons:4.9.1' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' - implementation 'com.android.support:multidex:1.0.3' + implementation 'androidx.multidex:multidex:2.0.0' implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15' - implementation 'com.android.support.constraint:constraint-layout:1.1.3' + implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2' implementation 'com.google.android.exoplayer:exoplayer-core:2.8.4' implementation 'com.google.vr:sdk-panowidget:1.170.0' implementation 'org.apache.sanselan:sanselan:0.97-incubator' @@ -57,9 +57,9 @@ dependencies { implementation 'com.caverock:androidsvg-aar:1.3' kapt 'com.github.bumptech.glide:compiler:4.8.0' // keep it here too, not just in Commons, else loading SVGs wont work - kapt "android.arch.persistence.room:compiler:1.1.1" - implementation "android.arch.persistence.room:runtime:1.1.1" - annotationProcessor "android.arch.persistence.room:compiler:1.1.1" + kapt "androidx.room:room-compiler:2.0.0" + implementation "androidx.room:room-runtime:2.0.0" + annotationProcessor "androidx.room:room-compiler:2.0.0" //implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0' implementation 'com.github.tibbi:subsampling-scale-image-view:v3.10.1-fork' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e58d5e3a1..85395342a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -203,7 +203,7 @@ diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt index e1562b1b4..8bb567298 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt @@ -1,6 +1,6 @@ package com.simplemobiletools.gallery -import android.support.multidex.MultiDexApplication +import androidx.multidex.MultiDexApplication import com.github.ajalt.reprint.core.Reprint import com.simplemobiletools.commons.extensions.checkUseEnglish diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index 129655165..2ab28c6c4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -9,7 +9,7 @@ import android.graphics.Point import android.net.Uri import android.os.Bundle import android.provider.MediaStore -import android.support.v7.widget.LinearLayoutManager +import androidx.recyclerview.widget.LinearLayoutManager import android.view.Menu import android.view.MenuItem import android.widget.RelativeLayout diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 0c189d3e8..4590512cb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -7,12 +7,13 @@ import android.net.Uri import android.os.Bundle import android.os.Handler import android.provider.MediaStore -import android.support.v7.widget.GridLayoutManager import android.view.Menu import android.view.MenuItem import android.view.ViewGroup import android.widget.FrameLayout import android.widget.Toast +import androidx.recyclerview.widget.GridLayoutManager +import androidx.recyclerview.widget.RecyclerView import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.dialogs.RadioGroupDialog @@ -475,10 +476,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private fun setupGridLayoutManager() { val layoutManager = directories_grid.layoutManager as MyGridLayoutManager if (config.scrollHorizontally) { - layoutManager.orientation = GridLayoutManager.HORIZONTAL + layoutManager.orientation = RecyclerView.HORIZONTAL directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT) } else { - layoutManager.orientation = GridLayoutManager.VERTICAL + layoutManager.orientation = RecyclerView.VERTICAL directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) } @@ -537,7 +538,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private fun setupListLayoutManager() { val layoutManager = directories_grid.layoutManager as MyGridLayoutManager layoutManager.spanCount = 1 - layoutManager.orientation = GridLayoutManager.VERTICAL + layoutManager.orientation = RecyclerView.VERTICAL directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) mZoomListener = null } @@ -921,7 +922,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { invalidDirs.add(it) } else if (it.path != config.tempFolderPath) { val children = if (it.path.startsWith(OTG_PATH)) getOTGFolderChildrenNames(it.path) else File(it.path).list()?.asList() - val hasMediaFile = children?.any { it.isMediaFile() } ?: false + val hasMediaFile = children?.any { it?.isMediaFile() == true } ?: false if (!hasMediaFile) { invalidDirs.add(it) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index da83fef12..1dd2514b6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -9,13 +9,14 @@ import android.graphics.Bitmap import android.net.Uri import android.os.Bundle import android.os.Handler -import android.support.v4.view.MenuItemCompat -import android.support.v7.widget.GridLayoutManager -import android.support.v7.widget.SearchView import android.view.Menu import android.view.MenuItem import android.view.ViewGroup import android.widget.FrameLayout +import androidx.appcompat.widget.SearchView +import androidx.core.view.MenuItemCompat +import androidx.recyclerview.widget.GridLayoutManager +import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.SimpleTarget @@ -629,10 +630,10 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private fun setupGridLayoutManager() { val layoutManager = media_grid.layoutManager as MyGridLayoutManager if (config.scrollHorizontally) { - layoutManager.orientation = GridLayoutManager.HORIZONTAL + layoutManager.orientation = RecyclerView.HORIZONTAL media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT) } else { - layoutManager.orientation = GridLayoutManager.VERTICAL + layoutManager.orientation = RecyclerView.VERTICAL media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) } @@ -721,7 +722,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private fun setupListLayoutManager() { val layoutManager = media_grid.layoutManager as MyGridLayoutManager layoutManager.spanCount = 1 - layoutManager.orientation = GridLayoutManager.VERTICAL + layoutManager.orientation = RecyclerView.VERTICAL media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) mZoomListener = null } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt index 55ad0345c..5a2cafd4b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -103,7 +103,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList mFragment = if (mIsVideo) VideoFragment() else PhotoFragment() mFragment!!.listener = this mFragment!!.arguments = bundle - supportFragmentManager.beginTransaction().replace(R.id.fragment_placeholder, mFragment).commit() + supportFragmentManager.beginTransaction().replace(R.id.fragment_placeholder, mFragment!!).commit() } if (config.blackBackground) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index bf7140cc5..9a318db83 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -20,7 +20,7 @@ import android.os.Build import android.os.Bundle import android.os.Handler import android.provider.MediaStore -import android.support.v4.view.ViewPager +import androidx.viewpager.widget.ViewPager import android.util.DisplayMetrics import android.view.Menu import android.view.MenuItem diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 1c6f525f0..12b095d18 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -366,7 +366,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList { val paths = ArrayList() activity.getOTGFolderChildren(path)?.forEach { - if (!it.isDirectory && it.name.isMediaFile() && (showHidden || !it.name.startsWith('.'))) { + if (!it.isDirectory && it.name!!.isMediaFile() && (showHidden || !it.name!!.startsWith('.'))) { val relativePath = it.uri.path.substringAfterLast("${activity.config.OTGPartition}:") paths.add("$OTG_PATH$relativePath") } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/FiltersAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/FiltersAdapter.kt index 782412a94..046abda1f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/FiltersAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/FiltersAdapter.kt @@ -2,10 +2,10 @@ package com.simplemobiletools.gallery.adapters import android.content.Context import android.graphics.drawable.Drawable -import android.support.v7.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.recyclerview.widget.RecyclerView import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.interfaces.FilterAdapterListener import com.simplemobiletools.gallery.models.FilterItem diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt index d4f3d0be1..7d0b6fe5c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt @@ -2,10 +2,10 @@ package com.simplemobiletools.gallery.adapters import android.os.Bundle import android.os.Parcelable -import android.support.v4.app.Fragment -import android.support.v4.app.FragmentManager -import android.support.v4.app.FragmentStatePagerAdapter -import android.support.v4.view.PagerAdapter +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentManager +import androidx.fragment.app.FragmentStatePagerAdapter +import androidx.viewpager.widget.PagerAdapter import android.view.ViewGroup import com.simplemobiletools.gallery.activities.ViewPagerActivity import com.simplemobiletools.gallery.fragments.PhotoFragment diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/databases/GalleryDatabase.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/databases/GalleryDatabase.kt index a787d3a4d..0c94fb848 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/databases/GalleryDatabase.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/databases/GalleryDatabase.kt @@ -1,8 +1,8 @@ package com.simplemobiletools.gallery.databases -import android.arch.persistence.room.Database -import android.arch.persistence.room.Room -import android.arch.persistence.room.RoomDatabase +import androidx.room.Database +import androidx.room.Room +import androidx.room.RoomDatabase import android.content.Context import com.simplemobiletools.gallery.interfaces.DirectoryDao import com.simplemobiletools.gallery.interfaces.MediumDao diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeGroupingDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeGroupingDialog.kt index 9c32dcf55..614759165 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeGroupingDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeGroupingDialog.kt @@ -1,8 +1,8 @@ package com.simplemobiletools.gallery.dialogs import android.content.DialogInterface -import android.support.v7.app.AlertDialog import android.view.View +import androidx.appcompat.app.AlertDialog import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.beVisibleIf import com.simplemobiletools.commons.extensions.setupDialogStuff diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt index dc26bb6bf..991d93e40 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt @@ -1,8 +1,8 @@ package com.simplemobiletools.gallery.dialogs import android.content.DialogInterface -import android.support.v7.app.AlertDialog import android.view.View +import androidx.appcompat.app.AlertDialog import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.beVisibleIf import com.simplemobiletools.commons.extensions.setupDialogStuff diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/DeleteWithRememberDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/DeleteWithRememberDialog.kt index f07705e35..ab702845b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/DeleteWithRememberDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/DeleteWithRememberDialog.kt @@ -1,7 +1,7 @@ package com.simplemobiletools.gallery.dialogs import android.app.Activity -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.gallery.R import kotlinx.android.synthetic.main.dialog_delete_with_remember.view.* diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt index 0721683e0..6cb546a04 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt @@ -1,6 +1,6 @@ package com.simplemobiletools.gallery.dialogs -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import android.view.ViewGroup import android.widget.RadioButton import android.widget.RadioGroup diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt index 18b404505..4d5387c58 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt @@ -1,6 +1,6 @@ package com.simplemobiletools.gallery.dialogs -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.gallery.R diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageBottomActionsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageBottomActionsDialog.kt index 0bd797c54..42b99ee2c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageBottomActionsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageBottomActionsDialog.kt @@ -1,6 +1,6 @@ package com.simplemobiletools.gallery.dialogs -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.gallery.R diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageExtendedDetailsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageExtendedDetailsDialog.kt index 62e50b612..8ee6eb1d8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageExtendedDetailsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageExtendedDetailsDialog.kt @@ -1,6 +1,6 @@ package com.simplemobiletools.gallery.dialogs -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.gallery.R diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt index 653041574..09482f5aa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt @@ -1,7 +1,7 @@ package com.simplemobiletools.gallery.dialogs -import android.support.v7.app.AlertDialog -import android.support.v7.widget.GridLayoutManager +import androidx.appcompat.app.AlertDialog +import androidx.recyclerview.widget.RecyclerView import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.extensions.beGoneIf @@ -27,14 +27,14 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri init { (view.directories_grid.layoutManager as MyGridLayoutManager).apply { - orientation = if (activity.config.scrollHorizontally && isGridViewType) GridLayoutManager.HORIZONTAL else GridLayoutManager.VERTICAL + orientation = if (activity.config.scrollHorizontally && isGridViewType) RecyclerView.HORIZONTAL else RecyclerView.VERTICAL spanCount = if (isGridViewType) activity.config.dirColumnCnt else 1 } dialog = AlertDialog.Builder(activity) .setPositiveButton(R.string.ok, null) .setNegativeButton(R.string.cancel, null) - .setNeutralButton(R.string.other_folder, { dialogInterface, i -> showOtherFolder() }) + .setNeutralButton(R.string.other_folder) { dialogInterface, i -> showOtherFolder() } .create().apply { activity.setupDialogStuff(view, this, R.string.select_destination) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt index 1ccef0923..056603a3a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt @@ -1,7 +1,7 @@ package com.simplemobiletools.gallery.dialogs -import android.support.v7.app.AlertDialog -import android.support.v7.widget.GridLayoutManager +import androidx.appcompat.app.AlertDialog +import androidx.recyclerview.widget.RecyclerView import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.beGoneIf import com.simplemobiletools.commons.extensions.beVisibleIf @@ -26,7 +26,7 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c init { (view.media_grid.layoutManager as MyGridLayoutManager).apply { - orientation = if (activity.config.scrollHorizontally && isGridViewType) GridLayoutManager.HORIZONTAL else GridLayoutManager.VERTICAL + orientation = if (activity.config.scrollHorizontally && isGridViewType) RecyclerView.HORIZONTAL else RecyclerView.VERTICAL spanCount = if (isGridViewType) activity.config.mediaColumnCnt else 1 } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt index 3489dd060..378d8a524 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt @@ -1,7 +1,7 @@ package com.simplemobiletools.gallery.dialogs import android.graphics.Point -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import android.text.Editable import android.text.TextWatcher import android.widget.EditText diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt index 3199ff9d7..9bb1f2ea9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt @@ -1,6 +1,6 @@ package com.simplemobiletools.gallery.dialogs -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.FilePickerDialog diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt index 58a4935dd..16e38f058 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt @@ -1,6 +1,6 @@ package com.simplemobiletools.gallery.dialogs -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import android.view.View import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.hideKeyboard diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt index b7cf04a5a..8993ebce3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -3,7 +3,7 @@ package com.simplemobiletools.gallery.extensions import android.app.Activity import android.content.Intent import android.provider.MediaStore -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import android.view.View import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.dialogs.ConfirmationDialog diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt index d1c9a4253..bb37b58e2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt @@ -1,6 +1,6 @@ package com.simplemobiletools.gallery.fragments -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.OTG_PATH import com.simplemobiletools.gallery.extensions.config diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/DirectoryDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/DirectoryDao.kt index 6ca318f4d..ce55fa3f4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/DirectoryDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/DirectoryDao.kt @@ -1,9 +1,9 @@ package com.simplemobiletools.gallery.interfaces -import android.arch.persistence.room.Dao -import android.arch.persistence.room.Insert -import android.arch.persistence.room.OnConflictStrategy.REPLACE -import android.arch.persistence.room.Query +import androidx.room.Dao +import androidx.room.Insert +import androidx.room.OnConflictStrategy.REPLACE +import androidx.room.Query import com.simplemobiletools.gallery.helpers.RECYCLE_BIN import com.simplemobiletools.gallery.models.Directory diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/MediumDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/MediumDao.kt index ac653ccd4..ab8f76c48 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/MediumDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/MediumDao.kt @@ -1,10 +1,10 @@ package com.simplemobiletools.gallery.interfaces -import android.arch.persistence.room.Dao -import android.arch.persistence.room.Delete -import android.arch.persistence.room.Insert -import android.arch.persistence.room.OnConflictStrategy.REPLACE -import android.arch.persistence.room.Query +import androidx.room.Dao +import androidx.room.Delete +import androidx.room.Insert +import androidx.room.OnConflictStrategy.REPLACE +import androidx.room.Query import com.simplemobiletools.gallery.models.Medium @Dao diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt index 3c748c50e..b6332d6f6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt @@ -1,9 +1,9 @@ package com.simplemobiletools.gallery.models -import android.arch.persistence.room.ColumnInfo -import android.arch.persistence.room.Entity -import android.arch.persistence.room.Index -import android.arch.persistence.room.PrimaryKey +import androidx.room.ColumnInfo +import androidx.room.Entity +import androidx.room.Index +import androidx.room.PrimaryKey import com.simplemobiletools.commons.extensions.formatDate import com.simplemobiletools.commons.extensions.formatSize import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt index 14d804178..aea443b78 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt @@ -1,9 +1,9 @@ package com.simplemobiletools.gallery.models -import android.arch.persistence.room.ColumnInfo -import android.arch.persistence.room.Entity -import android.arch.persistence.room.Index -import android.arch.persistence.room.PrimaryKey +import androidx.room.ColumnInfo +import androidx.room.Entity +import androidx.room.Index +import androidx.room.PrimaryKey import com.simplemobiletools.commons.extensions.formatDate import com.simplemobiletools.commons.extensions.formatSize import com.simplemobiletools.commons.extensions.getFilenameExtension diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 5946f7e31..5fda2a812 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,5 @@ - - + diff --git a/app/src/main/res/layout/activity_media.xml b/app/src/main/res/layout/activity_media.xml index 629861b53..fe95394c1 100644 --- a/app/src/main/res/layout/activity_media.xml +++ b/app/src/main/res/layout/activity_media.xml @@ -1,5 +1,5 @@ - - + diff --git a/app/src/main/res/layout/bottom_actions.xml b/app/src/main/res/layout/bottom_actions.xml index 0944d58ae..090a30d78 100644 --- a/app/src/main/res/layout/bottom_actions.xml +++ b/app/src/main/res/layout/bottom_actions.xml @@ -1,5 +1,5 @@ - - + diff --git a/app/src/main/res/layout/bottom_actions_aspect_ratio.xml b/app/src/main/res/layout/bottom_actions_aspect_ratio.xml index e2ccf6e00..4c3befbd5 100644 --- a/app/src/main/res/layout/bottom_actions_aspect_ratio.xml +++ b/app/src/main/res/layout/bottom_actions_aspect_ratio.xml @@ -1,5 +1,5 @@ - - + diff --git a/app/src/main/res/layout/bottom_editor_crop_rotate_actions.xml b/app/src/main/res/layout/bottom_editor_crop_rotate_actions.xml index da48247b9..83a59fe49 100644 --- a/app/src/main/res/layout/bottom_editor_crop_rotate_actions.xml +++ b/app/src/main/res/layout/bottom_editor_crop_rotate_actions.xml @@ -1,5 +1,5 @@ - - + diff --git a/app/src/main/res/layout/bottom_editor_primary_actions.xml b/app/src/main/res/layout/bottom_editor_primary_actions.xml index 2acfec635..282602483 100644 --- a/app/src/main/res/layout/bottom_editor_primary_actions.xml +++ b/app/src/main/res/layout/bottom_editor_primary_actions.xml @@ -1,5 +1,5 @@ - - + diff --git a/app/src/main/res/layout/bottom_set_wallpaper_actions.xml b/app/src/main/res/layout/bottom_set_wallpaper_actions.xml index 5f2576b73..44830df1b 100644 --- a/app/src/main/res/layout/bottom_set_wallpaper_actions.xml +++ b/app/src/main/res/layout/bottom_set_wallpaper_actions.xml @@ -1,5 +1,5 @@ - - + diff --git a/app/src/main/res/menu/menu_media.xml b/app/src/main/res/menu/menu_media.xml index b861865ce..fbae61223 100644 --- a/app/src/main/res/menu/menu_media.xml +++ b/app/src/main/res/menu/menu_media.xml @@ -5,7 +5,7 @@ android:id="@+id/search" android:icon="@drawable/ic_search" android:title="@string/search" - app:actionViewClass="android.support.v7.widget.SearchView" + app:actionViewClass="androidx.appcompat.widget.SearchView" app:showAsAction="collapseActionView|ifRoom"/>