mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-18 14:28:00 +01:00
properly handle exporting and importing thumbnail style related values
This commit is contained in:
parent
b613ab02ab
commit
042e50d8de
5 changed files with 8 additions and 20 deletions
|
@ -82,7 +82,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
private var mStoredAnimateGifs = true
|
private var mStoredAnimateGifs = true
|
||||||
private var mStoredCropThumbnails = true
|
private var mStoredCropThumbnails = true
|
||||||
private var mStoredScrollHorizontally = true
|
private var mStoredScrollHorizontally = true
|
||||||
private var mStoredShowMediaCount = true
|
|
||||||
private var mStoredTextColor = 0
|
private var mStoredTextColor = 0
|
||||||
private var mStoredPrimaryColor = 0
|
private var mStoredPrimaryColor = 0
|
||||||
|
|
||||||
|
@ -174,10 +173,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
getRecyclerAdapter()?.updateCropThumbnails(config.cropThumbnails)
|
getRecyclerAdapter()?.updateCropThumbnails(config.cropThumbnails)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mStoredShowMediaCount != config.showMediaCount) {
|
|
||||||
getRecyclerAdapter()?.updateShowMediaCount(config.showMediaCount)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mStoredScrollHorizontally != config.scrollHorizontally) {
|
if (mStoredScrollHorizontally != config.scrollHorizontally) {
|
||||||
mLoadedInitialPhotos = false
|
mLoadedInitialPhotos = false
|
||||||
directories_grid.adapter = null
|
directories_grid.adapter = null
|
||||||
|
@ -332,7 +327,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
mStoredAnimateGifs = animateGifs
|
mStoredAnimateGifs = animateGifs
|
||||||
mStoredCropThumbnails = cropThumbnails
|
mStoredCropThumbnails = cropThumbnails
|
||||||
mStoredScrollHorizontally = scrollHorizontally
|
mStoredScrollHorizontally = scrollHorizontally
|
||||||
mStoredShowMediaCount = showMediaCount
|
|
||||||
mStoredTextColor = textColor
|
mStoredTextColor = textColor
|
||||||
mStoredPrimaryColor = primaryColor
|
mStoredPrimaryColor = primaryColor
|
||||||
}
|
}
|
||||||
|
|
|
@ -650,7 +650,6 @@ class SettingsActivity : SimpleActivity() {
|
||||||
put(ANIMATE_GIFS, config.animateGifs)
|
put(ANIMATE_GIFS, config.animateGifs)
|
||||||
put(CROP_THUMBNAILS, config.cropThumbnails)
|
put(CROP_THUMBNAILS, config.cropThumbnails)
|
||||||
put(SHOW_THUMBNAIL_VIDEO_DURATION, config.showThumbnailVideoDuration)
|
put(SHOW_THUMBNAIL_VIDEO_DURATION, config.showThumbnailVideoDuration)
|
||||||
put(SHOW_MEDIA_COUNT, config.showMediaCount)
|
|
||||||
put(SCROLL_HORIZONTALLY, config.scrollHorizontally)
|
put(SCROLL_HORIZONTALLY, config.scrollHorizontally)
|
||||||
put(ENABLE_PULL_TO_REFRESH, config.enablePullToRefresh)
|
put(ENABLE_PULL_TO_REFRESH, config.enablePullToRefresh)
|
||||||
put(MAX_BRIGHTNESS, config.maxBrightness)
|
put(MAX_BRIGHTNESS, config.maxBrightness)
|
||||||
|
@ -704,6 +703,9 @@ class SettingsActivity : SimpleActivity() {
|
||||||
put(EDITOR_BRUSH_HARDNESS, config.editorBrushHardness)
|
put(EDITOR_BRUSH_HARDNESS, config.editorBrushHardness)
|
||||||
put(EDITOR_BRUSH_SIZE, config.editorBrushSize)
|
put(EDITOR_BRUSH_SIZE, config.editorBrushSize)
|
||||||
put(ALBUM_COVERS, config.albumCovers)
|
put(ALBUM_COVERS, config.albumCovers)
|
||||||
|
put(FOLDER_THUMBNAIL_STYLE, config.folderStyle)
|
||||||
|
put(FOLDER_MEDIA_COUNT, config.showFolderMediaCount)
|
||||||
|
put(LIMIT_FOLDER_TITLE, config.limitFolderTitle)
|
||||||
}
|
}
|
||||||
|
|
||||||
exportSettings(configItems)
|
exportSettings(configItems)
|
||||||
|
@ -785,7 +787,6 @@ class SettingsActivity : SimpleActivity() {
|
||||||
ANIMATE_GIFS -> config.animateGifs = value.toBoolean()
|
ANIMATE_GIFS -> config.animateGifs = value.toBoolean()
|
||||||
CROP_THUMBNAILS -> config.cropThumbnails = value.toBoolean()
|
CROP_THUMBNAILS -> config.cropThumbnails = value.toBoolean()
|
||||||
SHOW_THUMBNAIL_VIDEO_DURATION -> config.showThumbnailVideoDuration = value.toBoolean()
|
SHOW_THUMBNAIL_VIDEO_DURATION -> config.showThumbnailVideoDuration = value.toBoolean()
|
||||||
SHOW_MEDIA_COUNT -> config.showMediaCount = value.toBoolean()
|
|
||||||
SCROLL_HORIZONTALLY -> config.scrollHorizontally = value.toBoolean()
|
SCROLL_HORIZONTALLY -> config.scrollHorizontally = value.toBoolean()
|
||||||
ENABLE_PULL_TO_REFRESH -> config.enablePullToRefresh = value.toBoolean()
|
ENABLE_PULL_TO_REFRESH -> config.enablePullToRefresh = value.toBoolean()
|
||||||
MAX_BRIGHTNESS -> config.maxBrightness = value.toBoolean()
|
MAX_BRIGHTNESS -> config.maxBrightness = value.toBoolean()
|
||||||
|
@ -838,6 +839,9 @@ class SettingsActivity : SimpleActivity() {
|
||||||
EDITOR_BRUSH_COLOR -> config.editorBrushColor = value.toInt()
|
EDITOR_BRUSH_COLOR -> config.editorBrushColor = value.toInt()
|
||||||
EDITOR_BRUSH_HARDNESS -> config.editorBrushHardness = value.toString().toFloat()
|
EDITOR_BRUSH_HARDNESS -> config.editorBrushHardness = value.toString().toFloat()
|
||||||
EDITOR_BRUSH_SIZE -> config.editorBrushSize = value.toString().toFloat()
|
EDITOR_BRUSH_SIZE -> config.editorBrushSize = value.toString().toFloat()
|
||||||
|
FOLDER_THUMBNAIL_STYLE -> config.folderStyle = value.toInt()
|
||||||
|
FOLDER_MEDIA_COUNT -> config.showFolderMediaCount = value.toInt()
|
||||||
|
LIMIT_FOLDER_TITLE -> config.limitFolderTitle = value.toBoolean()
|
||||||
ALBUM_COVERS -> {
|
ALBUM_COVERS -> {
|
||||||
val existingCovers = config.parseAlbumCovers()
|
val existingCovers = config.parseAlbumCovers()
|
||||||
val existingCoverPaths = existingCovers.map { it.path }.toMutableList() as ArrayList<String>
|
val existingCoverPaths = existingCovers.map { it.path }.toMutableList() as ArrayList<String>
|
||||||
|
|
|
@ -46,7 +46,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
||||||
private val isListViewType = config.viewTypeFolders == VIEW_TYPE_LIST
|
private val isListViewType = config.viewTypeFolders == VIEW_TYPE_LIST
|
||||||
private var pinnedFolders = config.pinnedFolders
|
private var pinnedFolders = config.pinnedFolders
|
||||||
private var scrollHorizontally = config.scrollHorizontally
|
private var scrollHorizontally = config.scrollHorizontally
|
||||||
private var showMediaCount = config.showMediaCount
|
private var showMediaCount = config.showFolderMediaCount
|
||||||
private var animateGifs = config.animateGifs
|
private var animateGifs = config.animateGifs
|
||||||
private var cropThumbnails = config.cropThumbnails
|
private var cropThumbnails = config.cropThumbnails
|
||||||
private var groupDirectSubfolders = config.groupDirectSubfolders
|
private var groupDirectSubfolders = config.groupDirectSubfolders
|
||||||
|
@ -653,11 +653,6 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateShowMediaCount(showMediaCount: Boolean) {
|
|
||||||
this.showMediaCount = showMediaCount
|
|
||||||
notifyDataSetChanged()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setupView(view: View, directory: Directory) {
|
private fun setupView(view: View, directory: Directory) {
|
||||||
val isSelected = selectedKeys.contains(directory.path.hashCode())
|
val isSelected = selectedKeys.contains(directory.path.hashCode())
|
||||||
view.apply {
|
view.apply {
|
||||||
|
@ -693,7 +688,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
||||||
dir_location.setImageResource(if (directory.location == LOCATION_SD) R.drawable.ic_sd_card_vector else R.drawable.ic_usb_vector)
|
dir_location.setImageResource(if (directory.location == LOCATION_SD) R.drawable.ic_sd_card_vector else R.drawable.ic_usb_vector)
|
||||||
}
|
}
|
||||||
|
|
||||||
photo_cnt.beVisibleIf(showMediaCount)
|
photo_cnt.beVisibleIf(showMediaCount == FOLDER_MEDIA_CNT_LINE)
|
||||||
|
|
||||||
if (isListViewType) {
|
if (isListViewType) {
|
||||||
dir_name.setTextColor(textColor)
|
dir_name.setTextColor(textColor)
|
||||||
|
|
|
@ -272,10 +272,6 @@ class Config(context: Context) : BaseConfig(context) {
|
||||||
get() = prefs.getBoolean(ALLOW_VIDEO_GESTURES, true)
|
get() = prefs.getBoolean(ALLOW_VIDEO_GESTURES, true)
|
||||||
set(allowVideoGestures) = prefs.edit().putBoolean(ALLOW_VIDEO_GESTURES, allowVideoGestures).apply()
|
set(allowVideoGestures) = prefs.edit().putBoolean(ALLOW_VIDEO_GESTURES, allowVideoGestures).apply()
|
||||||
|
|
||||||
var showMediaCount: Boolean
|
|
||||||
get() = prefs.getBoolean(SHOW_MEDIA_COUNT, true)
|
|
||||||
set(showMediaCount) = prefs.edit().putBoolean(SHOW_MEDIA_COUNT, showMediaCount).apply()
|
|
||||||
|
|
||||||
var slideshowInterval: Int
|
var slideshowInterval: Int
|
||||||
get() = prefs.getInt(SLIDESHOW_INTERVAL, SLIDESHOW_DEFAULT_INTERVAL)
|
get() = prefs.getInt(SLIDESHOW_INTERVAL, SLIDESHOW_DEFAULT_INTERVAL)
|
||||||
set(slideshowInterval) = prefs.edit().putInt(SLIDESHOW_INTERVAL, slideshowInterval).apply()
|
set(slideshowInterval) = prefs.edit().putInt(SLIDESHOW_INTERVAL, slideshowInterval).apply()
|
||||||
|
|
|
@ -40,7 +40,6 @@ const val HIDE_SYSTEM_UI = "hide_system_ui"
|
||||||
const val DELETE_EMPTY_FOLDERS = "delete_empty_folders"
|
const val DELETE_EMPTY_FOLDERS = "delete_empty_folders"
|
||||||
const val ALLOW_PHOTO_GESTURES = "allow_photo_gestures"
|
const val ALLOW_PHOTO_GESTURES = "allow_photo_gestures"
|
||||||
const val ALLOW_VIDEO_GESTURES = "allow_video_gestures"
|
const val ALLOW_VIDEO_GESTURES = "allow_video_gestures"
|
||||||
const val SHOW_MEDIA_COUNT = "show_media_count"
|
|
||||||
const val TEMP_FOLDER_PATH = "temp_folder_path"
|
const val TEMP_FOLDER_PATH = "temp_folder_path"
|
||||||
const val VIEW_TYPE_FOLDERS = "view_type_folders"
|
const val VIEW_TYPE_FOLDERS = "view_type_folders"
|
||||||
const val VIEW_TYPE_FILES = "view_type_files"
|
const val VIEW_TYPE_FILES = "view_type_files"
|
||||||
|
|
Loading…
Reference in a new issue