mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +01:00
show an info bubble at fastscroller dragging
This commit is contained in:
parent
2341d0f009
commit
da2db79913
6 changed files with 25 additions and 7 deletions
|
@ -43,7 +43,7 @@ ext {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.simplemobiletools:commons:3.1.3'
|
||||
implementation 'com.simplemobiletools:commons:3.1.4'
|
||||
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0'
|
||||
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
|
||||
implementation 'com.android.support:multidex:1.0.2'
|
||||
|
|
|
@ -583,7 +583,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
|||
if (allowHorizontalScroll) {
|
||||
directories_horizontal_fastscroller.setViews(directories_grid, directories_refresh_layout)
|
||||
} else {
|
||||
directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout)
|
||||
directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout) {
|
||||
directories_vertical_fastscroller.updateBubbleText(mDirs[it].getBubbleText())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -203,7 +203,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
if (allowHorizontalScroll) {
|
||||
media_horizontal_fastscroller.setViews(media_grid, media_refresh_layout)
|
||||
} else {
|
||||
media_vertical_fastscroller.setViews(media_grid, media_refresh_layout)
|
||||
media_vertical_fastscroller.setViews(media_grid, media_refresh_layout) {
|
||||
media_vertical_fastscroller.updateBubbleText(mMedia[it].getBubbleText())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ abstract class ViewPagerFragment : Fragment() {
|
|||
}
|
||||
|
||||
if (detailsFlag and EXT_LAST_MODIFIED != 0) {
|
||||
file.lastModified().formatLastModified().let { if (it.isNotEmpty()) details.appendln(it) }
|
||||
file.lastModified().formatDate().let { if (it.isNotEmpty()) details.appendln(it) }
|
||||
}
|
||||
|
||||
if (detailsFlag and EXT_DATE_TAKEN != 0) {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.simplemobiletools.gallery.models
|
||||
|
||||
import com.simplemobiletools.commons.extensions.formatDate
|
||||
import com.simplemobiletools.commons.extensions.formatSize
|
||||
import com.simplemobiletools.commons.helpers.*
|
||||
import java.io.Serializable
|
||||
|
||||
|
@ -37,4 +39,11 @@ data class Directory(val path: String, val tmb: String, val name: String, var me
|
|||
}
|
||||
return result
|
||||
}
|
||||
|
||||
fun getBubbleText() = when {
|
||||
sorting and SORT_BY_SIZE != 0 -> size.formatSize()
|
||||
sorting and SORT_BY_DATE_MODIFIED != 0 -> modified.formatDate()
|
||||
sorting and SORT_BY_DATE_TAKEN != 0 -> taken.formatDate()
|
||||
else -> name
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package com.simplemobiletools.gallery.models
|
||||
|
||||
import com.simplemobiletools.commons.extensions.getMimeTypeFromPath
|
||||
import com.simplemobiletools.commons.extensions.isGif
|
||||
import com.simplemobiletools.commons.extensions.isPng
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.*
|
||||
import java.io.Serializable
|
||||
|
||||
|
@ -48,4 +46,11 @@ data class Medium(var name: String, var path: String, val video: Boolean, val mo
|
|||
}
|
||||
return result
|
||||
}
|
||||
|
||||
fun getBubbleText() = when {
|
||||
sorting and SORT_BY_SIZE != 0 -> size.formatSize()
|
||||
sorting and SORT_BY_DATE_MODIFIED != 0 -> modified.formatDate()
|
||||
sorting and SORT_BY_DATE_TAKEN != 0 -> taken.formatDate()
|
||||
else -> name
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue