Skip to content

Commit 4ade52c

Browse files
authored
feat: add new features and UI polish for v1.3.9
2 parents acb6126 + 11470d0 commit 4ade52c

46 files changed

Lines changed: 2207 additions & 355 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
.idea/
44
build/
55
app/build/
6+
app/*/release/
7+
app/*/debug/
68
local.properties
79

810
# Compiled class files

.kotlin/errors/errors-1782390623438.log

Lines changed: 366 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# OpenNotes [<img src="https://shields.rbtlog.dev/simple/com.opennotes" alt="RB Status" height="80">](https://shields.rbtlog.dev/com.opennotes)
1+
# Open Notes [<img src="https://shields.rbtlog.dev/simple/com.opennotes" alt="RB Status" height="80">](https://shields.rbtlog.dev/com.opennotes)
22

33
**A minimalist, secure, and fully offline notes app.**
44

@@ -11,7 +11,8 @@
1111

1212
## ✨ Features
1313

14-
- **Native Markdown rendering** for rich text formatting, including headers, checklists, code blocks, and quotes.
14+
- **Native Markdown rendering** for rich text formatting, including headers, checklists, numbered lists, code blocks, and quotes.
15+
- **Set reminders** for your notes and receive timely notifications.
1516
- **Seamless image support** to embed photos directly alongside your text.
1617
- **Organization tools** that allow you to color-code, pin, and sort your notes.
1718
- **Home screen widgets** for quick access to your most important notes.

app/build.gradle.kts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ android {
2020
applicationId = "com.opennotes"
2121
minSdk = 26
2222
targetSdk = 36
23-
versionCode = 12
24-
versionName = "1.3.8"
23+
versionCode = 13
24+
versionName = "1.3.9"
2525

2626
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2727
vectorDrawables {
@@ -45,6 +45,17 @@ android {
4545
}
4646
}
4747

48+
flavorDimensions += "distribution"
49+
productFlavors {
50+
create("fdroid") {
51+
dimension = "distribution"
52+
}
53+
create("playStore") {
54+
dimension = "distribution"
55+
applicationIdSuffix = ".play"
56+
}
57+
}
58+
4859
compileOptions {
4960
sourceCompatibility = JavaVersion.VERSION_17
5061
targetCompatibility = JavaVersion.VERSION_17
@@ -56,6 +67,7 @@ android {
5667

5768
buildFeatures {
5869
compose = true
70+
buildConfig = true
5971
}
6072

6173
packaging {
@@ -102,6 +114,7 @@ dependencies {
102114
implementation(libs.glance.appwidget)
103115
implementation(libs.glance.material3)
104116
implementation(libs.coil.compose)
117+
implementation(libs.work.runtime)
105118
testImplementation(libs.junit)
106119
androidTestImplementation(libs.androidx.junit)
107120
androidTestImplementation(libs.espresso)

app/src/main/AndroidManifest.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@
2020
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2121
xmlns:tools="http://schemas.android.com/tools">
2222

23+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
24+
2325
<application
2426
android:name=".OpenNotes"
2527
android:allowBackup="false"
2628
android:icon="@mipmap/ic_launcher"
2729
android:label="@string/app_name"
2830
android:roundIcon="@mipmap/ic_launcher_round"
2931
android:supportsRtl="true"
30-
31-
tools:targetApi="31">
32+
android:enableOnBackInvokedCallback="true"
33+
tools:targetApi="33">
3234

3335
<activity
3436
android:name="com.opennotes.notes.presentation.MainActivity"
@@ -67,7 +69,7 @@
6769

6870
<provider
6971
android:name="androidx.core.content.FileProvider"
70-
android:authorities="com.opennotes.fileprovider"
72+
android:authorities="${applicationId}.fileprovider"
7173
android:exported="false"
7274
android:grantUriPermissions="true">
7375
<meta-data
@@ -77,6 +79,7 @@
7779

7880
<receiver
7981
android:name=".widget.NotesWidgetReceiver"
82+
android:label="Notes"
8083
android:exported="true">
8184
<intent-filter>
8285
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
@@ -88,6 +91,7 @@
8891

8992
<receiver
9093
android:name=".widget.AddNoteReceiver"
94+
android:label="Add Note"
9195
android:exported="true">
9296
<intent-filter>
9397
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />

app/src/main/java/com/opennotes/di/AppModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ object AppModule {
5252
app,
5353
NoteDatabase::class.java,
5454
NoteDatabase.DATABASE_NAME,
55-
).addMigrations(NoteDatabase.MIGRATION_2_3)
55+
).addMigrations(NoteDatabase.MIGRATION_2_3, NoteDatabase.MIGRATION_3_4)
5656
.build()
5757

5858
@Provides

app/src/main/java/com/opennotes/notes/data/datasource/NoteDao.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ interface NoteDao {
3434
suspend fun getNoteById(id: Int): NoteEntity?
3535

3636
@Insert(onConflict = OnConflictStrategy.REPLACE)
37-
suspend fun insertNote(note: NoteEntity)
37+
suspend fun insertNote(note: NoteEntity): Long
3838

3939
@Delete
4040
suspend fun deleteNote(note: NoteEntity)

app/src/main/java/com/opennotes/notes/data/datasource/NoteDatabase.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import androidx.sqlite.db.SupportSQLiteDatabase
2525

2626
@Database(
2727
entities = [NoteEntity::class],
28-
version = 3,
28+
version = 4,
2929
)
3030
abstract class NoteDatabase : RoomDatabase() {
3131
abstract val noteDao: NoteDao
@@ -39,5 +39,12 @@ abstract class NoteDatabase : RoomDatabase() {
3939
db.execSQL("ALTER TABLE Note ADD COLUMN isPinned INTEGER NOT NULL DEFAULT 0")
4040
}
4141
}
42+
43+
val MIGRATION_3_4 =
44+
object : Migration(3, 4) {
45+
override fun migrate(db: SupportSQLiteDatabase) {
46+
db.execSQL("ALTER TABLE Note ADD COLUMN reminderTime INTEGER")
47+
}
48+
}
4249
}
4350
}

app/src/main/java/com/opennotes/notes/data/datasource/NoteEntity.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ data class NoteEntity(
2929
val timestamp: Long,
3030
val color: Int,
3131
val isPinned: Boolean = false,
32+
val reminderTime: Long? = null,
3233
@PrimaryKey val id: Int? = null,
3334
) {
3435
fun toNote(): Note =
@@ -38,6 +39,7 @@ data class NoteEntity(
3839
timestamp = timestamp,
3940
color = color,
4041
isPinned = isPinned,
42+
reminderTime = reminderTime,
4143
id = id,
4244
)
4345
}
@@ -49,5 +51,6 @@ fun Note.toNoteEntity(): NoteEntity =
4951
timestamp = timestamp,
5052
color = color,
5153
isPinned = isPinned,
54+
reminderTime = reminderTime,
5255
id = id,
5356
)

app/src/main/java/com/opennotes/notes/data/repository/NoteRepositoryImpl.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ class NoteRepositoryImpl(
3232

3333
override suspend fun getNoteById(id: Int): Note? = dao.getNoteById(id)?.toNote()
3434

35-
override suspend fun insertNote(note: Note) {
36-
dao.insertNote(note.toNoteEntity())
37-
}
35+
override suspend fun insertNote(note: Note): Int = dao.insertNote(note.toNoteEntity()).toInt()
3836

3937
override suspend fun deleteNote(note: Note) {
4038
dao.deleteNote(note.toNoteEntity())

0 commit comments

Comments
 (0)