update Commons to 2.38.8
This commit is contained in:
parent
e0628204ba
commit
99dee5e7f1
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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<Direc
|
|||
fun toggleItemSelection(select: Boolean, pos: Int) {
|
||||
if (select) {
|
||||
if (itemViews[pos] != null) {
|
||||
itemViews[pos].dir_check?.background?.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN)
|
||||
itemViews[pos].dir_check?.background?.applyColorFilter(primaryColor)
|
||||
selectedPositions.add(pos)
|
||||
}
|
||||
} else {
|
||||
|
@ -99,7 +100,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
|
|||
return true
|
||||
}
|
||||
|
||||
override fun onCreateActionMode(actionMode: ActionMode?, menu: Menu?): Boolean {
|
||||
override fun onCreateActionMode(actionMode: ActionMode?, menu: Menu): Boolean {
|
||||
super.onCreateActionMode(actionMode, menu)
|
||||
actMode = actionMode
|
||||
activity.menuInflater.inflate(R.menu.cab_directories, menu)
|
||||
|
@ -107,8 +108,8 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
|
|||
}
|
||||
|
||||
override fun onPrepareActionMode(actionMode: ActionMode?, menu: Menu): Boolean {
|
||||
menu.findItem(R.id.cab_rename).isVisible = selectedPositions.size <= 1
|
||||
menu.findItem(R.id.cab_change_cover_image).isVisible = selectedPositions.size <= 1
|
||||
menu.findItem(R.id.cab_rename).isVisible = selectedPositions.size == 1
|
||||
menu.findItem(R.id.cab_change_cover_image).isVisible = selectedPositions.size == 1
|
||||
|
||||
checkHideBtnVisibility(menu)
|
||||
checkPinBtnVisibility(menu)
|
||||
|
@ -491,12 +492,6 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
|
|||
}
|
||||
}
|
||||
|
||||
interface MyAdapterListener {
|
||||
fun toggleItemSelectionAdapter(select: Boolean, position: Int)
|
||||
|
||||
fun getSelectedPositions(): HashSet<Int>
|
||||
}
|
||||
|
||||
interface DirOperationsListener {
|
||||
fun refreshItems()
|
||||
|
||||
|
|
|
@ -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<Medium>,
|
|||
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<Medium>,
|
|||
}
|
||||
|
||||
media.removeAll(removeMedia)
|
||||
selectedPositions.clear()
|
||||
listener?.deleteFiles(files)
|
||||
|
||||
val newItems = SparseArray<View>()
|
||||
|
@ -414,12 +415,6 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
|
|||
}
|
||||
}
|
||||
|
||||
interface MyAdapterListener {
|
||||
fun toggleItemSelectionAdapter(select: Boolean, position: Int)
|
||||
|
||||
fun getSelectedPositions(): HashSet<Int>
|
||||
}
|
||||
|
||||
interface MediaOperationsListener {
|
||||
fun refreshItems()
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dir_pin"
|
||||
|
@ -33,7 +34,8 @@
|
|||
android:layout_margin="@dimen/small_margin"
|
||||
android:background="@drawable/circle_black_background"
|
||||
android:padding="@dimen/small_margin"
|
||||
android:src="@drawable/ic_pin"/>
|
||||
android:src="@drawable/ic_pin"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dir_shadow_holder"
|
||||
|
|
|
@ -22,7 +22,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"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dir_name"
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<resources>
|
||||
|
||||
<style name="AppTheme" parent="AppTheme.Base"/>
|
||||
<style name="AppTheme" parent="AppTheme.Base">
|
||||
<item name="android:textSize">@dimen/normal_text_size</item>
|
||||
</style>
|
||||
|
||||
<style name="FullScreenTheme.Base" parent="AppTheme">
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
|
|
Loading…
Reference in New Issue