diff --git a/app/build.gradle b/app/build.gradle index 3b08a6a9c..e713089bc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -45,7 +45,7 @@ ext { } dependencies { - compile 'com.simplemobiletools:commons:2.38.6' + compile 'com.simplemobiletools:commons:2.38.8' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.7.2' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' 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 20e8f48d6..e92593e3b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -114,9 +114,11 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.photo_video_menu, menu) - menu.findItem(R.id.menu_set_as).isVisible = mMedium?.isImage() == true - menu.findItem(R.id.menu_edit).isVisible = mMedium?.isImage() == true && mUri?.scheme == "file" - menu.findItem(R.id.menu_properties).isVisible = mUri?.scheme == "file" + menu.apply { + findItem(R.id.menu_set_as).isVisible = mMedium?.isImage() == true + findItem(R.id.menu_edit).isVisible = mMedium?.isImage() == true && mUri?.scheme == "file" + findItem(R.id.menu_properties).isVisible = mUri?.scheme == "file" + } return true } 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 9d2fddb3c..ec823353c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt @@ -61,8 +61,10 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.menu_set_wallpaper, menu) - menu.findItem(R.id.portrait_aspect_ratio).isVisible = isLandscapeRatio - menu.findItem(R.id.landscape_aspect_ratio).isVisible = !isLandscapeRatio + menu.apply { + findItem(R.id.portrait_aspect_ratio).isVisible = isLandscapeRatio + findItem(R.id.landscape_aspect_ratio).isVisible = !isLandscapeRatio + } return true } 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 b2f585e07..a4f057409 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -15,6 +15,7 @@ import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.interfaces.MyAdapterListener import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.dialogs.ExcludeFolderDialog @@ -48,7 +49,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList - } - interface DirOperationsListener { fun refreshItems() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index 496584e12..64b20fc49 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -13,8 +13,10 @@ import com.bignerdranch.android.multiselector.SwappingHolder import com.bumptech.glide.Glide import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog +import com.simplemobiletools.commons.extensions.applyColorFilter import com.simplemobiletools.commons.extensions.beGone import com.simplemobiletools.commons.extensions.beVisibleIf +import com.simplemobiletools.commons.interfaces.MyAdapterListener import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.dialogs.DeleteWithRememberDialog @@ -47,7 +49,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, fun toggleItemSelection(select: Boolean, pos: Int) { if (select) { if (itemViews[pos] != null) { - itemViews[pos].medium_check?.background?.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN) + itemViews[pos].medium_check?.background?.applyColorFilter(primaryColor) selectedPositions.add(pos) } } else { @@ -257,7 +259,6 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, } media.removeAll(removeMedia) - selectedPositions.clear() listener?.deleteFiles(files) val newItems = SparseArray() @@ -414,12 +415,6 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, } } - interface MyAdapterListener { - fun toggleItemSelectionAdapter(select: Boolean, position: Int) - - fun getSelectedPositions(): HashSet - } - interface MediaOperationsListener { fun refreshItems() diff --git a/app/src/main/res/layout/directory_item_grid.xml b/app/src/main/res/layout/directory_item_grid.xml index 6903b7f46..50a8a83fd 100644 --- a/app/src/main/res/layout/directory_item_grid.xml +++ b/app/src/main/res/layout/directory_item_grid.xml @@ -21,7 +21,8 @@ android:layout_margin="@dimen/small_margin" android:background="@drawable/circle_background" android:padding="@dimen/tiny_margin" - android:src="@drawable/ic_check"/> + android:src="@drawable/ic_check" + android:visibility="gone"/> + android:src="@drawable/ic_pin" + android:visibility="gone"/> + android:src="@drawable/ic_check" + android:visibility="gone"/> - - + + diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index f4091292b..80b730f36 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,5 +1,5 @@ - - + + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 54db9f7d0..90ea62bbf 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,6 +1,8 @@ -