-
-
Notifications
You must be signed in to change notification settings - Fork 158
feat: remember preview/edit mode per note #3203
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: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| */ | ||
| package it.niedermann.owncloud.notes.persistence.dao; | ||
|
|
||
| import androidx.annotation.Nullable; | ||
| import androidx.lifecycle.LiveData; | ||
| import androidx.room.Dao; | ||
| import androidx.room.Insert; | ||
|
|
@@ -72,28 +73,28 @@ | |
| Integer countFavorites(long accountId); | ||
|
|
||
| @Query(searchRecentByModified) | ||
| LiveData<List<Note>> searchRecentByModified$(long accountId, String query); | ||
|
Check warning on line 76 in app/src/main/java/it/niedermann/owncloud/notes/persistence/dao/NoteDao.java
|
||
|
|
||
| @Query(searchRecentByModified) | ||
| List<Note> searchRecentByModified(long accountId, String query); | ||
|
Check warning on line 79 in app/src/main/java/it/niedermann/owncloud/notes/persistence/dao/NoteDao.java
|
||
|
|
||
| @Query(searchRecentLexicographically) | ||
| LiveData<List<Note>> searchRecentLexicographically$(long accountId, String query); | ||
|
Check warning on line 82 in app/src/main/java/it/niedermann/owncloud/notes/persistence/dao/NoteDao.java
|
||
|
|
||
| @Query(searchRecentLexicographically) | ||
| List<Note> searchRecentLexicographically(long accountId, String query); | ||
|
Check warning on line 85 in app/src/main/java/it/niedermann/owncloud/notes/persistence/dao/NoteDao.java
|
||
|
|
||
| @Query(searchFavoritesByModified) | ||
| LiveData<List<Note>> searchFavoritesByModified$(long accountId, String query); | ||
|
Check warning on line 88 in app/src/main/java/it/niedermann/owncloud/notes/persistence/dao/NoteDao.java
|
||
|
|
||
| @Query(searchFavoritesByModified) | ||
| List<Note> searchFavoritesByModified(long accountId, String query); | ||
|
Check warning on line 91 in app/src/main/java/it/niedermann/owncloud/notes/persistence/dao/NoteDao.java
|
||
|
|
||
| @Query(searchFavoritesLexicographically) | ||
| LiveData<List<Note>> searchFavoritesLexicographically$(long accountId, String query); | ||
|
Check warning on line 94 in app/src/main/java/it/niedermann/owncloud/notes/persistence/dao/NoteDao.java
|
||
|
|
||
| @Query(searchFavoritesLexicographically) | ||
| List<Note> searchFavoritesLexicographically(long accountId, String query); | ||
|
Check warning on line 97 in app/src/main/java/it/niedermann/owncloud/notes/persistence/dao/NoteDao.java
|
||
|
|
||
| @Query(searchUncategorizedByModified) | ||
| LiveData<List<Note>> searchUncategorizedByModified$(long accountId, String query); | ||
|
|
@@ -125,6 +126,9 @@ | |
| @Query("UPDATE NOTE SET scrollY = :scrollY WHERE id = :id") | ||
| void updateScrollY(long id, int scrollY); | ||
|
|
||
| @Query("UPDATE NOTE SET noteMode = :noteMode WHERE id = :id") | ||
| void updateNoteMode(long id, @Nullable String noteMode); | ||
|
|
||
| @Query("UPDATE NOTE SET status = :status WHERE id = :id") | ||
| void updateStatus(long id, DBStatus status); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /* | ||
| * Nextcloud Notes - Android Client | ||
| * | ||
| * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: GPL-3.0-or-later | ||
| */ | ||
| package it.niedermann.owncloud.notes.persistence.migration | ||
|
|
||
| import androidx.room.migration.Migration | ||
| import androidx.sqlite.db.SupportSQLiteDatabase | ||
|
|
||
| @Suppress("ClassName", "Detekt.ClassNaming") | ||
| class Migration_29_30 : Migration(29, 30) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Auto migration should be enough to add new column to the note table |
||
| override fun migrate(db: SupportSQLiteDatabase) { | ||
| db.execSQL("ALTER TABLE Note ADD COLUMN noteMode TEXT DEFAULT NULL") | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use early returns