Skip to content

Commit 89c06a8

Browse files
committed
implement app intro and app blocking selection
- Add `appintro` multiplatform module for onboarding screens. - Implement `AppIntroActivity` to handle initial setup and permissions (Usage Stats, Notifications, Overlays). - Add `AllowedAppsRepository` to manage and persist allowed application packages on Android. - Integrate `AppSelectionDialog` into the `HomeScreen` to allow users to select allowed apps before starting the timer. - Update `AppBlockerService` to redirect to the home screen when unauthorized apps are accessed. - Add necessary Android permissions (`QUERY_ALL_PACKAGES`, `SYSTEM_ALERT_WINDOW`).
1 parent 57e8cb5 commit 89c06a8

32 files changed

Lines changed: 1208 additions & 52 deletions

File tree

appintro/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

appintro/build.gradle.kts

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
4+
plugins {
5+
alias(libs.plugins.androidLibrary)
6+
alias(libs.plugins.composeMultiplatform)
7+
alias(libs.plugins.kotlinMultiplatform)
8+
alias(libs.plugins.composeCompiler)
9+
alias(libs.plugins.composeHotReload)
10+
}
11+
12+
13+
kotlin {
14+
androidTarget {
15+
compilerOptions {
16+
jvmTarget.set(JvmTarget.JVM_11)
17+
}
18+
}
19+
20+
listOf(
21+
iosArm64(),
22+
iosSimulatorArm64()
23+
).forEach { iosTarget ->
24+
iosTarget.binaries.framework {
25+
baseName = "ComposeApp"
26+
isStatic = true
27+
}
28+
}
29+
30+
jvm()
31+
32+
js {
33+
browser()
34+
binaries.executable()
35+
}
36+
37+
@OptIn(ExperimentalWasmDsl::class)
38+
wasmJs {
39+
browser()
40+
binaries.executable()
41+
}
42+
43+
sourceSets {
44+
androidMain.dependencies {
45+
implementation(compose.preview)
46+
implementation(libs.androidx.activity.compose)
47+
}
48+
commonMain.dependencies {
49+
implementation(libs.androidx.core.ktx)
50+
implementation(libs.material)
51+
52+
implementation(compose.runtime)
53+
implementation(compose.foundation)
54+
implementation(compose.material3)
55+
implementation(compose.ui)
56+
implementation(compose.components.resources)
57+
implementation(compose.components.uiToolingPreview)
58+
implementation(libs.androidx.lifecycle.viewmodelCompose)
59+
implementation(libs.androidx.lifecycle.runtimeCompose)
60+
}
61+
}
62+
}
63+
64+
65+
android {
66+
namespace = "dev.pranav.appintro"
67+
compileSdk {
68+
version = release(36) {
69+
minorApiLevel = 1
70+
}
71+
}
72+
73+
defaultConfig {
74+
minSdk = 26
75+
76+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
77+
consumerProguardFiles("consumer-rules.pro")
78+
}
79+
80+
buildTypes {
81+
release {
82+
isMinifyEnabled = false
83+
proguardFiles(
84+
getDefaultProguardFile("proguard-android-optimize.txt"),
85+
"proguard-rules.pro"
86+
)
87+
}
88+
}
89+
compileOptions {
90+
sourceCompatibility = JavaVersion.VERSION_11
91+
targetCompatibility = JavaVersion.VERSION_11
92+
}
93+
94+
buildFeatures {
95+
compose = true
96+
}
97+
}

appintro/consumer-rules.pro

Whitespace-only changes.

appintro/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

appintro/src/androidTest/java/dev/pranav/appintro/ExampleInstrumentedTest.kt

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest>
3+
4+
</manifest>

0 commit comments

Comments
 (0)