From 85c303e6dc55c77cee45012e130cdd46adc20b15 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 31 Dec 2017 12:44:38 +0100 Subject: [PATCH] show a bubble and fastscroller at the Add Favorite dialog --- .../contacts/dialogs/AddFavoritesDialog.kt | 10 +++++- .../main/res/layout/dialog_add_favorites.xml | 33 +++++++++++++++---- .../layout/item_add_favorite_with_number.xml | 2 +- .../item_add_favorite_without_number.xml | 2 +- 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/dialogs/AddFavoritesDialog.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/dialogs/AddFavoritesDialog.kt index 6dd5fc11..f87f19cb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/dialogs/AddFavoritesDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/dialogs/AddFavoritesDialog.kt @@ -1,6 +1,7 @@ package com.simplemobiletools.contacts.dialogs import android.support.v7.app.AlertDialog +import com.simplemobiletools.commons.extensions.baseConfig import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.contacts.R import com.simplemobiletools.contacts.activities.SimpleActivity @@ -28,7 +29,14 @@ class AddFavoritesDialog(val activity: SimpleActivity, val callback: () -> Unit) if (!activity.config.showAllContacts()) { allContacts = allContacts.filter { contactSources.contains(it.source) } as ArrayList } - view.add_favorites_list.adapter = AddFavoritesAdapter(activity, allContacts, config.favorites) + + view.apply { + add_favorites_list.adapter = AddFavoritesAdapter(activity, allContacts, config.favorites) + add_favorites_fastscroller.allowBubbleDisplay = activity.baseConfig.showInfoBubble + add_favorites_fastscroller.setViews(add_favorites_list) { + add_favorites_fastscroller.updateBubbleText(allContacts[it].getBubbleText()) + } + } activity.runOnUiThread { dialog = AlertDialog.Builder(activity) diff --git a/app/src/main/res/layout/dialog_add_favorites.xml b/app/src/main/res/layout/dialog_add_favorites.xml index 87b08db0..ca66a80e 100644 --- a/app/src/main/res/layout/dialog_add_favorites.xml +++ b/app/src/main/res/layout/dialog_add_favorites.xml @@ -1,11 +1,30 @@ - + android:layout_height="wrap_content"> + + + + + + + + + diff --git a/app/src/main/res/layout/item_add_favorite_with_number.xml b/app/src/main/res/layout/item_add_favorite_with_number.xml index be6790eb..7a8900d7 100644 --- a/app/src/main/res/layout/item_add_favorite_with_number.xml +++ b/app/src/main/res/layout/item_add_favorite_with_number.xml @@ -13,7 +13,7 @@ android:id="@+id/contact_holder" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingRight="@dimen/medium_margin"> + android:paddingRight="@dimen/normal_margin"> + android:paddingRight="@dimen/normal_margin">