Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions application/composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ android {
applicationId = "io.writeopia"
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()
versionCode = 54
versionName = "0.41.0"
versionCode = 55
versionName = "0.42.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -62,6 +63,7 @@ fun CommonButton(
isEnabledState: StateFlow<Boolean> = MutableStateFlow(true),
verticalAlignment: Alignment.Vertical = Alignment.CenterVertically,
horizontalArrangement: Arrangement.Horizontal = Arrangement.Start,
textStyle: TextStyle = MaterialTheme.typography.bodySmall,
clickListener: () -> Unit,
) {
val isEditable by isEnabledState.collectAsState()
Expand Down Expand Up @@ -91,7 +93,7 @@ fun CommonButton(

Text(
text,
style = MaterialTheme.typography.bodySmall,
style = textStyle,
color = MaterialTheme.colorScheme.onBackground,
textAlign = TextAlign.Center,
fontWeight = FontWeight.Bold
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ LIMIT 10;
getLastUpdated:
SELECT *
FROM folderEntity
WHERE folderEntity.id != "root"
ORDER BY last_updated_at;

selectAllFolders:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
Expand All @@ -21,6 +22,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import io.writeopia.editor.features.editor.ui.desktop.edit.menu.FontOptions
import io.writeopia.editor.features.editor.ui.desktop.edit.menu.LockButton
Expand Down Expand Up @@ -67,7 +69,7 @@ internal fun NoteGlobalActionsMenu(
Spacer(modifier = Modifier.height(8.dp))

FontOptions(
modifier = Modifier.widthIn(max = 300.dp),
modifier = Modifier.fillMaxWidth(),
changeFontFamily = changeFontFamily,
selectedState = selectedState,
selectedColor = WriteopiaTheme.colorScheme.highlight,
Expand All @@ -82,13 +84,15 @@ internal fun NoteGlobalActionsMenu(

Row {
ShareButton(
modifier = Modifier.weight(1F),
text = WrStrings.exportJson(),
onClick = onShareJson
)

Spacer(modifier = Modifier.width(8.dp))

ShareButton(
modifier = Modifier.weight(1F),
text = WrStrings.exportMarkdown(),
onClick = onShareMd
)
Expand All @@ -107,17 +111,18 @@ private fun Title(label: String) {
}

@Composable
private fun ShareButton(text: String, onClick: () -> Unit) {
private fun ShareButton(text: String, modifier: Modifier = Modifier, onClick: () -> Unit) {
Text(
modifier = Modifier
modifier = modifier
.clickable(onClick = onClick)
.clip(RoundedCornerShape(6.dp))
.background(MaterialTheme.colorScheme.secondary)
.background(MaterialTheme.colorScheme.background)
.padding(8.dp),
text = text,
color = MaterialTheme.colorScheme.onPrimary,
style = MaterialTheme.typography.bodyMedium.copy(
color = MaterialTheme.colorScheme.onBackground,
style = MaterialTheme.typography.bodySmall.copy(
fontWeight = FontWeight.Bold
)
),
textAlign = TextAlign.Center
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,10 @@ fun NotesCardsScreen(

CommonButton(
modifier = modifier,
text = "Document",
text = WrStrings.document(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center,
textStyle = MaterialTheme.typography.bodyMedium,
clickListener = {
hideShowMenu()
newNote()
Expand All @@ -247,9 +248,10 @@ fun NotesCardsScreen(

CommonButton(
modifier = modifier,
text = "Folder",
text = WrStrings.folder(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center,
textStyle = MaterialTheme.typography.bodyMedium,
clickListener = {
hideShowMenu()
newFolder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SearchRepository(
) {
@OptIn(ExperimentalCoroutinesApi::class)
fun searchNotesAndFoldersLocally(query: String): Flow<List<SearchItem>> {
val workspaceFlow = authRepository.listenForWorkspace()
val workspaceFlow = authRepository.listenForWorkspace()

if (query.isEmpty()) return workspaceFlow.flatMapLatest { workspace ->
flow { emit(getNotesAndFolders(workspace.id)) }
Expand Down