From 2b4d71291205d790919d525fa08b8214758e02a6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Apr 2017 21:04:19 +0200 Subject: [PATCH] shorten some model variable names --- .../gallery/adapters/DirectoryAdapter.kt | 2 +- .../gallery/adapters/MediaAdapter.kt | 2 +- .../gallery/adapters/MyPagerAdapter.kt | 2 +- .../simplemobiletools/gallery/helpers/Constants.kt | 4 ++-- .../simplemobiletools/gallery/models/Directory.kt | 12 ++++++------ .../com/simplemobiletools/gallery/models/Medium.kt | 14 +++++++------- 6 files changed, 18 insertions(+), 18 deletions(-) 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 9ca45fddd..6fa0c8f3b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -330,7 +330,7 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList, 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) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt index 1f9b61ca5..fbd05d975 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt @@ -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() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index d02589de4..cb82d3a55 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -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 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt index 420fcc0ee..77cd94602 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt @@ -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 { 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 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt index d33f51d19..456d9cc92 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt @@ -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 { +data class Medium(val name: String, var path: String, val video: Boolean, val modified: Long, val taken: Long, val size: Long) : Serializable, Comparable { 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