allow adding not saved contacts to group threads

This commit is contained in:
tibbi 2020-04-13 11:42:51 +02:00
parent 8f913867f4
commit 956e798558
2 changed files with 26 additions and 0 deletions

View File

@ -176,10 +176,20 @@ class ThreadActivity : SimpleActivity() {
val selectedContact = currContacts[position] val selectedContact = currContacts[position]
addSelectedContact(selectedContact) addSelectedContact(selectedContact)
} }
add_contact_or_number.onTextChangeListener {
confirm_inserted_number.beVisibleIf(it.length > 2)
} }
} }
} }
confirm_inserted_number.setOnClickListener {
val number = add_contact_or_number.value
val contact = Contact(number.hashCode(), number, "", number)
addSelectedContact(contact)
}
}
private fun setupButtons() { private fun setupButtons() {
updateTextColors(thread_holder) updateTextColors(thread_holder)
thread_send_message.applyColorFilter(config.textColor) thread_send_message.applyColorFilter(config.textColor)

View File

@ -48,6 +48,7 @@
android:layout_below="@+id/message_divider_one" android:layout_below="@+id/message_divider_one"
android:layout_marginStart="@dimen/activity_margin" android:layout_marginStart="@dimen/activity_margin"
android:layout_marginEnd="@dimen/activity_margin" android:layout_marginEnd="@dimen/activity_margin"
android:layout_toStartOf="@+id/confirm_inserted_number"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:completionThreshold="2" android:completionThreshold="2"
android:gravity="center_vertical" android:gravity="center_vertical"
@ -55,6 +56,21 @@
android:inputType="textCapWords" android:inputType="textCapWords"
android:textSize="@dimen/big_text_size" /> android:textSize="@dimen/big_text_size" />
<ImageView
android:id="@+id/confirm_inserted_number"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignTop="@+id/add_contact_or_number"
android:layout_alignBottom="@+id/add_contact_or_number"
android:layout_alignParentEnd="true"
android:layout_marginStart="@dimen/medium_margin"
android:layout_marginEnd="@dimen/medium_margin"
android:background="?selectableItemBackgroundBorderless"
android:paddingStart="@dimen/medium_margin"
android:paddingEnd="@dimen/medium_margin"
android:src="@drawable/ic_check_vector"
android:visibility="gone" />
<View <View
android:id="@+id/message_divider_two" android:id="@+id/message_divider_two"
android:layout_width="match_parent" android:layout_width="match_parent"