-
-
Notifications
You must be signed in to change notification settings - Fork 9
feature/material_theme #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #113 +/- ##
==========================================
+ Coverage 0.88% 0.89% +0.01%
==========================================
Files 156 151 -5
Lines 6868 6782 -86
Branches 540 530 -10
==========================================
Hits 61 61
+ Misses 6794 6708 -86
Partials 13 13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This commit refactors the drawing controls into a new `DrawingBar2` composable and updates how `DrawingPath` style (stroke width) is handled. **Key changes:** * **`feature/drawing/src/main/java/com/mshdabiola/drawing/Board2.kt`**: * The bottom bar content, previously a `Row` with drawing tools, color picker, slider, and clear button, has been extracted into a new (presumably separate) `DrawingBar2(controller = controller)` composable. The old `Row` layout is commented out. * When drawing paths on the `Canvas`: * For existing `drawingPath`s in `controller.paths`, the `style` is now directly `drawingPath.strokeWidth` instead of `Stroke(width = drawingPath.strokeWidth)`. This implies `DrawingPath.strokeWidth` might have changed its type from `Float` to `StrokeStyle`. * For the `controller.currentPath` (live drawing): * The `color` is now `controller.currentPath.color` instead of conditionally being `controller.currentColor` or `Color.White`. * The `style` is now `controller.currentPath.strokeWidth` instead of `Stroke(width = controller.currentStrokeWidth)`.
This commit introduces a new data class `DrawingProperties` to encapsulate style attributes (color index, line width, line cap, line join, and alpha) for a drawing path. This refactoring centralizes these properties and simplifies the `DrawingPath` and `NewDrawingController` classes. **Key changes:** * **`feature/drawing/src/main/java/com/mshdabiola/drawing/NewDrawingController.kt`**: * **Added `DrawingProperties` data class**: * Contains `colorIndex`, `lineWidth`, `lineCapIndex`, `lineJoinIndex`, and `colorAlphaIndex`. * **Modified `DrawingPath` data class**: * Replaced individual style properties (`colorIndex`, `lineWidth`, etc.) with a single `drawingProperties: DrawingProperties` field. * Updated `color` and `strokeWidth` lazy properties to access values from `drawingProperties`. * **Modified `NewDrawingController` class**: * Removed individual state variables for current style (`currentColorIndex`, `currentStrokeWidth`, etc.). * Added `currentDrawingProperties` of type `DrawingProperties` to hold the current drawing style. * Updated `currentPath` initialization and reset logic (`onDragStart`, `onDragEnd`) to use `currentDrawingProperties` when creating new `DrawingPath` instances. * Removed unused imports for `mutableFloatStateOf` and `mutableIntStateOf`.
This commit modifies the `lineCaps` array in `DrawingController.kt` by changing the third element from `StrokeCap.Round` to `StrokeCap.Square`. - **`feature/drawing/src/main/java/com/mshdabiola/drawing/DrawingController.kt`**: - The `lineCaps` array is updated to `arrayOf(StrokeCap.Round, StrokeCap.Butt, StrokeCap.Square)`.
…awingBar2 This commit refactors `DrawingBar2` to use a new `DrawingProperties` data class (presumably defined elsewhere) to manage the state of pen, marker, and crayon tools, including color, alpha, line cap, and line width. It also updates `ColorAndWidth2` to handle line width selection with a `weight` parameter. **Key changes:** * **`feature/drawing/src/main/java/com/mshdabiola/drawing/DrawingBar.kt`**: * **`DrawingBar2` Composable**: * Replaced individual state variables (`penColor`, `markColor`, `crayonColor`, `penWidth`, `markWidth`, `crayonWidth`) with `penProperties`, `markProperties`, and `crayonProperties`, each being an instance of `DrawingProperties`. * `DrawingProperties` instances are initialized with default values for `colorIndex`, `colorAlphaIndex`, `lineCapIndex`, and `lineWidth` (converted from DP to pixels using `LocalDensity`). * Pen: `colorIndex = 1`, `colorAlphaIndex = 1f`, `lineCapIndex = 0`, `lineWidth = 4.dp`. * Marker: `colorIndex = 2`, `colorAlphaIndex = 1f`, `lineCapIndex = 0`, `lineWidth = 8.dp`. * Crayon: `colorIndex = 3`, `colorAlphaIndex = 0.5f`, `lineCapIndex = 1`, `lineWidth = 8.dp`. * When a tool (Pen, Marker, Crayon) is selected from the `TabRow`: * The corresponding `DrawingProperties` instance is set on `controller.currentDrawingProperties`. * The icon tint now uses the `colorIndex` from the respective tool's `DrawingProperties` (e.g., `colors[penProperties.colorIndex]`). * The `ColorAndWidth2` composable now receives `colorIndex` and `lineWidth` from the tool's `DrawingProperties`. * Callbacks (`onColorClick`, `onlineClick`) in `ColorAndWidth2` now update the respective `DrawingProperties` instance (e.g., `penProperties = penProperties.copy(...)`) and then update `controller.currentDrawingProperties`. * Marker and Crayon tabs now pass a `weight = 2` to `ColorAndWidth2`. * **`ColorAndWidth2` Composable**: * Added a new `weight: Int = 1` parameter. * Line width selection logic now calculates `currentWidthPx` using `((it + 1) * weight * 4).dp.roundToPx()`. * The border indicating the selected width now compares `currentWidthPx` with the `currentWidth` parameter.
This commit updates the `Board` composable to use the top-level `colors`, `lineCaps`, and `lineJoins` arrays directly when drawing paths, instead of accessing them through `drawingController`. - **`feature/drawing/src/main/java/com/mshdabiola/drawing/Board.kt`**: - When iterating through `p2` (presumably a list of paths and their properties) to draw each path: - The `color` is now derived from `colors[it.second.color]` instead of `drawingController.colors[it.second.color]`. - The `cap` for the `Stroke` style is now `lineCaps[it.second.lineCap]` instead of `drawingController.lineCaps[it.second.lineCap]`. - The `join` for the `Stroke` style is now `lineJoins[it.second.lineJoin]` instead of `drawingController.lineJoins[it.second.lineJoin]`.
This commit adds a new boolean property `isPen` to the `DrawingPath` data class. - **`feature/drawing/src/main/java/com/mshdabiola/drawing/NewDrawingController.kt`**: - The `DrawingPath` data class now includes an `isPen: Boolean` property, defaulting to `true`. This property will likely be used to differentiate between paths drawn with a pen tool versus other tools (e.g., marker, crayon).
This commit updates the `DrawingBar2` composable: - The `rememberPagerState` for the tool selection is now initialized to start at page 1 (Pen tool). - Default `DrawingPath` initializations for Pen, Marker, and Crayon tools now include an `isPen` boolean property. This is set to `true` for Pen and `false` for Marker and Crayon. **Key changes:** * **`feature/drawing/src/main/java/com/mshdabiola/drawing/DrawingBar.kt`**: * In `DrawingBar2`: * `penColor` state initialization for `DrawingPath`: * Added `isPen = true`. * `markColor` state initialization for `DrawingPath`: * Added `isPen = false`. * `crayonColor` state initialization for `DrawingPath`: * Added `isPen = false`. * `pagerState` is now initialized with `rememberPagerState(1) { 4 }`, making the Pen tool the default selected tab.
This commit introduces a tapered line effect for strokes made with the "pen" tool in the `Board2` composable. Lines drawn with the pen will now gradually decrease in width towards the end of the stroke. **Key changes:** * **`feature/drawing/src/main/java/com/mshdabiola/drawing/Board2.kt`**: * **Tapered Line Drawing Logic**: * When rendering `drawingPath`s and the `controller.currentPath` (if `drawingPath.drawingProperties.isPen` or `controller.currentDrawingProperties.isPen` is true respectively): * The drawing logic now iterates through the points in `drawingPath.paths` (or `controller.currentPath.paths`). * For each segment (pair of points), it calculates a `currentStrokeWidthPx`. * This width is tapered for the last `taperSegments` (currently 30 for existing paths, 25 for current path) of the line. * The tapering interpolates the stroke width from `maxStrokeWidthPx` down to `maxStrokeWidthPx * minStrokeFactor` (currently 0.1f). * Each segment is drawn using `drawLine` with the calculated `finalWidth`, the path's color, and cap style. * If the drawing tool is not a pen, the existing `drawPath` logic is used. * Minor formatting adjustments were made to parameters in `TopAppBar`, `DrawingBar2`, `Canvas` modifier, and `IconButton`s for clarity.
This commit introduces two new vector drawable resources for ink selection: * **`modules_designsystem_ink_selection_color.xml`**: A 24dp vector icon depicting a selection corner, filled with white. It uses a viewport of 4.763x4.763. * **`modules_designsystem_ink_selection.xml`**: A 24dp vector icon with a black tint, using a viewport of 960x960. It features a more complex path representing a selection tool or area with various rectangular and corner elements.
This commit introduces a new "Select" tool to the `DrawingBar` and adjusts the existing tab layout. **Key changes:** * **`feature/drawing/src/main/java/com/mshdabiola/drawing/DrawingBar.kt`**: * **PagerState Update**: * The `pagerState` initial page is changed from `1` to `2`. * The total page count for `pagerState` is increased from `4` to `5`. * **New "Select" Tab (Page 0)**: * A new `Tab` is added at index `0` for the "Select" tool. * Clicking this tab sets the `controller`'s drawing tool to `DrawingTool.SELECT`. * Manages the `isUp` state (controls visibility of tool options). * Animates `pagerState` to page `0`. * Uses `modules_designsystem_ink_selection` and `modules_designsystem_ink_selection_color` icons, with dynamic tinting based on selection and `MaterialTheme.colorScheme.primary`. * **Existing Tabs Shifted**: * The "Eraser" tab is now at page `1` (previously `0`). Its logic to set `DrawingTool.ERASE` and icon resources remain. * The "Pen" tab is now at page `2` (previously `1`). * The "Marker" tab is now at page `3` (previously `2`). * The "Crayon" tab is now at page `4` (previously `3`). * All click handlers and icon tint logic for these shifted tabs are updated to reflect their new page indices. * **HorizontalPager Content Update**: * The `when (index)` block within `HorizontalPager` is updated to align with the new tab structure: * `case 0` (Select): Currently has an empty block (no specific UI content defined yet). * `case 1` (Eraser): Displays the "Clear Canvas" `TextButton` (previously at index `0`). * `case 2` (Pen): Displays `ColorAndWidth2` for pen properties (previously at index `1`). * `case 3` (Marker): Displays `ColorAndWidth2` for marker properties (previously at index `2`). * `case 4` (Crayon): Displays `ColorAndWidth2` for crayon properties (previously at index `3`).
This commit significantly refactors the drawing functionality by replacing the legacy `DrawingController` with a new `DrawingController` (renamed from `NewDrawingController`). It introduces `DrawingPath`, `DrawingProperties`, and `DrawingTool` to manage drawing state and behavior. The UI (`DrawingBar`, `Board`, `DrawingScreen`) has been updated to use this new controller and its associated data structures. **Key changes:** * **`feature/drawing/src/main/java/com/mshdabiola/drawing/DrawingController.kt`**: * Renamed `NewDrawingController` to `DrawingController`. * **Introduced `DrawingTool` enum**: `DRAW`, `ERASE`, `SELECT`. * **Introduced `DrawingProperties` data class**: Holds color index, line width, cap/join indices, alpha, and `isPen` flag. * **Introduced `DrawingPath` data class**: * Holds a list of `Offset` points, `DrawingProperties`, an `id`, and an `isSelected` flag. * Lazily computes `path` (Android `Path`), `color` (from `colors` array and alpha), and `strokeWidth` (`Stroke` style). * **`DrawingController` members**: * `drawingPaths`: `mutableStateListOf<DrawingPath>` for storing all drawn paths. * `canUndo`, `canRedo`: `Boolean` states based on `drawingPaths` and `redo` list. * `redo`: `mutableStateListOf<DrawingPath>` for undone paths. * `currentTool`: `DrawingTool` state. * `currentDrawingProperties`: `DrawingProperties` for the current tool. * `currentPath`: `DrawingPath` for the path currently being drawn/erased. * `startDragPoint`: `Offset` for drag operations. * `selectionRect`: `Rect?` for visual selection drag. * `collectiveSelectedPathsBounds`: `Rect?` to highlight all selected paths. * **Core Logic**: * `undo()`/`redo()`: Move paths between `drawingPaths` and `redo` lists. * `clearCanvas()`: Clears paths and selections. * `setRedoUndo()`: Updates `canUndo`/`canRedo` flags. * `clearPathSelections()`, `updateCollectiveSelectedBounds()`: Manage selection state. * `onDragStart()`, `onDrag()`, `onDragEnd()`: Handle user input for drawing, erasing, and selecting. * Drawing: Appends points to `currentPath`. * Erasing: Removes paths intersecting with the drag area. * Selecting: Updates `selectionRect` and `isSelected` flags on paths, then updates `collectiveSelectedPathsBounds`. * `setDrawingTool()`: Changes the current tool and clears selections if necessary. * Removed old path management logic (`_unCompletePathData`, `_completePathData`, etc.). * **`feature/drawing/src/main/java/com/mshdabiola/drawing/DrawingBar.kt`**: * Renamed `DrawingBar2` to `DrawingBar` and `ColorAndWidth2` to `ColorAndWidth`. * Renamed `DrawingBarPreview2` to `DrawingBarPreview`. * Updated `DrawingBar` to use the new `DrawingController` and `DrawingProperties`. * State variables (`penProperties`, `markProperties`, `crayonProperties`) now use `DrawingProperties`. * Tool selection (Eraser, Pen, Marker, Crayon) now interacts with `controller.setDrawingTool()` and `controller.currentDrawingProperties`. * `ColorAndWidth` now updates `controller.currentDrawingProperties` via the tool-specific property states. * Removed old `DrawingBar` and its associated `DrawingController` usage. * **`feature/drawing/src/main/java/com/mshdabiola/drawing/Board.kt`**: * Updated `Board` to use the new `DrawingController`. * Pointer input now calls `controller.onDragStart()`, `controller.onDrag()`, and `controller.onDragEnd()`. * Canvas drawing logic: * Iterates through `controller.drawingPaths` to draw completed paths. * Implements tapered line drawing for paths where `drawingProperties.isPen` is true. * Draws `controller.currentPath` for live drawing/erasing, also with tapering for pens. * Draws `controller.selectionRect` for visual selection feedback. * Draws `controller.collectiveSelectedPathsBounds` to highlight selected items. * Removed old drawing logic based on `drawingController.getPathAndData()`. * **`feature/drawing/src/main/java/com/mshdabiola/drawing/DrawingScreen.kt`**: * Updated to instantiate and use the new `DrawingController`. * Undo/Redo `IconButton` `enabled` state now directly bound to `controller.canUndo` and `controller.canRedo` (which are now direct boolean states). * Passes the new `controller` to the `Board` composable. * **`feature/drawing/src/main/java/com/mshdabiola/drawing/DrawingUiState.kt`**: * Changed `filePath: String?` to `drawings: List<DrawingPath> = emptyList()`. * **`feature/drawing/src/main/java/com/mshdabiola/drawing/DrawingViewModel.kt`**: * Simplified `drawingState` to combine only `snapshotFlow { controller.drawingPaths }`. * Removed old logic related to `drawingPathRepository`, `toPathMap`, `isInit`, and saving images directly within the state flow. * `DrawingUiState` is now initialized with default values, implying path saving and loading might be handled elsewhere or is pending.
This commit removes the following files which are no longer in use: - `feature/drawing/src/main/java/com/mshdabiola/drawing/Board2.kt` - `feature/drawing/src/main/java/com/mshdabiola/drawing/ListOfPathData.kt` - `feature/drawing/src/main/java/com/mshdabiola/drawing/NewDrawingController.kt` These files contained composables and controller logic for a previous drawing implementation.
This commit introduces a new entity `NoteDrawingEntity` to store drawing data associated with notes and its corresponding Data Access Object (DAO) `NoteDrawingDao`. **Key changes:** * **`modules/database/src/main/java/com/mshdabiola/database/model/NoteDrawingEntity.kt`**: * Created `NoteDrawingEntity` data class: * `id`: Autogenerated Long primary key. * `noteId`: Long, foreign key referencing `NoteEntity.id` with cascade on delete. Indexed for performance. * `properties`: Nullable String to store drawing properties. * `paths`: Nullable String to store drawing path data. * **`modules/database/src/main/java/com/mshdabiola/database/dao/NoteDrawingDao.kt`**: * Created `NoteDrawingDao` interface: * `insert(noteDrawing: NoteDrawingEntity)`: Upsert operation for `NoteDrawingEntity`. * `delete(id: Long)`: Deletes a `NoteDrawingEntity` by its `id`. * `get(id: Long): Flow<NoteDrawingEntity?>`: Retrieves a `NoteDrawingEntity` by its `id` as a Flow. * `getNoteDrawing(noteId: Long): Flow<List<NoteDrawingEntity>>`: Retrieves all `NoteDrawingEntity` objects associated with a specific `noteId` as a Flow. * **`modules/database/src/main/java/com/mshdabiola/database/NoteDatabase.kt`**: * Added `NoteDrawingEntity::class` to the `entities` array in the `@Database` annotation. * Added an abstract function `getNoteDrawingDao(): NoteDrawingDao` to provide access to the new DAO. * Database version remains at 5 (implying this might be part of a larger schema change or the version was already bumped).
This commit introduces a new table, `note_drawing_table`, to the database schema (version 5). This table is designed to store drawing data associated with notes. **Key changes:** * **`modules/database/schemas/com.mshdabiola.database.NoteDatabase/5.json`**: * **New `note_drawing_table` entity**: * **Columns**: * `id`: INTEGER, PRIMARY KEY, AUTOINCREMENT * `note_id`: INTEGER, NOT NULL (Foreign Key to `note_table.id`) * `properties`: TEXT (Stores drawing properties) * `paths`: TEXT (Stores drawing paths) * **Foreign Key**: `note_id` references `note_table(id)` with `ON DELETE CASCADE` and `ON UPDATE NO ACTION`. * **Index**: An index `index_note_drawing_table_note_id` is created on the `note_id` column. * **Database Version**: Incremented to 5. * **Identity Hash**: Updated to reflect schema changes. * The `room_master_table` setup query is updated with the new identity hash.
This commit removes the `IntermediaryData.kt` file, which contained data classes like `DrawPathPojo` and utility functions for path conversion and bitmap generation (`getBitMap`, `changeToPathAndData`). **Key changes:** * **`modules/ui/src/main/kotlin/com/mshdabiola/ui/util/IntermediaryData.kt`**: * This file has been deleted. * This includes the removal of: * `DrawPathPojo` data class. * `DrawPath.toDrawPathPojo()` extension function. * `getBitMap()` function for creating a Bitmap from paths. * `changeToPathAndData()` function for converting a map of `PathData` and `Coordinate` lists into `Path` and `PathData` pairs. * Top-level `colors`, `lineCaps`, and `lineJoins` arrays. * **`modules/ui/build.gradle.kts`**: * Removed the `kotlin.serialization` plugin. * Removed the `kotlinx.serialization.json` dependency.
This commit removes the `Converter` object and its `pathToString` function. **Key changes:** * **`modules/ui/src/main/kotlin/com/mshdabiola/ui/util/Converter.kt`**: * The entire `Converter.kt` file, which contained the `Converter` object and the `pathToString` method, has been deleted. * The `pathToString` function was responsible for converting a list of `DrawPath` objects into a JSON string representation by first mapping them to `DrawPathPojo` objects.
…pdate model This commit renames `FakeDrawingPathRepository` to `FakeNoteDrawingRepository` and `TestDrawingPathRepository` to `TestNoteDrawingRepository`. It also updates the model class used by these repositories from `DrawPath` to `NoteDrawing` and changes the corresponding interface from `IDrawingPathRepository` to `INoteDrawingRepository`. **Key changes:** * **`modules/testing/src/main/java/com/mshdabiola/testing/fake/repository/FakeDrawingPathRepository.kt`**: * Deleted this file. * **`modules/testing/src/main/java/com/mshdabiola/testing/repository/TestDrawingPathRepository.kt`**: * Deleted this file. * **`modules/testing/src/main/java/com/mshdabiola/testing/fake/TestDataModule.kt`**: * Updated the binding for `IDrawingPathRepository` to `INoteDrawingRepository`. * Changed the injected dependency from `FakeDrawingPathRepository` to `FakeNoteDrawingRepository`. * **`modules/testing/src/main/java/com/mshdabiola/testing/fake/repository/FakeNoteDrawingRepository.kt`**: * Created this new file, which implements `INoteDrawingRepository` and uses the `NoteDrawing` model. * **`modules/testing/src/main/java/com/mshdabiola/testing/repository/TestNoteDrawingRepository.kt`**: * Created this new file, which implements `INoteDrawingRepository` and uses the `NoteDrawing` model, with methods stubbed with `TODO("Not yet implemented")`.
This commit refactors the data models related to drawing, introducing new classes, modifying existing ones, and adding serialization capabilities using `kotlinx.serialization.json`. **Key changes:** * **Model Deletions:** * `DrawingController.kt` (empty class) deleted. * `DrawPath.kt` data class deleted. * `Path.kt` (containing `PathData`, `MODE`, `DRAW_MODE`) deleted. * **Model Additions:** * **`NoteDrawing.kt`**: * New data class `NoteDrawing(id: Long, noteId: Long, drawingPaths: List<DrawingPath>)` introduced to associate drawings with notes. * **`Converter.kt`**: * New object `Converter` with `kotlinx.serialization.json.Json` instance. * Adds `pathToString(List<DrawingPath>): String` to serialize a list of `DrawingPath` objects to a JSON string. * Adds `toPath(String): List<DrawingPath>` to deserialize a JSON string back to a list of `DrawingPath` objects. * **`DrawingProperties.kt`**: * New `@Serializable` data class `DrawingProperties` to hold attributes of a drawing stroke (color index, line width, cap index, join index, alpha, pen type). * **`DrawingPath.kt`**: * New `@Serializable` data class `DrawingPath(coordinates: List<Coordinate>, drawingProperties: DrawingProperties, isSelected: Boolean)` to represent a single drawn path with its geometric points and style properties. * **Model Modifications:** * **`Coordinate.kt`**: * Annotated with `@Serializable`. * Removed `companion object` with `Zero` instance. * **`NoteImage.kt`**: * Removed `isDrawing: Boolean` and `timestamp: Long` properties. * **`NotePad.kt`**: * Added `drawing: List<NoteDrawing>` property to include drawings in the main note model. * **Build Configuration:** * **`modules/model/build.gradle.kts`**: * Added `kotlinx.serialization` plugin. * Added `kotlinx.serialization.json` as an implementation dependency.
This commit introduces schema changes for version 5 of the `NoteDatabase`, primarily focusing on foreign key constraints, index creation, and the removal of deprecated tables and columns. It also updates DAOs to reflect these changes. **Key Schema and Entity Changes:** * **Foreign Key Constraints & Indices:** * `NoteImageEntity`: `noteId` now has a foreign key to `NoteEntity(id)` with `ON DELETE CASCADE`. An index is added on `noteId`. * `NoteVoiceEntity`: `noteId` now has a foreign key to `NoteEntity(id)` with `ON DELETE CASCADE`. An index is added on `noteId`. * `NoteCheckEntity`: `noteId` now has a foreign key to `NoteEntity(id)` with `ON DELETE CASCADE`. An index is added on `noteId`. * `NoteLabelEntity`: * `noteId` now has a foreign key to `NoteEntity(id)` with `ON DELETE CASCADE`. * `labelId` now has a foreign key to `LabelEntity(id)` with `ON DELETE CASCADE`. * Indices are added on both `noteId` and `labelId`. * `NoteDrawingEntity`: `note_id` (noteId) now has a foreign key to `NoteEntity(id)` with `ON DELETE CASCADE`. An index is added on `note_id`. * **Table/Column Deletions:** * **Deleted `PathDao.kt` and `DrawPathEntity.kt`**: The entire table `path_table` and its associated DAO and entity are removed. * **`NoteImageEntity`**: * Removed `isDrawing: Boolean` column. * Removed `timestamp: Long` column. * **`NoteEntity` (from `note_table`)**: * Removed `interval` column. * Removed `reminder` column. * **`NoteDrawingEntity`**: * Removed `properties: String?` column. * **`NotePadEntity`**: * Added `@Relation` for `drawings: List<NoteDrawingEntity>` linking to `note_id` in `note_drawing_table`. * **Database Version Update**: * `NoteDatabase` version incremented to 5. * `Migrate4to5` AutoMigrationSpec defined to handle the deletion of `path_table`, columns in `note_image_table`, and columns in `note_table`. * Schema file `5.json` updated to reflect all these changes, including new foreign key definitions and index creations. **DAO Changes:** * **`DatabaseModule.kt`**: * `pathDaoProvider` is removed. * `noteDrawingDaoProvider` is added to provide `NoteDrawingDao`. * **`NoteDrawingDao.kt`**: * `insert` renamed to `upsert` and now returns `Long`. * Added `upserts(noteDrawings: List<NoteDrawingEntity>): List<Long>` for bulk upsert. * **`NoteDao.kt`**: * Added `delete(ids: Set<Long>)` to delete multiple notes by their IDs. * Added `deleteTrash(noteType: NoteType)` to delete notes of a specific type (presumably for trash functionality). **Summary of AutoMigrationSpec `Migrate4to5`:** * Deletes the table `path_table`. * Deletes the column `timestamp` from `note_image_table`. * Deletes the column `isDrawing` from `note_image_table`. * Deletes the column `interval` from `note_table`. * Deletes the column `reminder` from `note_table`.
This commit removes the `DrawingPathRepository` and `IDrawingPathRepository` and introduces `NoteDrawingRepository` and `INoteDrawingRepository` to handle drawing data associated with notes. **Key changes:** * **Removed:** * `modules/data/src/main/kotlin/com/mshdabiola/data/repository/DrawingPathRepository.kt` * `modules/data/src/main/kotlin/com/mshdabiola/data/repository/IDrawingPathRepository.kt` * **Added:** * **`modules/data/src/main/kotlin/com/mshdabiola/data/repository/INoteDrawingRepository.kt`**: * Defines an interface for `NoteDrawing` operations: * `insert(noteDrawing: NoteDrawing): Long` * `delete(id: Long)` * `get(id: Long): Flow<NoteDrawing?>` * `getNoteDrawing(noteId: Long): Flow<List<NoteDrawing>>` * **`modules/data/src/main/kotlin/com/mshdabiola/data/repository/NoteDrawingRepository.kt`**: * Implements `INoteDrawingRepository`. * Injects `NoteDrawingDao`. * Provides concrete implementations for insert, delete, get by ID, and get by note ID operations, mapping between `NoteDrawing` model and its entity. * **`modules/data/src/main/kotlin/com/mshdabiola/data/repository/NotePadRepository.kt`**: * Replaced `PathDao` dependency with `NoteDrawingDao`. * In `upsert(notePad: NotePad)`: * Added a call to `noteDrawingDao.upserts(notePad.drawing.map { it.toEntity() })` to save drawings associated with the note. * In `deleteTrashType()`: * Now directly calls `noteDao.deleteTrash(NoteType.TRASH)` instead of fetching and then deleting notes. * The `delete(notePads: List<NotePad>)` method was renamed to `delete(ids: Set<Long>)` and its implementation was simplified to directly call `noteDao.delete(ids)`. * The previous logic for deleting associated images, labels, voices, checks, and paths for each `NotePad` individually has been removed, likely relying on cascaded deletes or other DAO-level handling. * Removed `deleteNotePad(notePads: List<NotePad>)` method, as its functionality is covered by the updated `delete(ids: Set<Long>)`. * **`modules/data/src/main/kotlin/com/mshdabiola/data/repository/INotePadRepository.kt`**: * The `delete(notePads: List<NotePad>)` method signature was changed to `delete(ids: Set<Long>)`. * Removed `deleteNotePad(notePads: List<NotePad>)`.
This commit renames `DrawingPath` and its related classes and interfaces to `NoteDrawing` to better reflect its purpose in relation to notes. It also updates the mapping between the domain model and the database entity. **Key changes:** * **`modules/data/src/main/kotlin/com/mshdabiola/data/di/DataModule.kt`**: * Renamed `DrawingPathRepository` to `NoteDrawingRepository`. * Renamed `IDrawingPathRepository` to `INoteDrawingRepository`. * Updated the Binds method to reflect these name changes. * **`modules/data/src/main/kotlin/com/mshdabiola/data/model/ModelExtentions.kt`**: * Removed `DrawPathEntity.toDrawPath()` and `DrawPath.toDrawPathEntity()` extension functions. * Added `NoteDrawingEntity.toDrawing()` to convert `NoteDrawingEntity` to the domain model `NoteDrawing`. This function uses a `Converter` to deserialize the `paths` string into a list of drawing paths. * Added `NoteDrawing.toEntity()` to convert the domain model `NoteDrawing` to `NoteDrawingEntity`. This function uses a `Converter` to serialize the list of drawing paths into a string. * Modified `NoteImage.toNoteImageEntity()`: Removed `isDrawing` and `timestamp` parameters. * Modified `NoteImageEntity.toNoteImage()`: Removed `isDrawing` and `timestamp` from the returned `NoteImage` object.
…r drawings This commit relocates drawing-related composables (`DrawingBar`, `DrawingController`, `Board`) and data classes/extensions (`DrawingPath`, `DrawingTool`, `colors`, etc.) from the `feature/drawing` module to a new `modules/ui` module. It also updates `NoteCard` to display `NoteVisual.NoteDrawing` alongside images, using a new `BoardViewer` composable. **Key changes:** * **File Moves & Package Updates**: * `feature/drawing/src/main/java/com/mshdabiola/drawing/DrawingBar.kt` moved to `modules/ui/src/main/kotlin/com/mshdabiola/ui/DrawingBar.kt`. Package changed from `com.mshdabiola.drawing` to `com.mshdabiola.ui`. * `feature/drawing/src/main/java/com/mshdabiola/drawing/DrawingController.kt` moved to `modules/ui/src/main/kotlin/com/mshdabiola/ui/DrawingController.kt`. Package changed from `com.mshdabiola.drawing` to `com.mshdabiola.ui`. * `DrawingProperties` is now imported from `com.mshdabiola.model`. * `DrawingPath` is now imported from `com.mshdabiola.model`. * Extension properties (`paths`, `path`, `color`, `strokeWidth`) for `DrawingPath` are now defined in this file. * `currentPath` in `DrawingController` now uses `Coordinate` from the model when updating paths. * `feature/drawing/src/main/java/com/mshdabiola/drawing/Board.kt` moved to `modules/ui/src/main/kotlin/com/mshdabiola/ui/Board.kt`. Package changed from `com.mshdabiola.drawing` to `com.mshdabiola.ui`. * Uses `com.mshdabiola.model.DrawingPath`. * Explicitly uses `androidx.compose.ui.geometry.Rect` for `selectionRect`. * **`modules/ui/src/main/kotlin/com/mshdabiola/ui/NoteCard.kt`**: * Imports `com.mshdabiola.model.NoteVisual`. * `notePad.images` is replaced with `notePad.visuals`. * The image display logic now iterates through `notePad.visuals` and uses a `when` statement: * For `NoteVisual.NoteImage`, it displays an `AsyncImage` as before. * For `NoteVisual.NoteDrawing`, it displays a new `BoardViewer` composable, passing `it.drawingPaths`. * **`modules/ui/src/main/kotlin/com/mshdabiola/ui/Board.kt`**: * **Added `BoardViewer` composable**: * Takes `modifier` and `drawingPaths: List<DrawingPath>`. * Renders paths on a `Canvas`. * If `drawingPath.drawingProperties.isPen` is true, it attempts to render the path with a tapering effect on the stroke width for the last 30 segments. * Otherwise, it draws the path normally using `drawPath`. * **`modules/ui/src/main/kotlin/com/mshdabiola/ui/DrawingController.kt`**: * `PathData` and `ImmutablePath` typealias removed (now uses `DrawingPath` from model). * `DrawingPath` data class definition removed (now uses `DrawingPath` from model). * Extension properties `paths`, `path`, `color`, `strokeWidth` added for `com.mshdabiola.model.DrawingPath`. * `onDrag` method in `DrawingController` now maps `Offset` to `Coordinate` when updating `currentPath.coordinates`.
…d `NoteDrawing` This commit introduces a new sealed class `NoteVisual` which encapsulates `NoteImage` and `NoteDrawing` as its subclasses. This change aims to provide a unified type for handling different visual elements within a note. **Key changes:** * **`modules/model/src/main/java/com/mshdabiola/model/NoteDrawing.kt`**: * Deleted. Its functionality is now part of `NoteVisual.NoteDrawing`. * **`modules/model/src/main/java/com/mshdabiola/model/NoteImage.kt`**: * Deleted. Its functionality is now part of `NoteVisual.NoteImage`. * **`modules/model/src/main/java/com/mshdabiola/model/NoteVisual.kt`**: * **Added `NoteVisual` sealed class**: * Takes a `key: Long` in its constructor. * **`NoteVisual.NoteImage` data class**: Replicates the structure of the old `NoteImage`. Inherits from `NoteVisual(id)`. * **`NoteVisual.NoteDrawing` data class**: Replicates the structure of the old `NoteDrawing`. Inherits from `NoteVisual(id)`. * **`modules/model/src/main/java/com/mshdabiola/model/NotePad.kt`**: * Replaced `images: List<NoteImage>` with `visuals: List<NoteVisual>`. * Removed `drawing: List<NoteDrawing>` as its content is now handled by `visuals`. * Updated `isEmpty()` and `isImageOnly()` methods to use `visuals.isEmpty()` instead of `images.isEmpty()`.
This commit removes the `properties` column from the `note_drawing_table` in the database schema. The `NoteDrawingDao.get()` method's return type is also updated to reflect that a `NoteDrawingEntity` will always be returned, changing from `Flow<NoteDrawingEntity?>` to `Flow<NoteDrawingEntity>`. **Key changes:** * **`modules/database/src/main/java/com/mshdabiola/database/dao/NoteDrawingDao.kt`**: * The `get(id: Long)` function now returns `Flow<NoteDrawingEntity>` instead of `Flow<NoteDrawingEntity?>`. * **`modules/database/schemas/com.mshdabiola.database.NoteDatabase/5.json`**: * The `properties` field has been removed from the `note_drawing_table` entity definition. * The `createSql` for `note_drawing_table` no longer includes the `properties` column. * The database `identityHash` has been updated.
This commit introduces comprehensive instrumented tests for the following DAO classes in the `database` module: - `NoteDrawingDao` - `NoteImageDao` - `NoteLabelDao` - `NoteNotificationDao` - `NoteVoiceDao` **Key Changes & Test Coverage:** For each DAO, tests cover core functionalities including: - `upsert` (single entity) and `upserts` (list of entities), including update behavior. - `get` (single entity by ID). - `getAll` (all entities). - `delete` (single entity by ID or specific criteria like `noteId`). - `getByNoteId` (retrieving entities associated with a specific note). - Edge cases like retrieving non-existent entities and querying empty tables. - Foreign key constraint checks, particularly `ON DELETE CASCADE` behavior when a parent `NoteEntity` or `LabelEntity` is deleted. **General Test Setup:** - Each test class uses `@RunWith(AndroidJUnit4::class)`. - An in-memory `NoteDatabase` is created before each test (`@Before`) and closed afterwards (`@After`). - Prerequisite `NoteEntity` and `LabelEntity` instances are inserted into the database as needed to satisfy foreign key constraints for the entities under test. - Tests utilize `kotlinx.coroutines.test.runTest` for testing suspending DAO functions. - Assertions are made using `kotlin.test` and standard JUnit assertions. **Specifics for each DAO Test:** - **`NoteDrawingDaoTest.kt`:** - Tests `upsert`, `upserts`, `get`, `getAll`, `delete`, `deleteByNoteId`, and `getByNoteId`. - Verifies auto-generation of IDs for new `NoteDrawingEntity` instances. - Confirms cascade deletion of drawings when their parent note is deleted. - **`NoteImageDaoTest.kt`:** - Tests `upsert`, `upserts`, `get`, `getAll`, `delete`, `deleteByNoteId`, and `getByNoteId`. - `NoteImageEntity` uses a non-auto-generated ID; tests confirm that `upsert` correctly inserts or replaces based on the provided ID. - Confirms cascade deletion of images when their parent note is deleted. - **`NoteLabelDaoTest.kt`:** - Tests `upsert`, `upserts`, `getAll`, `deleteByNoteId`, `deleteByNoteIdAndLabelId`, `getByNoteId`, `getByLabelId`, and `getByNoteIds`. - Verifies behavior with composite primary keys (`noteId`, `labelId`), ensuring `upsert` does not create duplicates. - Confirms cascade deletion of `NoteLabelEntity` entries when either the associated `NoteEntity` or `LabelEntity` is deleted. - **`NoteNotificationDaoTest.kt`:** - Tests `upsert`, `upserts`, `get`, `getAll`, `delete`, `deleteByNoteId`, and `getByNoteId`. - `NotificationEntity` ID is auto-generated. - Confirms cascade deletion of notifications when their parent note is deleted. - **`NoteVoiceDaoTest.kt`:** - Tests `upsert`, `upserts`, `get`, `getAll`, `delete`, `deleteByNoteId`, and `getByNoteId`. - `NoteVoiceEntity` uses a non-auto-generated ID; tests confirm `upsert` behavior. - Confirms cascade deletion of voice entries when their parent note is deleted.
This commit adds missing French and Russian translations for the following strings in the designsystem module: - `modules_designsystem_unarchive` - `modules_designsystem_dialog_empty_trash` - `modules_designsystem_dialog_empty_trash_content` - `modules_designsystem_dialog_delete_forever` - `modules_designsystem_dialog_delete_forever_content` These translations are necessary for dialogs related to unarchiving notes, emptying the trash, and permanently deleting notes.
…sertions This commit refactors the instrumented tests for several DAO classes to correctly reflect the behavior of `upsert` and to enhance assertion clarity. The primary change addresses the expected return value of `upsert` operations when updating existing entities. Previously, tests asserted that the original ID would be returned. This has been corrected to assert that `-1` is returned, which is the behavior when an update occurs due to a conflict, and the `OnConflictStrategy` is `REPLACE` (the default for `@Upsert`). **Key changes in specific test files:** - **`NoteDrawingDaoTest.kt`:** - Modified `upsertUpdatesExistingDrawing` and `upsertsUpdatesExistingAndInsertsNewDrawing` to expect `-1` from `upsert` on update and `assertFalse` for `resultIds.contains(id1)` respectively. - Removed assertions for `drawing3Retrieved` in `upsertsUpdatesExistingAndInsertsNewDrawing` as the behavior of returned IDs from `upserts` with mixed insert/update operations can be complex and the primary focus is on the state of the database. - Minor formatting adjustments (e.g., trailing commas). - **`NoteImageDaoTest.kt`:** - Updated `upsertUpdatesExistingImage` to assert `assertEquals(-1, updatedIdResult)` for `upsert` on update. - Corrected `upsertsUpdatesExistingAndInsertsNewImage` to use `assertFalse(resultIds.containsAll(listOf(imageId1, imageId2)))` as `upserts` replacing items will result in new row IDs or -1, not necessarily the original IDs. - Minor formatting adjustments. - **`NoteNotificationDaoTest.kt`:** - Changed `upsertUpdatesExistingNotification` to assert `assertEquals(-1, updatedIdResult)` for `upsert` on update. - Improved formatting for `NoteEntity` instantiation. - **`NoteVoiceDaoTest.kt`:** - Updated `upsertUpdatesExistingVoice` to assert `assertEquals(-1, updatedIdResult)` for `upsert` on update. - Improved formatting for `NoteEntity` instantiation. - **`NoteLabelDaoTest.kt`:** - Improved formatting for `NoteEntity` instantiation and list assertions. These changes ensure the tests more accurately reflect Room's `upsert` behavior and provide more robust verification of DAO operations.
This commit introduces unit tests for the `UserPreferencesRepository` to ensure its functionality for managing user preferences. The tests cover the following scenarios: - Verifying that the initial `userData` flow emits the default values. - Testing each `set` method (e.g., `setThemeBrand`, `setDarkThemeConfig`) to confirm that it correctly updates the corresponding value in the DataStore. - Testing the `toggleGrid` method to ensure it correctly flips the boolean value of `isGrid`. - Verifying that multiple updates to different preferences are reflected correctly in the `userData`. A `TestScope` and `StandardTestDispatcher` are used to manage coroutines in the tests. The DataStore is created using `DataStoreFactory` with an `OkioStorage` backed by a temporary file for each test, ensuring test isolation.
This commit updates the build configuration for the `fossReliantRelease` variant. The following changes were made in `app/fossReliantRelease-badging.txt`: - `platformBuildVersionName` changed from `15` to `16` - `platformBuildVersionCode` changed from `35` to `36` - `compileSdkVersion` changed from `35` to `36` - `compileSdkVersionCodename` changed from `15` to `16`
This commit consolidates string resources within the `modules/designsystem` module. The following string resources were moved from individual `strings.xml` files into `modules_designsystem_strings.xml` for default, French (`fr`), and Russian (`ru`) localizations: - `modules_designsystem_no_result` - `modules_designsystem_delete_forever` The now-empty `strings.xml` files under `values/`, `values-fr/`, and `values-ru/` within the `modules/designsystem` module have been deleted.
bugfix/reorder_modules
This commit introduces a new `lint` module with custom lint checks for the Notepad project. - **DesignSystemDetector**: Ensures that Compose Material APIs are not used directly and instead, the equivalents from the `core-designsystem` module are used. - Checks for incorrect usage of composable functions like `MaterialTheme`, `Button`, `NavigationBar`, etc., and suggests their `Note` prefixed counterparts (e.g., `NoteTheme`, `NoteButton`). - Checks for incorrect usage of receiver objects like `Icons` and suggests `NoteIcons`. - **TestMethodNameDetector**: Enforces naming conventions for test methods. - Warns if a test method name starts with "test". - For Android instrumented tests, warns if the method name does not follow the `given_when_then` or `when_then` format. - **NotepadIssueRegistry**: Registers the custom lint checks. - Adds the `lint` module to `settings.gradle.kts`. - Includes necessary dependencies and configurations in `lint/build.gradle.kts`.
This commit renames `SkTheme` to `NoteTheme` for clarity and introduces new UI components and icons. - In `Theme.kt`, the composable `SkTheme` has been renamed to `NoteTheme`. - New icons `Alarm` and `Repeat` have been added to `NoteIcon.kt`. - A new composable `NoteTextButton` has been created in `Button.kt`. - The `Button` composable in `Button.kt` has been updated to remove the explicit setting of `containerColor`. - In `designsystem/build.gradle.kts`, `lintPublish(projects.lint)` has been uncommented, enabling lint checks for this module.
This commit updates the theme name used in the `ScreenshotHelper.kt` file. - Changed `SkTheme` to `NoteTheme` in the `captureRoboImage` and `ThemedScreenshot` functions.
This commit updates various UI elements to use standardized components and icons from the design system. - Replaced Material `Button` and `TextButton` with `NoteButton` and `NoteTextButton` in `TimeDialog.kt`, `NewDialog.kt`, and `DateDialog.kt`. - Replaced Material `CircularProgressIndicator` with `NoteLoadingWheel` in `WaitingUi.kt`. - Updated icons in `MainActions.kt`, `RemainderCard.kt`, and `ColorDialog.kt` to use icons from `NoteIcon`. - Changed `MaterialTheme` to `NoteTheme` in `FlowLayout.kt` preview. - Removed unused date/time formatting extension functions from `TimeExtention.kt`.
This commit removes the following unused UI composable functions and classes: - `NoteficationDialog.kt`: This file contained composables related to displaying a dialog for setting and editing notifications, including `NotificationDialog`, `TimeContent`, `TimeDropbox`, `DateDropbox`, and `RepeatDropbox`. - `NotifySneackerUi.kt`: This file contained the `NotifySnacker` composable, which was responsible for displaying snackbar notifications. - `TimeZoneBroadcastReceiver.kt`: This file contained the `TimeZoneBroadcastReceiver` class, used to listen for system time zone changes.
This commit replaces the `TextButton` composable with the custom `NoteTextButton` composable in `DetailScreen.kt`. - The "Add list item" button now uses `NoteTextButton`. - The button to show/hide checked items now uses `NoteTextButton` and its `leadingIcon` parameter is utilized for the expand/collapse icon.
This commit updates `DrawingBar.kt` to use UI components from the design system module. - Replaced `TabRow` with `NoteTabRow`. - Replaced `Tab` with `NoteTab`. - Replaced `TextButton` with `NoteTextButton`. - Removed `unselectedContentColor` from tabs as this is handled by the `NoteTab` component.
This commit replaces `Button` and `TextButton` with their design system equivalents (`NoteButton` and `NoteTextButton`) in `MainScreen.kt` and `TopbarAndDialog.kt`. - Replaced `Button` with `NoteButton` in `NameNoteAlertDialog`. - Replaced `TextButton` with `NoteTextButton` in `NameNoteAlertDialog`, `DeleteNoteAlertDialog`, and `BottomNoteItem`. - In `TopbarAndDialog.kt`, the `onClick` and `onLongClick` lambdas in `MainCard` were simplified by directly passing `notePad.id` to the respective functions.
This commit replaces the `TextButton` with the custom `NoteTextButton` composable in `LabelScreen.kt`. - In `LabelScreen.kt`, when `labelScreenUiState.showAddLabel` is true, the UI now uses `NoteTextButton` for the "create label" action. This change utilizes the leadingIcon parameter of `NoteTextButton` to display an add icon.
This commit updates the `OptionsDialog` composable in `OptionsDialog.kt` to use the `NoteTextButton` component from the design system module for its confirm button. - Replaced `TextButton` with `NoteTextButton` for the dialog's confirm button.
This commit adds the `kotlin-test` artifact to the project's dependencies. - In `gradle/libs.versions.toml`, `kotlin-test` is added to the `[libraries]` section.
…th `NoteTheme` This commit replaces the Material `TextButton` with the custom `NoteTextButton` and the `SkTheme` with `NoteTheme` across several files. - In `MainNavigatin.kt` and `ShareActivity.kt`, instances of `TextButton` have been updated to `NoteTextButton`. - In `MainActivity.kt` and `ShareActivity.kt`, `SkTheme` has been replaced with `NoteTheme`.
…gWheel` This commit removes several unused composable functions from the design system module: - `DynamicAsyncImage` - `NoteIconToggleButton` and `NoteIconButtonDefaults` - `NoteTopicTag` and `SkTagDefaults` Additionally, the `NoteLoadingWheel` composable has been simplified by removing commented-out code. The `NoteOverlayLoadingWheel` composable, which was using `NoteLoadingWheel`, has also been removed as it's no longer used.
This commit refactors the `NoteTopAppBar` composable for better flexibility and updates its usage across various screens. - Simplified `NoteTopAppBar` in `designsystem/component/TopAppBar.kt` by: - Removing `titleRes`, `navigationIcon`, `navigationIconContentDescription`, `actionIcon`, and `actionIconContentDescription` parameters. - Adding parameters for `title` (String), `subTitle` (String), `navigationIcon` (Composable), `alignment` (Alignment.Horizontal), `actions` (Composable RowScope), and `scrollBehavior` (TopAppBarScrollBehavior). - Removed the `NoteDetailTopAppBar` composable as its functionality is now covered by the refactored `NoteTopAppBar`. - Updated usages of `TopAppBar` to `NoteTopAppBar` in: - `DrawingScreen.kt` - `DetailScreen.kt` - `GalleryScreen.kt` - `AboutScreen.kt` - `LabeScreen.kt` - Modified `TopAppBarScreenShot.kt` to reflect the changes in `NoteTopAppBar` parameters.
This commit refactors the TopAppBar implementation across multiple feature modules to use the centralized `NoteTopAppBar` from the design system module. It also removes unused `TopAppBar` imports from these modules. - In `feature/drawing/DrawingScreen.kt`, `feature/detail/DetailScreen.kt`, `feature/gallery/GalleryScreen.kt`, `feature/about/AboutScreen.kt`, and `feature/labelscreen/LabeScreen.kt`: - Replaced direct `androidx.compose.material3.TopAppBar` usage with `com.mshdabiola.designsystem.component.NoteTopAppBar`. - Removed the unused import for `androidx.compose.material3.TopAppBar`. - In `modules/designsystem/src/main/kotlin/com/mshdabiola/designsystem/component/TopAppBar.kt`: - Removed unused imports like `Icons`, `ArrowBack`, `Delete`, `CenterAlignedTopAppBar`, `Icon`, `IconButton`, and `MaterialTheme`. - Minor code formatting adjustments. - In `modules/designsystem/src/screenshotTest/kotlin/com/mshdabiola/designsystem/ScreenShot.kt`: - Removed unused import for `NoteIcon`.
…`NoteApp` This commit replaces the `BottomAppBar` with the experimental `HorizontalFloatingToolbar` for creating new notes in the `NoteApp`. - In `NoteApp.kt`: - Renamed `NoteBottomBar` composable to `NoteFloatingToolbar`. - Implemented `HorizontalFloatingToolbar` which includes a primary `FloatingActionButton` to toggle an expanded state revealing more options. - The main FAB now shows a `Cancel` icon when expanded and an `Add` icon when collapsed. - Removed the individual FAB for adding a new note; this action is now implicitly handled by the main FAB or the first icon in the expanded toolbar. - Updated the `Scaffold` to use `floatingActionButton` for the new `NoteFloatingToolbar` instead of `bottomBar`. - Added `@OptIn(ExperimentalMaterial3ExpressiveApi::class)` where `HorizontalFloatingToolbar` is used. - Added a preview for `NoteFloatingToolbar`. - Removed the disabled state visual cue for the voice input IconButton when voice support is unavailable.
This commit updates the `onAddButton_showDetails` test in `NavigationTest.kt`. - The test now simulates a click on a note type (e.g., "main:note") after clicking the add button. - The assertion for the detail title (`detail:title`) is currently commented out. - Added `@OptIn(ExperimentalTestApi::class)` annotation to the test method.
This commit updates the `NoteVoicePlayer` composable in `DetailScreen.kt` to use the `LinearWavyProgressIndicator` from Material 3 Expressive instead of the standard `LinearProgressIndicator`. - In `feature/detail/src/main/kotlin/com/mshdabiola/detail/DetailScreen.kt`: - Imported `ExperimentalMaterial3ExpressiveApi` and `LinearWavyProgressIndicator`. - Annotated `NoteVoicePlayer` with `@OptIn(ExperimentalMaterial3ExpressiveApi::class)`. - Replaced `LinearProgressIndicator` with `LinearWavyProgressIndicator` for displaying voice playback progress.
….Outlined.Close` This commit changes the `Cancel` icon in `NoteIcon.kt`. - In `modules/designsystem/src/main/kotlin/com/mshdabiola/designsystem/icon/NoteIcon.kt`: - Replaced `androidx.compose.material.icons.outlined.Cancel` with `androidx.compose.material.icons.outlined.Close`. - Updated `NoteIcon.Cancel` to use `Icons.Outlined.Close`.
This commit updates the `getOneNotePad` function in both `TestNotePadRepository` and `FakeNotePadRepository` to return a `NotePad` object with the provided `id`. - In `TestNotePadRepository.kt`: - Modified `getOneNotePad(id: Long)` to return `flow { NotePad(id = id) }`. - Added a `println` statement for debugging. - In `FakeNotePadRepository.kt`: - Modified `getOneNotePad(id: Long)` to return `flow { NotePad(id = id) }`. - Added a `println` statement for debugging.
…ture/material_theme # Conflicts: # modules/designsystem/src/main/kotlin/com/mshdabiola/designsystem/icon/NoteIcon.kt # settings.gradle.kts
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 96 files out of 212 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
The `lintPublish` dependency on `projects.lint` in `modules/designsystem/build.gradle.kts` has been commented out.
PR Type
Enhancement, Tests
Description
Refactor UI components.
Add custom lint checks.
Update theme name.
Standardize UI components.
Changes walkthrough 📝
19 files
Update theme name in MainActivity
Update theme name and button in ShareActivity
Update button composable in MainNavigation
Update button composable in DetailScreen
Update Tab composable in DrawingBar
Update button and alert composables in MainScreen
Update button and alert composables in TopbarAndDialog
Update button composable in LabelScreen
Update button composable in OptionsDialog
Rename SkTheme to NoteTheme
Update theme name in ScreenshotHelper
Update icons in ColorDialog
Update button composables in DateDialog
Update theme in FlowLayout preview
Update icons in ImageDialog
Update button composables in NewDialog
Update icons in ReminderCard
Update button composables in TimeDialog
Update loading wheel
3 files
Add lint module build file
Add lint module
Add kotlin-test dependency
6 files
Add lint registry
Add test method name detector
Add design system detector
Add test for test method name detector
Add test for design system detector
Add lint registry entry
1 files
Enable lint checks for designsystem module
2 files
Add NoteTextButton composable
Add Alarm and Repeat icons
4 files
Remove file
Remove file
Remove file
Remove file