mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-06-05 21:49:22 +02:00
updating commons with some style improvements
This commit is contained in:
@@ -63,7 +63,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:ab6a89e3b9'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:4f9c2f94ff'
|
||||||
implementation 'org.greenrobot:eventbus:3.3.1'
|
implementation 'org.greenrobot:eventbus:3.3.1'
|
||||||
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
||||||
implementation 'com.github.tibbi:android-smsmms:1012d20ab9'
|
implementation 'com.github.tibbi:android-smsmms:1012d20ab9'
|
||||||
|
@@ -12,8 +12,6 @@ import android.graphics.drawable.LayerDrawable
|
|||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.provider.Telephony
|
import android.provider.Telephony
|
||||||
import android.view.Menu
|
|
||||||
import android.view.MenuItem
|
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import com.simplemobiletools.commons.dialogs.FilePickerDialog
|
import com.simplemobiletools.commons.dialogs.FilePickerDialog
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
@@ -55,6 +53,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_main)
|
setContentView(R.layout.activity_main)
|
||||||
appLaunched(BuildConfig.APPLICATION_ID)
|
appLaunched(BuildConfig.APPLICATION_ID)
|
||||||
|
setupOptionsMenu()
|
||||||
|
|
||||||
if (checkAppSideloading()) {
|
if (checkAppSideloading()) {
|
||||||
return
|
return
|
||||||
@@ -88,6 +87,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
setupToolbar(main_toolbar)
|
||||||
if (storedTextColor != getProperTextColor()) {
|
if (storedTextColor != getProperTextColor()) {
|
||||||
(conversations_list.adapter as? ConversationsAdapter)?.updateTextColor(getProperTextColor())
|
(conversations_list.adapter as? ConversationsAdapter)?.updateTextColor(getProperTextColor())
|
||||||
}
|
}
|
||||||
@@ -116,22 +116,18 @@ class MainActivity : SimpleActivity() {
|
|||||||
bus?.unregister(this)
|
bus?.unregister(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
private fun setupOptionsMenu() {
|
||||||
menuInflater.inflate(R.menu.menu_main, menu)
|
main_toolbar.setOnMenuItemClickListener { menuItem ->
|
||||||
updateMenuItemColors(menu)
|
when (menuItem.itemId) {
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
|
||||||
when (item.itemId) {
|
|
||||||
R.id.search -> launchSearch()
|
R.id.search -> launchSearch()
|
||||||
R.id.settings -> launchSettings()
|
R.id.settings -> launchSettings()
|
||||||
R.id.export_messages -> tryToExportMessages()
|
R.id.export_messages -> tryToExportMessages()
|
||||||
R.id.import_messages -> tryImportMessages()
|
R.id.import_messages -> tryImportMessages()
|
||||||
R.id.about -> launchAbout()
|
R.id.about -> launchAbout()
|
||||||
else -> return super.onOptionsItemSelected(item)
|
else -> return@setOnMenuItemClickListener false
|
||||||
|
}
|
||||||
|
return@setOnMenuItemClickListener true
|
||||||
}
|
}
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
|
||||||
|
@@ -3,16 +3,12 @@ package com.simplemobiletools.smsmessenger.activities
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.Menu
|
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.reddit.indicatorfastscroll.FastScrollItemIndicator
|
import com.reddit.indicatorfastscroll.FastScrollItemIndicator
|
||||||
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.helpers.MyContactsContentProvider
|
import com.simplemobiletools.commons.helpers.*
|
||||||
import com.simplemobiletools.commons.helpers.PERMISSION_READ_CONTACTS
|
|
||||||
import com.simplemobiletools.commons.helpers.SimpleContactsHelper
|
|
||||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
|
||||||
import com.simplemobiletools.commons.models.RadioItem
|
import com.simplemobiletools.commons.models.RadioItem
|
||||||
import com.simplemobiletools.commons.models.SimpleContact
|
import com.simplemobiletools.commons.models.SimpleContact
|
||||||
import com.simplemobiletools.smsmessenger.R
|
import com.simplemobiletools.smsmessenger.R
|
||||||
@@ -46,15 +42,11 @@ class NewConversationActivity : SimpleActivity() {
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
setupToolbar(new_conversation_toolbar, NavigationIcon.Arrow)
|
||||||
no_contacts_placeholder_2.setTextColor(getProperPrimaryColor())
|
no_contacts_placeholder_2.setTextColor(getProperPrimaryColor())
|
||||||
no_contacts_placeholder_2.underlineText()
|
no_contacts_placeholder_2.underlineText()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
|
||||||
updateMenuItemColors(menu)
|
|
||||||
return super.onCreateOptionsMenu(menu)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun initContacts() {
|
private fun initContacts() {
|
||||||
if (isThirdPartyIntent()) {
|
if (isThirdPartyIntent()) {
|
||||||
return
|
return
|
||||||
|
@@ -37,12 +37,12 @@ class SearchActivity : SimpleActivity() {
|
|||||||
updateTextColors(search_holder)
|
updateTextColors(search_holder)
|
||||||
search_placeholder.setTextSize(TypedValue.COMPLEX_UNIT_PX, getTextSize())
|
search_placeholder.setTextSize(TypedValue.COMPLEX_UNIT_PX, getTextSize())
|
||||||
search_placeholder_2.setTextSize(TypedValue.COMPLEX_UNIT_PX, getTextSize())
|
search_placeholder_2.setTextSize(TypedValue.COMPLEX_UNIT_PX, getTextSize())
|
||||||
|
setupSearch(search_toolbar.menu)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
override fun onResume() {
|
||||||
menuInflater.inflate(R.menu.menu_search, menu)
|
super.onResume()
|
||||||
setupSearch(menu)
|
setupToolbar(search_toolbar, searchMenuItem = mSearchMenuItem)
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupSearch(menu: Menu) {
|
private fun setupSearch(menu: Menu) {
|
||||||
|
@@ -4,7 +4,6 @@ import android.annotation.TargetApi
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.Menu
|
|
||||||
import com.simplemobiletools.commons.activities.ManageBlockedNumbersActivity
|
import com.simplemobiletools.commons.activities.ManageBlockedNumbersActivity
|
||||||
import com.simplemobiletools.commons.dialogs.ChangeDateTimeFormatDialog
|
import com.simplemobiletools.commons.dialogs.ChangeDateTimeFormatDialog
|
||||||
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
||||||
@@ -27,6 +26,7 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
setupToolbar(settings_toolbar, NavigationIcon.Arrow)
|
||||||
|
|
||||||
setupPurchaseThankYou()
|
setupPurchaseThankYou()
|
||||||
setupCustomizeColors()
|
setupCustomizeColors()
|
||||||
@@ -42,7 +42,7 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
setupGroupMessageAsMMS()
|
setupGroupMessageAsMMS()
|
||||||
setupLockScreenVisibility()
|
setupLockScreenVisibility()
|
||||||
setupMMSFileSizeLimit()
|
setupMMSFileSizeLimit()
|
||||||
updateTextColors(settings_scrollview)
|
updateTextColors(settings_nested_scrollview)
|
||||||
|
|
||||||
if (blockedNumbersAtPause != -1 && blockedNumbersAtPause != getBlockedNumbers().hashCode()) {
|
if (blockedNumbersAtPause != -1 && blockedNumbersAtPause != getBlockedNumbers().hashCode()) {
|
||||||
refreshMessages()
|
refreshMessages()
|
||||||
@@ -67,11 +67,6 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
blockedNumbersAtPause = getBlockedNumbers().hashCode()
|
blockedNumbersAtPause = getBlockedNumbers().hashCode()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
|
||||||
updateMenuItemColors(menu)
|
|
||||||
return super.onCreateOptionsMenu(menu)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setupPurchaseThankYou() {
|
private fun setupPurchaseThankYou() {
|
||||||
settings_purchase_thank_you_holder.beGoneIf(isOrWasThankYouInstalled())
|
settings_purchase_thank_you_holder.beGoneIf(isOrWasThankYouInstalled())
|
||||||
|
|
||||||
|
@@ -16,7 +16,9 @@ import android.telephony.SmsMessage
|
|||||||
import android.telephony.SubscriptionManager
|
import android.telephony.SubscriptionManager
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
import android.view.*
|
import android.view.Gravity
|
||||||
|
import android.view.View
|
||||||
|
import android.view.WindowManager
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import android.widget.LinearLayout.LayoutParams
|
import android.widget.LinearLayout.LayoutParams
|
||||||
@@ -84,6 +86,8 @@ class ThreadActivity : SimpleActivity() {
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_thread)
|
setContentView(R.layout.activity_thread)
|
||||||
|
setupOptionsMenu()
|
||||||
|
refreshMenuItems()
|
||||||
|
|
||||||
val extras = intent.extras
|
val extras = intent.extras
|
||||||
if (extras == null) {
|
if (extras == null) {
|
||||||
@@ -95,7 +99,7 @@ class ThreadActivity : SimpleActivity() {
|
|||||||
clearAllMessagesIfNeeded()
|
clearAllMessagesIfNeeded()
|
||||||
threadId = intent.getLongExtra(THREAD_ID, 0L)
|
threadId = intent.getLongExtra(THREAD_ID, 0L)
|
||||||
intent.getStringExtra(THREAD_TITLE)?.let {
|
intent.getStringExtra(THREAD_TITLE)?.let {
|
||||||
supportActionBar?.title = it
|
thread_toolbar.title = it
|
||||||
}
|
}
|
||||||
|
|
||||||
bus = EventBus.getDefault()
|
bus = EventBus.getDefault()
|
||||||
@@ -123,6 +127,7 @@ class ThreadActivity : SimpleActivity() {
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
setupToolbar(thread_toolbar, NavigationIcon.Arrow)
|
||||||
|
|
||||||
val smsDraft = getSmsDraft(threadId)
|
val smsDraft = getSmsDraft(threadId)
|
||||||
if (smsDraft != null) {
|
if (smsDraft != null) {
|
||||||
@@ -150,10 +155,9 @@ class ThreadActivity : SimpleActivity() {
|
|||||||
bus?.unregister(this)
|
bus?.unregister(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
private fun refreshMenuItems() {
|
||||||
menuInflater.inflate(R.menu.menu_thread, menu)
|
|
||||||
val firstPhoneNumber = participants.firstOrNull()?.phoneNumbers?.firstOrNull()?.value
|
val firstPhoneNumber = participants.firstOrNull()?.phoneNumbers?.firstOrNull()?.value
|
||||||
menu.apply {
|
thread_toolbar.menu.apply {
|
||||||
findItem(R.id.delete).isVisible = threadItems.isNotEmpty()
|
findItem(R.id.delete).isVisible = threadItems.isNotEmpty()
|
||||||
findItem(R.id.block_number).isVisible = isNougatPlus()
|
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
|
||||||
@@ -164,27 +168,25 @@ class ThreadActivity : SimpleActivity() {
|
|||||||
it.isDigit()
|
it.isDigit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMenuItemColors(menu)
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
private fun setupOptionsMenu() {
|
||||||
|
thread_toolbar.setOnMenuItemClickListener { menuItem ->
|
||||||
if (participants.isEmpty()) {
|
if (participants.isEmpty()) {
|
||||||
return true
|
return@setOnMenuItemClickListener true
|
||||||
}
|
}
|
||||||
|
|
||||||
when (item.itemId) {
|
when (menuItem.itemId) {
|
||||||
R.id.block_number -> blockNumber()
|
R.id.block_number -> blockNumber()
|
||||||
R.id.delete -> askConfirmDelete()
|
R.id.delete -> askConfirmDelete()
|
||||||
R.id.add_number_to_contact -> addNumberToContact()
|
R.id.add_number_to_contact -> addNumberToContact()
|
||||||
R.id.dial_number -> dialNumber()
|
R.id.dial_number -> dialNumber()
|
||||||
R.id.manage_people -> managePeople()
|
R.id.manage_people -> managePeople()
|
||||||
R.id.mark_as_unread -> markAsUnread()
|
R.id.mark_as_unread -> markAsUnread()
|
||||||
android.R.id.home -> onHomePressed()
|
else -> return@setOnMenuItemClickListener false
|
||||||
else -> return super.onOptionsItemSelected(item)
|
}
|
||||||
|
return@setOnMenuItemClickListener true
|
||||||
}
|
}
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
|
||||||
@@ -320,9 +322,10 @@ class ThreadActivity : SimpleActivity() {
|
|||||||
|
|
||||||
private fun setupAdapter() {
|
private fun setupAdapter() {
|
||||||
threadItems = getThreadItems()
|
threadItems = getThreadItems()
|
||||||
invalidateOptionsMenu()
|
|
||||||
|
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
|
refreshMenuItems()
|
||||||
|
|
||||||
val currAdapter = thread_messages_list.adapter
|
val currAdapter = thread_messages_list.adapter
|
||||||
if (currAdapter == null) {
|
if (currAdapter == null) {
|
||||||
ThreadAdapter(this, threadItems, thread_messages_list) {
|
ThreadAdapter(this, threadItems, thread_messages_list) {
|
||||||
@@ -514,7 +517,7 @@ class ThreadActivity : SimpleActivity() {
|
|||||||
private fun setupThreadTitle() {
|
private fun setupThreadTitle() {
|
||||||
val threadTitle = participants.getThreadTitle()
|
val threadTitle = participants.getThreadTitle()
|
||||||
if (threadTitle.isNotEmpty()) {
|
if (threadTitle.isNotEmpty()) {
|
||||||
supportActionBar?.title = participants.getThreadTitle()
|
thread_toolbar.title = participants.getThreadTitle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -831,7 +834,7 @@ class ThreadActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun checkSendMessageAvailability() {
|
private fun checkSendMessageAvailability() {
|
||||||
if (thread_type_message.text.isNotEmpty() || (attachmentSelections.isNotEmpty() && !attachmentSelections.values.any { it.isPending })) {
|
if (thread_type_message.text!!.isNotEmpty() || (attachmentSelections.isNotEmpty() && !attachmentSelections.values.any { it.isPending })) {
|
||||||
thread_send_message.isClickable = true
|
thread_send_message.isClickable = true
|
||||||
thread_send_message.alpha = 0.9f
|
thread_send_message.alpha = 0.9f
|
||||||
} else {
|
} else {
|
||||||
|
@@ -22,31 +22,30 @@ class ExportMessagesDialog(
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
val view = (activity.layoutInflater.inflate(R.layout.dialog_export_messages, null) as ViewGroup).apply {
|
val view = (activity.layoutInflater.inflate(R.layout.dialog_export_messages, null) as ViewGroup).apply {
|
||||||
export_messages_folder.text = activity.humanizePath(realPath)
|
export_messages_folder.setText(activity.humanizePath(realPath))
|
||||||
export_messages_filename.setText("${activity.getString(R.string.messages)}_${activity.getCurrentFormattedDateTime()}")
|
export_messages_filename.setText("${activity.getString(R.string.messages)}_${activity.getCurrentFormattedDateTime()}")
|
||||||
export_sms_checkbox.isChecked = config.exportSms
|
export_sms_checkbox.isChecked = config.exportSms
|
||||||
export_mms_checkbox.isChecked = config.exportMms
|
export_mms_checkbox.isChecked = config.exportMms
|
||||||
|
|
||||||
if (hidePath) {
|
if (hidePath) {
|
||||||
export_messages_folder_label.beGone()
|
export_messages_folder_hint.beGone()
|
||||||
export_messages_folder.beGone()
|
|
||||||
} else {
|
} else {
|
||||||
export_messages_folder.setOnClickListener {
|
export_messages_folder.setOnClickListener {
|
||||||
activity.hideKeyboard(export_messages_filename)
|
activity.hideKeyboard(export_messages_filename)
|
||||||
FilePickerDialog(activity, realPath, false, showFAB = true) {
|
FilePickerDialog(activity, realPath, false, showFAB = true) {
|
||||||
export_messages_folder.text = activity.humanizePath(it)
|
export_messages_folder.setText(activity.humanizePath(it))
|
||||||
realPath = it
|
realPath = it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AlertDialog.Builder(activity)
|
activity.getAlertDialogBuilder()
|
||||||
.setPositiveButton(R.string.ok, null)
|
.setPositiveButton(R.string.ok, null)
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
.create().apply {
|
.apply {
|
||||||
activity.setupDialogStuff(view, this, R.string.export_messages) {
|
activity.setupDialogStuff(view, this, R.string.export_messages) { alertDialog ->
|
||||||
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
||||||
val filename = view.export_messages_filename.value
|
val filename = view.export_messages_filename.value
|
||||||
when {
|
when {
|
||||||
filename.isEmpty() -> activity.toast(R.string.empty_name)
|
filename.isEmpty() -> activity.toast(R.string.empty_name)
|
||||||
@@ -66,7 +65,7 @@ class ExportMessagesDialog(
|
|||||||
config.exportMms = view.export_mms_checkbox.isChecked
|
config.exportMms = view.export_mms_checkbox.isChecked
|
||||||
config.lastExportPath = file.absolutePath.getParentPath()
|
config.lastExportPath = file.absolutePath.getParentPath()
|
||||||
callback(file)
|
callback(file)
|
||||||
dismiss()
|
alertDialog.dismiss()
|
||||||
}
|
}
|
||||||
else -> activity.toast(R.string.invalid_name)
|
else -> activity.toast(R.string.invalid_name)
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,7 @@ package com.simplemobiletools.smsmessenger.dialogs
|
|||||||
|
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||||
import com.simplemobiletools.commons.extensions.toast
|
import com.simplemobiletools.commons.extensions.toast
|
||||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||||
@@ -27,12 +28,12 @@ class ImportMessagesDialog(
|
|||||||
import_mms_checkbox.isChecked = config.importMms
|
import_mms_checkbox.isChecked = config.importMms
|
||||||
}
|
}
|
||||||
|
|
||||||
AlertDialog.Builder(activity)
|
activity.getAlertDialogBuilder()
|
||||||
.setPositiveButton(R.string.ok, null)
|
.setPositiveButton(R.string.ok, null)
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
.create().apply {
|
.apply {
|
||||||
activity.setupDialogStuff(view, this, R.string.import_messages) {
|
activity.setupDialogStuff(view, this, R.string.import_messages) { alertDialog ->
|
||||||
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
||||||
if (ignoreClicks) {
|
if (ignoreClicks) {
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
@@ -49,7 +50,7 @@ class ImportMessagesDialog(
|
|||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
MessagesImporter(activity).importMessages(path) {
|
MessagesImporter(activity).importMessages(path) {
|
||||||
handleParseResult(it)
|
handleParseResult(it)
|
||||||
dismiss()
|
alertDialog.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
package com.simplemobiletools.smsmessenger.dialogs
|
package com.simplemobiletools.smsmessenger.dialogs
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog
|
|
||||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||||
|
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||||
import com.simplemobiletools.smsmessenger.R
|
import com.simplemobiletools.smsmessenger.R
|
||||||
import kotlinx.android.synthetic.main.dialog_select_text.view.*
|
import kotlinx.android.synthetic.main.dialog_select_text.view.*
|
||||||
@@ -13,9 +13,9 @@ class SelectTextDialog(val activity: BaseSimpleActivity, val text: String) {
|
|||||||
dialog_select_text_value.text = text
|
dialog_select_text_value.text = text
|
||||||
}
|
}
|
||||||
|
|
||||||
AlertDialog.Builder(activity)
|
activity.getAlertDialogBuilder()
|
||||||
.setPositiveButton(R.string.ok) { dialog, which -> { } }
|
.setPositiveButton(R.string.ok) { dialog, which -> { } }
|
||||||
.create().apply {
|
.apply {
|
||||||
activity.setupDialogStuff(view, this)
|
activity.setupDialogStuff(view, this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,11 +2,8 @@
|
|||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:id="@+id/selected_contact_bg">
|
<item android:id="@+id/selected_contact_bg">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="@dimen/material_button_corner_radius" />
|
||||||
<corners android:radius="@dimen/normal_margin" />
|
|
||||||
|
|
||||||
<solid android:color="@color/md_grey_white" />
|
<solid android:color="@color/md_grey_white" />
|
||||||
|
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
</layer-list>
|
</layer-list>
|
||||||
|
@@ -5,6 +5,35 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/main_app_bar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/main_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/color_primary"
|
||||||
|
app:menu="@menu/menu_main"
|
||||||
|
app:title="@string/app_launcher_name"
|
||||||
|
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:id="@+id/main_nested_scrollview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fillViewport="true"
|
||||||
|
android:scrollbars="none"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
|
android:id="@+id/main_coordinator_wrapper"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/main_holder"
|
android:id="@+id/main_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -65,3 +94,5 @@
|
|||||||
android:src="@drawable/ic_plus_vector" />
|
android:src="@drawable/ic_plus_vector" />
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
@@ -1,6 +1,32 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
|
||||||
|
android:id="@+id/new_conversation_coordinator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/new_conversation_app_bar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/new_conversation_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/color_primary"
|
||||||
|
app:title="@string/new_conversation"
|
||||||
|
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/new_conversation_nested_scrollview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
android:id="@+id/new_conversation_holder"
|
android:id="@+id/new_conversation_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
@@ -125,3 +151,5 @@
|
|||||||
android:layout_toStartOf="@+id/contacts_letter_fastscroller" />
|
android:layout_toStartOf="@+id/contacts_letter_fastscroller" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
@@ -1,6 +1,35 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
|
||||||
|
android:id="@+id/search_coordinator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/search_bar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/search_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/color_primary"
|
||||||
|
app:menu="@menu/menu_search"
|
||||||
|
app:title=""
|
||||||
|
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:id="@+id/search_nested_scrollview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fillViewport="true"
|
||||||
|
android:scrollbars="none"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
android:id="@+id/search_holder"
|
android:id="@+id/search_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
@@ -44,3 +73,5 @@
|
|||||||
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
|
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
@@ -1,10 +1,34 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/settings_scrollview"
|
android:id="@+id/settings_coordinator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/settings_app_bar_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/settings_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/color_primary"
|
||||||
|
app:title="@string/settings"
|
||||||
|
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:id="@+id/settings_nested_scrollview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fillViewport="true"
|
||||||
|
android:scrollbars="none"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/settings_holder"
|
android:id="@+id/settings_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -322,4 +346,5 @@
|
|||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
@@ -1,11 +1,33 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/thread_coordinator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/thread_app_bar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/thread_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/color_primary"
|
||||||
|
app:menu="@menu/menu_thread"
|
||||||
|
app:title=""
|
||||||
|
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
android:id="@+id/thread_holder"
|
android:id="@+id/thread_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/tiny_margin">
|
android:layout_marginBottom="@dimen/tiny_margin"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/thread_add_contacts"
|
android:id="@+id/thread_add_contacts"
|
||||||
@@ -221,3 +243,4 @@
|
|||||||
android:textSize="@dimen/smaller_text_size" />
|
android:textSize="@dimen/smaller_text_size" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
@@ -14,57 +14,49 @@
|
|||||||
android:paddingTop="@dimen/activity_margin"
|
android:paddingTop="@dimen/activity_margin"
|
||||||
android:paddingEnd="@dimen/activity_margin">
|
android:paddingEnd="@dimen/activity_margin">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.simplemobiletools.commons.views.MyTextInputLayout
|
||||||
android:id="@+id/export_messages_folder_label"
|
android:id="@+id/export_messages_folder_hint"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/folder"
|
|
||||||
android:textSize="@dimen/smaller_text_size" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/export_messages_folder"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/activity_margin"
|
|
||||||
android:layout_marginBottom="@dimen/activity_margin"
|
android:layout_marginBottom="@dimen/activity_margin"
|
||||||
android:paddingTop="@dimen/small_margin"
|
android:hint="@string/folder">
|
||||||
android:paddingEnd="@dimen/small_margin"
|
|
||||||
android:paddingBottom="@dimen/small_margin" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/export_messages_filename_label"
|
android:id="@+id/export_messages_folder"
|
||||||
android:layout_width="wrap_content"
|
style="@style/UnclickableEditText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</com.simplemobiletools.commons.views.MyTextInputLayout>
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextInputLayout
|
||||||
|
android:id="@+id/export_messages_filename_hint"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/small_margin"
|
android:hint="@string/filename_without_json">
|
||||||
android:text="@string/filename_without_json"
|
|
||||||
android:textSize="@dimen/smaller_text_size" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/export_messages_filename"
|
android:id="@+id/export_messages_filename"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/activity_margin"
|
android:layout_marginBottom="@dimen/activity_margin"
|
||||||
android:paddingTop="@dimen/normal_margin"
|
android:singleLine="true"
|
||||||
android:paddingEnd="@dimen/small_margin"
|
android:textCursorDrawable="@null"
|
||||||
android:textSize="@dimen/normal_text_size"
|
android:textSize="@dimen/normal_text_size"
|
||||||
tools:text="Messages" />
|
tools:text="Messages" />
|
||||||
|
|
||||||
|
</com.simplemobiletools.commons.views.MyTextInputLayout>
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||||
android:id="@+id/export_sms_checkbox"
|
android:id="@+id/export_sms_checkbox"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/activity_margin"
|
|
||||||
android:paddingTop="@dimen/small_margin"
|
|
||||||
android:paddingBottom="@dimen/small_margin"
|
|
||||||
android:text="@string/export_sms" />
|
android:text="@string/export_sms" />
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||||
android:id="@+id/export_mms_checkbox"
|
android:id="@+id/export_mms_checkbox"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/activity_margin"
|
|
||||||
android:paddingTop="@dimen/small_margin"
|
|
||||||
android:paddingBottom="@dimen/small_margin"
|
|
||||||
android:text="@string/export_mms" />
|
android:text="@string/export_mms" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@@ -13,8 +13,8 @@
|
|||||||
android:paddingStart="@dimen/normal_margin"
|
android:paddingStart="@dimen/normal_margin"
|
||||||
android:paddingTop="@dimen/normal_margin"
|
android:paddingTop="@dimen/normal_margin"
|
||||||
android:paddingBottom="@dimen/normal_margin"
|
android:paddingBottom="@dimen/normal_margin"
|
||||||
android:textSize="@dimen/bigger_text_size"
|
|
||||||
android:textColor="@color/md_grey_white"
|
android:textColor="@color/md_grey_white"
|
||||||
|
android:textSize="@dimen/bigger_text_size"
|
||||||
tools:text="John" />
|
tools:text="John" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
Reference in New Issue
Block a user