Commit 15c56e83 by zhangchengbo

feat:删除最近联系人列表展示

parent aa5d4754
...@@ -122,7 +122,7 @@ class NewConversationActivity : SimpleActivity() { ...@@ -122,7 +122,7 @@ class NewConversationActivity : SimpleActivity() {
} }
private fun fetchContacts() { private fun fetchContacts() {
fillSuggestedContacts { /*fillSuggestedContacts {
SimpleContactsHelper(this).getAvailableContacts(false) { SimpleContactsHelper(this).getAvailableContacts(false) {
allContacts = it allContacts = it
...@@ -135,7 +135,26 @@ class NewConversationActivity : SimpleActivity() { ...@@ -135,7 +135,26 @@ class NewConversationActivity : SimpleActivity() {
setupAdapter(allContacts) setupAdapter(allContacts)
} }
} }
}*/
ensureBackgroundThread {
val privateCursor = getMyContactsCursor(favoritesOnly = false, withPhoneNumbersOnly = true)
privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor)
SimpleContactsHelper(this).getAvailableContacts(false) {
allContacts = it
if (privateContacts.isNotEmpty()) {
allContacts.addAll(privateContacts)
allContacts.sort()
} }
runOnUiThread {
setupAdapter(allContacts)
}
}
}
} }
private fun setupAdapter(contacts: ArrayList<SimpleContact>) { private fun setupAdapter(contacts: ArrayList<SimpleContact>) {
...@@ -196,7 +215,7 @@ class NewConversationActivity : SimpleActivity() { ...@@ -196,7 +215,7 @@ class NewConversationActivity : SimpleActivity() {
val privateCursor = getMyContactsCursor(favoritesOnly = false, withPhoneNumbersOnly = true) val privateCursor = getMyContactsCursor(favoritesOnly = false, withPhoneNumbersOnly = true)
ensureBackgroundThread { ensureBackgroundThread {
privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor) privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor)
val suggestions = getSuggestedContacts(privateContacts) val suggestions: java.util.ArrayList<SimpleContact> = getSuggestedContacts(privateContacts)
runOnUiThread { runOnUiThread {
binding.suggestionsHolder.removeAllViews() binding.suggestionsHolder.removeAllViews()
if (suggestions.isEmpty()) { if (suggestions.isEmpty()) {
......
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
android:id="@+id/suggestions_label" android:id="@+id/suggestions_label"
style="@style/MaterialSectionLabelStyle" style="@style/MaterialSectionLabelStyle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:visibility="gone"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/add_contact_divider" android:layout_below="@+id/add_contact_divider"
android:layout_marginStart="@dimen/activity_margin" android:layout_marginStart="@dimen/activity_margin"
...@@ -95,6 +96,7 @@ ...@@ -95,6 +96,7 @@
android:id="@+id/suggestions_scrollview" android:id="@+id/suggestions_scrollview"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone"
android:layout_below="@+id/suggestions_label" android:layout_below="@+id/suggestions_label"
android:layout_marginBottom="@dimen/medium_margin" android:layout_marginBottom="@dimen/medium_margin"
android:overScrollMode="never" android:overScrollMode="never"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment