mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-02-01 18:06:51 +01:00
show an Add Person menu button at the top menu of conversations
This commit is contained in:
parent
8379a753b2
commit
cdfaa3cea9
@ -87,7 +87,7 @@ class MainActivity : SimpleActivity() {
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.menu, menu)
|
||||
menuInflater.inflate(R.menu.menu_main, menu)
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,8 @@ import android.os.Bundle
|
||||
import android.provider.Telephony
|
||||
import android.telephony.SmsManager
|
||||
import android.util.Log
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||
import com.simplemobiletools.commons.extensions.onTextChangeListener
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
@ -60,6 +62,19 @@ class ThreadActivity : SimpleActivity() {
|
||||
bus?.unregister(this)
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.menu_thread, menu)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.add_person -> addPerson()
|
||||
else -> return super.onOptionsItemSelected(item)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private fun setupAdapter() {
|
||||
val threadId = intent.getIntExtra(THREAD_ID, 0)
|
||||
val items = getThreadItems(threadId)
|
||||
@ -98,6 +113,10 @@ class ThreadActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun addPerson() {
|
||||
|
||||
}
|
||||
|
||||
private fun getThreadItems(threadID: Int): ArrayList<ThreadItem> {
|
||||
val messages = getMessages(threadID)
|
||||
messages.sortBy { it.id }
|
||||
|
9
app/src/main/res/drawable/add_person_vector.xml
Normal file
9
app/src/main/res/drawable/add_person_vector.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="96dp"
|
||||
android:height="96dp"
|
||||
android:viewportWidth="128"
|
||||
android:viewportHeight="128">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="m78.881,62.706c11.048,0 19.996,-8.948 19.996,-19.996 0,-11.048 -8.948,-19.996 -19.996,-19.996 -11.048,0 -19.996,8.948 -19.996,19.996 0,11.048 8.948,19.996 19.996,19.996zM33.891,52.708 L33.891,37.712 23.893,37.712 23.893,52.708 8.897,52.708 8.897,62.706 23.893,62.706 23.893,77.703 33.891,77.703 33.891,62.706 48.888,62.706 48.888,52.708zM78.881,72.704c-13.347,0 -39.991,6.699 -39.991,19.996l0,9.998 79.982,0 0,-9.998c0,-13.297 -26.644,-19.996 -39.991,-19.996z" />
|
||||
</vector>
|
9
app/src/main/res/menu/menu_thread.xml
Normal file
9
app/src/main/res/menu/menu_thread.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/add_person"
|
||||
android:icon="@drawable/add_person_vector"
|
||||
android:title="@string/add_person"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
@ -3,6 +3,7 @@
|
||||
<string name="app_launcher_name">SMS Messenger</string>
|
||||
<string name="type_a_message">Type a message…</string>
|
||||
<string name="message_not_sent">Message has not been sent.</string>
|
||||
<string name="add_person">Add Person</string>
|
||||
|
||||
<!-- New message -->
|
||||
<string name="create_new_message">Create new message</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user