add a contact searching field at the New Message activity

This commit is contained in:
tibbi 2020-04-05 17:16:48 +02:00
parent 251eca8823
commit 3373ce66e1
3 changed files with 29 additions and 12 deletions

View File

@ -1,24 +1,19 @@
package com.simplemobiletools.smsmessenger.activities package com.simplemobiletools.smsmessenger.activities
import android.os.Bundle import android.os.Bundle
import com.simplemobiletools.commons.extensions.applyColorFilter import android.view.WindowManager
import com.simplemobiletools.commons.extensions.onTextChangeListener import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.extensions.value
import com.simplemobiletools.smsmessenger.R import com.simplemobiletools.smsmessenger.R
import com.simplemobiletools.smsmessenger.adapters.ThreadAdapter import kotlinx.android.synthetic.main.activity_new_message.*
import com.simplemobiletools.smsmessenger.extensions.config
import com.simplemobiletools.smsmessenger.extensions.getMessages
import com.simplemobiletools.smsmessenger.helpers.THREAD_ID
import com.simplemobiletools.smsmessenger.helpers.THREAD_NAME
import com.simplemobiletools.smsmessenger.helpers.THREAD_NUMBER
import com.simplemobiletools.smsmessenger.models.ThreadDateTime
import com.simplemobiletools.smsmessenger.models.ThreadItem
import kotlinx.android.synthetic.main.activity_thread.*
class NewMessageActivity : SimpleActivity() { class NewMessageActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_new_message) setContentView(R.layout.activity_new_message)
title = getString(R.string.create_new_message) title = getString(R.string.create_new_message)
updateTextColors(new_message_holder)
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
new_message_to.requestFocus()
} }
} }

View File

@ -4,4 +4,23 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/new_message_to"
android:layout_width="match_parent"
android:layout_height="@dimen/normal_icon_size"
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginEnd="@dimen/activity_margin"
android:background="@android:color/transparent"
android:gravity="center_vertical"
android:hint="@string/send_to"
android:inputType="textCapWords" />
<View
android:id="@+id/message_divider"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_below="@+id/new_message_to"
android:background="@color/divider_grey"
android:importantForAccessibility="no" />
</RelativeLayout> </RelativeLayout>

View File

@ -3,7 +3,10 @@
<string name="app_launcher_name">SMS Messenger</string> <string name="app_launcher_name">SMS Messenger</string>
<string name="type_a_message">Type a message…</string> <string name="type_a_message">Type a message…</string>
<string name="message_not_sent">Message has not been sent.</string> <string name="message_not_sent">Message has not been sent.</string>
<!-- New message -->
<string name="create_new_message">Create new message</string> <string name="create_new_message">Create new message</string>
<string name="send_to">To…</string>
<!-- Notifications --> <!-- Notifications -->
<string name="channel_received_sms">Received SMS</string> <string name="channel_received_sms">Received SMS</string>