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 af6e3b8ee..89f8e1fbf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -598,7 +598,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { mLastMediaHandler.removeCallbacksAndMessages(null) mLastMediaHandler.postDelayed({ - Thread({ + Thread { val mediaId = getLatestMediaId() if (mLatestMediaId != mediaId) { mLatestMediaId = mediaId @@ -608,7 +608,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } else { checkLastMediaChanged() } - }).start() + }.start() }, LAST_MEDIA_CHECK_PERIOD) } 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 0ec644665..9da4e2278 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -75,7 +75,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { mAllowPickingMultiple = getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false) } - media_refresh_layout.setOnRefreshListener({ getMedia() }) + media_refresh_layout.setOnRefreshListener { getMedia() } mPath = intent.getStringExtra(DIRECTORY) storeStateVariables() if (mShowAll) @@ -218,7 +218,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { mLastMediaHandler.removeCallbacksAndMessages(null) mLastMediaHandler.postDelayed({ - Thread({ + Thread { val mediaId = getLatestMediaId() if (mLatestMediaId != mediaId) { mLatestMediaId = mediaId @@ -228,7 +228,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { } else { checkLastMediaChanged() } - }).start() + }.start() }, LAST_MEDIA_CHECK_PERIOD) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt index 559d06452..9f149647c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt @@ -114,7 +114,7 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete if (result.error == null) { toast(R.string.setting_wallpaper) - Thread({ + Thread { val bitmap = result.bitmap val wantedHeight = wallpaperManager.desiredMinimumHeight val ratio = wantedHeight / bitmap.height.toFloat() @@ -132,7 +132,7 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete setResult(Activity.RESULT_CANCELED) } finish() - }).start() + }.start() } else { toast("${getString(R.string.image_editing_failed)}: ${result.error.message}") } 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 47b0f6e53..428c1125b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -499,9 +499,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View SaveAsDialog(this, currPath, false) { val selectedFile = File(it) handleSAFDialog(selectedFile) { - Thread({ + Thread { saveImageToFile(currPath, it) - }).start() + }.start() } } } 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 dbd4cd7de..25a95566a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -1,6 +1,5 @@ package com.simplemobiletools.gallery.adapters -import android.graphics.PorterDuff import android.view.Menu import android.view.View import android.view.ViewGroup @@ -342,8 +341,8 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList, } private fun toggleFileVisibility(hide: Boolean) { - Thread({ + Thread { getSelectedMedia().forEach { val oldFile = File(it.path) activity.toggleFileVisibility(oldFile, hide) @@ -151,7 +150,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, listener?.refreshItems() finishActMode() } - }).start() + }.start() } private fun shareMedia() { @@ -264,7 +263,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, if (isListViewType) { photo_name.setTextColor(textColor) - play_outline.setColorFilter(textColor, PorterDuff.Mode.SRC_IN) + play_outline.applyColorFilter(textColor) } } } diff --git a/app/src/main/res/layout/directory_item_list.xml b/app/src/main/res/layout/directory_item_list.xml index fb7e8e7d8..c5dca4520 100644 --- a/app/src/main/res/layout/directory_item_list.xml +++ b/app/src/main/res/layout/directory_item_list.xml @@ -4,9 +4,9 @@ android:id="@+id/dir_holder" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingLeft="@dimen/small_margin" android:clickable="true" android:focusable="true" + android:paddingLeft="@dimen/small_margin" android:paddingTop="@dimen/small_margin">