shorten some model variable names
This commit is contained in:
parent
7cc41bb86e
commit
2b4d712912
6 changed files with 18 additions and 18 deletions
|
@ -330,7 +330,7 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList<Direc
|
|||
photo_cnt.text = directory.mediaCnt.toString()
|
||||
dir_pin.visibility = if (isPinned) View.VISIBLE else View.GONE
|
||||
toggleItemSelection(this, markedItems.contains(pos), pos)
|
||||
activity.loadImage(directory.thumbnail, dir_thumbnail)
|
||||
activity.loadImage(directory.tmb, dir_thumbnail)
|
||||
|
||||
setOnClickListener { viewClicked(multiSelector, directory, pos) }
|
||||
setOnLongClickListener {
|
||||
|
|
|
@ -235,7 +235,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
|
|||
class ViewHolder(val view: View, val itemClick: (Medium) -> (Unit)) : SwappingHolder(view, MultiSelector()) {
|
||||
fun bindView(activity: SimpleActivity, multiSelectorCallback: ModalMultiSelectorCallback, multiSelector: MultiSelector, medium: Medium, pos: Int): View {
|
||||
itemView.apply {
|
||||
play_outline.visibility = if (medium.isVideo) View.VISIBLE else View.GONE
|
||||
play_outline.visibility = if (medium.video) View.VISIBLE else View.GONE
|
||||
photo_name.beVisibleIf(displayFilenames)
|
||||
photo_name.text = medium.name
|
||||
toggleItemSelection(this, markedItems.contains(pos), pos)
|
||||
|
|
|
@ -24,7 +24,7 @@ class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val m
|
|||
bundle.putSerializable(MEDIUM, medium)
|
||||
val fragment: ViewPagerFragment
|
||||
|
||||
if (medium.isVideo) {
|
||||
if (medium.video) {
|
||||
fragment = VideoFragment()
|
||||
} else {
|
||||
fragment = PhotoFragment()
|
||||
|
|
|
@ -18,7 +18,7 @@ val DIR_COLUMN_CNT = "dir_column_cnt"
|
|||
val MEDIA_COLUMN_CNT = "media_column_cnt"
|
||||
val SHOW_ALL = "show_all" // display images and videos from all folders together
|
||||
val SHOW_MEDIA = "show_media"
|
||||
val SAVE_FOLDER_PREFIX = "folder_"
|
||||
val SAVE_FOLDER_PREFIX = "folder2_"
|
||||
val HIDE_FOLDER_TOOLTIP_SHOWN = "hide_folder_tooltip_shown"
|
||||
val EXCLUDED_FOLDERS = "excluded_folders"
|
||||
val INCLUDED_FOLDERS = "included_folders"
|
||||
|
@ -31,7 +31,7 @@ val GET_IMAGE_INTENT = "get_image_intent"
|
|||
val GET_VIDEO_INTENT = "get_video_intent"
|
||||
val GET_ANY_INTENT = "get_any_intent"
|
||||
val SET_WALLPAPER_INTENT = "set_wallpaper_intent"
|
||||
val DIRECTORIES = "directories"
|
||||
val DIRECTORIES = "directories2"
|
||||
|
||||
val REQUEST_EDIT_IMAGE = 1
|
||||
val REQUEST_SET_WALLPAPER = 2
|
||||
|
|
|
@ -6,10 +6,10 @@ import com.simplemobiletools.commons.helpers.SORT_BY_SIZE
|
|||
import com.simplemobiletools.commons.helpers.SORT_DESCENDING
|
||||
import java.io.Serializable
|
||||
|
||||
data class Directory(val path: String, val thumbnail: String, val name: String, var mediaCnt: Int, val date_modified: Long, val date_taken: Long,
|
||||
data class Directory(val path: String, val tmb: String, val name: String, var mediaCnt: Int, val modified: Long, val taken: Long,
|
||||
var size: Long) : Serializable, Comparable<Directory> {
|
||||
companion object {
|
||||
private val serialVersionUID = -6553345863575455L
|
||||
private val serialVersionUID = -6553345863555455L
|
||||
var sorting: Int = 0
|
||||
}
|
||||
|
||||
|
@ -29,16 +29,16 @@ data class Directory(val path: String, val thumbnail: String, val name: String,
|
|||
else
|
||||
-1
|
||||
} else if (sorting and SORT_BY_DATE_MODIFIED != 0) {
|
||||
result = if (date_modified == other.date_modified)
|
||||
result = if (modified == other.modified)
|
||||
0
|
||||
else if (date_modified > other.date_modified)
|
||||
else if (modified > other.modified)
|
||||
1
|
||||
else
|
||||
-1
|
||||
} else {
|
||||
result = if (date_taken == other.date_taken)
|
||||
result = if (taken == other.taken)
|
||||
0
|
||||
else if (date_taken > other.date_taken)
|
||||
else if (taken > other.taken)
|
||||
1
|
||||
else
|
||||
-1
|
||||
|
|
|
@ -10,9 +10,9 @@ import com.simplemobiletools.commons.helpers.SORT_DESCENDING
|
|||
import java.io.File
|
||||
import java.io.Serializable
|
||||
|
||||
data class Medium(val name: String, var path: String, val isVideo: Boolean, val date_modified: Long, val date_taken: Long, val size: Long) : Serializable, Comparable<Medium> {
|
||||
data class Medium(val name: String, var path: String, val video: Boolean, val modified: Long, val taken: Long, val size: Long) : Serializable, Comparable<Medium> {
|
||||
companion object {
|
||||
private val serialVersionUID = -6553149466975455L
|
||||
private val serialVersionUID = -6553149366975455L
|
||||
var sorting: Int = 0
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ data class Medium(val name: String, var path: String, val isVideo: Boolean, val
|
|||
|
||||
fun isGif() = path.isGif()
|
||||
|
||||
fun isImage() = !isGif() && !isVideo
|
||||
fun isImage() = !isGif() && !video
|
||||
|
||||
fun getMimeType() = File(path).getMimeType()
|
||||
|
||||
|
@ -36,16 +36,16 @@ data class Medium(val name: String, var path: String, val isVideo: Boolean, val
|
|||
else
|
||||
-1
|
||||
} else if (sorting and SORT_BY_DATE_MODIFIED != 0) {
|
||||
res = if (date_modified == other.date_modified)
|
||||
res = if (modified == other.modified)
|
||||
0
|
||||
else if (date_modified > other.date_modified)
|
||||
else if (modified > other.modified)
|
||||
1
|
||||
else
|
||||
-1
|
||||
} else {
|
||||
res = if (date_taken == other.date_taken)
|
||||
res = if (taken == other.taken)
|
||||
0
|
||||
else if (date_taken > other.date_taken)
|
||||
else if (taken > other.taken)
|
||||
1
|
||||
else
|
||||
-1
|
||||
|
|
Loading…
Reference in a new issue