always show the sidebar info bubble at scrolling by handle

This commit is contained in:
tibbi 2020-06-12 22:08:52 +02:00
parent 32b9a5db08
commit c3afe2b6d3
8 changed files with 7 additions and 59 deletions

View file

@ -78,7 +78,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.simplemobiletools:commons:5.29.5' implementation 'com.simplemobiletools:commons:5.29.7'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1'

View file

@ -84,7 +84,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
private var mStoredCropThumbnails = true private var mStoredCropThumbnails = true
private var mStoredScrollHorizontally = true private var mStoredScrollHorizontally = true
private var mStoredShowMediaCount = true private var mStoredShowMediaCount = true
private var mStoredShowInfoBubble = true
private var mStoredTextColor = 0 private var mStoredTextColor = 0
private var mStoredPrimaryColor = 0 private var mStoredPrimaryColor = 0
@ -204,8 +203,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
directories_horizontal_fastscroller.updateBubbleColors() directories_horizontal_fastscroller.updateBubbleColors()
directories_vertical_fastscroller.updateBubbleColors() directories_vertical_fastscroller.updateBubbleColors()
directories_horizontal_fastscroller.allowBubbleDisplay = config.showInfoBubble
directories_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble
directories_refresh_layout.isEnabled = config.enablePullToRefresh directories_refresh_layout.isEnabled = config.enablePullToRefresh
directories_empty_placeholder.setTextColor(config.textColor) directories_empty_placeholder.setTextColor(config.textColor)
@ -343,7 +340,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
mStoredCropThumbnails = cropThumbnails mStoredCropThumbnails = cropThumbnails
mStoredScrollHorizontally = scrollHorizontally mStoredScrollHorizontally = scrollHorizontally
mStoredShowMediaCount = showMediaCount mStoredShowMediaCount = showMediaCount
mStoredShowInfoBubble = showInfoBubble
mStoredTextColor = textColor mStoredTextColor = textColor
mStoredPrimaryColor = primaryColor mStoredPrimaryColor = primaryColor
} }
@ -1177,12 +1173,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
directories_horizontal_fastscroller.beVisibleIf(allowHorizontalScroll) directories_horizontal_fastscroller.beVisibleIf(allowHorizontalScroll)
if (allowHorizontalScroll) { if (allowHorizontalScroll) {
directories_horizontal_fastscroller.allowBubbleDisplay = config.showInfoBubble
directories_horizontal_fastscroller.setViews(directories_grid, directories_refresh_layout) { directories_horizontal_fastscroller.setViews(directories_grid, directories_refresh_layout) {
directories_horizontal_fastscroller.updateBubbleText(getBubbleTextItem(it)) directories_horizontal_fastscroller.updateBubbleText(getBubbleTextItem(it))
} }
} else { } else {
directories_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble
directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout) { directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout) {
directories_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it)) directories_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it))
} }

View file

@ -76,7 +76,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
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 mStoredShowInfoBubble = true
private var mStoredShowFileTypes = true private var mStoredShowFileTypes = true
private var mStoredTextColor = 0 private var mStoredTextColor = 0
private var mStoredPrimaryColor = 0 private var mStoredPrimaryColor = 0
@ -159,8 +158,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
media_horizontal_fastscroller.updateBubbleColors() media_horizontal_fastscroller.updateBubbleColors()
media_vertical_fastscroller.updateBubbleColors() media_vertical_fastscroller.updateBubbleColors()
media_horizontal_fastscroller.allowBubbleDisplay = config.showInfoBubble
media_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble
media_refresh_layout.isEnabled = config.enablePullToRefresh media_refresh_layout.isEnabled = config.enablePullToRefresh
media_empty_text_placeholder.setTextColor(config.textColor) media_empty_text_placeholder.setTextColor(config.textColor)
media_empty_text_placeholder_2.setTextColor(getAdjustedPrimaryColor()) media_empty_text_placeholder_2.setTextColor(getAdjustedPrimaryColor())
@ -294,7 +291,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
mStoredAnimateGifs = animateGifs mStoredAnimateGifs = animateGifs
mStoredCropThumbnails = cropThumbnails mStoredCropThumbnails = cropThumbnails
mStoredScrollHorizontally = scrollHorizontally mStoredScrollHorizontally = scrollHorizontally
mStoredShowInfoBubble = showInfoBubble
mStoredShowFileTypes = showThumbnailFileTypes mStoredShowFileTypes = showThumbnailFileTypes
mStoredTextColor = textColor mStoredTextColor = textColor
mStoredPrimaryColor = primaryColor mStoredPrimaryColor = primaryColor
@ -426,12 +422,10 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
val sorting = config.getFolderSorting(if (mShowAll) SHOW_ALL else mPath) val sorting = config.getFolderSorting(if (mShowAll) SHOW_ALL else mPath)
if (allowHorizontalScroll) { if (allowHorizontalScroll) {
media_horizontal_fastscroller.allowBubbleDisplay = config.showInfoBubble
media_horizontal_fastscroller.setViews(media_grid, media_refresh_layout) { media_horizontal_fastscroller.setViews(media_grid, media_refresh_layout) {
media_horizontal_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting)) media_horizontal_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting))
} }
} else { } else {
media_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble
media_vertical_fastscroller.setViews(media_grid, media_refresh_layout) { media_vertical_fastscroller.setViews(media_grid, media_refresh_layout) {
media_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting)) media_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting))
} }

View file

@ -218,12 +218,10 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener {
val sorting = config.getFolderSorting(SHOW_ALL) val sorting = config.getFolderSorting(SHOW_ALL)
if (allowHorizontalScroll) { if (allowHorizontalScroll) {
media_horizontal_fastscroller.allowBubbleDisplay = config.showInfoBubble
media_horizontal_fastscroller.setViews(media_grid) { media_horizontal_fastscroller.setViews(media_grid) {
media_horizontal_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting)) media_horizontal_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting))
} }
} else { } else {
media_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble
media_vertical_fastscroller.setViews(media_grid) { media_vertical_fastscroller.setViews(media_grid) {
media_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting)) media_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting))
} }

View file

@ -70,7 +70,6 @@ class SettingsActivity : SimpleActivity() {
setupThumbnailFileTypes() setupThumbnailFileTypes()
setupShowMediaCount() setupShowMediaCount()
setupKeepLastModified() setupKeepLastModified()
setupShowInfoBubble()
setupEnablePullToRefresh() setupEnablePullToRefresh()
setupAllowZoomingImages() setupAllowZoomingImages()
setupShowHighestQuality() setupShowHighestQuality()
@ -428,14 +427,6 @@ class SettingsActivity : SimpleActivity() {
} }
} }
private fun setupShowInfoBubble() {
settings_show_info_bubble.isChecked = config.showInfoBubble
settings_show_info_bubble_holder.setOnClickListener {
settings_show_info_bubble.toggle()
config.showInfoBubble = settings_show_info_bubble.isChecked
}
}
private fun setupEnablePullToRefresh() { private fun setupEnablePullToRefresh() {
settings_enable_pull_to_refresh.isChecked = config.enablePullToRefresh settings_enable_pull_to_refresh.isChecked = config.enablePullToRefresh
settings_enable_pull_to_refresh_holder.setOnClickListener { settings_enable_pull_to_refresh_holder.setOnClickListener {
@ -650,7 +641,6 @@ 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_MEDIA_COUNT, config.showMediaCount) put(SHOW_MEDIA_COUNT, config.showMediaCount)
put(SHOW_INFO_BUBBLE, config.showInfoBubble)
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)
@ -786,7 +776,6 @@ 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_MEDIA_COUNT -> config.showMediaCount = value.toBoolean() SHOW_MEDIA_COUNT -> config.showMediaCount = value.toBoolean()
SHOW_INFO_BUBBLE -> config.showInfoBubble = 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()

View file

@ -134,12 +134,10 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri
directories_horizontal_fastscroller.beVisibleIf(scrollHorizontally) directories_horizontal_fastscroller.beVisibleIf(scrollHorizontally)
if (scrollHorizontally) { if (scrollHorizontally) {
directories_horizontal_fastscroller.allowBubbleDisplay = activity.config.showInfoBubble
directories_horizontal_fastscroller.setViews(directories_grid) { directories_horizontal_fastscroller.setViews(directories_grid) {
directories_horizontal_fastscroller.updateBubbleText(dirs[it].getBubbleText(sorting, activity, dateFormat, timeFormat)) directories_horizontal_fastscroller.updateBubbleText(dirs[it].getBubbleText(sorting, activity, dateFormat, timeFormat))
} }
} else { } else {
directories_vertical_fastscroller.allowBubbleDisplay = activity.config.showInfoBubble
directories_vertical_fastscroller.setViews(directories_grid) { directories_vertical_fastscroller.setViews(directories_grid) {
directories_vertical_fastscroller.updateBubbleText(dirs[it].getBubbleText(sorting, activity, dateFormat, timeFormat)) directories_vertical_fastscroller.updateBubbleText(dirs[it].getBubbleText(sorting, activity, dateFormat, timeFormat))
} }

View file

@ -87,13 +87,11 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c
media_horizontal_fastscroller.beVisibleIf(scrollHorizontally) media_horizontal_fastscroller.beVisibleIf(scrollHorizontally)
if (scrollHorizontally) { if (scrollHorizontally) {
media_horizontal_fastscroller.allowBubbleDisplay = activity.config.showInfoBubble
media_horizontal_fastscroller.setViews(media_grid) { media_horizontal_fastscroller.setViews(media_grid) {
val medium = (media[it] as? Medium) val medium = (media[it] as? Medium)
media_horizontal_fastscroller.updateBubbleText(medium?.getBubbleText(sorting, activity, dateFormat, timeFormat) ?: "") media_horizontal_fastscroller.updateBubbleText(medium?.getBubbleText(sorting, activity, dateFormat, timeFormat) ?: "")
} }
} else { } else {
media_vertical_fastscroller.allowBubbleDisplay = activity.config.showInfoBubble
media_vertical_fastscroller.setViews(media_grid) { media_vertical_fastscroller.setViews(media_grid) {
val medium = (media[it] as? Medium) val medium = (media[it] as? Medium)
media_vertical_fastscroller.updateBubbleText(medium?.getBubbleText(sorting, activity, dateFormat, timeFormat) ?: "") media_vertical_fastscroller.updateBubbleText(medium?.getBubbleText(sorting, activity, dateFormat, timeFormat) ?: "")

View file

@ -468,29 +468,6 @@
android:textAllCaps="true" android:textAllCaps="true"
android:textSize="@dimen/smaller_text_size" /> android:textSize="@dimen/smaller_text_size" />
<RelativeLayout
android:id="@+id/settings_show_info_bubble_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:paddingEnd="@dimen/normal_margin"
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_show_info_bubble"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingStart="@dimen/medium_margin"
android:text="@string/show_info_bubble"
app:switchPadding="@dimen/medium_margin" />
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/settings_scroll_horizontally_holder" android:id="@+id/settings_scroll_horizontally_holder"
android:layout_width="match_parent" android:layout_width="match_parent"