diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/fragments/GroupsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/fragments/GroupsFragment.kt index 338ff39e..1c4af541 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/fragments/GroupsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/fragments/GroupsFragment.kt @@ -5,6 +5,9 @@ import android.content.Intent import android.support.design.widget.CoordinatorLayout import android.util.AttributeSet import android.view.ViewGroup +import com.simplemobiletools.commons.extensions.beVisibleIf +import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor +import com.simplemobiletools.commons.extensions.underlineText import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.contacts.activities.GroupContactsActivity import com.simplemobiletools.contacts.activities.MainActivity @@ -32,6 +35,13 @@ class GroupsFragment(context: Context, attributeSet: AttributeSet) : Coordinator } } + groups_placeholder_2.setOnClickListener { + CreateNewGroupDialog(activity) { + refreshContacts(lastContacts) + } + } + + groups_placeholder_2.underlineText() updateViewStuff() } } @@ -62,7 +72,11 @@ class GroupsFragment(context: Context, attributeSet: AttributeSet) : Coordinator } } - storedGroups = storedGroups.sortedWith(compareBy { it.title }).toList() as ArrayList + groups_placeholder_2.beVisibleIf(storedGroups.isEmpty()) + groups_placeholder.beVisibleIf(storedGroups.isEmpty()) + groups_list.beVisibleIf(storedGroups.isNotEmpty()) + + storedGroups = storedGroups.sortedWith(compareBy { it.title }) as? ArrayList ?: ArrayList() val currAdapter = groups_list.adapter if (currAdapter == null) { GroupsAdapter(activity as SimpleActivity, storedGroups, groups_list, groups_fastscroller) { @@ -117,5 +131,6 @@ class GroupsFragment(context: Context, attributeSet: AttributeSet) : Coordinator context.updateTextColors(groups_wrapper.parent as ViewGroup) groups_fastscroller.updateBubbleColors() groups_fastscroller.allowBubbleDisplay = context.config.showInfoBubble + groups_placeholder_2.setTextColor(context.getAdjustedPrimaryColor()) } } diff --git a/app/src/main/res/layout/fragment_groups.xml b/app/src/main/res/layout/fragment_groups.xml index 771bc148..4d7ca134 100644 --- a/app/src/main/res/layout/fragment_groups.xml +++ b/app/src/main/res/layout/fragment_groups.xml @@ -11,6 +11,32 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> + + + + No groups Create a new group Remove from group + This group is empty + Add contacts + There are no contact groups on the device + Create group Foto machen diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 635f9997..f05f65c3 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -19,6 +19,10 @@ No groups Create a new group Remove from group + This group is empty + Add contacts + There are no contact groups on the device + Create group Prendre une photo diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 3ea4c0a0..dd42e2ff 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -19,6 +19,10 @@ No groups Create a new group Remove from group + This group is empty + Add contacts + There are no contact groups on the device + Create group 사진 촬영 diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 13117b75..2252cd62 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -19,6 +19,10 @@ Nėra grupių Sukurti naują grupę Remove from group + This group is empty + Add contacts + There are no contact groups on the device + Create group Nufotografuoti diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index d8a5081c..0fdbc998 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -19,6 +19,10 @@ No groups Create a new group Remove from group + This group is empty + Add contacts + There are no contact groups on the device + Create group Tirar foto diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 7bba539b..8da75776 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -19,6 +19,10 @@ Нет групп Создать новую группу Remove from group + This group is empty + Add contacts + There are no contact groups on the device + Create group Снять фото diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 3132bc11..df9be923 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -19,6 +19,10 @@ Žiadne skupiny Vytvoriť novú skupinu Odstrániť zo skupiny + Skupina je prázdna + Pridať kontakty + Nemáte v zariadení vytvorené žiadne skupiny kontaktov + Vytvoriť skupinu Vytvoriť foto diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index f63ad6a9..537bbce5 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -19,6 +19,10 @@ No groups Create a new group Remove from group + This group is empty + Add contacts + There are no contact groups on the device + Create group Ta foto diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index ae382cac..f9c10a88 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -19,6 +19,10 @@ 沒有群組 Create a new group Remove from group + This group is empty + Add contacts + There are no contact groups on the device + Create group 拍照 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ad65b889..960aa948 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -19,6 +19,10 @@ No groups Create a new group Remove from group + This group is empty + Add contacts + There are no contact groups on the device + Create group Take photo