Skip to content

Commit 3c36a23

Browse files
authored
feat: Improve Ui and add widget support
2 parents c4d1fdf + 9baea3d commit 3c36a23

71 files changed

Lines changed: 2839 additions & 1838 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: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
11

2-
# Android/Ignored files
32
.gradle/
43
.idea/
54
build/
65
app/build/
76
local.properties
7+
8+
# Compiled class files
89
*.iml
910
*.class
10-
gradle.propeties
11-
test0.jks
11+
12+
13+
*.apk
14+
*.ap_
15+
*.aab
16+
*.dex
17+
18+
19+
*.jks
20+
*.keystore
21+
22+
23+
!debug.keystore
24+
25+
# Native build folders
26+
.cxx/
27+
.externalNativeBuild/
28+
29+
# OS-specific files
30+
.DS_Store

app/build.gradle

Lines changed: 0 additions & 107 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
plugins {
2+
id("com.android.application")
3+
id("org.jetbrains.kotlin.android")
4+
id("com.google.devtools.ksp")
5+
id("org.jetbrains.kotlin.plugin.compose")
6+
id("dagger.hilt.android.plugin")
7+
alias(libs.plugins.ktlint)
8+
}
9+
10+
ktlint {
11+
android.set(true)
12+
outputToConsole.set(true)
13+
}
14+
15+
android {
16+
namespace = "com.opennotes"
17+
compileSdk = 36
18+
19+
defaultConfig {
20+
applicationId = "com.opennotes"
21+
minSdk = 26
22+
targetSdk = 36
23+
versionCode = 11
24+
versionName = "1.3.7"
25+
26+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
27+
vectorDrawables {
28+
useSupportLibrary = true
29+
}
30+
}
31+
32+
dependenciesInfo {
33+
includeInApk = false
34+
includeInBundle = false
35+
}
36+
37+
buildTypes {
38+
release {
39+
isMinifyEnabled = true
40+
isShrinkResources = true
41+
proguardFiles(
42+
getDefaultProguardFile("proguard-android-optimize.txt"),
43+
"proguard-rules.pro",
44+
)
45+
}
46+
}
47+
48+
compileOptions {
49+
sourceCompatibility = JavaVersion.VERSION_17
50+
targetCompatibility = JavaVersion.VERSION_17
51+
}
52+
53+
kotlinOptions {
54+
jvmTarget = "17"
55+
}
56+
57+
buildFeatures {
58+
compose = true
59+
}
60+
61+
packaging {
62+
resources {
63+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
64+
excludes += "META-INF/*"
65+
}
66+
}
67+
}
68+
69+
dependencies {
70+
implementation(platform(libs.compose.bom))
71+
implementation(libs.compose.ui)
72+
implementation(libs.compose.material)
73+
implementation(libs.compose.material.icons.extended)
74+
implementation(libs.compose.ui.tooling.preview)
75+
implementation(libs.compose.material3)
76+
debugImplementation(libs.compose.ui.tooling)
77+
androidTestImplementation(platform(libs.compose.bom))
78+
implementation(libs.material.kolor)
79+
androidTestImplementation(libs.compose.test.junit)
80+
implementation(libs.androidx.datastore.core)
81+
implementation(libs.androidx.datastore.preferences)
82+
implementation(libs.activity.compose)
83+
implementation(libs.lifecycle.runtime.ktx)
84+
implementation(libs.lifecycle.viewmodel.compose)
85+
implementation(libs.navigation.compose)
86+
implementation(libs.hilt.navigation.compose)
87+
implementation(libs.core.ktx)
88+
implementation(libs.appcompat)
89+
implementation(libs.material)
90+
implementation(libs.hilt.android)
91+
ksp(libs.hilt.android.compiler)
92+
ksp(libs.hilt.compiler)
93+
implementation(libs.room.runtime)
94+
implementation(libs.room.ktx)
95+
ksp(libs.room.compiler)
96+
implementation(libs.coroutines.core)
97+
implementation(libs.coroutines.android)
98+
implementation(libs.gson)
99+
implementation(libs.core.splashscreen)
100+
implementation(libs.biometric)
101+
implementation(libs.glance.appwidget)
102+
implementation(libs.glance.material3)
103+
testImplementation(libs.junit)
104+
androidTestImplementation(libs.androidx.junit)
105+
androidTestImplementation(libs.espresso)
106+
}

app/src/androidTest/java/com/opennotes/ExampleInstrumentedTest.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
package com.opennotes
22

3-
import androidx.test.platform.app.InstrumentationRegistry
43
import androidx.test.ext.junit.runners.AndroidJUnit4
5-
4+
import androidx.test.platform.app.InstrumentationRegistry
5+
import org.junit.Assert.assertEquals
66
import org.junit.Test
77
import org.junit.runner.RunWith
88

9-
import org.junit.Assert.*
10-
119
/**
1210
* Instrumented test, which will execute on an Android device.
1311
*
@@ -21,4 +19,4 @@ class ExampleInstrumentedTest {
2119
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
2220
assertEquals("com.plcoding.cleanarchitecturenoteapp", appContext.packageName)
2321
}
24-
}
22+
}

app/src/main/AndroidManifest.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,21 @@
3939
<action android:name="android.intent.action.MAIN" />
4040
<category android:name="android.intent.category.LAUNCHER" />
4141
</intent-filter>
42+
<intent-filter>
43+
<action android:name="android.intent.action.VIEW" />
44+
<category android:name="android.intent.category.DEFAULT" />
45+
<category android:name="android.intent.category.BROWSABLE" />
46+
<data android:scheme="opennotes" android:host="note" />
47+
</intent-filter>
48+
</activity>
49+
50+
<activity
51+
android:name=".feature_node.widget.NotesWidgetConfigActivity"
52+
android:exported="true"
53+
android:theme="@style/Theme.OpenNotes">
54+
<intent-filter>
55+
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
56+
</intent-filter>
4257
</activity>
4358

4459
<provider
@@ -50,6 +65,17 @@
5065
android:name="android.support.FILE_PROVIDER_PATHS"
5166
android:resource="@xml/provider_paths" />
5267
</provider>
68+
69+
<receiver
70+
android:name=".feature_node.widget.NotesWidgetReceiver"
71+
android:exported="true">
72+
<intent-filter>
73+
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
74+
</intent-filter>
75+
<meta-data
76+
android:name="android.appwidget.provider"
77+
android:resource="@xml/notes_widget_info" />
78+
</receiver>
5379
</application>
5480

5581
</manifest>

app/src/main/java/com/opennotes/OpenNotes.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ package com.opennotes
2121
import android.app.Application
2222
import dagger.hilt.android.HiltAndroidApp
2323

24-
2524
@HiltAndroidApp
26-
class OpenNotes: Application()
25+
class OpenNotes : Application()

0 commit comments

Comments
 (0)