mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-02-17 04:10:39 +01:00
show a placeholder text when theres no favorite folders
This commit is contained in:
parent
ac4d65c69d
commit
54b13bb54e
@ -2,6 +2,7 @@ package com.simplemobiletools.filemanager.activities
|
||||
|
||||
import android.graphics.PorterDuff
|
||||
import android.os.Bundle
|
||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||
import com.simplemobiletools.filemanager.R
|
||||
import com.simplemobiletools.filemanager.extensions.config
|
||||
import kotlinx.android.synthetic.main.activity_favorites.*
|
||||
@ -16,18 +17,20 @@ class FavoritesActivity : SimpleActivity() {
|
||||
|
||||
private fun updateFavorites() {
|
||||
favorites_holder.removeAllViews()
|
||||
val folders = config.favorites
|
||||
val favorites = config.favorites
|
||||
favorites_placeholder.beVisibleIf(favorites.isEmpty())
|
||||
favorites_placeholder.setTextColor(config.textColor)
|
||||
|
||||
for (folder in folders) {
|
||||
for (favorite in favorites) {
|
||||
layoutInflater.inflate(R.layout.item_favorite, null, false).apply {
|
||||
favorite_title.apply {
|
||||
text = folder
|
||||
text = favorite
|
||||
setTextColor(config.textColor)
|
||||
}
|
||||
favorite_icon.apply {
|
||||
setColorFilter(config.textColor, PorterDuff.Mode.SRC_IN)
|
||||
setOnClickListener {
|
||||
config.removeFavorite(folder)
|
||||
config.removeFavorite(favorite)
|
||||
updateFavorites()
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
android:paddingLeft="@dimen/big_margin"
|
||||
android:paddingRight="@dimen/big_margin"
|
||||
android:paddingTop="@dimen/activity_margin"
|
||||
android:text="@string/favorites_activity_placeholder"
|
||||
android:visibility="gone"/>
|
||||
</RelativeLayout>
|
||||
</ScrollView>
|
||||
|
@ -14,6 +14,7 @@
|
||||
<string name="remove_from_favorites">Remove from favorites</string>
|
||||
<string name="manage_favorites">Manage favorites</string>
|
||||
<string name="go_to_favorite">Go to favorite</string>
|
||||
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -14,6 +14,7 @@
|
||||
<string name="remove_from_favorites">Remove from favorites</string>
|
||||
<string name="manage_favorites">Manage favorites</string>
|
||||
<string name="go_to_favorite">Go to favorite</string>
|
||||
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -14,6 +14,7 @@
|
||||
<string name="remove_from_favorites">Enlever des favoris</string>
|
||||
<string name="manage_favorites">Manage favorites</string>
|
||||
<string name="go_to_favorite">Go to favorite</string>
|
||||
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -14,6 +14,7 @@
|
||||
<string name="remove_from_favorites">Remove from favorites</string>
|
||||
<string name="manage_favorites">Manage favorites</string>
|
||||
<string name="go_to_favorite">Go to favorite</string>
|
||||
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -14,6 +14,7 @@
|
||||
<string name="remove_from_favorites">Remove from favorites</string>
|
||||
<string name="manage_favorites">Manage favorites</string>
|
||||
<string name="go_to_favorite">Go to favorite</string>
|
||||
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -14,6 +14,7 @@
|
||||
<string name="remove_from_favorites">Remover dos favoritos</string>
|
||||
<string name="manage_favorites">Manage favorites</string>
|
||||
<string name="go_to_favorite">Go to favorite</string>
|
||||
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -14,6 +14,7 @@
|
||||
<string name="remove_from_favorites">Убрать из избранного</string>
|
||||
<string name="manage_favorites">Manage favorites</string>
|
||||
<string name="go_to_favorite">Go to favorite</string>
|
||||
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -14,6 +14,7 @@
|
||||
<string name="remove_from_favorites">Ta bort från favoriter</string>
|
||||
<string name="manage_favorites">Manage favorites</string>
|
||||
<string name="go_to_favorite">Go to favorite</string>
|
||||
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -14,6 +14,7 @@
|
||||
<string name="remove_from_favorites">Favorilerden kaldır</string>
|
||||
<string name="manage_favorites">Manage favorites</string>
|
||||
<string name="go_to_favorite">Go to favorite</string>
|
||||
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -14,6 +14,7 @@
|
||||
<string name="remove_from_favorites">Remove from favorites</string>
|
||||
<string name="manage_favorites">Manage favorites</string>
|
||||
<string name="go_to_favorite">Go to favorite</string>
|
||||
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
Loading…
x
Reference in New Issue
Block a user