mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-06-05 21:49:22 +02:00
allow toggling the Add Person UI at the thread activity
This commit is contained in:
@@ -21,7 +21,6 @@ import com.simplemobiletools.smsmessenger.extensions.*
|
|||||||
import com.simplemobiletools.smsmessenger.helpers.*
|
import com.simplemobiletools.smsmessenger.helpers.*
|
||||||
import com.simplemobiletools.smsmessenger.models.*
|
import com.simplemobiletools.smsmessenger.models.*
|
||||||
import com.simplemobiletools.smsmessenger.receivers.SmsSentReceiver
|
import com.simplemobiletools.smsmessenger.receivers.SmsSentReceiver
|
||||||
import kotlinx.android.synthetic.main.activity_new_message.*
|
|
||||||
import kotlinx.android.synthetic.main.activity_thread.*
|
import kotlinx.android.synthetic.main.activity_thread.*
|
||||||
import kotlinx.android.synthetic.main.activity_thread.new_message_to
|
import kotlinx.android.synthetic.main.activity_thread.new_message_to
|
||||||
import kotlinx.android.synthetic.main.activity_thread.selected_contacts
|
import kotlinx.android.synthetic.main.activity_thread.selected_contacts
|
||||||
@@ -88,7 +87,7 @@ class ThreadActivity : SimpleActivity() {
|
|||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
R.id.add_person -> addPerson()
|
R.id.manage_people -> managePeople()
|
||||||
else -> return super.onOptionsItemSelected(item)
|
else -> return super.onOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
@@ -145,11 +144,16 @@ class ThreadActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addPerson() {
|
private fun managePeople() {
|
||||||
showSelectedContacts()
|
if (thread_add_contacts.isVisible()) {
|
||||||
thread_add_contacts.beVisible()
|
hideKeyboard()
|
||||||
new_message_to.requestFocus()
|
thread_add_contacts.beGone()
|
||||||
showKeyboard(new_message_to)
|
} else {
|
||||||
|
showSelectedContacts()
|
||||||
|
thread_add_contacts.beVisible()
|
||||||
|
new_message_to.requestFocus()
|
||||||
|
showKeyboard(new_message_to)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showSelectedContacts() {
|
private fun showSelectedContacts() {
|
||||||
|
@@ -7,10 +7,10 @@
|
|||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:bottom="@dimen/medium_margin"
|
android:bottom="@dimen/small_margin"
|
||||||
android:drawable="@drawable/ic_person_vector"
|
android:drawable="@drawable/ic_person_vector"
|
||||||
android:left="@dimen/medium_margin"
|
android:left="@dimen/small_margin"
|
||||||
android:right="@dimen/medium_margin"
|
android:right="@dimen/small_margin"
|
||||||
android:top="@dimen/medium_margin" />
|
android:top="@dimen/small_margin" />
|
||||||
|
|
||||||
</layer-list>
|
</layer-list>
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/add_person"
|
android:id="@+id/manage_people"
|
||||||
android:icon="@drawable/add_person_vector"
|
android:icon="@drawable/add_person_vector"
|
||||||
android:title="@string/add_person"
|
android:title="@string/add_person"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
|
Reference in New Issue
Block a user