mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-01-29 08:39:48 +01:00
Disable replying to non-numeric short codes
Also, break down large thread layout file
This commit is contained in:
parent
7665415b87
commit
f0c3333a72
@ -51,19 +51,19 @@ import com.simplemobiletools.smsmessenger.R
|
||||
import com.simplemobiletools.smsmessenger.adapters.AttachmentsAdapter
|
||||
import com.simplemobiletools.smsmessenger.adapters.AutoCompleteTextViewAdapter
|
||||
import com.simplemobiletools.smsmessenger.adapters.ThreadAdapter
|
||||
import com.simplemobiletools.smsmessenger.dialogs.InvalidNumberDialog
|
||||
import com.simplemobiletools.smsmessenger.dialogs.RenameConversationDialog
|
||||
import com.simplemobiletools.smsmessenger.dialogs.ScheduleMessageDialog
|
||||
import com.simplemobiletools.smsmessenger.extensions.*
|
||||
import com.simplemobiletools.smsmessenger.helpers.*
|
||||
import com.simplemobiletools.smsmessenger.messaging.cancelScheduleSendPendingIntent
|
||||
import com.simplemobiletools.smsmessenger.messaging.isLongMmsMessage
|
||||
import com.simplemobiletools.smsmessenger.messaging.scheduleMessage
|
||||
import com.simplemobiletools.smsmessenger.messaging.sendMessageCompat
|
||||
import com.simplemobiletools.smsmessenger.messaging.*
|
||||
import com.simplemobiletools.smsmessenger.models.*
|
||||
import com.simplemobiletools.smsmessenger.models.ThreadItem.*
|
||||
import kotlinx.android.synthetic.main.activity_thread.*
|
||||
import kotlinx.android.synthetic.main.item_selected_contact.view.*
|
||||
import kotlinx.android.synthetic.main.layout_attachment_picker.*
|
||||
import kotlinx.android.synthetic.main.layout_invalid_short_code_info.*
|
||||
import kotlinx.android.synthetic.main.layout_thread_send_message_holder.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
@ -180,6 +180,7 @@ class ThreadActivity : SimpleActivity() {
|
||||
}
|
||||
|
||||
thread_send_message_holder.setBackgroundColor(bottomBarColor)
|
||||
reply_disabled_info_holder.setBackgroundColor(bottomBarColor)
|
||||
updateNavigationBarColor(bottomBarColor)
|
||||
}
|
||||
|
||||
@ -218,7 +219,8 @@ class ThreadActivity : SimpleActivity() {
|
||||
findItem(R.id.conversation_details).isVisible = participants.size > 1 && conversation != null
|
||||
findItem(R.id.block_number).title = addLockedLabelIfNeeded(R.string.block_number)
|
||||
findItem(R.id.block_number).isVisible = isNougatPlus()
|
||||
findItem(R.id.dial_number).isVisible = participants.size == 1
|
||||
findItem(R.id.dial_number).isVisible = participants.size == 1 && !isSpecialNumber()
|
||||
findItem(R.id.manage_people).isVisible = !isSpecialNumber()
|
||||
findItem(R.id.mark_as_unread).isVisible = threadItems.isNotEmpty()
|
||||
|
||||
// allow saving number in cases when we dont have it stored yet and it is a casual readable number
|
||||
@ -674,6 +676,33 @@ class ThreadActivity : SimpleActivity() {
|
||||
} else {
|
||||
messages.first().participants
|
||||
}
|
||||
maybeDisableShortCodeReply()
|
||||
}
|
||||
}
|
||||
|
||||
private fun isSpecialNumber(): Boolean {
|
||||
val addresses = participants.getAddresses()
|
||||
return addresses.any { isShortCodeWithLetters(it) }
|
||||
}
|
||||
|
||||
private fun maybeDisableShortCodeReply() {
|
||||
if (isSpecialNumber()) {
|
||||
thread_send_message_holder.beGone()
|
||||
reply_disabled_info_holder.beVisible()
|
||||
val textColor = getProperTextColor()
|
||||
reply_disabled_text.setTextColor(textColor)
|
||||
reply_disabled_info.apply {
|
||||
applyColorFilter(textColor)
|
||||
setOnClickListener {
|
||||
InvalidNumberDialog(
|
||||
activity = this@ThreadActivity,
|
||||
text = getString(R.string.invalid_short_code_desc)
|
||||
)
|
||||
}
|
||||
if (isOreoPlus()) {
|
||||
tooltipText = getString(R.string.more_info)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,21 @@
|
||||
package com.simplemobiletools.smsmessenger.dialogs
|
||||
|
||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
|
||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||
import com.simplemobiletools.smsmessenger.R
|
||||
import kotlinx.android.synthetic.main.dialog_invalid_number.view.*
|
||||
|
||||
class InvalidNumberDialog(val activity: BaseSimpleActivity, val text: String) {
|
||||
init {
|
||||
val view = activity.layoutInflater.inflate(R.layout.dialog_invalid_number, null).apply {
|
||||
dialog_invalid_number_desc.text = text
|
||||
}
|
||||
|
||||
activity.getAlertDialogBuilder()
|
||||
.setPositiveButton(R.string.ok) { _, _ -> { } }
|
||||
.apply {
|
||||
activity.setupDialogStuff(view, this)
|
||||
}
|
||||
}
|
||||
}
|
@ -59,3 +59,16 @@ fun Context.sendMessageCompat(text: String, addresses: List<String>, subId: Int?
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given "address" is a short code.
|
||||
* There's not much info available on these special numbers, even the wikipedia page (https://en.wikipedia.org/wiki/Short_code)
|
||||
* contains outdated information regarding max number of digits. The exact parameters for short codes can vary by country and by carrier.
|
||||
*
|
||||
* This function returns true if the [address] length is less than or equal to [maxLength] and contains at least one letter.
|
||||
*/
|
||||
fun isShortCodeWithLetters(address: String, maxLength: Int = 10): Boolean {
|
||||
if (address.length > maxLength) {
|
||||
return false
|
||||
}
|
||||
return address.any { it.isLetter() }
|
||||
}
|
||||
|
@ -102,7 +102,7 @@
|
||||
android:id="@+id/thread_messages_fastscroller"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/thread_send_message_holder"
|
||||
app:layout_constraintBottom_toTopOf="@id/reply_disabled_info_holder"
|
||||
app:layout_constraintTop_toBottomOf="@id/thread_add_contacts"
|
||||
app:supportSwipeToRefresh="true">
|
||||
|
||||
@ -112,7 +112,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:overScrollMode="ifContentScrolls"
|
||||
android:paddingBottom="@dimen/small_margin"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:scrollbars="none"
|
||||
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager"
|
||||
app:stackFromEnd="true"
|
||||
@ -121,215 +121,24 @@
|
||||
|
||||
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/thread_send_message_holder"
|
||||
<include
|
||||
layout="@layout/layout_invalid_short_code_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/thread_send_message_holder"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/thread_messages_fastscroller"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<include
|
||||
layout="@layout/layout_thread_send_message_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/scheduled_message_holder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/normal_margin"
|
||||
android:layout_marginTop="@dimen/medium_margin"
|
||||
android:layout_marginEnd="@dimen/medium_margin"
|
||||
android:background="@drawable/section_holder_stroke"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/thread_attachments_recyclerview"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_goneMarginBottom="@dimen/medium_margin"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/scheduled_message_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/scheduled_message_button"
|
||||
android:layout_alignBottom="@+id/scheduled_message_button"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:src="@drawable/ic_clock_vector" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/scheduled_message_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_toStartOf="@+id/discard_scheduled_message"
|
||||
android:layout_toEndOf="@+id/scheduled_message_icon"
|
||||
android:background="@drawable/ripple_background"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/normal_icon_size"
|
||||
android:paddingStart="@dimen/small_margin"
|
||||
android:paddingEnd="@dimen/activity_margin"
|
||||
android:textSize="@dimen/middle_text_size"
|
||||
tools:ignore="HardcodedText"
|
||||
tools:text="Tomorrow at 6PM GMT +05:30" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/discard_scheduled_message"
|
||||
android:layout_width="@dimen/normal_icon_size"
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="end"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/cancel_schedule_send"
|
||||
android:padding="@dimen/normal_margin"
|
||||
android:src="@drawable/ic_cross_vector" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/thread_attachments_recyclerview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/tiny_margin"
|
||||
android:layout_marginBottom="@dimen/small_margin"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="@dimen/normal_margin"
|
||||
android:paddingEnd="@dimen/normal_margin"
|
||||
android:scrollbars="none"
|
||||
android:visibility="gone"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toTopOf="@id/thread_type_message"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_goneMarginTop="@dimen/medium_margin"
|
||||
tools:itemCount="2"
|
||||
tools:listitem="@layout/item_attachment_document_preview"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/thread_add_attachment"
|
||||
android:layout_width="@dimen/normal_icon_size"
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:layout_marginStart="@dimen/small_margin"
|
||||
android:alpha="0.9"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/attachment"
|
||||
android:padding="@dimen/normal_margin"
|
||||
android:src="@drawable/ic_plus_vector"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/thread_type_message"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/thread_type_message" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
android:id="@+id/thread_type_message"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/small_margin"
|
||||
android:layout_marginEnd="@dimen/small_margin"
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="@string/type_a_message"
|
||||
android:inputType="textCapSentences|textMultiLine"
|
||||
android:minHeight="@dimen/normal_icon_size"
|
||||
app:layout_constraintBottom_toTopOf="@+id/attachment_picker_divider"
|
||||
app:layout_constraintEnd_toStartOf="@id/thread_select_sim_icon"
|
||||
app:layout_constraintStart_toEndOf="@+id/thread_add_attachment" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/thread_select_sim_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.9"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:paddingTop="@dimen/normal_margin"
|
||||
android:paddingEnd="@dimen/medium_margin"
|
||||
android:paddingBottom="@dimen/normal_margin"
|
||||
android:src="@drawable/ic_sim_vector"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/thread_type_message"
|
||||
app:layout_constraintEnd_toStartOf="@id/thread_character_counter"
|
||||
app:layout_constraintTop_toTopOf="@+id/thread_type_message"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/thread_select_sim_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/normal_text_size"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/thread_select_sim_icon"
|
||||
app:layout_constraintEnd_toEndOf="@id/thread_select_sim_icon"
|
||||
app:layout_constraintStart_toStartOf="@id/thread_select_sim_icon"
|
||||
app:layout_constraintTop_toTopOf="@id/thread_select_sim_icon"
|
||||
tools:text="1"
|
||||
tools:textColor="@color/dark_grey"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/thread_character_counter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/small_margin"
|
||||
android:paddingEnd="@dimen/small_margin"
|
||||
android:text="0"
|
||||
android:textSize="@dimen/normal_text_size"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/thread_type_message"
|
||||
app:layout_constraintEnd_toStartOf="@+id/thread_send_message"
|
||||
app:layout_constraintTop_toTopOf="@+id/thread_type_message"
|
||||
tools:ignore="HardcodedText"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyButton
|
||||
android:id="@+id/thread_send_message"
|
||||
android:layout_width="@dimen/normal_icon_size"
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:layout_marginEnd="@dimen/small_margin"
|
||||
android:alpha="0.4"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:clickable="false"
|
||||
android:contentDescription="@string/ok"
|
||||
android:drawableTop="@drawable/ic_send_vector"
|
||||
android:paddingVertical="@dimen/small_margin"
|
||||
android:text="@string/sms"
|
||||
android:textSize="@dimen/smaller_text_size"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/thread_type_message"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/thread_type_message" />
|
||||
|
||||
<View
|
||||
android:id="@+id/attachment_picker_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/divider_height"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:background="@color/divider_grey"
|
||||
android:importantForAccessibility="no"
|
||||
app:layout_constraintBottom_toTopOf="@id/attachment_picker_holder" />
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/attachment_picker_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/small_margin"
|
||||
android:overScrollMode="always"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<include
|
||||
layout="@layout/layout_attachment_picker"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</ScrollView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
11
app/src/main/res/layout/dialog_invalid_number.xml
Normal file
11
app/src/main/res/layout/dialog_invalid_number.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.simplemobiletools.commons.views.MyTextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/dialog_invalid_number_desc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/big_margin"
|
||||
android:paddingTop="@dimen/big_margin"
|
||||
android:paddingEnd="@dimen/big_margin"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="My sample text" />
|
36
app/src/main/res/layout/layout_invalid_short_code_info.xml
Normal file
36
app/src/main/res/layout/layout_invalid_short_code_info.xml
Normal file
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/reply_disabled_info_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/activity_margin">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/reply_disabled_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_gravity="center"
|
||||
android:layout_toEndOf="@+id/reply_disabled_info"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="@dimen/activity_margin"
|
||||
android:text="@string/invalid_short_code"
|
||||
android:textAlignment="center" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/reply_disabled_info"
|
||||
android:layout_width="@dimen/normal_icon_size"
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:layout_alignTop="@id/reply_disabled_text"
|
||||
android:layout_alignBottom="@id/reply_disabled_text"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="end"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/more_info"
|
||||
android:padding="@dimen/normal_margin"
|
||||
android:src="@drawable/ic_info_vector"
|
||||
android:tooltipText="@string/more_info" />
|
||||
|
||||
</RelativeLayout>
|
209
app/src/main/res/layout/layout_thread_send_message_holder.xml
Normal file
209
app/src/main/res/layout/layout_thread_send_message_holder.xml
Normal file
@ -0,0 +1,209 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/thread_send_message_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/scheduled_message_holder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/normal_margin"
|
||||
android:layout_marginTop="@dimen/medium_margin"
|
||||
android:layout_marginEnd="@dimen/medium_margin"
|
||||
android:background="@drawable/section_holder_stroke"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/thread_attachments_recyclerview"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_goneMarginBottom="@dimen/medium_margin"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/scheduled_message_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/scheduled_message_button"
|
||||
android:layout_alignBottom="@+id/scheduled_message_button"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:src="@drawable/ic_clock_vector" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/scheduled_message_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_toStartOf="@+id/discard_scheduled_message"
|
||||
android:layout_toEndOf="@+id/scheduled_message_icon"
|
||||
android:background="@drawable/ripple_background"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/normal_icon_size"
|
||||
android:paddingStart="@dimen/small_margin"
|
||||
android:paddingEnd="@dimen/activity_margin"
|
||||
android:textSize="@dimen/middle_text_size"
|
||||
tools:ignore="HardcodedText"
|
||||
tools:text="Tomorrow at 6PM GMT +05:30" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/discard_scheduled_message"
|
||||
android:layout_width="@dimen/normal_icon_size"
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="end"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/cancel_schedule_send"
|
||||
android:padding="@dimen/normal_margin"
|
||||
android:src="@drawable/ic_cross_vector" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/thread_attachments_recyclerview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/tiny_margin"
|
||||
android:layout_marginBottom="@dimen/small_margin"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="@dimen/normal_margin"
|
||||
android:paddingEnd="@dimen/normal_margin"
|
||||
android:scrollbars="none"
|
||||
android:visibility="gone"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toTopOf="@id/thread_type_message"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_goneMarginTop="@dimen/medium_margin"
|
||||
tools:itemCount="2"
|
||||
tools:listitem="@layout/item_attachment_document_preview"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/thread_add_attachment"
|
||||
android:layout_width="@dimen/normal_icon_size"
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:layout_marginStart="@dimen/small_margin"
|
||||
android:alpha="0.9"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/attachment"
|
||||
android:padding="@dimen/normal_margin"
|
||||
android:src="@drawable/ic_plus_vector"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/thread_type_message"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/thread_type_message" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
android:id="@+id/thread_type_message"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/small_margin"
|
||||
android:layout_marginEnd="@dimen/small_margin"
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="@string/type_a_message"
|
||||
android:inputType="textCapSentences|textMultiLine"
|
||||
android:minHeight="@dimen/normal_icon_size"
|
||||
app:layout_constraintBottom_toTopOf="@+id/attachment_picker_divider"
|
||||
app:layout_constraintEnd_toStartOf="@id/thread_select_sim_icon"
|
||||
app:layout_constraintStart_toEndOf="@+id/thread_add_attachment" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/thread_select_sim_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.9"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:paddingTop="@dimen/normal_margin"
|
||||
android:paddingEnd="@dimen/medium_margin"
|
||||
android:paddingBottom="@dimen/normal_margin"
|
||||
android:src="@drawable/ic_sim_vector"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/thread_type_message"
|
||||
app:layout_constraintEnd_toStartOf="@id/thread_character_counter"
|
||||
app:layout_constraintTop_toTopOf="@+id/thread_type_message"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/thread_select_sim_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/normal_text_size"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/thread_select_sim_icon"
|
||||
app:layout_constraintEnd_toEndOf="@id/thread_select_sim_icon"
|
||||
app:layout_constraintStart_toStartOf="@id/thread_select_sim_icon"
|
||||
app:layout_constraintTop_toTopOf="@id/thread_select_sim_icon"
|
||||
tools:text="1"
|
||||
tools:textColor="@color/dark_grey"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/thread_character_counter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/small_margin"
|
||||
android:paddingEnd="@dimen/small_margin"
|
||||
android:text="0"
|
||||
android:textSize="@dimen/normal_text_size"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/thread_type_message"
|
||||
app:layout_constraintEnd_toStartOf="@+id/thread_send_message"
|
||||
app:layout_constraintTop_toTopOf="@+id/thread_type_message"
|
||||
tools:ignore="HardcodedText"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyButton
|
||||
android:id="@+id/thread_send_message"
|
||||
android:layout_width="@dimen/normal_icon_size"
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:layout_marginEnd="@dimen/small_margin"
|
||||
android:alpha="0.4"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:clickable="false"
|
||||
android:contentDescription="@string/ok"
|
||||
android:drawableTop="@drawable/ic_send_vector"
|
||||
android:paddingVertical="@dimen/small_margin"
|
||||
android:text="@string/sms"
|
||||
android:textSize="@dimen/smaller_text_size"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/thread_type_message"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/thread_type_message" />
|
||||
|
||||
<View
|
||||
android:id="@+id/attachment_picker_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/divider_height"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:background="@color/divider_grey"
|
||||
android:importantForAccessibility="no"
|
||||
app:layout_constraintBottom_toTopOf="@id/attachment_picker_holder" />
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/attachment_picker_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/small_margin"
|
||||
android:overScrollMode="always"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<include
|
||||
layout="@layout/layout_attachment_picker"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</ScrollView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
x
Reference in New Issue
Block a user