show a different placeholder at empty favorites

This commit is contained in:
tibbi 2017-12-30 17:31:59 +01:00
parent 0b360ec934
commit 09b9d954fb
10 changed files with 54 additions and 5 deletions

View File

@ -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"

View File

@ -12,6 +12,10 @@ class ContactsFragment(context: Context, attributeSet: AttributeSet) : MyViewPag
}
}
override fun placeholderClicked() {
activity!!.showFilterDialog()
}
override fun refreshItems() {
initContacts()
}

View File

@ -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()
}
}
}

View File

@ -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()
}

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>