From aa7300fc3550f3c1c3a8bb573eb4545361f0dcec Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 18 Apr 2020 10:32:13 +0200 Subject: [PATCH] updating placeholder texts a bit --- .../gallery/pro/activities/MainActivity.kt | 33 ++++++++++--------- .../gallery/pro/activities/MediaActivity.kt | 22 ++++++------- .../gallery/pro/activities/SearchActivity.kt | 8 ++--- app/src/main/res/layout/activity_main.xml | 12 ++++--- app/src/main/res/layout/activity_media.xml | 25 +++++++------- app/src/main/res/layout/activity_search.xml | 19 ++++++----- 6 files changed, 62 insertions(+), 57 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index 82c781150..113de1281 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -196,8 +196,9 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { directories_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble directories_refresh_layout.isEnabled = config.enablePullToRefresh invalidateOptionsMenu() - directories_empty_text_label.setTextColor(config.textColor) - directories_empty_text.setTextColor(getAdjustedPrimaryColor()) + + directories_empty_placeholder.setTextColor(config.textColor) + directories_empty_placeholder_2.setTextColor(getAdjustedPrimaryColor()) directories_switch_searching.setTextColor(getAdjustedPrimaryColor()) directories_switch_searching.underlineText() @@ -1009,8 +1010,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { if (isPlaceholderVisible) { isPlaceholderVisible = false runOnUiThread { - directories_empty_text_label.beGone() - directories_empty_text.beGone() + directories_empty_placeholder.beGone() + directories_empty_placeholder_2.beGone() directories_grid.beVisible() } } @@ -1052,32 +1053,32 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } private fun checkPlaceholderVisibility(dirs: ArrayList) { - directories_empty_text_label.beVisibleIf(dirs.isEmpty() && mLoadedInitialPhotos) - directories_empty_text.beVisibleIf(dirs.isEmpty() && mLoadedInitialPhotos) + directories_empty_placeholder.beVisibleIf(dirs.isEmpty() && mLoadedInitialPhotos) + directories_empty_placeholder_2.beVisibleIf(dirs.isEmpty() && mLoadedInitialPhotos) if (mIsSearchOpen) { - directories_empty_text_label.text = getString(R.string.no_items_found) - directories_empty_text.beGone() + directories_empty_placeholder.text = getString(R.string.no_items_found) + directories_empty_placeholder_2.beGone() } else if (dirs.isEmpty() && config.filterMedia == TYPE_DEFAULT_FILTER) { - directories_empty_text_label.text = getString(R.string.no_media_add_included) - directories_empty_text.text = getString(R.string.add_folder) + directories_empty_placeholder.text = getString(R.string.no_media_add_included) + directories_empty_placeholder_2.text = getString(R.string.add_folder) - directories_empty_text.setOnClickListener { + directories_empty_placeholder_2.setOnClickListener { showAddIncludedFolderDialog { refreshItems() } } } else { - directories_empty_text_label.text = getString(R.string.no_media_with_filters) - directories_empty_text.text = getString(R.string.change_filters_underlined) + directories_empty_placeholder.text = getString(R.string.no_media_with_filters) + directories_empty_placeholder_2.text = getString(R.string.change_filters_underlined) - directories_empty_text.setOnClickListener { + directories_empty_placeholder_2.setOnClickListener { showFilterMediaDialog() } } - directories_empty_text.underlineText() - directories_grid.beVisibleIf(directories_empty_text_label.isGone()) + directories_empty_placeholder_2.underlineText() + directories_grid.beVisibleIf(directories_empty_placeholder.isGone()) } private fun setupAdapter(dirs: ArrayList, textToSearch: String = "") { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt index 2eaf9f668..03db71e21 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt @@ -108,7 +108,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { registerFileUpdateListener() } - media_empty_text.setOnClickListener { + media_empty_text_placeholder_2.setOnClickListener { showFilterMediaDialog() } @@ -156,8 +156,8 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { media_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble media_refresh_layout.isEnabled = config.enablePullToRefresh invalidateOptionsMenu() - media_empty_text_label.setTextColor(config.textColor) - media_empty_text.setTextColor(getAdjustedPrimaryColor()) + media_empty_text_placeholder.setTextColor(config.textColor) + media_empty_text_placeholder_2.setTextColor(getAdjustedPrimaryColor()) if (mMedia.isEmpty() || config.getFolderSorting(mPath) and SORT_BY_RANDOM == 0) { tryLoadGallery() @@ -339,10 +339,10 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { val grouped = MediaFetcher(applicationContext).groupMedia(filtered as ArrayList, mPath) runOnUiThread { if (grouped.isEmpty()) { - media_empty_text_label.text = getString(R.string.no_items_found) - media_empty_text_label.beVisible() + media_empty_text_placeholder.text = getString(R.string.no_items_found) + media_empty_text_placeholder.beVisible() } else { - media_empty_text_label.beGone() + media_empty_text_placeholder.beGone() } getMediaAdapter()?.updateMedia(grouped) @@ -876,13 +876,13 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { runOnUiThread { media_refresh_layout.isRefreshing = false - media_empty_text_label.beVisibleIf(media.isEmpty() && !isFromCache) - media_empty_text.beVisibleIf(media.isEmpty() && !isFromCache) + media_empty_text_placeholder.beVisibleIf(media.isEmpty() && !isFromCache) + media_empty_text_placeholder_2.beVisibleIf(media.isEmpty() && !isFromCache) - if (media_empty_text_label.isVisible()) { - media_empty_text_label.text = getString(R.string.no_media_with_filters) + if (media_empty_text_placeholder.isVisible()) { + media_empty_text_placeholder.text = getString(R.string.no_media_with_filters) } - media_grid.beVisibleIf(media_empty_text_label.isGone()) + media_grid.beVisibleIf(media_empty_text_placeholder.isGone()) val viewType = config.getFolderViewType(if (mShowAll) SHOW_ALL else mPath) val allowHorizontalScroll = config.scrollHorizontally && viewType == VIEW_TYPE_GRID diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt index 85dc0331a..ced82efa0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt @@ -39,7 +39,7 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_search) - media_empty_text_label.setTextColor(config.textColor) + media_empty_text_placeholder.setTextColor(config.textColor) getAllMedia() } @@ -108,10 +108,10 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { val grouped = MediaFetcher(applicationContext).groupMedia(filtered as ArrayList, "") runOnUiThread { if (grouped.isEmpty()) { - media_empty_text_label.text = getString(R.string.no_items_found) - media_empty_text_label.beVisible() + media_empty_text_placeholder.text = getString(R.string.no_items_found) + media_empty_text_placeholder.beVisible() } else { - media_empty_text_label.beGone() + media_empty_text_placeholder.beGone() } getMediaAdapter()?.updateMedia(grouped) diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 1d2d25731..6e2f06d16 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -22,23 +22,25 @@ android:visibility="gone"/> - + android:textStyle="italic" + android:visibility="gone" /> + android:visibility="gone" /> + app:spanCount="@integer/media_columns_vertical_scroll" /> - + @@ -64,7 +65,7 @@ android:paddingTop="@dimen/normal_margin" android:visibility="gone"> - + diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml index 13f9fb57e..cee91220e 100644 --- a/app/src/main/res/layout/activity_search.xml +++ b/app/src/main/res/layout/activity_search.xml @@ -1,22 +1,23 @@ - + android:textStyle="italic" + android:visibility="gone" /> + app:spanCount="@integer/media_columns_vertical_scroll" /> - + @@ -47,7 +48,7 @@ android:paddingTop="@dimen/normal_margin" android:visibility="gone"> - +