mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-15 18:20:14 +00:00
Added back app_name string so app names properly, fixed API 28 save issue, made some buttons display as red if they should
This commit is contained in:
@@ -34,6 +34,7 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
@@ -228,11 +229,11 @@ private fun SaveAttachmentWarningDialog(
|
||||
val context = LocalContext.current
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismissRequest,
|
||||
title = context.getString(R.string.permissionsRequired),
|
||||
title = context.getString(R.string.warning),
|
||||
text = context.resources.getString(R.string.attachmentsWarning),
|
||||
buttons = listOf(
|
||||
DialogButtonModel(GetString(R.string.save), onClick = onAccepted),
|
||||
DialogButtonModel(GetString(android.R.string.cancel), dismissOnClick = true)
|
||||
DialogButtonModel(GetString(R.string.save), GetString(R.string.AccessibilityId_save), color = LocalColors.current.danger, onClick = onAccepted),
|
||||
DialogButtonModel(GetString(android.R.string.cancel), GetString(R.string.AccessibilityId_cancel), dismissOnClick = true)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@@ -409,6 +409,8 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
|
||||
showSessionDialog {
|
||||
title(R.string.profileDisplayPictureSet)
|
||||
view(R.layout.dialog_change_avatar)
|
||||
|
||||
// Note: This is the only instance in a dialog where the "Save" button is not a `dangerButton`
|
||||
button(R.string.save) { startAvatarSelection() }
|
||||
|
||||
if (prefs.getProfileAvatarId() != 0) {
|
||||
|
@@ -73,7 +73,7 @@ class SaveAttachmentTask @JvmOverloads constructor(context: Context, count: Int
|
||||
fun saveAttachment(context: Context, attachment: Attachment): String? {
|
||||
val contentType = checkNotNull(MediaUtil.getCorrectedMimeType(attachment.contentType))
|
||||
var fileName = attachment.fileName
|
||||
if (fileName == null) fileName = generateOutputFileName(contentType, attachment.date)
|
||||
if (fileName.isNullOrEmpty()) fileName = generateOutputFileName(contentType, attachment.date)
|
||||
fileName = sanitizeOutputFileName(fileName)
|
||||
val outputUri: Uri = getMediaStoreContentUriForType(contentType)
|
||||
val mediaUri = createOutputUri(context, outputUri, contentType, fileName)
|
||||
@@ -132,6 +132,17 @@ class SaveAttachmentTask @JvmOverloads constructor(context: Context, count: Int
|
||||
}
|
||||
|
||||
private fun createOutputUri(context: Context, outputUri: Uri, contentType: String, fileName: String): Uri? {
|
||||
|
||||
if (fileName == null)
|
||||
{
|
||||
Log.w("ACL", "Filename is null - wtf!")
|
||||
}
|
||||
|
||||
if (fileName != null && fileName.isEmpty())
|
||||
{
|
||||
Log.w("ACL", "Filename is empty - wtf!")
|
||||
}
|
||||
|
||||
val fileParts: Array<String> = getFileNameParts(fileName)
|
||||
val base = fileParts[0]
|
||||
val extension = fileParts[1]
|
||||
|
Reference in New Issue
Block a user