Removed Text custom element
This commit is contained in:
@@ -52,6 +52,7 @@ import androidx.compose.material3.IconButton
|
|||||||
import androidx.compose.material3.OutlinedTextField
|
import androidx.compose.material3.OutlinedTextField
|
||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material3.TopAppBar
|
import androidx.compose.material3.TopAppBar
|
||||||
import androidx.compose.material3.TopAppBarDefaults
|
import androidx.compose.material3.TopAppBarDefaults
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@@ -80,7 +81,6 @@ import androidx.compose.ui.unit.sp
|
|||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import com.tutpro.baresip.CustomElements.AlertDialog
|
import com.tutpro.baresip.CustomElements.AlertDialog
|
||||||
import com.tutpro.baresip.CustomElements.LabelText
|
import com.tutpro.baresip.CustomElements.LabelText
|
||||||
import com.tutpro.baresip.CustomElements.Text
|
|
||||||
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import java.text.DateFormat
|
import java.text.DateFormat
|
||||||
@@ -266,9 +266,8 @@ class ChatActivity : ComponentActivity() {
|
|||||||
else
|
else
|
||||||
aor.split(":")[1]
|
aor.split(":")[1]
|
||||||
Text(
|
Text(
|
||||||
text = headerText, modifier = Modifier
|
text = headerText,
|
||||||
.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth().padding(top = 8.dp, bottom = 8.dp),
|
||||||
.padding(top = 8.dp, bottom = 8.dp),
|
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
fontWeight = FontWeight.SemiBold,
|
fontWeight = FontWeight.SemiBold,
|
||||||
textAlign = TextAlign.Center
|
textAlign = TextAlign.Center
|
||||||
@@ -470,7 +469,7 @@ class ChatActivity : ComponentActivity() {
|
|||||||
val keyboardController = LocalSoftwareKeyboardController.current
|
val keyboardController = LocalSoftwareKeyboardController.current
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = newMessage,
|
value = newMessage,
|
||||||
placeholder = { Text(text = stringResource(R.string.new_message)) },
|
placeholder = { Text(stringResource(R.string.new_message)) },
|
||||||
onValueChange = { newMessage = it },
|
onValueChange = { newMessage = it },
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
@@ -514,11 +513,7 @@ class ChatActivity : ComponentActivity() {
|
|||||||
time.toString()
|
time.toString()
|
||||||
) != 0
|
) != 0
|
||||||
) {
|
) {
|
||||||
Toast.makeText(
|
Toast.makeText(ctx, "${getString(R.string.message_failed)}!", Toast.LENGTH_SHORT).show()
|
||||||
ctx,
|
|
||||||
"${getString(R.string.message_failed)}!",
|
|
||||||
Toast.LENGTH_SHORT
|
|
||||||
).show()
|
|
||||||
msg.direction = MESSAGE_UP_FAIL
|
msg.direction = MESSAGE_UP_FAIL
|
||||||
msg.responseReason = getString(R.string.message_failed)
|
msg.responseReason = getString(R.string.message_failed)
|
||||||
} else {
|
} else {
|
||||||
@@ -551,7 +546,7 @@ class ChatActivity : ComponentActivity() {
|
|||||||
modifier = Modifier.clickable { newMessage = "" }
|
modifier = Modifier.clickable { newMessage = "" }
|
||||||
)
|
)
|
||||||
} },
|
} },
|
||||||
label = { LabelText(text = stringResource(R.string.new_message), fontSize = 16.sp) },
|
label = { LabelText(stringResource(R.string.new_message)) },
|
||||||
textStyle = TextStyle(fontSize = 18.sp),
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
keyboardOptions = KeyboardOptions(
|
keyboardOptions = KeyboardOptions(
|
||||||
capitalization = KeyboardCapitalization.Sentences,
|
capitalization = KeyboardCapitalization.Sentences,
|
||||||
@@ -601,11 +596,7 @@ class ChatActivity : ComponentActivity() {
|
|||||||
time.toString()
|
time.toString()
|
||||||
) != 0
|
) != 0
|
||||||
) {
|
) {
|
||||||
Toast.makeText(
|
Toast.makeText(ctx, "${getString(R.string.message_failed)}!", Toast.LENGTH_SHORT).show()
|
||||||
ctx,
|
|
||||||
"${getString(R.string.message_failed)}!",
|
|
||||||
Toast.LENGTH_SHORT
|
|
||||||
).show()
|
|
||||||
msg.direction = MESSAGE_UP_FAIL
|
msg.direction = MESSAGE_UP_FAIL
|
||||||
msg.responseReason = getString(R.string.message_failed)
|
msg.responseReason = getString(R.string.message_failed)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ import androidx.compose.material3.OutlinedTextField
|
|||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.SmallFloatingActionButton
|
import androidx.compose.material3.SmallFloatingActionButton
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material3.TopAppBar
|
import androidx.compose.material3.TopAppBar
|
||||||
import androidx.compose.material3.TopAppBarDefaults
|
import androidx.compose.material3.TopAppBarDefaults
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@@ -82,7 +83,6 @@ import com.tutpro.baresip.BaresipService.Companion.contactNames
|
|||||||
import com.tutpro.baresip.CustomElements.AlertDialog
|
import com.tutpro.baresip.CustomElements.AlertDialog
|
||||||
import com.tutpro.baresip.CustomElements.ImageAvatar
|
import com.tutpro.baresip.CustomElements.ImageAvatar
|
||||||
import com.tutpro.baresip.CustomElements.LabelText
|
import com.tutpro.baresip.CustomElements.LabelText
|
||||||
import com.tutpro.baresip.CustomElements.Text
|
|
||||||
import com.tutpro.baresip.CustomElements.TextAvatar
|
import com.tutpro.baresip.CustomElements.TextAvatar
|
||||||
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
||||||
import com.tutpro.baresip.CustomElements.SelectableAlertDialog
|
import com.tutpro.baresip.CustomElements.SelectableAlertDialog
|
||||||
@@ -281,9 +281,9 @@ class ChatsActivity: ComponentActivity() {
|
|||||||
else
|
else
|
||||||
aor.split(":")[1]
|
aor.split(":")[1]
|
||||||
Text(
|
Text(
|
||||||
text = headerText, modifier = Modifier
|
text = headerText,
|
||||||
.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth().padding(top = 8.dp, bottom = 8.dp),
|
||||||
.padding(top = 8.dp, bottom = 8.dp),
|
color = LocalCustomColors.current.itemText,
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
fontWeight = FontWeight.SemiBold,
|
fontWeight = FontWeight.SemiBold,
|
||||||
textAlign = TextAlign.Center
|
textAlign = TextAlign.Center
|
||||||
@@ -558,7 +558,7 @@ class ChatsActivity: ComponentActivity() {
|
|||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = newPeer,
|
value = newPeer,
|
||||||
placeholder = {
|
placeholder = {
|
||||||
Text(text = stringResource(R.string.new_chat_peer))
|
Text(stringResource(R.string.new_chat_peer))
|
||||||
},
|
},
|
||||||
onValueChange = {
|
onValueChange = {
|
||||||
newPeer = it
|
newPeer = it
|
||||||
@@ -593,10 +593,7 @@ class ChatsActivity: ComponentActivity() {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
label = {
|
label = {
|
||||||
LabelText(
|
LabelText(stringResource(R.string.new_chat_peer))
|
||||||
text = stringResource(R.string.new_chat_peer),
|
|
||||||
fontSize = 16.sp
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
|
|||||||
@@ -596,7 +596,8 @@ class ConfigActivity : ComponentActivity() {
|
|||||||
showAlert.value = true
|
showAlert.value = true
|
||||||
},
|
},
|
||||||
textStyle = androidx.compose.ui.text.TextStyle(
|
textStyle = androidx.compose.ui.text.TextStyle(
|
||||||
fontSize = 18.sp, color = LocalCustomColors.current.itemText),
|
fontSize = 18.sp, color = LocalCustomColors.current.itemText
|
||||||
|
),
|
||||||
label = { LabelText(stringResource(R.string.dns_servers)) },
|
label = { LabelText(stringResource(R.string.dns_servers)) },
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import androidx.compose.material3.IconButton
|
|||||||
import androidx.compose.material3.OutlinedTextField
|
import androidx.compose.material3.OutlinedTextField
|
||||||
import androidx.compose.material3.OutlinedTextFieldDefaults
|
import androidx.compose.material3.OutlinedTextFieldDefaults
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material3.TextButton
|
import androidx.compose.material3.TextButton
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
@@ -84,27 +85,6 @@ import androidx.core.content.ContextCompat.getString
|
|||||||
|
|
||||||
object CustomElements {
|
object CustomElements {
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun Text(
|
|
||||||
text: String,
|
|
||||||
modifier: Modifier = Modifier,
|
|
||||||
color: Color = LocalCustomColors.current.itemText,
|
|
||||||
fontSize: TextUnit = 16.sp,
|
|
||||||
fontWeight: FontWeight = FontWeight.Normal,
|
|
||||||
textAlign: TextAlign? = null,
|
|
||||||
maxLines: Int = Int.MAX_VALUE,
|
|
||||||
) {
|
|
||||||
androidx.compose.material3.Text(
|
|
||||||
text = text,
|
|
||||||
modifier = modifier,
|
|
||||||
color = color,
|
|
||||||
fontSize = fontSize,
|
|
||||||
fontWeight = fontWeight,
|
|
||||||
textAlign = textAlign,
|
|
||||||
maxLines = maxLines
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LabelText(
|
fun LabelText(
|
||||||
text: String,
|
text: String,
|
||||||
@@ -115,7 +95,7 @@ object CustomElements {
|
|||||||
textAlign: TextAlign? = null,
|
textAlign: TextAlign? = null,
|
||||||
maxLines: Int = 1,
|
maxLines: Int = 1,
|
||||||
) {
|
) {
|
||||||
androidx.compose.material3.Text(
|
Text(
|
||||||
text = text,
|
text = text,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
color = color,
|
color = color,
|
||||||
@@ -174,7 +154,12 @@ object CustomElements {
|
|||||||
while (itemsIterator.hasNext()) {
|
while (itemsIterator.hasNext()) {
|
||||||
val item = itemsIterator.next()
|
val item = itemsIterator.next()
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(item, color = LocalCustomColors.current.light) },
|
text = {
|
||||||
|
Text(
|
||||||
|
text = item,
|
||||||
|
color = LocalCustomColors.current.light,
|
||||||
|
fontSize = 16.sp
|
||||||
|
) },
|
||||||
onClick = { onItemClick(item) }
|
onClick = { onItemClick(item) }
|
||||||
)
|
)
|
||||||
if (itemsIterator.hasNext())
|
if (itemsIterator.hasNext())
|
||||||
@@ -314,13 +299,13 @@ object CustomElements {
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
Column(modifier = Modifier.padding(16.dp)) {
|
Column(modifier = Modifier.padding(16.dp)) {
|
||||||
androidx.compose.material3.Text(
|
Text(
|
||||||
text = title,
|
text = title,
|
||||||
fontSize = 20.sp,
|
fontSize = 20.sp,
|
||||||
color = LocalCustomColors.current.alert,
|
color = LocalCustomColors.current.alert,
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
androidx.compose.material3.Text(
|
Text(
|
||||||
text = message,
|
text = message,
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
color = LocalCustomColors.current.itemText,
|
color = LocalCustomColors.current.itemText,
|
||||||
@@ -335,7 +320,7 @@ object CustomElements {
|
|||||||
onPositiveClicked()
|
onPositiveClicked()
|
||||||
showDialog.value = false
|
showDialog.value = false
|
||||||
}) {
|
}) {
|
||||||
androidx.compose.material3.Text(
|
Text(
|
||||||
text = positiveButtonText.uppercase(),
|
text = positiveButtonText.uppercase(),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = LocalCustomColors.current.alert,
|
color = LocalCustomColors.current.alert,
|
||||||
@@ -345,7 +330,7 @@ object CustomElements {
|
|||||||
onNeutralClicked()
|
onNeutralClicked()
|
||||||
showDialog.value = false
|
showDialog.value = false
|
||||||
}) {
|
}) {
|
||||||
androidx.compose.material3.Text(
|
Text(
|
||||||
text = neutralButtonText.uppercase(),
|
text = neutralButtonText.uppercase(),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = LocalCustomColors.current.alert
|
color = LocalCustomColors.current.alert
|
||||||
@@ -355,7 +340,7 @@ object CustomElements {
|
|||||||
onNegativeClicked()
|
onNegativeClicked()
|
||||||
showDialog.value = false
|
showDialog.value = false
|
||||||
}) {
|
}) {
|
||||||
androidx.compose.material3.Text(
|
Text(
|
||||||
text = negativeButtonText.uppercase(),
|
text = negativeButtonText.uppercase(),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = LocalCustomColors.current.gray
|
color = LocalCustomColors.current.gray
|
||||||
@@ -374,7 +359,7 @@ object CustomElements {
|
|||||||
onNegativeClicked()
|
onNegativeClicked()
|
||||||
showDialog.value = false
|
showDialog.value = false
|
||||||
}) {
|
}) {
|
||||||
androidx.compose.material3.Text(
|
Text(
|
||||||
text = negativeButtonText.uppercase(),
|
text = negativeButtonText.uppercase(),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = LocalCustomColors.current.gray
|
color = LocalCustomColors.current.gray
|
||||||
@@ -385,7 +370,7 @@ object CustomElements {
|
|||||||
onNeutralClicked()
|
onNeutralClicked()
|
||||||
showDialog.value = false
|
showDialog.value = false
|
||||||
}) {
|
}) {
|
||||||
androidx.compose.material3.Text(
|
Text(
|
||||||
text = neutralButtonText.uppercase(),
|
text = neutralButtonText.uppercase(),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = LocalCustomColors.current.alert
|
color = LocalCustomColors.current.alert
|
||||||
@@ -395,7 +380,7 @@ object CustomElements {
|
|||||||
onPositiveClicked()
|
onPositiveClicked()
|
||||||
showDialog.value = false
|
showDialog.value = false
|
||||||
}) {
|
}) {
|
||||||
androidx.compose.material3.Text(
|
Text(
|
||||||
text = positiveButtonText.uppercase(),
|
text = positiveButtonText.uppercase(),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = LocalCustomColors.current.alert,
|
color = LocalCustomColors.current.alert,
|
||||||
@@ -435,7 +420,7 @@ object CustomElements {
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
Column(modifier = Modifier.padding(16.dp)) {
|
Column(modifier = Modifier.padding(16.dp)) {
|
||||||
androidx.compose.material3.Text(
|
Text(
|
||||||
text = title,
|
text = title,
|
||||||
fontSize = 20.sp,
|
fontSize = 20.sp,
|
||||||
color = LocalCustomColors.current.alert,
|
color = LocalCustomColors.current.alert,
|
||||||
@@ -457,7 +442,7 @@ object CustomElements {
|
|||||||
},
|
},
|
||||||
modifier = Modifier.align(Alignment.End)
|
modifier = Modifier.align(Alignment.End)
|
||||||
) {
|
) {
|
||||||
androidx.compose.material3.Text(
|
Text(
|
||||||
text = item,
|
text = item,
|
||||||
color = LocalCustomColors.current.itemText,
|
color = LocalCustomColors.current.itemText,
|
||||||
)
|
)
|
||||||
@@ -471,7 +456,7 @@ object CustomElements {
|
|||||||
openDialog.value = false
|
openDialog.value = false
|
||||||
},
|
},
|
||||||
modifier = Modifier.align(Alignment.End)){
|
modifier = Modifier.align(Alignment.End)){
|
||||||
androidx.compose.material3.Text(
|
Text(
|
||||||
text = neutralButtonText.uppercase(),
|
text = neutralButtonText.uppercase(),
|
||||||
color = LocalCustomColors.current.gray,
|
color = LocalCustomColors.current.gray,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ import com.tutpro.baresip.CustomElements.DropdownMenu
|
|||||||
import com.tutpro.baresip.CustomElements.LabelText
|
import com.tutpro.baresip.CustomElements.LabelText
|
||||||
import com.tutpro.baresip.CustomElements.PasswordDialog
|
import com.tutpro.baresip.CustomElements.PasswordDialog
|
||||||
import com.tutpro.baresip.CustomElements.SelectableAlertDialog
|
import com.tutpro.baresip.CustomElements.SelectableAlertDialog
|
||||||
import com.tutpro.baresip.CustomElements.Text
|
|
||||||
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@@ -1350,7 +1349,7 @@ class MainActivity : ComponentActivity() {
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
Column(modifier = Modifier.padding(16.dp)) {
|
Column(modifier = Modifier.padding(16.dp)) {
|
||||||
androidx.compose.material3.Text(
|
Text(
|
||||||
text = stringResource(R.string.call_transfer),
|
text = stringResource(R.string.call_transfer),
|
||||||
fontSize = 20.sp,
|
fontSize = 20.sp,
|
||||||
color = LocalCustomColors.current.alert,
|
color = LocalCustomColors.current.alert,
|
||||||
|
|||||||
Reference in New Issue
Block a user