fix: v0.3.0.1 — editor chip-row to bottom + centred colour picker + hashtags on list cards + dog-ear colour accent
Urgent UI polish patch on top of v0.3.0.0.
EDITOR (NoteEditorScreen.kt)
- Drop the '+ add' chip from the hashtag row. The '#' icon in the
top bar is now the only way to add tags.
- Move the hashtag chip row to the bottom of the editor. The text
field now uses weight(1f) instead of fillMaxSize() so the row stays
visible below it.
- Hide the chip row entirely when the note has no hashtags (no 'No
tags' placeholder).
- Centre the colour picker horizontally. Switched from a left-aligned
LazyRow to a plain Row with Arrangement.spacedBy(12.dp,
Alignment.CenterHorizontally).
LIST CARDS (NoteListScreen.kt)
- Replace the small 10 dp colour circle chip (next to the star) with
a 'dog-ear' colour accent overlaid on the top-right corner of the
card (a 28 dp right-triangle filled with the note's colour).
- Add a hashtag row to each card. Shows up to three tags as a
FlowRow of label-styled text; an '+N' indicator appears when
there are more than three. Hidden when the note has no tags.
- Wrap the Card in a Box so the dog-ear can be aligned to
Alignment.TopEnd.
VERSION + DOCS
- app/build.gradle.kts: versionCode 5 → 6, versionName '0.3.0.0' →
'0.3.0.1'. The MAJOR.MINOR.MAINTENANCE.EMERGENCY scheme validator
remains in place.
- README.md changelog: new 0.3.0.1 row.
- Incido Development Plan.txt §10: new 0.3.0.1 row.
VERIFIED
- ./gradlew assembleDebug assembleRelease both green.
- Debug 25.7 MB, release 19.8 MB.
- versionCode=6, versionName='0.3.0.1'.
- No INTERNET permission in either APK.
- Release signed (v2 scheme).
This commit is contained in:
1 parent
d616ce3021
commit
dbc4e7acba
5 files changed
+112
-77
No files matched your search
@@ -374,6 +374,7 @@ A short reference for AI assistants:
|
|||||||
| 0.2.0.0 | 2026-08-14 | Polish + first Keep-parity features. Discard-confirm dialog; release signing config (dev keystore). Favorites (renamed from Pinned Notes), full-text search, 6 colour-coded notes, inline GFM checklists (open/done counts). ObjectBox KMP migration deferred to v0.5 (tracked). |
|
| 0.2.0.0 | 2026-08-14 | Polish + first Keep-parity features. Discard-confirm dialog; release signing config (dev keystore). Favorites (renamed from Pinned Notes), full-text search, 6 colour-coded notes, inline GFM checklists (open/done counts). ObjectBox KMP migration deferred to v0.5 (tracked). |
|
||||||
| 0.2.0.1 | 2026-08-14 | Hotfix: search-active flag folded into uiState so the search icon actually opens the field. |
|
| 0.2.0.1 | 2026-08-14 | Hotfix: search-active flag folded into uiState so the search icon actually opens the field. |
|
||||||
| 0.3.0.0 | 2026-08-14 | Hashtags (separate entity + cross-ref, 5-tag cap, autocomplete, persistent chips on editor, search() also matches tag names) + bolder colour accent (14 dp gradient stripe + tinted card background + corner chip) + nav drawer (Home / Favorites / Untagged + recent tags) + centred app-bar title + new version scheme adopted (validator in app/build.gradle.kts). |
|
| 0.3.0.0 | 2026-08-14 | Hashtags (separate entity + cross-ref, 5-tag cap, autocomplete, persistent chips on editor, search() also matches tag names) + bolder colour accent (14 dp gradient stripe + tinted card background + corner chip) + nav drawer (Home / Favorites / Untagged + recent tags) + centred app-bar title + new version scheme adopted (validator in app/build.gradle.kts). |
|
||||||
|
| 0.3.0.1 | 2026-08-14 | Urgent UI polish: editor hashtag row moved to the bottom (and hidden when empty), `+ add` chip removed (use `#` icon in top bar), colour picker centred horizontally, list-card dog-ear colour accent replaces the small circle chip, list cards show a hashtag row (with `+N` abbreviation when capped). |
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ cross-platform ports, end-to-end sync, and security features.
|
|||||||
| 0.2.0.0 | 2026-08-14 | Polish + favourites, search, colours, checklists, discard dialog, release signing |
|
| 0.2.0.0 | 2026-08-14 | Polish + favourites, search, colours, checklists, discard dialog, release signing |
|
||||||
| 0.2.0.1 | 2026-08-14 | Hotfix: search icon now actually opens the search bar |
|
| 0.2.0.1 | 2026-08-14 | Hotfix: search icon now actually opens the search bar |
|
||||||
| 0.3.0.0 | 2026-08-14 | Hashtags (visible chips on editor, 5-tag cap, autocomplete) + bolder colour accent + nav drawer (Home / Favorites / Untagged + recent tags) + centred app-bar title + new version scheme |
|
| 0.3.0.0 | 2026-08-14 | Hashtags (visible chips on editor, 5-tag cap, autocomplete) + bolder colour accent + nav drawer (Home / Favorites / Untagged + recent tags) + centred app-bar title + new version scheme |
|
||||||
|
| 0.3.0.1 | 2026-08-14 | Urgent UI polish: editor hashtag row moved to the bottom (and hidden when empty), `+ add` chip removed (use `#` icon in top bar), colour picker centred horizontally, list-card dog-ear colour accent replaces the small circle chip, list cards show a hashtag row (with `+N` abbreviation when capped). |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ android {
|
|||||||
applicationId = "org.incido.app"
|
applicationId = "org.incido.app"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 5
|
versionCode = 6
|
||||||
versionName = "0.3.0.0"
|
versionName = "0.3.0.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Signing ---
|
// --- Signing ---
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.Box
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
||||||
import androidx.compose.foundation.layout.FlowRow
|
import androidx.compose.foundation.layout.FlowRow
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.WindowInsets
|
import androidx.compose.foundation.layout.WindowInsets
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
@@ -17,12 +18,10 @@ import androidx.compose.foundation.layout.padding
|
|||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.systemBars
|
import androidx.compose.foundation.layout.systemBars
|
||||||
import androidx.compose.foundation.layout.union
|
import androidx.compose.foundation.layout.union
|
||||||
import androidx.compose.foundation.lazy.LazyRow
|
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.foundation.text.KeyboardOptions
|
import androidx.compose.foundation.text.KeyboardOptions
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.Add
|
|
||||||
import androidx.compose.material.icons.filled.Close
|
import androidx.compose.material.icons.filled.Close
|
||||||
import androidx.compose.material.icons.filled.Delete
|
import androidx.compose.material.icons.filled.Delete
|
||||||
import androidx.compose.material.icons.filled.Done
|
import androidx.compose.material.icons.filled.Done
|
||||||
@@ -32,7 +31,6 @@ import androidx.compose.material.icons.filled.Tag
|
|||||||
import androidx.compose.material.icons.outlined.StarOutline
|
import androidx.compose.material.icons.outlined.StarOutline
|
||||||
import androidx.compose.material3.AlertDialog
|
import androidx.compose.material3.AlertDialog
|
||||||
import androidx.compose.material3.AssistChip
|
import androidx.compose.material3.AssistChip
|
||||||
import androidx.compose.material3.AssistChipDefaults
|
|
||||||
import androidx.compose.material3.CenterAlignedTopAppBar
|
import androidx.compose.material3.CenterAlignedTopAppBar
|
||||||
import androidx.compose.material3.DropdownMenu
|
import androidx.compose.material3.DropdownMenu
|
||||||
import androidx.compose.material3.DropdownMenuItem
|
import androidx.compose.material3.DropdownMenuItem
|
||||||
@@ -57,6 +55,7 @@ import androidx.compose.runtime.remember
|
|||||||
import androidx.compose.runtime.rememberCoroutineScope
|
import androidx.compose.runtime.rememberCoroutineScope
|
||||||
import androidx.compose.runtime.saveable.rememberSaveable
|
import androidx.compose.runtime.saveable.rememberSaveable
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.focus.FocusRequester
|
import androidx.compose.ui.focus.FocusRequester
|
||||||
@@ -211,25 +210,18 @@ fun NoteEditorScreen(
|
|||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.padding(padding),
|
.padding(padding),
|
||||||
) {
|
) {
|
||||||
HashtagChipRow(
|
// v0.3.0.1: colour picker centred horizontally (was left-aligned
|
||||||
tags = state.hashtags,
|
// LazyRow in v0.3.0.0). Six fixed entries → plain Row, no LazyRow.
|
||||||
canAddMore = state.canAddMoreTags,
|
Row(
|
||||||
onAddClick = { viewModel.openAddTagSheet() },
|
|
||||||
onRemove = { viewModel.removeTag(it) },
|
|
||||||
)
|
|
||||||
|
|
||||||
// Colour-picker row above the editor text field.
|
|
||||||
LazyRow(
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(horizontal = 16.dp, vertical = 4.dp),
|
.padding(horizontal = 16.dp, vertical = 4.dp),
|
||||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
horizontalArrangement = Arrangement.spacedBy(
|
||||||
|
space = 12.dp,
|
||||||
|
alignment = Alignment.CenterHorizontally,
|
||||||
|
),
|
||||||
) {
|
) {
|
||||||
items(
|
AllNoteColors.forEach { color ->
|
||||||
count = AllNoteColors.size,
|
|
||||||
key = { idx -> AllNoteColors[idx].storageKey.toInt() },
|
|
||||||
) { idx ->
|
|
||||||
val color = AllNoteColors[idx]
|
|
||||||
ColorSwatch(
|
ColorSwatch(
|
||||||
color = color,
|
color = color,
|
||||||
selected = state.color == color,
|
selected = state.color == color,
|
||||||
@@ -238,13 +230,16 @@ fun NoteEditorScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// v0.3.0.1: text field takes remaining vertical space via
|
||||||
|
// weight(1f) instead of fillMaxSize() so the chip row below
|
||||||
|
// it stays visible at the bottom.
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = state.content,
|
value = state.content,
|
||||||
onValueChange = viewModel::onContentChange,
|
onValueChange = viewModel::onContentChange,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.weight(1f)
|
||||||
|
.fillMaxWidth()
|
||||||
.padding(horizontal = 16.dp)
|
.padding(horizontal = 16.dp)
|
||||||
.padding(bottom = 16.dp)
|
|
||||||
.focusRequester(focusRequester),
|
.focusRequester(focusRequester),
|
||||||
placeholder = { Text("Write something…") },
|
placeholder = { Text("Write something…") },
|
||||||
keyboardOptions = KeyboardOptions(
|
keyboardOptions = KeyboardOptions(
|
||||||
@@ -252,6 +247,15 @@ fun NoteEditorScreen(
|
|||||||
imeAction = ImeAction.Default,
|
imeAction = ImeAction.Default,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// v0.3.0.1: hashtag chip row now sits at the bottom of the
|
||||||
|
// editor. Hidden entirely when the note has no tags — the `#`
|
||||||
|
// icon in the top bar is the only way to add tags (no `+ add`
|
||||||
|
// chip anymore).
|
||||||
|
HashtagChipRow(
|
||||||
|
tags = state.hashtags,
|
||||||
|
onRemove = { viewModel.removeTag(it) },
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,11 +284,12 @@ fun NoteEditorScreen(
|
|||||||
@Composable
|
@Composable
|
||||||
private fun HashtagChipRow(
|
private fun HashtagChipRow(
|
||||||
tags: List<String>,
|
tags: List<String>,
|
||||||
canAddMore: Boolean,
|
|
||||||
onAddClick: () -> Unit,
|
|
||||||
onRemove: (String) -> Unit,
|
onRemove: (String) -> Unit,
|
||||||
) {
|
) {
|
||||||
if (tags.isEmpty() && !canAddMore) return
|
// v0.3.0.1: hide the row entirely when there are no hashtags. The
|
||||||
|
// user opens the add-tag sheet via the `#` icon in the top bar; the
|
||||||
|
// row only appears once at least one tag is present.
|
||||||
|
if (tags.isEmpty()) return
|
||||||
FlowRow(
|
FlowRow(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@@ -292,13 +297,6 @@ private fun HashtagChipRow(
|
|||||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
verticalArrangement = Arrangement.spacedBy(4.dp),
|
verticalArrangement = Arrangement.spacedBy(4.dp),
|
||||||
) {
|
) {
|
||||||
if (tags.isEmpty()) {
|
|
||||||
Text(
|
|
||||||
text = "Tags",
|
|
||||||
style = MaterialTheme.typography.labelLarge,
|
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
tags.forEach { tag ->
|
tags.forEach { tag ->
|
||||||
AssistChip(
|
AssistChip(
|
||||||
onClick = { onRemove(tag) },
|
onClick = { onRemove(tag) },
|
||||||
@@ -308,21 +306,10 @@ private fun HashtagChipRow(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (canAddMore) {
|
|
||||||
AssistChip(
|
|
||||||
onClick = onAddClick,
|
|
||||||
label = { Text("+ add") },
|
|
||||||
leadingIcon = { Icon(Icons.Filled.Add, contentDescription = null, modifier = Modifier.size(16.dp)) },
|
|
||||||
colors = AssistChipDefaults.assistChipColors(
|
|
||||||
labelColor = MaterialTheme.colorScheme.primary,
|
|
||||||
leadingIconContentColor = MaterialTheme.colorScheme.primary,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
private fun AddTagSheet(
|
private fun AddTagSheet(
|
||||||
tagInput: String,
|
tagInput: String,
|
||||||
@@ -360,9 +347,8 @@ private fun AddTagSheet(
|
|||||||
style = MaterialTheme.typography.labelLarge,
|
style = MaterialTheme.typography.labelLarge,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
)
|
)
|
||||||
LazyRow(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
FlowRow(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||||
items(count = suggestions.size, key = { idx -> suggestions[idx] }) { idx ->
|
suggestions.forEach { s ->
|
||||||
val s = suggestions[idx]
|
|
||||||
SuggestionChip(
|
SuggestionChip(
|
||||||
onClick = { onPickSuggestion(s) },
|
onClick = { onPickSuggestion(s) },
|
||||||
label = { Text("#$s") },
|
label = { Text("#$s") },
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import androidx.compose.foundation.background
|
|||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
||||||
|
import androidx.compose.foundation.layout.FlowRow
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
@@ -13,7 +15,7 @@ import androidx.compose.foundation.layout.padding
|
|||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.GenericShape
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.Add
|
import androidx.compose.material.icons.filled.Add
|
||||||
import androidx.compose.material.icons.filled.CheckBox
|
import androidx.compose.material.icons.filled.CheckBox
|
||||||
@@ -41,9 +43,7 @@ import androidx.compose.runtime.remember
|
|||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
|
||||||
import androidx.compose.ui.graphics.Brush
|
import androidx.compose.ui.graphics.Brush
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.graphics.lerp
|
import androidx.compose.ui.graphics.lerp
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
@@ -55,6 +55,19 @@ import org.incido.domain.model.Note
|
|||||||
import org.incido.domain.model.NoteColor
|
import org.incido.domain.model.NoteColor
|
||||||
import org.incido.domain.model.NoteFilter
|
import org.incido.domain.model.NoteFilter
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Right-triangle that fills the top-right corner of its bounds — a
|
||||||
|
* "dog-ear" / folded-page effect used to mark the note's colour.
|
||||||
|
*/
|
||||||
|
private val DogEarShape = GenericShape { size, _ ->
|
||||||
|
// Right-triangle anchored to the top-right corner: vertices at
|
||||||
|
// (0, 0), (size.width, 0), (size.width, size.height).
|
||||||
|
moveTo(0f, 0f)
|
||||||
|
lineTo(size.width, 0f)
|
||||||
|
lineTo(size.width, size.height)
|
||||||
|
close()
|
||||||
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun NoteListScreen(
|
fun NoteListScreen(
|
||||||
@@ -66,7 +79,6 @@ fun NoteListScreen(
|
|||||||
val state by viewModel.uiState.collectAsStateWithLifecycle()
|
val state by viewModel.uiState.collectAsStateWithLifecycle()
|
||||||
var localQuery by remember { mutableStateOf("") }
|
var localQuery by remember { mutableStateOf("") }
|
||||||
|
|
||||||
// Keep the ViewModel in sync with the parent's filter selection.
|
|
||||||
LaunchedEffect(filterMode) { viewModel.setFilter(filterMode) }
|
LaunchedEffect(filterMode) { viewModel.setFilter(filterMode) }
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
@@ -84,14 +96,13 @@ fun NoteListScreen(
|
|||||||
if (state.isSearchActive) viewModel.closeSearch() else viewModel.openSearch()
|
if (state.isSearchActive) viewModel.closeSearch() else viewModel.openSearch()
|
||||||
localQuery = ""
|
localQuery = ""
|
||||||
}) {
|
}) {
|
||||||
Icon(Icons.Filled.Search, contentDescription = "Search notes")
|
Icon(Icons.Default.Search, contentDescription = "Search notes")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
floatingActionButton = {
|
floatingActionButton = {
|
||||||
// FAB only on Home — adding notes while filtered makes less sense.
|
|
||||||
if (filterMode == NoteFilter.Home) {
|
if (filterMode == NoteFilter.Home) {
|
||||||
FloatingActionButton(onClick = { onOpenEditor(null) }) {
|
FloatingActionButton(onClick = { onOpenEditor(null) }) {
|
||||||
Icon(Icons.Default.Add, contentDescription = "New note")
|
Icon(Icons.Default.Add, contentDescription = "New note")
|
||||||
@@ -209,11 +220,14 @@ private fun NoteList(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* v0.3.0.0 card redesign — three-layer colour accent so notes of
|
* v0.3.0.1 card layout:
|
||||||
* different colours are visually distinct at a glance:
|
* - 14 dp vertical gradient stripe down the left edge
|
||||||
* 1. 14 dp vertical gradient stripe down the left edge.
|
* - Tinted card surface (12 % colour blend over the M3 surface)
|
||||||
* 2. Tinted card surface (12 % colour blend over the M3 surface).
|
* - Dog-ear colour accent in the top-right corner (replaces the old
|
||||||
* 3. 10 dp solid colour chip in the top-right corner.
|
* circle chip next to the star)
|
||||||
|
* - Title + body preview + checklist summary + hashtag row +
|
||||||
|
* timestamp / delete
|
||||||
|
* - Hashtag row is hidden entirely when the note has no tags.
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
private fun NoteCard(
|
private fun NoteCard(
|
||||||
@@ -228,6 +242,7 @@ private fun NoteCard(
|
|||||||
val noteColor = note.color
|
val noteColor = note.color
|
||||||
val hasColor = noteColor != NoteColor.NONE
|
val hasColor = noteColor != NoteColor.NONE
|
||||||
|
|
||||||
|
Box(modifier = Modifier.fillMaxWidth()) {
|
||||||
Card(
|
Card(
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
@@ -243,7 +258,6 @@ private fun NoteCard(
|
|||||||
) {
|
) {
|
||||||
Row(modifier = Modifier.fillMaxWidth()) {
|
Row(modifier = Modifier.fillMaxWidth()) {
|
||||||
if (hasColor) {
|
if (hasColor) {
|
||||||
// Layer 1: 14 dp gradient stripe.
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(width = 14.dp, height = 110.dp)
|
.size(width = 14.dp, height = 110.dp)
|
||||||
@@ -269,16 +283,8 @@ private fun NoteCard(
|
|||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f),
|
||||||
)
|
)
|
||||||
// Layer 3: top-right colour chip (only when coloured).
|
// v0.3.0.1: small circle chip removed — the
|
||||||
if (hasColor) {
|
// dog-ear below is now the colour indicator.
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.size(10.dp)
|
|
||||||
.clip(CircleShape)
|
|
||||||
.background(noteColor.toComposeColor()),
|
|
||||||
)
|
|
||||||
Spacer(modifier = Modifier.size(8.dp))
|
|
||||||
}
|
|
||||||
IconButton(onClick = onToggleFavorite) {
|
IconButton(onClick = onToggleFavorite) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = if (note.isFavorite) Icons.Filled.Star else Icons.Outlined.StarOutline,
|
imageVector = if (note.isFavorite) Icons.Filled.Star else Icons.Outlined.StarOutline,
|
||||||
@@ -315,6 +321,10 @@ private fun NoteCard(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (note.hashtags.isNotEmpty()) {
|
||||||
|
Spacer(modifier = Modifier.padding(top = 4.dp))
|
||||||
|
HashtagRow(hashtags = note.hashtags)
|
||||||
|
}
|
||||||
Spacer(modifier = Modifier.padding(top = 8.dp))
|
Spacer(modifier = Modifier.padding(top = 8.dp))
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
@@ -337,13 +347,50 @@ private fun NoteCard(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// v0.3.0.1: dog-ear colour accent overlays the top-right corner.
|
||||||
|
if (hasColor) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.TopEnd)
|
||||||
|
.size(28.dp)
|
||||||
|
.background(
|
||||||
|
color = noteColor.toComposeColor(),
|
||||||
|
shape = DogEarShape,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Lightweight imports used to avoid shadowed-name conflicts in
|
/**
|
||||||
// other files that might also import these symbols ---
|
* v0.3.0.1: hashtag list on the card. Shows up to three tags as a
|
||||||
@Suppress("unused")
|
* compact FlowRow of label-styled text; if there are more, renders a
|
||||||
private fun clip(@Suppress("UNUSED_PARAMETER") shape: androidx.compose.ui.graphics.Shape): Modifier =
|
* "+N" abbreviation indicator. Hidden entirely by the caller when
|
||||||
Modifier.clip(shape)
|
* [hashtags] is empty.
|
||||||
|
*/
|
||||||
@Suppress("unused")
|
@OptIn(ExperimentalLayoutApi::class)
|
||||||
private fun background(color: Color): Modifier = Modifier.background(color)
|
@Composable
|
||||||
|
private fun HashtagRow(hashtags: List<String>) {
|
||||||
|
val visible = hashtags.take(3)
|
||||||
|
val overflow = hashtags.size - visible.size
|
||||||
|
FlowRow(
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(6.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(2.dp),
|
||||||
|
) {
|
||||||
|
visible.forEach { tag ->
|
||||||
|
Text(
|
||||||
|
text = "#$tag",
|
||||||
|
style = MaterialTheme.typography.labelSmall,
|
||||||
|
color = MaterialTheme.colorScheme.primary,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (overflow > 0) {
|
||||||
|
Text(
|
||||||
|
text = "+$overflow",
|
||||||
|
style = MaterialTheme.typography.labelSmall,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user