From 4c25e5f7c8009a44a089aa078d26adf458f96724 Mon Sep 17 00:00:00 2001 From: Sherzod Nosirov Date: Tue, 17 Oct 2023 15:11:40 +0200 Subject: [PATCH] Gradle version upgrade to 7.4.2 to support new version of Spotless. Kotlin and Spotless upgrades. Code style refactoring (automated by Spotless) --- .../lovoo/android/pickpic/ExampleActivity.kt | 2 +- build.gradle | 6 +- gradle/wrapper/gradle-wrapper.properties | 2 +- .../android/pickapp/adapter/PickPicAdapter.kt | 2 +- .../pickapp/adapter/SelectionAdapter.kt | 2 +- .../android/pickapp/factory/GlideEngine.kt | 9 +- .../android/pickapp/model/PickPicConfig.kt | 4 +- .../lovoo/android/pickapp/model/PickType.kt | 2 +- .../com/lovoo/android/pickapp/model/Picker.kt | 10 +-- .../android/pickapp/view/PickPicActivity.kt | 20 ++--- .../com/lovoo/android/pickapp/view/Preview.kt | 8 +- .../android/pickapp/view/PreviewFragment.kt | 2 +- .../android/pickapp/view/Selectionbar.kt | 6 +- .../pickcam/view/PickPicCaptureFragment.kt | 16 +++- .../pickcam/worker/CaptureResultWorker.kt | 6 +- .../pickcore/contract/CameraDestination.kt | 1 - .../android/pickcore/loader/Collector.kt | 2 +- .../android/pickcore/loader/GalleryLoader.kt | 85 +++++++++++-------- .../android/pickcore/loader/PictureLoader.kt | 8 +- .../lovoo/android/pickcore/model/Converter.kt | 8 +- .../lovoo/android/pickcore/model/Gallery.kt | 4 +- .../android/pickcore/model/GalleryLib.kt | 2 +- .../lovoo/android/pickcore/model/Picture.kt | 4 +- .../android/pickcore/model/PictureLib.kt | 2 +- .../pickcore/util/ContextExtensions.kt | 8 +- .../lovoo/android/pickfacebook/Facebook.kt | 9 +- .../pickfacebook/adapter/FbGalleryAdapter.kt | 6 +- .../pickfacebook/adapter/FbPictureAdapter.kt | 6 +- .../android/pickfacebook/model/Converter.kt | 18 ++-- .../android/pickfacebook/model/FbPicture.kt | 4 +- .../presenter/FbGalleryPresenterImpl.kt | 2 +- .../pickfacebook/view/FbPictureFragment.kt | 4 +- .../android/pickui/adapter/GalleryAdapter.kt | 6 +- .../android/pickui/adapter/PictureAdapter.kt | 6 +- .../pickui/adapter/PopUpGalleryAdapter.kt | 10 ++- .../android/pickui/adapter/ViewHolder.kt | 4 +- .../android/pickui/view/GalleryFragment.kt | 4 +- .../android/pickui/view/PictureDecoration.kt | 2 +- .../android/pickui/view/PictureFragment.kt | 4 +- spotless.gradle | 4 +- 40 files changed, 167 insertions(+), 143 deletions(-) diff --git a/app/src/main/kotlin/com/lovoo/android/pickpic/ExampleActivity.kt b/app/src/main/kotlin/com/lovoo/android/pickpic/ExampleActivity.kt index 3e07999..4d1e185 100644 --- a/app/src/main/kotlin/com/lovoo/android/pickpic/ExampleActivity.kt +++ b/app/src/main/kotlin/com/lovoo/android/pickpic/ExampleActivity.kt @@ -45,7 +45,7 @@ class ExampleActivity : AppCompatActivity() { maxCount = 10, sendIcon = R.drawable.ic_send, header = getString(R.string.pickpic_actionbar_header), - title = getString(R.string.pickpic_title) + title = getString(R.string.pickpic_title), ) // pass the config to PickPic PickPicActivity.applyConfig(it, config) diff --git a/build.gradle b/build.gradle index d66dbd8..11eca7d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.4.10' + ext.kotlin_version = '1.6.21' ext.multidex_version = "2.0.1" ext.legacy_v4_version = "1.0.0" @@ -53,10 +53,10 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:4.2.2' + classpath 'com.android.tools.build:gradle:7.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'org.jetbrains.dokka:dokka-gradle-plugin:0.9.18' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:3.27.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.22.0' classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.21.0' // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 43f8bd0..0b7f05c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/adapter/PickPicAdapter.kt b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/adapter/PickPicAdapter.kt index c342f99..e0e769a 100644 --- a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/adapter/PickPicAdapter.kt +++ b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/adapter/PickPicAdapter.kt @@ -34,7 +34,7 @@ import com.lovoo.android.pickui.view.GalleryFragment class PickPicAdapter( private val context: Context, manager: FragmentManager, - private val dependencies: PickDependencies + private val dependencies: PickDependencies, ) : FragmentStatePagerAdapter(manager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) { override fun getItem(position: Int) = buildFragment(getType(position)) diff --git a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/adapter/SelectionAdapter.kt b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/adapter/SelectionAdapter.kt index f9a9036..fa211c8 100644 --- a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/adapter/SelectionAdapter.kt +++ b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/adapter/SelectionAdapter.kt @@ -109,7 +109,7 @@ class SelectionAdapter( class ViewHolder( view: View, - private val imageEngine: ImageEngine + private val imageEngine: ImageEngine, ) : RecyclerView.ViewHolder(view) { private val size = view.context.resources.getDimensionPixelSize(R.dimen.pickpic_thumbnail_size) private val corner = view.context.resources.getDimensionPixelSize(R.dimen.pickpic_thumbnail_corner_size) diff --git a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/factory/GlideEngine.kt b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/factory/GlideEngine.kt index a1fd9ae..5bcc756 100644 --- a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/factory/GlideEngine.kt +++ b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/factory/GlideEngine.kt @@ -70,9 +70,12 @@ class GlideEngine : ImageEngine { RequestOptions() .override(width, height) .also { - if (corner > 0) it.transform(CenterCrop(), RoundedCorners(corner)) - else it.centerCrop() - } + if (corner > 0) { + it.transform(CenterCrop(), RoundedCorners(corner)) + } else { + it.centerCrop() + } + }, ) .apply { if (errorRes != 0) { diff --git a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/model/PickPicConfig.kt b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/model/PickPicConfig.kt index e5b117c..4473092 100644 --- a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/model/PickPicConfig.kt +++ b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/model/PickPicConfig.kt @@ -43,7 +43,7 @@ data class PickPicConfig( val sendText: String? = null, @DrawableRes val sendIcon: Int? = null, val header: String? = null, - val faqUrl: String? = null + val faqUrl: String? = null, ) : Parcelable { constructor(parcel: Parcel) : this( @@ -54,7 +54,7 @@ data class PickPicConfig( parcel.readString(), parcel.readValue(Int::class.java.classLoader) as? Int, parcel.readString(), - parcel.readString() + parcel.readString(), ) override fun writeToParcel(parcel: Parcel, flags: Int) { diff --git a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/model/PickType.kt b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/model/PickType.kt index 3bbd188..3088b62 100644 --- a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/model/PickType.kt +++ b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/model/PickType.kt @@ -21,5 +21,5 @@ package com.lovoo.android.pickapp.model */ enum class PickType { GALLERY, - FACEBOOK + FACEBOOK, } diff --git a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/model/Picker.kt b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/model/Picker.kt index 5cc7c67..2aea0a9 100644 --- a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/model/Picker.kt +++ b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/model/Picker.kt @@ -30,7 +30,7 @@ import io.reactivex.subjects.BehaviorSubject * @param config the [PickConfig] to determine the limits */ class Picker( - val config: PickConfig + val config: PickConfig, ) { /** @@ -136,7 +136,7 @@ class Picker( */ data class PickConfig( val minCount: Int = 1, - val maxCount: Int = 1 + val maxCount: Int = 1, ) sealed class State { @@ -148,7 +148,7 @@ class Picker( */ data class Select( val position: Int, - val uri: Uri? + val uri: Uri?, ) : State() /** @@ -159,7 +159,7 @@ class Picker( */ data class Add( val uri: Uri, - val gallery: Gallery + val gallery: Gallery, ) : State() /** @@ -170,7 +170,7 @@ class Picker( */ data class Remove( val uri: Uri, - val gallery: Gallery + val gallery: Gallery, ) : State() } } diff --git a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/PickPicActivity.kt b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/PickPicActivity.kt index 0901dd6..2fd3c74 100644 --- a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/PickPicActivity.kt +++ b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/PickPicActivity.kt @@ -85,7 +85,7 @@ class PickPicActivity : AppCompatActivity(), SelectionHolder, CameraEngine, Capt maxCount = 10, sendText = "DONE", title = getString(R.string.pickpic_title), - header = getString(R.string.pickpic_actionbar_header) + header = getString(R.string.pickpic_actionbar_header), ) config = intent?.getParcelableExtra(INTENT_IN_CONFIG) ?: default @@ -140,8 +140,9 @@ class PickPicActivity : AppCompatActivity(), SelectionHolder, CameraEngine, Capt try { val uris = savedInstanceState.getParcelableArray(BUNDLE_URIS)?.map { it as Uri }?.toTypedArray() val galleries = savedInstanceState.getParcelableArray(BUNDLE_GALLERIES)?.map { it as Gallery }?.toTypedArray() - if (uris != null && galleries != null) + if (uris != null && galleries != null) { picker.toggle(uris, galleries) + } } catch (e: Exception) { e.printStackTrace() } @@ -219,8 +220,8 @@ class PickPicActivity : AppCompatActivity(), SelectionHolder, CameraEngine, Capt is Picker.State.Select -> selectedUri = state.uri } }, - { error -> error.printStackTrace() } - ) + { error -> error.printStackTrace() }, + ), ) } @@ -233,12 +234,12 @@ class PickPicActivity : AppCompatActivity(), SelectionHolder, CameraEngine, Capt { finishSelection() }, - AUTO_FINISH_DELAY + AUTO_FINISH_DELAY, ) } }, - { /* no-op */ } - ) + { /* no-op */ }, + ), ) } @@ -298,7 +299,7 @@ class PickPicActivity : AppCompatActivity(), SelectionHolder, CameraEngine, Capt this.paddingStart, this.paddingTop, this.paddingEnd, - resources.getDimensionPixelOffset(R.dimen.pickpic_actionbar_headline_margin) + resources.getDimensionPixelOffset(R.dimen.pickpic_actionbar_headline_margin), ) } (toolbar.layoutParams as CollapsingToolbarLayout.LayoutParams).collapseMode = @@ -314,9 +315,8 @@ class PickPicActivity : AppCompatActivity(), SelectionHolder, CameraEngine, Capt selectionbar = Selectionbar( picker, binding.selectionBar, - arrayOf(binding.fragmentPager, binding.previewPager) + arrayOf(binding.fragmentPager, binding.previewPager), ).apply { - setButtonText(this@PickPicActivity.config.sendText) setButtonIcon(this@PickPicActivity.config.sendIcon) setButtonOnClick { finishSelection() } diff --git a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/Preview.kt b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/Preview.kt index 994d25a..6617981 100644 --- a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/Preview.kt +++ b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/Preview.kt @@ -35,7 +35,7 @@ import io.reactivex.disposables.CompositeDisposable class Preview( val pager: ViewPager, val fragmentManager: FragmentManager, - val picker: Picker + val picker: Picker, ) { private val subscriptions = CompositeDisposable() @@ -77,8 +77,8 @@ class Preview( } } }, - { error -> error.printStackTrace() } - ) + { error -> error.printStackTrace() }, + ), ) } @@ -87,7 +87,7 @@ class Preview( it.adapter = object : FragmentStatePagerAdapter(fragmentManager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) { override fun getItem(position: Int) = PreviewFragment.createInstance( position, - picker.getPickedUris().getOrNull(position) + picker.getPickedUris().getOrNull(position), ) override fun getCount() = picker.map.size diff --git a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/PreviewFragment.kt b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/PreviewFragment.kt index a9d327d..7d9a1ab 100644 --- a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/PreviewFragment.kt +++ b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/PreviewFragment.kt @@ -64,7 +64,7 @@ class PreviewFragment : Fragment() { it.measuredHeight, uri, it, - 0 + 0, ) } } diff --git a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/Selectionbar.kt b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/Selectionbar.kt index 87722cd..eb3fd74 100644 --- a/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/Selectionbar.kt +++ b/pickapp/src/main/kotlin/com/lovoo/android/pickapp/view/Selectionbar.kt @@ -49,7 +49,7 @@ import io.reactivex.disposables.CompositeDisposable class Selectionbar( private val picker: Picker, private val binding: PickpicLayoutSelectionbarBinding, - private val dependingViews: Array + private val dependingViews: Array, ) { private val adapter = SelectionAdapter(picker.config.maxCount) @@ -201,8 +201,8 @@ class Selectionbar( } } }, - { error -> error.printStackTrace() } - ) + { error -> error.printStackTrace() }, + ), ) } diff --git a/pickcam/src/main/kotlin/com/lovoo/android/pickcam/view/PickPicCaptureFragment.kt b/pickcam/src/main/kotlin/com/lovoo/android/pickcam/view/PickPicCaptureFragment.kt index 4d7bbdf..607d629 100644 --- a/pickcam/src/main/kotlin/com/lovoo/android/pickcam/view/PickPicCaptureFragment.kt +++ b/pickcam/src/main/kotlin/com/lovoo/android/pickcam/view/PickPicCaptureFragment.kt @@ -16,12 +16,20 @@ package com.lovoo.android.pickcam.view import android.app.Activity -import android.content.* +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import android.content.IntentFilter import android.content.pm.PackageManager -import android.os.* -import android.view.* +import android.os.Build +import android.os.Bundle +import android.os.Environment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup import androidx.core.content.ContextCompat -import androidx.fragment.app.* +import androidx.fragment.app.DialogFragment +import androidx.fragment.app.FragmentManager import com.lovoo.android.pickcam.R import com.lovoo.android.pickcam.worker.CaptureResultWorker import com.lovoo.android.pickcore.contract.CameraDestination diff --git a/pickcam/src/main/kotlin/com/lovoo/android/pickcam/worker/CaptureResultWorker.kt b/pickcam/src/main/kotlin/com/lovoo/android/pickcam/worker/CaptureResultWorker.kt index f80673c..1feaa00 100644 --- a/pickcam/src/main/kotlin/com/lovoo/android/pickcam/worker/CaptureResultWorker.kt +++ b/pickcam/src/main/kotlin/com/lovoo/android/pickcam/worker/CaptureResultWorker.kt @@ -48,7 +48,7 @@ import java.io.File */ class CaptureResultWorker( private val context: Context, - params: WorkerParameters + params: WorkerParameters, ) : RxWorker(context, params) { private var inputFile: File = File(params.inputData.getString(INPUT_FILE)) @@ -72,7 +72,7 @@ class CaptureResultWorker( // LiveData holds to long the old result so we have to forward the result as broadcast context.sendBroadcast(Intent(INTENT_ACTION_ON_RESULT).putExtra(OUTPUT_URI, uri)) emitter.onSuccess(Result.success()) - } + }, ) } } @@ -99,7 +99,7 @@ class CaptureResultWorker( fun start(context: Context, destination: CameraDestination, name: String = "CaptureResultWorker") { val data = workDataOf( INPUT_IS_PUBLIC to (destination !is PrivateDirectory), - INPUT_FILE to (destination.file?.path ?: "") + INPUT_FILE to (destination.file?.path ?: ""), ) val request = OneTimeWorkRequest.Builder(CaptureResultWorker::class.java) diff --git a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/contract/CameraDestination.kt b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/contract/CameraDestination.kt index 15d0f43..eefebe6 100644 --- a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/contract/CameraDestination.kt +++ b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/contract/CameraDestination.kt @@ -55,7 +55,6 @@ fun CameraDestination.getUri(context: Context): Uri? = when { * @param fileName optional complete filename or if not set JPEG_.jpg */ fun CameraDestination.createTempFile(fileName: String = ""): File? { - if (Environment.MEDIA_MOUNTED != EnvironmentCompat.getStorageState(directory)) { // the storage state is broken return null diff --git a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/loader/Collector.kt b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/loader/Collector.kt index 49144e0..0b96c3a 100644 --- a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/loader/Collector.kt +++ b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/loader/Collector.kt @@ -34,7 +34,7 @@ import androidx.loader.content.Loader class Collector( private val manager: LoaderManager, private val loader: Loader, - private val id: Int + private val id: Int, ) : LoaderManager.LoaderCallbacks { /** diff --git a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/loader/GalleryLoader.kt b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/loader/GalleryLoader.kt index 73b1642..bd6cd7f 100644 --- a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/loader/GalleryLoader.kt +++ b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/loader/GalleryLoader.kt @@ -37,29 +37,33 @@ import com.lovoo.android.pickcore.util.isMinimumQ * @see GalleryLoader.convert */ class GalleryLoader( - context: Context + context: Context, ) : CursorLoader( context, query, projection, selection, selectArguments, - "${MediaStore.Images.Media.DISPLAY_NAME} ASC" + "${MediaStore.Images.Media.DISPLAY_NAME} ASC", ) { - private val columns = if (isMinimumQ()) arrayOf( - MediaStore.Files.FileColumns._ID, - COLUMN_NAME_ID, - COLUMN_NAME_DISPLAY_NAME, - MediaStore.Images.Media._ID, - COLUMN_NAME_COUNT - ) else arrayOf( - MediaStore.Files.FileColumns._ID, - COLUMN_NAME_ID, - COLUMN_NAME_DISPLAY_NAME, - MediaStore.MediaColumns.DATA, - COLUMN_NAME_COUNT - ) + private val columns = if (isMinimumQ()) { + arrayOf( + MediaStore.Files.FileColumns._ID, + COLUMN_NAME_ID, + COLUMN_NAME_DISPLAY_NAME, + MediaStore.Images.Media._ID, + COLUMN_NAME_COUNT, + ) + } else { + arrayOf( + MediaStore.Files.FileColumns._ID, + COLUMN_NAME_ID, + COLUMN_NAME_DISPLAY_NAME, + MediaStore.MediaColumns.DATA, + COLUMN_NAME_COUNT, + ) + } override fun loadInBackground(): Cursor { return try { @@ -130,8 +134,8 @@ class GalleryLoader( bucketId.toString(), bucketDisplayName, uri.toString(), - count.toString() - ) + count.toString(), + ), ) done.add(bucketId) @@ -146,8 +150,8 @@ class GalleryLoader( -1, Constants.All_FOLDER_NAME, allAlbumCoverUri?.toString(), - totalCount - ) + totalCount, + ), ) return MergeCursor(arrayOf(allEntry, otherAlbums)) @@ -159,19 +163,22 @@ class GalleryLoader( private const val COLUMN_NAME_COUNT = "count" private val query = MediaStore.Files.getContentUri("external") - private val projection = if (isMinimumQ()) arrayOf( - MediaStore.Files.FileColumns._ID, - COLUMN_NAME_ID, - COLUMN_NAME_DISPLAY_NAME, - MediaStore.Images.Media._ID - ) else + private val projection = if (isMinimumQ()) { + arrayOf( + MediaStore.Files.FileColumns._ID, + COLUMN_NAME_ID, + COLUMN_NAME_DISPLAY_NAME, + MediaStore.Images.Media._ID, + ) + } else { arrayOf( MediaStore.Files.FileColumns._ID, COLUMN_NAME_ID, COLUMN_NAME_DISPLAY_NAME, MediaStore.MediaColumns.DATA, - "COUNT(*) AS $COLUMN_NAME_COUNT" + "COUNT(*) AS $COLUMN_NAME_COUNT", ) + } private val group = if (isMinimumQ()) "" else ") GROUP BY ($COLUMN_NAME_ID" private val selection = "${MediaStore.Files.FileColumns.MEDIA_TYPE}=? AND ${MediaStore.MediaColumns.SIZE}>0$group" private val selectArguments = arrayOf(MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE.toString()) @@ -190,17 +197,21 @@ class GalleryLoader( * @param cursor the [Cursor] * @return the [GalleryLib] object with the data from the [Cursor] */ - fun convert(cursor: Cursor) = if (isMinimumQ()) GalleryLib( - cursor.getString(cursor.getColumnIndex(COLUMN_NAME_ID)), - getUri(cursor)?.toString(), - cursor.getString(cursor.getColumnIndex(COLUMN_NAME_DISPLAY_NAME)), - cursor.getLong(cursor.getColumnIndex(COLUMN_NAME_COUNT)) - ) else GalleryLib( - cursor.getString(cursor.getColumnIndex(COLUMN_NAME_ID)), - cursor.getString(cursor.getColumnIndex(MediaStore.MediaColumns.DATA)), - cursor.getString(cursor.getColumnIndex(COLUMN_NAME_DISPLAY_NAME)), - cursor.getLong(cursor.getColumnIndex(COLUMN_NAME_COUNT)) - ) + fun convert(cursor: Cursor) = if (isMinimumQ()) { + GalleryLib( + cursor.getString(cursor.getColumnIndex(COLUMN_NAME_ID)), + getUri(cursor)?.toString(), + cursor.getString(cursor.getColumnIndex(COLUMN_NAME_DISPLAY_NAME)), + cursor.getLong(cursor.getColumnIndex(COLUMN_NAME_COUNT)), + ) + } else { + GalleryLib( + cursor.getString(cursor.getColumnIndex(COLUMN_NAME_ID)), + cursor.getString(cursor.getColumnIndex(MediaStore.MediaColumns.DATA)), + cursor.getString(cursor.getColumnIndex(COLUMN_NAME_DISPLAY_NAME)), + cursor.getLong(cursor.getColumnIndex(COLUMN_NAME_COUNT)), + ) + } private fun getUri(cursor: Cursor): Uri? { val id = cursor.getLong(cursor.getColumnIndex(MediaStore.Files.FileColumns._ID)) diff --git a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/loader/PictureLoader.kt b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/loader/PictureLoader.kt index d1f17ef..1cdaf2e 100644 --- a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/loader/PictureLoader.kt +++ b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/loader/PictureLoader.kt @@ -39,14 +39,14 @@ import com.lovoo.android.pickcore.model.PictureLib */ class PictureLoader( context: Context, - private val gallery: GalleryLib + private val gallery: GalleryLib, ) : CursorLoader( context, query, projection, getSelection(gallery), getSelectionArgs(gallery), - "${MediaStore.Images.Media.DATE_ADDED} DESC" + "${MediaStore.Images.Media.DATE_ADDED} DESC", ) { private val cameraEngine: CameraEngine @@ -82,7 +82,7 @@ class PictureLoader( MediaStore.Files.FileColumns._ID, MediaStore.MediaColumns.DISPLAY_NAME, MediaStore.MediaColumns.MIME_TYPE, - MediaStore.MediaColumns.SIZE + MediaStore.MediaColumns.SIZE, ) private fun getSelection(gallery: GalleryLib) = when (gallery.name) { @@ -113,7 +113,7 @@ class PictureLoader( fun convert(cursor: Cursor) = PictureLib( cursor.getLong(cursor.getColumnIndex(MediaStore.Files.FileColumns._ID)), cursor.getString(cursor.getColumnIndex(MediaStore.MediaColumns.MIME_TYPE)), - cursor.getLong(cursor.getColumnIndex(MediaStore.MediaColumns.SIZE)) + cursor.getLong(cursor.getColumnIndex(MediaStore.MediaColumns.SIZE)), ) } } diff --git a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/Converter.kt b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/Converter.kt index c3a1eec..7dfef58 100644 --- a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/Converter.kt +++ b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/Converter.kt @@ -21,7 +21,7 @@ package com.lovoo.android.pickcore.model fun Picture.convertToLib() = PictureLib( id, mimeType, - size + size, ) /** @@ -30,7 +30,7 @@ fun Picture.convertToLib() = PictureLib( fun PictureLib.convertToUi() = Picture( id, mimeType ?: "", - size ?: 0L + size ?: 0L, ) /** @@ -40,7 +40,7 @@ fun Gallery.convertToLib() = GalleryLib( id, coverPath, name, - count + count, ) /** @@ -50,5 +50,5 @@ fun GalleryLib.convertToUi() = Gallery( id ?: "", coverPath ?: "", name ?: "", - count ?: 0L + count ?: 0L, ) diff --git a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/Gallery.kt b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/Gallery.kt index 195a864..d5275c3 100644 --- a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/Gallery.kt +++ b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/Gallery.kt @@ -30,14 +30,14 @@ data class Gallery( val id: String, val coverPath: String, val name: String, - val count: Long + val count: Long, ) : Parcelable { constructor(parcel: Parcel) : this( parcel.readString() ?: "", parcel.readString() ?: "", parcel.readString() ?: "", - parcel.readLong() + parcel.readLong(), ) override fun writeToParcel(parcel: Parcel, flags: Int) { diff --git a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/GalleryLib.kt b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/GalleryLib.kt index dfdaf79..7c588d2 100644 --- a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/GalleryLib.kt +++ b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/GalleryLib.kt @@ -27,5 +27,5 @@ data class GalleryLib( val id: String? = "", val coverPath: String? = "", val name: String? = "", - val count: Long? = 0L + val count: Long? = 0L, ) diff --git a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/Picture.kt b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/Picture.kt index 269d198..42d5ab0 100644 --- a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/Picture.kt +++ b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/Picture.kt @@ -31,13 +31,13 @@ import android.provider.MediaStore data class Picture( val id: Long, val mimeType: String, - val size: Long + val size: Long, ) : Parcelable { constructor(parcel: Parcel) : this( parcel.readLong(), parcel.readString() ?: "", - parcel.readLong() + parcel.readLong(), ) override fun writeToParcel(parcel: Parcel, flags: Int) { diff --git a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/PictureLib.kt b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/PictureLib.kt index ca4a048..f712323 100644 --- a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/PictureLib.kt +++ b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/model/PictureLib.kt @@ -25,5 +25,5 @@ package com.lovoo.android.pickcore.model data class PictureLib( val id: Long, val mimeType: String? = "", - val size: Long? = 0L + val size: Long? = 0L, ) diff --git a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/util/ContextExtensions.kt b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/util/ContextExtensions.kt index 44bfd53..d9b900a 100644 --- a/pickcore/src/main/kotlin/com/lovoo/android/pickcore/util/ContextExtensions.kt +++ b/pickcore/src/main/kotlin/com/lovoo/android/pickcore/util/ContextExtensions.kt @@ -16,7 +16,9 @@ package com.lovoo.android.pickcore.util import android.annotation.SuppressLint -import android.content.* +import android.content.BroadcastReceiver +import android.content.Context +import android.content.IntentFilter import android.os.Build fun isMinimumQ() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q @@ -33,7 +35,7 @@ fun isMinimumR() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.R fun Context.registerReceiverSafely( receiver: BroadcastReceiver, filter: IntentFilter, - isExported: Boolean = false + isExported: Boolean = false, ) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { val exportedFlag = if (isExported) Context.RECEIVER_EXPORTED else Context.RECEIVER_NOT_EXPORTED @@ -41,4 +43,4 @@ fun Context.registerReceiverSafely( } else { registerReceiver(receiver, filter) } -} \ No newline at end of file +} diff --git a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/Facebook.kt b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/Facebook.kt index 92dbdbc..7f16e16 100644 --- a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/Facebook.kt +++ b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/Facebook.kt @@ -54,8 +54,8 @@ class Facebook { User( currentProfile.id, currentProfile.name, - currentProfile.getProfilePictureUri(1000, 1000).path ?: "" - ) + currentProfile.getProfilePictureUri(1000, 1000).path ?: "", + ), ) } } @@ -86,9 +86,8 @@ class Facebook { fun requestAccessToken( fragment: Fragment, permissions: List = listOf("public_profile"), - callback: FacebookCallback? + callback: FacebookCallback?, ) { - LoginManager.getInstance().apply { registerCallback(callbackManager, callback) }.logInWithReadPermissions(fragment, permissions) @@ -222,6 +221,6 @@ class Facebook { data class User( val id: String, val name: String, - val picture: String + val picture: String, ) } diff --git a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/adapter/FbGalleryAdapter.kt b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/adapter/FbGalleryAdapter.kt index c3050a4..3221570 100644 --- a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/adapter/FbGalleryAdapter.kt +++ b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/adapter/FbGalleryAdapter.kt @@ -36,7 +36,7 @@ import com.lovoo.android.pickfacebook.R */ class FbGalleryAdapter( context: Context, - private val onClick: (View, Gallery) -> Unit + private val onClick: (View, Gallery) -> Unit, ) : RecyclerView.Adapter() { private val inflater = LayoutInflater.from(context) @@ -77,7 +77,7 @@ class FbGalleryAdapter( class ViewHolder( view: View, private val engine: ImageEngine, - private val onClick: (View, Gallery) -> Unit + private val onClick: (View, Gallery) -> Unit, ) : RecyclerView.ViewHolder(view) { fun bind(gallery: Gallery) { @@ -93,7 +93,7 @@ class FbGalleryAdapter( itemView.measuredWidth, Uri.parse(gallery.coverPath), itemView.findViewById(R.id.gallery_cover), - 0 + 0, ) return true } diff --git a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/adapter/FbPictureAdapter.kt b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/adapter/FbPictureAdapter.kt index d444973..cfbd1e0 100644 --- a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/adapter/FbPictureAdapter.kt +++ b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/adapter/FbPictureAdapter.kt @@ -36,7 +36,7 @@ import com.lovoo.android.pickfacebook.model.FbPicture class FbPictureAdapter( context: Context, private val selectionLookUp: (FbPicture) -> Boolean, - private val onClick: (View, FbPicture) -> Unit + private val onClick: (View, FbPicture) -> Unit, ) : RecyclerView.Adapter() { private val inflater = LayoutInflater.from(context) @@ -108,13 +108,13 @@ class FbPictureAdapter( view: View, engine: ImageEngine, selectionLookUp: (FbPicture) -> Boolean, - onClick: (View, FbPicture) -> Unit + onClick: (View, FbPicture) -> Unit, ) : com.lovoo.android.pickui.adapter.ViewHolder( view, engine, selectionLookUp, - onClick + onClick, ) { override fun getUri(item: FbPicture): Uri = item.getUri() diff --git a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/model/Converter.kt b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/model/Converter.kt index 061d7ff..5c13bf0 100644 --- a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/model/Converter.kt +++ b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/model/Converter.kt @@ -52,9 +52,9 @@ object Converter { it.id ?: "", it.picture?.data?.url ?: "", it.name ?: "", - it.count?.toLong() ?: 0L + it.count?.toLong() ?: 0L, ) - } + }, ) } } @@ -74,9 +74,9 @@ object Converter { it.id ?: "", photo.url ?: "", photo.width ?: 0, - photo.height ?: 0 + photo.height ?: 0, ) - } + }, ) } } @@ -93,14 +93,14 @@ object Converter { @SerializedName("id") val id: String? = "", @SerializedName("name") val name: String? = "", @SerializedName("count") val count: Int? = 0, - @SerializedName("picture") val picture: FbAlbumData? = null + @SerializedName("picture") val picture: FbAlbumData? = null, ) /** * @param data the album cover */ data class FbAlbumData( - @SerializedName("data") val data: FbCover? = null + @SerializedName("data") val data: FbCover? = null, ) /** @@ -109,7 +109,7 @@ object Converter { */ data class FbCover( @SerializedName("is_silhouette") val isPlaceholder: Boolean? = false, - @SerializedName("url") val url: String? = "" + @SerializedName("url") val url: String? = "", ) /** @@ -118,7 +118,7 @@ object Converter { */ data class FbPhoto( @SerializedName("id") val id: String? = "", - @SerializedName("images") val images: List? = emptyList() + @SerializedName("images") val images: List? = emptyList(), ) /** @@ -129,6 +129,6 @@ object Converter { data class FbImage( @SerializedName("source") val url: String? = "", @SerializedName("height") val height: Int? = 0, - @SerializedName("width") val width: Int? = 0 + @SerializedName("width") val width: Int? = 0, ) } diff --git a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/model/FbPicture.kt b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/model/FbPicture.kt index 1e6c427..db2186e 100644 --- a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/model/FbPicture.kt +++ b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/model/FbPicture.kt @@ -31,14 +31,14 @@ data class FbPicture( val id: String, val url: String, val width: Int, - val height: Int + val height: Int, ) : Parcelable { constructor(parcel: Parcel) : this( parcel.readString() ?: "", parcel.readString() ?: "", parcel.readInt(), - parcel.readInt() + parcel.readInt(), ) override fun writeToParcel(parcel: Parcel, flags: Int) { diff --git a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/presenter/FbGalleryPresenterImpl.kt b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/presenter/FbGalleryPresenterImpl.kt index bd7312e..db06d60 100644 --- a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/presenter/FbGalleryPresenterImpl.kt +++ b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/presenter/FbGalleryPresenterImpl.kt @@ -92,7 +92,7 @@ class FbGalleryPresenterImpl(private val view: FbGalleryView) : FbGalleryPresent override fun onError(error: FacebookException?) { error?.let { view.onError(it) } } - } + }, ) } diff --git a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/view/FbPictureFragment.kt b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/view/FbPictureFragment.kt index 56d2354..d313481 100644 --- a/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/view/FbPictureFragment.kt +++ b/pickfacebook/src/main/kotlin/com/lovoo/android/pickfacebook/view/FbPictureFragment.kt @@ -74,7 +74,7 @@ class FbPictureFragment : Fragment(), FbPictureView { adapter = FbPictureAdapter( context, { selectionHolder?.isSelected(it.getUri()) == true }, - { _, picture -> onPictureClick(picture) } + { _, picture -> onPictureClick(picture) }, ) } } @@ -94,7 +94,7 @@ class FbPictureFragment : Fragment(), FbPictureView { } } } - } + }, ) } diff --git a/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/GalleryAdapter.kt b/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/GalleryAdapter.kt index f1f54ff..1d45d80 100644 --- a/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/GalleryAdapter.kt +++ b/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/GalleryAdapter.kt @@ -40,12 +40,12 @@ import java.io.File */ class GalleryAdapter( private val allFolderName: String, - private val onClick: (View, Gallery) -> Unit + private val onClick: (View, Gallery) -> Unit, ) : RecyclerViewCursorAdapter(null) { override fun onCreateViewHolder( parent: ViewGroup, - viewType: Int + viewType: Int, ): ViewHolder { val binding = PickpicListItemGalleryBinding.inflate(LayoutInflater.from(parent.context), parent, false) return ViewHolder(binding, allFolderName, onClick) @@ -74,7 +74,7 @@ class GalleryAdapter( itemView.measuredWidth, Uri.fromFile(File(gallery.coverPath)), galleryCover, - 0 + 0, ) return true } diff --git a/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/PictureAdapter.kt b/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/PictureAdapter.kt index 5ef1f9f..72707a7 100644 --- a/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/PictureAdapter.kt +++ b/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/PictureAdapter.kt @@ -42,7 +42,7 @@ import com.lovoo.android.pickui.R class PictureAdapter( context: Context, private val selectionLookUp: (Picture) -> Boolean, - private val onClick: (View, Picture) -> Unit + private val onClick: (View, Picture) -> Unit, ) : RecyclerViewCursorAdapter(null) { private val inflater = LayoutInflater.from(context) @@ -81,13 +81,13 @@ class PictureAdapter( private class ViewHolder( view: View, selectionLookUp: (Picture) -> Boolean, - onClick: (View, Picture) -> Unit + onClick: (View, Picture) -> Unit, ) : com.lovoo.android.pickui.adapter.ViewHolder( view, PickPicProvider.imageEngine, selectionLookUp, - onClick + onClick, ) { override fun getUri(item: Picture) = item.getUri() diff --git a/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/PopUpGalleryAdapter.kt b/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/PopUpGalleryAdapter.kt index 356507f..4715701 100644 --- a/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/PopUpGalleryAdapter.kt +++ b/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/PopUpGalleryAdapter.kt @@ -39,7 +39,7 @@ import java.io.File class PopUpGalleryAdapter( private val context: Context, private val items: List, - private val folderNameLookUp: (Gallery) -> String + private val folderNameLookUp: (Gallery) -> String, ) : BaseAdapter() { private val inflater = LayoutInflater.from(context) @@ -47,7 +47,7 @@ class PopUpGalleryAdapter( override fun getView( position: Int, convertView: View?, - container: ViewGroup + container: ViewGroup, ): View { val item = getItem(position) ?: return View(context) val binding = convertView?.let { PickpicListItemGalleryBinding.bind(it) } ?: PickpicListItemGalleryBinding.inflate(inflater, container, false) @@ -61,7 +61,11 @@ class PopUpGalleryAdapter( false -> Uri.parse(item.coverPath) } PickPicProvider.imageEngine.loadThumbnail( - context, galleryCover.measuredHeight, uri, galleryCover, 0 + context, + galleryCover.measuredHeight, + uri, + galleryCover, + 0, ) return true } diff --git a/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/ViewHolder.kt b/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/ViewHolder.kt index f974b26..c69ff17 100644 --- a/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/ViewHolder.kt +++ b/pickui/src/main/kotlin/com/lovoo/android/pickui/adapter/ViewHolder.kt @@ -41,7 +41,7 @@ abstract class ViewHolder( view: View, private val engine: ImageEngine, private val selectionLookUp: (T) -> Boolean, - private val onClick: (View, T) -> Unit + private val onClick: (View, T) -> Unit, ) : RecyclerView.ViewHolder(view) { private val size = MutableLiveData() @@ -75,7 +75,7 @@ abstract class ViewHolder( PlaceHolderDrawable().apply { this.width = width this.height = width - } + }, ) } diff --git a/pickui/src/main/kotlin/com/lovoo/android/pickui/view/GalleryFragment.kt b/pickui/src/main/kotlin/com/lovoo/android/pickui/view/GalleryFragment.kt index cd2e2d3..ec18bd8 100644 --- a/pickui/src/main/kotlin/com/lovoo/android/pickui/view/GalleryFragment.kt +++ b/pickui/src/main/kotlin/com/lovoo/android/pickui/view/GalleryFragment.kt @@ -22,7 +22,6 @@ import android.content.Context import android.content.Intent import android.content.IntentFilter import android.database.Cursor -import android.os.Build import android.os.Bundle import android.view.Gravity import android.view.LayoutInflater @@ -77,7 +76,6 @@ class GalleryFragment : Fragment(), GalleryView { presenter.onCreate(savedInstanceState) } - @SuppressLint("UnspecifiedRegisterReceiverFlag") override fun onAttach(context: Context) { super.onAttach(context) @@ -87,7 +85,7 @@ class GalleryFragment : Fragment(), GalleryView { val filter = IntentFilter().apply { addAction(CameraLoader.INTENT_INVALIDATE_GALLERY) } - context.registerReceiverSafely(receiver = invalidateReceiver, filter = filter,) + context.registerReceiverSafely(receiver = invalidateReceiver, filter = filter) } override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { diff --git a/pickui/src/main/kotlin/com/lovoo/android/pickui/view/PictureDecoration.kt b/pickui/src/main/kotlin/com/lovoo/android/pickui/view/PictureDecoration.kt index ceaac15..3f056b4 100644 --- a/pickui/src/main/kotlin/com/lovoo/android/pickui/view/PictureDecoration.kt +++ b/pickui/src/main/kotlin/com/lovoo/android/pickui/view/PictureDecoration.kt @@ -25,7 +25,7 @@ import androidx.recyclerview.widget.RecyclerView */ class PictureDecoration( private val spanCount: Int, - private val padding: Int + private val padding: Int, ) : RecyclerView.ItemDecoration() { override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) { diff --git a/pickui/src/main/kotlin/com/lovoo/android/pickui/view/PictureFragment.kt b/pickui/src/main/kotlin/com/lovoo/android/pickui/view/PictureFragment.kt index deaa24b..d8ceb0d 100644 --- a/pickui/src/main/kotlin/com/lovoo/android/pickui/view/PictureFragment.kt +++ b/pickui/src/main/kotlin/com/lovoo/android/pickui/view/PictureFragment.kt @@ -84,7 +84,7 @@ class PictureFragment : Fragment(), PictureView { adapter = PictureAdapter( context, { selectionHolder?.isSelected(it.getUri()) == true }, - { _, picture -> onPictureClick(picture) } + { _, picture -> onPictureClick(picture) }, ) } } @@ -107,7 +107,7 @@ class PictureFragment : Fragment(), PictureView { } } } - } + }, ) val filter = IntentFilter().apply { addAction(CameraLoader.INTENT_INVALIDATE_GALLERY) diff --git a/spotless.gradle b/spotless.gradle index bf4979e..6844590 100644 --- a/spotless.gradle +++ b/spotless.gradle @@ -1,6 +1,6 @@ -apply plugin: "com.diffplug.gradle.spotless" +apply plugin: "com.diffplug.spotless" -ext.ktlint_version = "0.37.2" +ext.ktlint_version = "0.48.0" spotless { kotlin {