mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-18 06:17:59 +01:00
preparing some folder customization things
This commit is contained in:
parent
2c4912950d
commit
b35b22d0eb
5 changed files with 64 additions and 26 deletions
|
@ -77,11 +77,11 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.simplemobiletools:commons:5.31.19'
|
||||
implementation 'com.simplemobiletools:commons:5.31.28'
|
||||
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
||||
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
||||
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.6'
|
||||
implementation 'com.google.vr:sdk-panowidget:1.180.0'
|
||||
implementation 'com.google.vr:sdk-videowidget:1.180.0'
|
||||
|
|
|
@ -14,7 +14,10 @@ import com.simplemobiletools.commons.models.RadioItem
|
|||
import com.simplemobiletools.gallery.pro.R
|
||||
import com.simplemobiletools.gallery.pro.dialogs.ManageBottomActionsDialog
|
||||
import com.simplemobiletools.gallery.pro.dialogs.ManageExtendedDetailsDialog
|
||||
import com.simplemobiletools.gallery.pro.extensions.*
|
||||
import com.simplemobiletools.gallery.pro.extensions.config
|
||||
import com.simplemobiletools.gallery.pro.extensions.emptyTheRecycleBin
|
||||
import com.simplemobiletools.gallery.pro.extensions.mediaDB
|
||||
import com.simplemobiletools.gallery.pro.extensions.showRecycleBinEmptyingDialog
|
||||
import com.simplemobiletools.gallery.pro.helpers.*
|
||||
import com.simplemobiletools.gallery.pro.models.AlbumCover
|
||||
import kotlinx.android.synthetic.main.activity_settings.*
|
||||
|
@ -68,7 +71,7 @@ class SettingsActivity : SimpleActivity() {
|
|||
setupBottomActions()
|
||||
setupThumbnailVideoDuration()
|
||||
setupThumbnailFileTypes()
|
||||
setupShowMediaCount()
|
||||
setupFolderThumbnailStyle()
|
||||
setupKeepLastModified()
|
||||
setupEnablePullToRefresh()
|
||||
setupAllowZoomingImages()
|
||||
|
@ -411,14 +414,18 @@ class SettingsActivity : SimpleActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun setupShowMediaCount() {
|
||||
settings_show_media_count.isChecked = config.showMediaCount
|
||||
settings_show_media_count_holder.setOnClickListener {
|
||||
settings_show_media_count.toggle()
|
||||
config.showMediaCount = settings_show_media_count.isChecked
|
||||
private fun setupFolderThumbnailStyle() {
|
||||
settings_folder_thumbnail_style.text = getFolderStyleText()
|
||||
settings_folder_thumbnail_style_holder.setOnClickListener {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private fun getFolderStyleText() = getString(when (config.folderStyle) {
|
||||
FOLDER_STYLE_SQUARE -> R.string.square
|
||||
else -> R.string.rounded_corners
|
||||
})
|
||||
|
||||
private fun setupKeepLastModified() {
|
||||
settings_keep_last_modified.isChecked = config.keepLastModified
|
||||
settings_keep_last_modified_holder.setOnClickListener {
|
||||
|
|
|
@ -495,4 +495,16 @@ class Config(context: Context) : BaseConfig(context) {
|
|||
var wereFavoritesMigrated: Boolean
|
||||
get() = prefs.getBoolean(WERE_FAVORITES_MIGRATED, false)
|
||||
set(wereFavoritesMigrated) = prefs.edit().putBoolean(WERE_FAVORITES_MIGRATED, wereFavoritesMigrated).apply()
|
||||
|
||||
var showFolderMediaCount: Int
|
||||
get() = prefs.getInt(FOLDER_MEDIA_COUNT, FOLDER_MEDIA_CNT_LINE)
|
||||
set(showFolderMediaCount) = prefs.edit().putInt(FOLDER_MEDIA_COUNT, showFolderMediaCount).apply()
|
||||
|
||||
var folderStyle: Int
|
||||
get() = prefs.getInt(FOLDER_THUMBNAIL_STYLE, FOLDER_STYLE_SQUARE)
|
||||
set(folderStyle) = prefs.edit().putInt(FOLDER_THUMBNAIL_STYLE, folderStyle).apply()
|
||||
|
||||
var limitFolderTitle: Boolean
|
||||
get() = prefs.getBoolean(LIMIT_FOLDER_TITLE, false)
|
||||
set(limitFolderTitle) = prefs.edit().putBoolean(LIMIT_FOLDER_TITLE, limitFolderTitle).apply()
|
||||
}
|
||||
|
|
|
@ -83,6 +83,9 @@ const val EDITOR_BRUSH_COLOR = "editor_brush_color"
|
|||
const val EDITOR_BRUSH_HARDNESS = "editor_brush_hardness"
|
||||
const val EDITOR_BRUSH_SIZE = "editor_brush_size"
|
||||
const val WERE_FAVORITES_MIGRATED = "were_favorites_migrated"
|
||||
const val FOLDER_THUMBNAIL_STYLE = "folder_thumbnail_style"
|
||||
const val FOLDER_MEDIA_COUNT = "folder_media_count"
|
||||
const val LIMIT_FOLDER_TITLE = "folder_limit_title"
|
||||
|
||||
// slideshow
|
||||
const val SLIDESHOW_INTERVAL = "slideshow_interval"
|
||||
|
@ -224,3 +227,10 @@ const val HIGH_TILE_DPI = 280
|
|||
const val ROUNDED_CORNERS_NONE = 1
|
||||
const val ROUNDED_CORNERS_SMALL = 2
|
||||
const val ROUNDED_CORNERS_BIG = 3
|
||||
|
||||
const val FOLDER_MEDIA_CNT_LINE = 1
|
||||
const val FOLDER_MEDIA_CNT_BRACKETS = 2
|
||||
const val FOLDER_MEDIA_CNT_NONE = 3
|
||||
|
||||
const val FOLDER_STYLE_SQUARE = 1
|
||||
const val FOLDER_STYLE_ROUNDED_CORNERS = 2
|
||||
|
|
|
@ -436,25 +436,34 @@
|
|||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_show_media_count_holder"
|
||||
android:id="@+id/settings_folder_thumbnail_style_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/medium_margin"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingStart="@dimen/normal_margin"
|
||||
android:paddingTop="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/bigger_margin"
|
||||
android:paddingEnd="@dimen/normal_margin"
|
||||
android:paddingBottom="@dimen/activity_margin">
|
||||
android:paddingBottom="@dimen/bigger_margin">
|
||||
|
||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||
android:id="@+id/settings_show_media_count"
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/settings_folder_thumbnail_style_label"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:clickable="false"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toStartOf="@+id/settings_folder_thumbnail_style"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:text="@string/show_media_count"
|
||||
app:switchPadding="@dimen/medium_margin" />
|
||||
android:paddingEnd="@dimen/medium_margin"
|
||||
android:text="@string/folder_thumbnail_style" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/settings_folder_thumbnail_style"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/medium_margin"
|
||||
android:background="@null"
|
||||
android:clickable="false" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
Loading…
Reference in a new issue