diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 1eca016..e545993 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -15,8 +15,8 @@ android { applicationId = "ru.tech.firenote" minSdk = 21 targetSdk = 32 - versionCode = 7 - versionName = "1.1.2" + versionCode = 8 + versionName = "1.1.3" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/release/app-release.apk b/app/release/app-release.apk index eed38db..dce10c3 100644 Binary files a/app/release/app-release.apk and b/app/release/app-release.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index 64b61da..d4fdd0c 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -11,8 +11,8 @@ "type": "SINGLE", "filters": [], "attributes": [], - "versionCode": 7, - "versionName": "1.1.2", + "versionCode": 8, + "versionName": "1.1.3", "outputFile": "app-release.apk" } ], diff --git a/app/src/main/java/ru/tech/firenote/ui/composable/single/bar/AppBarActions.kt b/app/src/main/java/ru/tech/firenote/ui/composable/single/bar/AppBarActions.kt index f77e0bf..0fdf46c 100644 --- a/app/src/main/java/ru/tech/firenote/ui/composable/single/bar/AppBarActions.kt +++ b/app/src/main/java/ru/tech/firenote/ui/composable/single/bar/AppBarActions.kt @@ -10,10 +10,11 @@ import androidx.compose.material.icons.filled.Palette import androidx.compose.material.icons.filled.TextSnippet import androidx.compose.material.icons.outlined.* import androidx.compose.material3.* -import androidx.compose.runtime.* +import androidx.compose.runtime.Composable +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp @@ -204,88 +205,4 @@ fun ProfileActions(onClick: () -> Unit) { dismissAction = onClick, backHandler = {} ) -} - -@Composable -fun FileAttachActions(onItemSelected: (Attachments) -> Unit) { - - var showFilter by remember { mutableStateOf(false) } - - IconButton(onClick = { - showFilter = true - }) { - Icon(Icons.Outlined.AttachFile, null, tint = Color.Black) - } - - DropdownMenu( - expanded = showFilter, - onDismissRequest = { showFilter = false } - ) { - DropdownMenuItem( - onClick = { - showFilter = false - onItemSelected(Attachments.IMAGE) - }, - text = { Text(stringResource(R.string.image)) }, - leadingIcon = { Icon(Icons.Outlined.Image, null) } - ) - DropdownMenuItem( - onClick = { - showFilter = false - onItemSelected(Attachments.DOCUMENT) - }, - text = { Text(stringResource(R.string.document)) }, - leadingIcon = { Icon(Icons.Outlined.TextSnippet, null) } - ) - DropdownMenuItem( - onClick = { - showFilter = false - onItemSelected(Attachments.AUDIO) - }, - text = { Text(stringResource(R.string.Audio)) }, - leadingIcon = { Icon(Icons.Outlined.MusicNote, null) } - ) - DropdownMenuItem( - onClick = { - showFilter = false - onItemSelected(Attachments.FILE) - }, - text = { Text(stringResource(R.string.File)) }, - leadingIcon = { Icon(Icons.Outlined.InsertDriveFile, null) } - ) - } - -// val contentLauncher = rememberLauncherForActivityResult( -// ActivityResultContracts.GetContent() -// ) { uri: Uri? -> -// uri?.let { viewModel.addAttachment(uri) } -// } -// -// val documentLauncher = rememberLauncherForActivityResult( -// ActivityResultContracts.OpenDocument() -// ) { uri: Uri? -> -// uri?.let { viewModel.addAttachment(uri) } -// } -// -// FileAttachActions(onItemSelected = { -// when (it) { -// Attachments.IMAGE -> contentLauncher.launch("image/*") -// Attachments.DOCUMENT -> documentLauncher.launch(arrayOf( -// "docx", "doc", "ppt", "pptx", "xls", "xlsx", "pdf" -// ).toMimeType()) -// Attachments.AUDIO -> contentLauncher.launch("audio/*") -// else -> contentLauncher.launch("*/*") -// } -// }) - - - // fun Array.toMimeType() : Array { - // return this.map { - // MimeTypeMap.getSingleton().getMimeTypeFromExtension(it) ?: "" - // }.toTypedArray() - // } -} - -enum class Attachments { - IMAGE, DOCUMENT, AUDIO, FILE -} +} \ No newline at end of file