show a different placeholder at empty favorites
This commit is contained in:
parent
0b360ec934
commit
09b9d954fb
|
@ -36,7 +36,7 @@ ext {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.simplemobiletools:commons:3.5.0'
|
||||
implementation 'com.simplemobiletools:commons:3.5.1'
|
||||
implementation 'joda-time:joda-time:2.9.9'
|
||||
|
||||
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
|
||||
|
|
|
@ -12,6 +12,10 @@ class ContactsFragment(context: Context, attributeSet: AttributeSet) : MyViewPag
|
|||
}
|
||||
}
|
||||
|
||||
override fun placeholderClicked() {
|
||||
activity!!.showFilterDialog()
|
||||
}
|
||||
|
||||
override fun refreshItems() {
|
||||
initContacts()
|
||||
}
|
||||
|
|
|
@ -6,12 +6,20 @@ import com.simplemobiletools.contacts.dialogs.AddFavoritesDialog
|
|||
|
||||
class FavoritesFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet) {
|
||||
override fun fabClicked() {
|
||||
AddFavoritesDialog(activity!!) {
|
||||
initContacts()
|
||||
}
|
||||
showAddFavoritesDialog()
|
||||
}
|
||||
|
||||
override fun placeholderClicked() {
|
||||
showAddFavoritesDialog()
|
||||
}
|
||||
|
||||
override fun refreshItems() {
|
||||
initContacts()
|
||||
}
|
||||
|
||||
private fun showAddFavoritesDialog() {
|
||||
AddFavoritesDialog(activity!!) {
|
||||
initContacts()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,11 +36,16 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
|||
}
|
||||
|
||||
fragment_placeholder_2.setOnClickListener {
|
||||
activity.showFilterDialog()
|
||||
placeholderClicked()
|
||||
}
|
||||
|
||||
fragment_placeholder_2.paintFlags = fragment_placeholder_2.paintFlags or Paint.UNDERLINE_TEXT_FLAG
|
||||
updateViewStuff()
|
||||
|
||||
if (this is FavoritesFragment) {
|
||||
fragment_placeholder.text = activity.getString(R.string.no_favorites)
|
||||
fragment_placeholder_2.text = activity.getString(R.string.add_favorites)
|
||||
}
|
||||
}
|
||||
|
||||
initContacts()
|
||||
|
@ -153,4 +158,6 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
|||
}
|
||||
|
||||
abstract fun fabClicked()
|
||||
|
||||
abstract fun placeholderClicked()
|
||||
}
|
||||
|
|
|
@ -40,6 +40,11 @@
|
|||
<string name="birthday">Geburtstag</string>
|
||||
<string name="anniversary">Jahrestag</string>
|
||||
|
||||
<!-- Favorites -->
|
||||
<string name="no_favorites">Seems like you haven\'t added any favorite contacts yet.</string>
|
||||
<string name="add_favorites">Add favorites</string>
|
||||
<string name="remove_from_favorites">Remove from favorites</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
<string name="app_short_description">Eine App zum Verwalten von Kontakten, ganz ohne Werbung.</string>
|
||||
|
|
|
@ -40,6 +40,11 @@
|
|||
<string name="birthday">생일</string>
|
||||
<string name="anniversary">기념일</string>
|
||||
|
||||
<!-- Favorites -->
|
||||
<string name="no_favorites">Seems like you haven\'t added any favorite contacts yet.</string>
|
||||
<string name="add_favorites">Add favorites</string>
|
||||
<string name="remove_from_favorites">Remove from favorites</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
<string name="app_short_description">광고가 없는 연락처 관리 애플리케이션입니다.</string>
|
||||
|
|
|
@ -40,6 +40,11 @@
|
|||
<string name="birthday">Birthday</string>
|
||||
<string name="anniversary">Anniversary</string>
|
||||
|
||||
<!-- Favorites -->
|
||||
<string name="no_favorites">Seems like you haven\'t added any favorite contacts yet.</string>
|
||||
<string name="add_favorites">Add favorites</string>
|
||||
<string name="remove_from_favorites">Remove from favorites</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
<string name="app_short_description">A contacts app for managing your contacts without ads.</string>
|
||||
|
|
|
@ -40,6 +40,11 @@
|
|||
<string name="birthday">День рождения</string>
|
||||
<string name="anniversary">Годовщина</string>
|
||||
|
||||
<!-- Favorites -->
|
||||
<string name="no_favorites">Seems like you haven\'t added any favorite contacts yet.</string>
|
||||
<string name="add_favorites">Add favorites</string>
|
||||
<string name="remove_from_favorites">Remove from favorites</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
<string name="app_short_description">A contacts app for managing your contacts without ads.</string>
|
||||
|
|
|
@ -40,6 +40,11 @@
|
|||
<string name="birthday">Narodeniny</string>
|
||||
<string name="anniversary">Výročie</string>
|
||||
|
||||
<!-- Favorites -->
|
||||
<string name="no_favorites">Zdá sa, že ste ešte nepridali žiadne obľúbené kontakty.</string>
|
||||
<string name="add_favorites">Pridať obľúbené</string>
|
||||
<string name="remove_from_favorites">Odstrániť z obľúbených</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
<string name="app_short_description">Aplikácia pre správu vašich kontaktov bez reklám.</string>
|
||||
|
|
|
@ -40,6 +40,11 @@
|
|||
<string name="birthday">Birthday</string>
|
||||
<string name="anniversary">Anniversary</string>
|
||||
|
||||
<!-- Favorites -->
|
||||
<string name="no_favorites">Seems like you haven\'t added any favorite contacts yet.</string>
|
||||
<string name="add_favorites">Add favorites</string>
|
||||
<string name="remove_from_favorites">Remove from favorites</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
<string name="app_short_description">A contacts app for managing your contacts without ads.</string>
|
||||
|
|
Loading…
Reference in New Issue