allow selecting parts of a message instead of copying the whole

This commit is contained in:
tibbi 2020-11-04 10:39:51 +01:00
parent acd0055477
commit 87e1be8e1b
5 changed files with 49 additions and 1 deletions

View file

@ -0,0 +1,22 @@
package com.simplemobiletools.smsmessenger.dialogs
import androidx.appcompat.app.AlertDialog
import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.smsmessenger.R
import kotlinx.android.synthetic.main.dialog_select_text.view.*
// helper dialog for selecting just a part of a message, not copying the whole into clipboard
class SelectTextDialog(val activity: BaseSimpleActivity, val text: String) {
init {
val view = activity.layoutInflater.inflate(R.layout.dialog_select_text, null).apply {
dialog_select_text_value.text = text
}
AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok) { dialog, which -> { } }
.create().apply {
activity.setupDialogStuff(view, this)
}
}
}