diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt index 0441ef8f..f3d9678b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt @@ -31,7 +31,7 @@ import java.util.* class ContactsAdapter(activity: SimpleActivity, var contactItems: ArrayList, private val refreshListener: RefreshContactsListener?, private val location: Int, private val removeListener: RemoveFromGroupListener?, recyclerView: MyRecyclerView, - fastScroller: FastScroller, highlightText: String = "", itemClick: (Any) -> Unit) : + fastScroller: FastScroller?, highlightText: String = "", itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, fastScroller, itemClick) { private val NEW_GROUP_ID = -1 diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt index 9fc67f47..0c46067c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt @@ -79,8 +79,8 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) } fun primaryColorChanged() { - fragment_fastscroller.updatePrimaryColor() - fragment_fastscroller.updateBubblePrimaryColor() + fragment_fastscroller?.updatePrimaryColor() + fragment_fastscroller?.updateBubblePrimaryColor() (fragment_list.adapter as? ContactsAdapter)?.apply { adjustedPrimaryColor = context.getAdjustedPrimaryColor() } @@ -197,17 +197,11 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) else -> LOCATION_CONTACTS_TAB } - ContactsAdapter(activity as SimpleActivity, contacts, activity as RefreshContactsListener, location, null, fragment_list, fragment_fastscroller) { + ContactsAdapter(activity as SimpleActivity, contacts, activity as RefreshContactsListener, location, null, fragment_list, null) { (activity as RefreshContactsListener).contactClicked(it as Contact) }.apply { fragment_list.adapter = this } - - fragment_fastscroller.setScrollToY(0) - fragment_fastscroller.setViews(fragment_list) { - val item = (fragment_list.adapter as ContactsAdapter).contactItems.getOrNull(it) - fragment_fastscroller.updateBubbleText(item?.getBubbleText() ?: "") - } } else { (currAdapter as ContactsAdapter).apply { startNameWithSurname = config.startNameWithSurname @@ -318,8 +312,8 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) private fun updateViewStuff() { context.updateTextColors(fragment_wrapper.parent as ViewGroup) - fragment_fastscroller.updateBubbleColors() - fragment_fastscroller.allowBubbleDisplay = config.showInfoBubble + fragment_fastscroller?.updateBubbleColors() + fragment_fastscroller?.allowBubbleDisplay = config.showInfoBubble fragment_placeholder_2?.setTextColor(context.getAdjustedPrimaryColor()) } diff --git a/app/src/main/res/layout/fragment_contacts.xml b/app/src/main/res/layout/fragment_contacts.xml index ff20f456..23bfe6c3 100644 --- a/app/src/main/res/layout/fragment_contacts.xml +++ b/app/src/main/res/layout/fragment_contacts.xml @@ -5,6 +5,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - + diff --git a/app/src/main/res/layout/fragment_favorites.xml b/app/src/main/res/layout/fragment_favorites.xml index 03380853..8056e04d 100644 --- a/app/src/main/res/layout/fragment_favorites.xml +++ b/app/src/main/res/layout/fragment_favorites.xml @@ -5,6 +5,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - + diff --git a/app/src/main/res/layout/fragment_letters_layout.xml b/app/src/main/res/layout/fragment_letters_layout.xml new file mode 100644 index 00000000..e8a508a9 --- /dev/null +++ b/app/src/main/res/layout/fragment_letters_layout.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + +