mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
Merge pull request #2258 from Aga-C/mark-favorite-items
Added stars to mark favorite items (#2102)
This commit is contained in:
commit
510f48c413
12 changed files with 96 additions and 12 deletions
|
@ -73,6 +73,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
private var mStoredScrollHorizontally = true
|
private var mStoredScrollHorizontally = true
|
||||||
private var mStoredShowFileTypes = true
|
private var mStoredShowFileTypes = true
|
||||||
private var mStoredRoundedCorners = false
|
private var mStoredRoundedCorners = false
|
||||||
|
private var mStoredMarkFavoriteItems = true
|
||||||
private var mStoredTextColor = 0
|
private var mStoredTextColor = 0
|
||||||
private var mStoredAdjustedPrimaryColor = 0
|
private var mStoredAdjustedPrimaryColor = 0
|
||||||
private var mStoredThumbnailSpacing = 0
|
private var mStoredThumbnailSpacing = 0
|
||||||
|
@ -149,12 +150,11 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
getMediaAdapter()?.updatePrimaryColor(config.primaryColor)
|
getMediaAdapter()?.updatePrimaryColor(config.primaryColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mStoredThumbnailSpacing != config.thumbnailSpacing) {
|
if (
|
||||||
media_grid.adapter = null
|
mStoredThumbnailSpacing != config.thumbnailSpacing
|
||||||
setupAdapter()
|
|| mStoredRoundedCorners != config.fileRoundedCorners
|
||||||
}
|
|| mStoredMarkFavoriteItems != config.markFavoriteItems
|
||||||
|
) {
|
||||||
if (mStoredRoundedCorners != config.fileRoundedCorners) {
|
|
||||||
media_grid.adapter = null
|
media_grid.adapter = null
|
||||||
setupAdapter()
|
setupAdapter()
|
||||||
}
|
}
|
||||||
|
@ -306,6 +306,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
mStoredCropThumbnails = cropThumbnails
|
mStoredCropThumbnails = cropThumbnails
|
||||||
mStoredScrollHorizontally = scrollHorizontally
|
mStoredScrollHorizontally = scrollHorizontally
|
||||||
mStoredShowFileTypes = showThumbnailFileTypes
|
mStoredShowFileTypes = showThumbnailFileTypes
|
||||||
|
mStoredMarkFavoriteItems = markFavoriteItems
|
||||||
mStoredTextColor = textColor
|
mStoredTextColor = textColor
|
||||||
mStoredThumbnailSpacing = thumbnailSpacing
|
mStoredThumbnailSpacing = thumbnailSpacing
|
||||||
mStoredRoundedCorners = fileRoundedCorners
|
mStoredRoundedCorners = fileRoundedCorners
|
||||||
|
|
|
@ -731,6 +731,7 @@ class SettingsActivity : SimpleActivity() {
|
||||||
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_THUMBNAIL_FILE_TYPES, config.showThumbnailFileTypes)
|
put(SHOW_THUMBNAIL_FILE_TYPES, config.showThumbnailFileTypes)
|
||||||
|
put(MARK_FAVORITE_ITEMS, config.markFavoriteItems)
|
||||||
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)
|
||||||
|
@ -872,6 +873,7 @@ class SettingsActivity : SimpleActivity() {
|
||||||
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_THUMBNAIL_FILE_TYPES -> config.showThumbnailFileTypes = value.toBoolean()
|
SHOW_THUMBNAIL_FILE_TYPES -> config.showThumbnailFileTypes = value.toBoolean()
|
||||||
|
MARK_FAVORITE_ITEMS -> config.markFavoriteItems = 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()
|
||||||
|
|
|
@ -35,6 +35,7 @@ import kotlinx.android.synthetic.main.photo_item_grid.view.*
|
||||||
import kotlinx.android.synthetic.main.thumbnail_section.view.*
|
import kotlinx.android.synthetic.main.thumbnail_section.view.*
|
||||||
import kotlinx.android.synthetic.main.video_item_grid.view.*
|
import kotlinx.android.synthetic.main.video_item_grid.view.*
|
||||||
import kotlinx.android.synthetic.main.video_item_grid.view.media_item_holder
|
import kotlinx.android.synthetic.main.video_item_grid.view.media_item_holder
|
||||||
|
import kotlinx.android.synthetic.main.video_item_grid.view.favorite
|
||||||
import kotlinx.android.synthetic.main.video_item_grid.view.medium_check
|
import kotlinx.android.synthetic.main.video_item_grid.view.medium_check
|
||||||
import kotlinx.android.synthetic.main.video_item_grid.view.medium_name
|
import kotlinx.android.synthetic.main.video_item_grid.view.medium_name
|
||||||
import kotlinx.android.synthetic.main.video_item_grid.view.medium_thumbnail
|
import kotlinx.android.synthetic.main.video_item_grid.view.medium_thumbnail
|
||||||
|
@ -537,6 +538,8 @@ class MediaAdapter(
|
||||||
|
|
||||||
media_item_holder.setPadding(padding, padding, padding, padding)
|
media_item_holder.setPadding(padding, padding, padding, padding)
|
||||||
|
|
||||||
|
favorite.beVisibleIf(medium.isFavorite && config.markFavoriteItems)
|
||||||
|
|
||||||
play_portrait_outline?.beVisibleIf(medium.isVideo() || medium.isPortrait())
|
play_portrait_outline?.beVisibleIf(medium.isVideo() || medium.isPortrait())
|
||||||
if (medium.isVideo()) {
|
if (medium.isVideo()) {
|
||||||
play_portrait_outline?.setImageResource(R.drawable.ic_play_outline_vector)
|
play_portrait_outline?.setImageResource(R.drawable.ic_play_outline_vector)
|
||||||
|
|
|
@ -22,11 +22,13 @@ class ChangeFileThumbnailStyleDialog(val activity: BaseSimpleActivity) : DialogI
|
||||||
dialog_file_style_animate_gifs.isChecked = config.animateGifs
|
dialog_file_style_animate_gifs.isChecked = config.animateGifs
|
||||||
dialog_file_style_show_thumbnail_video_duration.isChecked = config.showThumbnailVideoDuration
|
dialog_file_style_show_thumbnail_video_duration.isChecked = config.showThumbnailVideoDuration
|
||||||
dialog_file_style_show_thumbnail_file_types.isChecked = config.showThumbnailFileTypes
|
dialog_file_style_show_thumbnail_file_types.isChecked = config.showThumbnailFileTypes
|
||||||
|
dialog_file_style_mark_favorite_items.isChecked = config.markFavoriteItems
|
||||||
|
|
||||||
dialog_file_style_rounded_corners_holder.setOnClickListener { dialog_file_style_rounded_corners.toggle() }
|
dialog_file_style_rounded_corners_holder.setOnClickListener { dialog_file_style_rounded_corners.toggle() }
|
||||||
dialog_file_style_animate_gifs_holder.setOnClickListener { dialog_file_style_animate_gifs.toggle() }
|
dialog_file_style_animate_gifs_holder.setOnClickListener { dialog_file_style_animate_gifs.toggle() }
|
||||||
dialog_file_style_show_thumbnail_video_duration_holder.setOnClickListener { dialog_file_style_show_thumbnail_video_duration.toggle() }
|
dialog_file_style_show_thumbnail_video_duration_holder.setOnClickListener { dialog_file_style_show_thumbnail_video_duration.toggle() }
|
||||||
dialog_file_style_show_thumbnail_file_types_holder.setOnClickListener { dialog_file_style_show_thumbnail_file_types.toggle() }
|
dialog_file_style_show_thumbnail_file_types_holder.setOnClickListener { dialog_file_style_show_thumbnail_file_types.toggle() }
|
||||||
|
dialog_file_style_mark_favorite_items_holder.setOnClickListener { dialog_file_style_mark_favorite_items.toggle() }
|
||||||
|
|
||||||
dialog_file_style_spacing_holder.setOnClickListener {
|
dialog_file_style_spacing_holder.setOnClickListener {
|
||||||
val items = arrayListOf(
|
val items = arrayListOf(
|
||||||
|
@ -61,6 +63,7 @@ class ChangeFileThumbnailStyleDialog(val activity: BaseSimpleActivity) : DialogI
|
||||||
config.animateGifs = view.dialog_file_style_animate_gifs.isChecked
|
config.animateGifs = view.dialog_file_style_animate_gifs.isChecked
|
||||||
config.showThumbnailVideoDuration = view.dialog_file_style_show_thumbnail_video_duration.isChecked
|
config.showThumbnailVideoDuration = view.dialog_file_style_show_thumbnail_video_duration.isChecked
|
||||||
config.showThumbnailFileTypes = view.dialog_file_style_show_thumbnail_file_types.isChecked
|
config.showThumbnailFileTypes = view.dialog_file_style_show_thumbnail_file_types.isChecked
|
||||||
|
config.markFavoriteItems = view.dialog_file_style_mark_favorite_items.isChecked
|
||||||
config.thumbnailSpacing = thumbnailSpacing
|
config.thumbnailSpacing = thumbnailSpacing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -167,6 +167,10 @@ class Config(context: Context) : BaseConfig(context) {
|
||||||
get() = prefs.getBoolean(SHOW_THUMBNAIL_FILE_TYPES, true)
|
get() = prefs.getBoolean(SHOW_THUMBNAIL_FILE_TYPES, true)
|
||||||
set(showThumbnailFileTypes) = prefs.edit().putBoolean(SHOW_THUMBNAIL_FILE_TYPES, showThumbnailFileTypes).apply()
|
set(showThumbnailFileTypes) = prefs.edit().putBoolean(SHOW_THUMBNAIL_FILE_TYPES, showThumbnailFileTypes).apply()
|
||||||
|
|
||||||
|
var markFavoriteItems: Boolean
|
||||||
|
get() = prefs.getBoolean(MARK_FAVORITE_ITEMS, true)
|
||||||
|
set(markFavoriteItems) = prefs.edit().putBoolean(MARK_FAVORITE_ITEMS, markFavoriteItems).apply()
|
||||||
|
|
||||||
var screenRotation: Int
|
var screenRotation: Int
|
||||||
get() = prefs.getInt(SCREEN_ROTATION, ROTATE_BY_SYSTEM_SETTING)
|
get() = prefs.getInt(SCREEN_ROTATION, ROTATE_BY_SYSTEM_SETTING)
|
||||||
set(screenRotation) = prefs.edit().putInt(SCREEN_ROTATION, screenRotation).apply()
|
set(screenRotation) = prefs.edit().putInt(SCREEN_ROTATION, screenRotation).apply()
|
||||||
|
|
|
@ -79,6 +79,7 @@ const val SHOW_NOTCH = "show_notch"
|
||||||
const val FILE_LOADING_PRIORITY = "file_loading_priority"
|
const val FILE_LOADING_PRIORITY = "file_loading_priority"
|
||||||
const val SPAM_FOLDERS_CHECKED = "spam_folders_checked"
|
const val SPAM_FOLDERS_CHECKED = "spam_folders_checked"
|
||||||
const val SHOW_THUMBNAIL_FILE_TYPES = "show_thumbnail_file_types"
|
const val SHOW_THUMBNAIL_FILE_TYPES = "show_thumbnail_file_types"
|
||||||
|
const val MARK_FAVORITE_ITEMS = "mark_favorite_items"
|
||||||
const val EDITOR_BRUSH_COLOR = "editor_brush_color"
|
const val EDITOR_BRUSH_COLOR = "editor_brush_color"
|
||||||
const val EDITOR_BRUSH_HARDNESS = "editor_brush_hardness"
|
const val EDITOR_BRUSH_HARDNESS = "editor_brush_hardness"
|
||||||
const val EDITOR_BRUSH_SIZE = "editor_brush_size"
|
const val EDITOR_BRUSH_SIZE = "editor_brush_size"
|
||||||
|
|
|
@ -108,5 +108,21 @@
|
||||||
android:text="@string/show_image_file_types" />
|
android:text="@string/show_image_file_types" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/dialog_file_style_mark_favorite_items_holder"
|
||||||
|
style="@style/SettingsHolderCheckboxStyle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||||
|
android:id="@+id/dialog_file_style_mark_favorite_items"
|
||||||
|
style="@style/SettingsCheckboxStyle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/mark_favorite_items" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
|
@ -27,6 +27,19 @@
|
||||||
android:textSize="@dimen/bigger_text_size"
|
android:textSize="@dimen/bigger_text_size"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/favorite"
|
||||||
|
android:layout_width="@dimen/favorite_icon_size"
|
||||||
|
android:layout_height="@dimen/favorite_icon_size"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_margin="@dimen/small_margin"
|
||||||
|
android:padding="@dimen/small_margin"
|
||||||
|
android:gravity="end"
|
||||||
|
android:background="@drawable/circle_black_background"
|
||||||
|
android:src="@drawable/ic_star_vector"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/medium_check"
|
android:id="@+id/medium_check"
|
||||||
android:layout_width="@dimen/selection_check_size"
|
android:layout_width="@dimen/selection_check_size"
|
||||||
|
|
|
@ -17,6 +17,19 @@
|
||||||
android:layout_width="@dimen/list_view_folder_thumbnail_size"
|
android:layout_width="@dimen/list_view_folder_thumbnail_size"
|
||||||
android:layout_height="@dimen/list_view_folder_thumbnail_size" />
|
android:layout_height="@dimen/list_view_folder_thumbnail_size" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/favorite"
|
||||||
|
android:layout_width="@dimen/favorite_list_icon_size"
|
||||||
|
android:layout_height="@dimen/favorite_list_icon_size"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_margin="@dimen/smaller_margin"
|
||||||
|
android:padding="@dimen/tiny_margin"
|
||||||
|
android:gravity="end"
|
||||||
|
android:background="@drawable/circle_black_background"
|
||||||
|
android:src="@drawable/ic_star_vector"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/medium_check"
|
android:id="@+id/medium_check"
|
||||||
android:layout_width="@dimen/selection_check_size"
|
android:layout_width="@dimen/selection_check_size"
|
||||||
|
|
|
@ -22,17 +22,30 @@
|
||||||
android:src="@drawable/ic_play_outline_vector"
|
android:src="@drawable/ic_play_outline_vector"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/video_duration"
|
android:id="@+id/favorite"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="@dimen/favorite_icon_size"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/favorite_icon_size"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_margin="@dimen/small_margin"
|
||||||
|
android:background="@drawable/circle_black_background"
|
||||||
|
android:gravity="end"
|
||||||
|
android:padding="@dimen/small_margin"
|
||||||
|
android:src="@drawable/ic_star_vector"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/video_duration"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignTop="@+id/play_portrait_outline"
|
||||||
|
android:layout_alignBottom="@+id/play_portrait_outline"
|
||||||
|
android:layout_marginTop="@dimen/small_margin"
|
||||||
|
android:layout_toEndOf="@id/play_portrait_outline"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="end"
|
android:gravity="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:paddingLeft="@dimen/small_margin"
|
|
||||||
android:paddingRight="@dimen/small_margin"
|
|
||||||
android:shadowColor="@color/default_background_color"
|
android:shadowColor="@color/default_background_color"
|
||||||
android:shadowRadius="4"
|
android:shadowRadius="4"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
|
|
|
@ -17,6 +17,19 @@
|
||||||
android:layout_width="@dimen/list_view_folder_thumbnail_size"
|
android:layout_width="@dimen/list_view_folder_thumbnail_size"
|
||||||
android:layout_height="@dimen/list_view_folder_thumbnail_size" />
|
android:layout_height="@dimen/list_view_folder_thumbnail_size" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/favorite"
|
||||||
|
android:layout_width="@dimen/favorite_list_icon_size"
|
||||||
|
android:layout_height="@dimen/favorite_list_icon_size"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_margin="@dimen/smaller_margin"
|
||||||
|
android:padding="@dimen/tiny_margin"
|
||||||
|
android:gravity="end"
|
||||||
|
android:background="@drawable/circle_black_background"
|
||||||
|
android:src="@drawable/ic_star_vector"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/medium_check"
|
android:id="@+id/medium_check"
|
||||||
android:layout_width="@dimen/selection_check_size"
|
android:layout_width="@dimen/selection_check_size"
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
<dimen name="medium_tmb_size">100dp</dimen>
|
<dimen name="medium_tmb_size">100dp</dimen>
|
||||||
<dimen name="sd_card_icon_size">20dp</dimen>
|
<dimen name="sd_card_icon_size">20dp</dimen>
|
||||||
<dimen name="play_outline_icon_size">22dp</dimen>
|
<dimen name="play_outline_icon_size">22dp</dimen>
|
||||||
|
<dimen name="favorite_list_icon_size">17dp</dimen>
|
||||||
|
<dimen name="favorite_icon_size">26dp</dimen>
|
||||||
<dimen name="selection_check_size">26dp</dimen>
|
<dimen name="selection_check_size">26dp</dimen>
|
||||||
<dimen name="drag_handle_size">34dp</dimen>
|
<dimen name="drag_handle_size">34dp</dimen>
|
||||||
<dimen name="play_outline_size_big">96dp</dimen>
|
<dimen name="play_outline_size_big">96dp</dimen>
|
||||||
|
|
Loading…
Reference in a new issue