Skip to content

Commit 54b13bb

Browse files
committed
show a placeholder text when theres no favorite folders
1 parent ac4d65c commit 54b13bb

File tree

12 files changed

+18
-4
lines changed

12 files changed

+18
-4
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/activities/FavoritesActivity.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.simplemobiletools.filemanager.activities
22

33
import android.graphics.PorterDuff
44
import android.os.Bundle
5+
import com.simplemobiletools.commons.extensions.beVisibleIf
56
import com.simplemobiletools.filemanager.R
67
import com.simplemobiletools.filemanager.extensions.config
78
import kotlinx.android.synthetic.main.activity_favorites.*
@@ -16,18 +17,20 @@ class FavoritesActivity : SimpleActivity() {
1617

1718
private fun updateFavorites() {
1819
favorites_holder.removeAllViews()
19-
val folders = config.favorites
20+
val favorites = config.favorites
21+
favorites_placeholder.beVisibleIf(favorites.isEmpty())
22+
favorites_placeholder.setTextColor(config.textColor)
2023

21-
for (folder in folders) {
24+
for (favorite in favorites) {
2225
layoutInflater.inflate(R.layout.item_favorite, null, false).apply {
2326
favorite_title.apply {
24-
text = folder
27+
text = favorite
2528
setTextColor(config.textColor)
2629
}
2730
favorite_icon.apply {
2831
setColorFilter(config.textColor, PorterDuff.Mode.SRC_IN)
2932
setOnClickListener {
30-
config.removeFavorite(folder)
33+
config.removeFavorite(favorite)
3134
updateFavorites()
3235
}
3336
}

app/src/main/res/layout/activity_favorites.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
android:paddingLeft="@dimen/big_margin"
2525
android:paddingRight="@dimen/big_margin"
2626
android:paddingTop="@dimen/activity_margin"
27+
android:text="@string/favorites_activity_placeholder"
2728
android:visibility="gone"/>
2829
</RelativeLayout>
2930
</ScrollView>

app/src/main/res/values-de/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<string name="remove_from_favorites">Remove from favorites</string>
1515
<string name="manage_favorites">Manage favorites</string>
1616
<string name="go_to_favorite">Go to favorite</string>
17+
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
1718

1819
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
1920
<!-- Short description has to have less than 80 chars -->

app/src/main/res/values-es/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<string name="remove_from_favorites">Remove from favorites</string>
1515
<string name="manage_favorites">Manage favorites</string>
1616
<string name="go_to_favorite">Go to favorite</string>
17+
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
1718

1819
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
1920
<!-- Short description has to have less than 80 chars -->

app/src/main/res/values-fr/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<string name="remove_from_favorites">Enlever des favoris</string>
1515
<string name="manage_favorites">Manage favorites</string>
1616
<string name="go_to_favorite">Go to favorite</string>
17+
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
1718

1819
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
1920
<!-- Short description has to have less than 80 chars -->

app/src/main/res/values-it/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<string name="remove_from_favorites">Remove from favorites</string>
1515
<string name="manage_favorites">Manage favorites</string>
1616
<string name="go_to_favorite">Go to favorite</string>
17+
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
1718

1819
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
1920
<!-- Short description has to have less than 80 chars -->

app/src/main/res/values-ja/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<string name="remove_from_favorites">Remove from favorites</string>
1515
<string name="manage_favorites">Manage favorites</string>
1616
<string name="go_to_favorite">Go to favorite</string>
17+
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
1718

1819
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
1920
<!-- Short description has to have less than 80 chars -->

app/src/main/res/values-pt-rPT/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<string name="remove_from_favorites">Remover dos favoritos</string>
1515
<string name="manage_favorites">Manage favorites</string>
1616
<string name="go_to_favorite">Go to favorite</string>
17+
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
1718

1819
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
1920
<!-- Short description has to have less than 80 chars -->

app/src/main/res/values-ru/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<string name="remove_from_favorites">Убрать из избранного</string>
1515
<string name="manage_favorites">Manage favorites</string>
1616
<string name="go_to_favorite">Go to favorite</string>
17+
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
1718

1819
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
1920
<!-- Short description has to have less than 80 chars -->

app/src/main/res/values-sv/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<string name="remove_from_favorites">Ta bort från favoriter</string>
1515
<string name="manage_favorites">Manage favorites</string>
1616
<string name="go_to_favorite">Go to favorite</string>
17+
<string name="favorites_activity_placeholder">You can add frequently used folders to favorites for easy access from anywhere.</string>
1718

1819
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
1920
<!-- Short description has to have less than 80 chars -->

0 commit comments

Comments
 (0)