diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt index 8711fc237..4e7bff317 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt @@ -12,7 +12,7 @@ import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.gallery.pro.R -import com.simplemobiletools.gallery.pro.dialogs.ChangeThumbnailStyleDialog +import com.simplemobiletools.gallery.pro.dialogs.ChangeFolderThumbnailStyleDialog import com.simplemobiletools.gallery.pro.dialogs.ManageBottomActionsDialog import com.simplemobiletools.gallery.pro.dialogs.ManageExtendedDetailsDialog import com.simplemobiletools.gallery.pro.extensions.config @@ -70,6 +70,7 @@ class SettingsActivity : SimpleActivity() { setupBottomActions() setupThumbnailVideoDuration() setupThumbnailFileTypes() + setupFileThumbnailStyle() setupFolderThumbnailStyle() setupKeepLastModified() setupEnablePullToRefresh() @@ -398,10 +399,16 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupFileThumbnailStyle() { + settings_file_thumbnail_style_holder.setOnClickListener { + + } + } + private fun setupFolderThumbnailStyle() { settings_folder_thumbnail_style.text = getFolderStyleText() settings_folder_thumbnail_style_holder.setOnClickListener { - ChangeThumbnailStyleDialog(this) { + ChangeFolderThumbnailStyleDialog(this) { settings_folder_thumbnail_style.text = getFolderStyleText() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeThumbnailStyleDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFolderThumbnailStyleDialog.kt similarity index 70% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeThumbnailStyleDialog.kt rename to app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFolderThumbnailStyleDialog.kt index 10e5129da..b41b4b23e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeThumbnailStyleDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFolderThumbnailStyleDialog.kt @@ -15,16 +15,16 @@ import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.extensions.config import com.simplemobiletools.gallery.pro.helpers.* -import kotlinx.android.synthetic.main.dialog_change_thumbnail_style.view.* +import kotlinx.android.synthetic.main.dialog_change_folder_thumbnail_style.view.* import kotlinx.android.synthetic.main.directory_item_grid_square.view.* -class ChangeThumbnailStyleDialog(val activity: BaseSimpleActivity, val callback: () -> Unit) : DialogInterface.OnClickListener { +class ChangeFolderThumbnailStyleDialog(val activity: BaseSimpleActivity, val callback: () -> Unit) : DialogInterface.OnClickListener { private var config = activity.config private var view: View init { - view = activity.layoutInflater.inflate(R.layout.dialog_change_thumbnail_style, null).apply { - dialog_limit_title.isChecked = config.limitFolderTitle + view = activity.layoutInflater.inflate(R.layout.dialog_change_folder_thumbnail_style, null).apply { + dialog_folder_limit_title.isChecked = config.limitFolderTitle } AlertDialog.Builder(activity) @@ -40,29 +40,29 @@ class ChangeThumbnailStyleDialog(val activity: BaseSimpleActivity, val callback: } private fun setupStyle() { - val styleRadio = view.dialog_radio_style + val styleRadio = view.dialog_radio_folder_style styleRadio.setOnCheckedChangeListener { group, checkedId -> updateSample() } val styleBtn = when (config.folderStyle) { - FOLDER_STYLE_SQUARE -> styleRadio.dialog_radio_square - else -> styleRadio.dialog_radio_rounded_corners + FOLDER_STYLE_SQUARE -> styleRadio.dialog_radio_folder_square + else -> styleRadio.dialog_radio_folder_rounded_corners } styleBtn.isChecked = true } private fun setupMediaCount() { - val countRadio = view.dialog_radio_count_holder + val countRadio = view.dialog_radio_folder_count_holder countRadio.setOnCheckedChangeListener { group, checkedId -> updateSample() } val countBtn = when (config.showFolderMediaCount) { - FOLDER_MEDIA_CNT_LINE -> countRadio.dialog_radio_count_line - FOLDER_MEDIA_CNT_BRACKETS -> countRadio.dialog_radio_count_brackets - else -> countRadio.dialog_radio_count_none + FOLDER_MEDIA_CNT_LINE -> countRadio.dialog_radio_folder_count_line + FOLDER_MEDIA_CNT_BRACKETS -> countRadio.dialog_radio_folder_count_brackets + else -> countRadio.dialog_radio_folder_count_none } countBtn.isChecked = true @@ -72,23 +72,23 @@ class ChangeThumbnailStyleDialog(val activity: BaseSimpleActivity, val callback: val photoCount = 36 val folderName = "Camera" view.apply { - val useRoundedCornersLayout = dialog_radio_style.checkedRadioButtonId == R.id.dialog_radio_rounded_corners - dialog_sample_holder.removeAllViews() + val useRoundedCornersLayout = dialog_radio_folder_style.checkedRadioButtonId == R.id.dialog_radio_folder_rounded_corners + dialog_folder_sample_holder.removeAllViews() val layout = if (useRoundedCornersLayout) R.layout.directory_item_grid_rounded_corners else R.layout.directory_item_grid_square val sampleView = activity.layoutInflater.inflate(layout, null) - dialog_sample_holder.addView(sampleView) + dialog_folder_sample_holder.addView(sampleView) sampleView.layoutParams.width = activity.resources.getDimension(R.dimen.sample_thumbnail_size).toInt() (sampleView.layoutParams as RelativeLayout.LayoutParams).addRule(RelativeLayout.CENTER_HORIZONTAL) - when (dialog_radio_count_holder.checkedRadioButtonId) { - R.id.dialog_radio_count_line -> { + when (dialog_radio_folder_count_holder.checkedRadioButtonId) { + R.id.dialog_radio_folder_count_line -> { dir_name.text = folderName photo_cnt.text = photoCount.toString() photo_cnt.beVisible() } - R.id.dialog_radio_count_brackets -> { + R.id.dialog_radio_folder_count_brackets -> { photo_cnt.beGone() dir_name.text = "$folderName ($photoCount)" } @@ -115,20 +115,20 @@ class ChangeThumbnailStyleDialog(val activity: BaseSimpleActivity, val callback: } override fun onClick(dialog: DialogInterface, which: Int) { - val style = when (view.dialog_radio_style.checkedRadioButtonId) { - R.id.dialog_radio_square -> FOLDER_STYLE_SQUARE + val style = when (view.dialog_radio_folder_style.checkedRadioButtonId) { + R.id.dialog_radio_folder_square -> FOLDER_STYLE_SQUARE else -> FOLDER_STYLE_ROUNDED_CORNERS } - val count = when (view.dialog_radio_count_holder.checkedRadioButtonId) { - R.id.dialog_radio_count_line -> FOLDER_MEDIA_CNT_LINE - R.id.dialog_radio_count_brackets -> FOLDER_MEDIA_CNT_BRACKETS + val count = when (view.dialog_radio_folder_count_holder.checkedRadioButtonId) { + R.id.dialog_radio_folder_count_line -> FOLDER_MEDIA_CNT_LINE + R.id.dialog_radio_folder_count_brackets -> FOLDER_MEDIA_CNT_BRACKETS else -> FOLDER_MEDIA_CNT_NONE } config.folderStyle = style config.showFolderMediaCount = count - config.limitFolderTitle = view.dialog_limit_title.isChecked + config.limitFolderTitle = view.dialog_folder_limit_title.isChecked callback() } } diff --git a/app/src/main/res/layout/dialog_change_thumbnail_style.xml b/app/src/main/res/layout/dialog_change_folder_thumbnail_style.xml similarity index 86% rename from app/src/main/res/layout/dialog_change_thumbnail_style.xml rename to app/src/main/res/layout/dialog_change_folder_thumbnail_style.xml index 34d935527..e29763f1a 100644 --- a/app/src/main/res/layout/dialog_change_thumbnail_style.xml +++ b/app/src/main/res/layout/dialog_change_folder_thumbnail_style.xml @@ -14,19 +14,19 @@ android:paddingRight="@dimen/activity_margin">