Skip to content

Commit fe74f08

Browse files
committed
update android metadata
1 parent bc8b813 commit fe74f08

File tree

6 files changed

+145
-17
lines changed

6 files changed

+145
-17
lines changed

Cargo.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,24 @@ inherits = "dev"
9090

9191
[profile.android-dev]
9292
inherits = "dev"
93+
94+
[package.metadata.android]
95+
package_name = "xyz.waozi.myquest"
96+
97+
[package.metadata.bundle]
98+
name = "myQuest"
99+
identifier = "xyz.waozi.myquest"
100+
version = "1.0.0"
101+
copyright = "Copyright (c) 2024 waozixyz"
102+
category = "Productivity"
103+
short_description = "Personal life management and habit tracking application"
104+
long_description = """
105+
myQuest is a comprehensive personal life management application focused on visualization and habit tracking. Features include:
106+
107+
- Habit Tracker: Track daily habits with calendar view and visual progress tracking
108+
- Weekly Todo List: Organize tasks by day with week-at-a-glance view
109+
- Life Timeline: Visualize life journey and experiences on an interactive timeline
110+
- Routine Manager (Coming Soon): Plan and optimize daily schedules with detailed time allocation
111+
112+
Built with Rust and Dioxus, myQuest helps you build consistency, manage tasks, and gain perspective on your life journey.
113+
"""

metadata/android/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="xyz.waozi.myQuest">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<uses-permission android:name="android.permission.INTERNET" />
65

metadata/android/MainActivity.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package dev.dioxus.main;
2+
3+
// need to re-export buildconfig down from the parent
4+
import xyz.waozi.myQuest.BuildConfig;
5+
typealias BuildConfig = BuildConfig;
6+
7+
8+
class MainActivity : WryActivity()

metadata/android/build.gradle.kts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
plugins {
2+
id("com.android.application")
3+
id("org.jetbrains.kotlin.android")
4+
}
5+
6+
android {
7+
namespace = "xyz.waozi.myQuest"
8+
compileSdk = 34
9+
10+
defaultConfig {
11+
applicationId = "xyz.waozi.myQuest"
12+
minSdk = 24
13+
targetSdk = 34
14+
versionCode = 1
15+
versionName = "1.0"
16+
}
17+
18+
buildTypes {
19+
debug {
20+
isDebuggable = true
21+
isJniDebuggable = true
22+
isMinifyEnabled = false
23+
packaging {
24+
jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so")
25+
jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so")
26+
jniLibs.keepDebugSymbols.add("*/x86/*.so")
27+
jniLibs.keepDebugSymbols.add("*/x86_64/*.so")
28+
}
29+
}
30+
release {
31+
isMinifyEnabled = true
32+
proguardFiles(
33+
getDefaultProguardFile("proguard-android-optimize.txt"),
34+
"proguard-rules.pro"
35+
)
36+
}
37+
}
38+
39+
compileOptions {
40+
sourceCompatibility = JavaVersion.VERSION_1_8
41+
targetCompatibility = JavaVersion.VERSION_1_8
42+
}
43+
44+
kotlinOptions {
45+
jvmTarget = "1.8"
46+
}
47+
48+
buildFeatures {
49+
buildConfig = true
50+
}
51+
52+
sourceSets {
53+
getByName("main") {
54+
java.srcDirs("src/main/kotlin")
55+
}
56+
}
57+
}
58+
59+
dependencies {
60+
implementation("androidx.webkit:webkit:1.8.0")
61+
implementation("androidx.appcompat:appcompat:1.6.1")
62+
implementation("com.google.android.material:material:1.11.0")
63+
implementation("androidx.core:core-ktx:1.12.0")
64+
}
Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<color name="colorPrimary">#008577</color>
4-
<color name="colorPrimaryDark">#00574B</color>
5-
<color name="colorAccent">#D81B60</color>
3+
<!-- Primary colors -->
4+
<color name="colorPrimary">#942f4a</color>
5+
<color name="colorPrimaryDark">#2d1a2c</color>
6+
<color name="colorAccent">#ff6b97</color>
7+
8+
<!-- Additional theme colors -->
9+
<color name="backgroundColor">#1a0f1f</color>
10+
<color name="secondaryColor">#4a2639</color>
11+
<color name="textColor">#e6dde9</color>
12+
13+
<!-- State colors -->
14+
<color name="successColor">#4caf50</color>
15+
<color name="warningColor">#ff9800</color>
16+
<color name="errorColor">#f44336</color>
17+
<color name="infoColor">#2196f3</color>
18+
19+
<!-- UI element colors -->
20+
<color name="cardBackground">#2d1f33</color>
21+
<color name="borderColor">#4a3655</color>
22+
<color name="inputBackgroundColor">#241a28</color>
623
</resources>

update_android_resources.sh

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
#!/bin/bash
2-
32
# Source directories
43
METADATA_DIR="metadata/android"
54
MANIFEST_SOURCE="$METADATA_DIR/AndroidManifest.xml"
65
RES_SOURCE="$METADATA_DIR/res"
6+
GRADLE_SOURCE="$METADATA_DIR/build.gradle.kts"
7+
ACTIVITY_SOURCE="$METADATA_DIR/MainActivity.kt"
78

89
# Target directories
9-
DEBUG_DIR="target/dx/myquest/debug/android/app/app/src/main"
1010
RELEASE_DIR="target/dx/myquest/release/android/app/app/src/main"
11+
RELEASE_GRADLE="target/dx/myquest/release/android/app/app"
12+
KOTLIN_TARGET="$RELEASE_DIR/kotlin/dev/dioxus/main"
1113

1214
# Function to copy files
1315
copy_android_resources() {
1416
local target_dir="$1"
15-
17+
local gradle_dir="$2"
18+
local kotlin_target="$3"
19+
1620
# Create directories if they don't exist
1721
mkdir -p "$target_dir"
18-
22+
mkdir -p "$gradle_dir"
23+
mkdir -p "$kotlin_target"
24+
1925
# Copy AndroidManifest.xml
2026
if [ -f "$MANIFEST_SOURCE" ]; then
2127
cp "$MANIFEST_SOURCE" "$target_dir/AndroidManifest.xml"
@@ -24,23 +30,36 @@ copy_android_resources() {
2430
echo "Error: Source AndroidManifest.xml not found at $MANIFEST_SOURCE"
2531
exit 1
2632
fi
27-
33+
2834
# Copy res directory
2935
if [ -d "$RES_SOURCE" ]; then
30-
# Remove existing res directory if it exists
3136
rm -rf "$target_dir/res"
3237
cp -r "$RES_SOURCE" "$target_dir/"
3338
echo "Copied res folder to $target_dir"
3439
else
3540
echo "Error: Source res directory not found at $RES_SOURCE"
3641
exit 1
3742
fi
38-
}
3943

40-
# Copy to debug directory
41-
copy_android_resources "$DEBUG_DIR"
44+
# Copy build.gradle.kts
45+
if [ -f "$GRADLE_SOURCE" ]; then
46+
cp "$GRADLE_SOURCE" "$gradle_dir/build.gradle.kts"
47+
echo "Copied build.gradle.kts to $gradle_dir"
48+
else
49+
echo "Error: Source build.gradle.kts not found at $GRADLE_SOURCE"
50+
exit 1
51+
fi
52+
53+
# Copy MainActivity.kt
54+
if [ -f "$ACTIVITY_SOURCE" ]; then
55+
cp "$ACTIVITY_SOURCE" "$kotlin_target/MainActivity.kt"
56+
echo "Copied MainActivity.kt to $kotlin_target"
57+
else
58+
echo "Error: Source MainActivity.kt not found at $ACTIVITY_SOURCE"
59+
exit 1
60+
fi
61+
}
4262

4363
# Copy to release directory
44-
copy_android_resources "$RELEASE_DIR"
45-
46-
echo "Resource copy completed successfully!"
64+
copy_android_resources "$RELEASE_DIR" "$RELEASE_GRADLE" "$KOTLIN_TARGET"
65+
echo "Resource copy completed successfully!"

0 commit comments

Comments
 (0)