Skip to content

Commit 9525323

Browse files
committed
Rebuild as a native Material 3 app: directions, stops, routes, alerts
The whole app is now native Kotlin/Compose, with the desktop app's features ported over instead of wrapped in a WebView: - Directions: AT's full GTFS timetable downloads once and compiles on the phone, and a RAPTOR planner finds journeys (leave now, leave at, arrive by, today or later in the week), with live delays on every ride, walking paths and turn-by-turn from OSRM, and options for walking distance, pace, modes and changes - Journey view over a map, with share, add to calendar and "track this ride" - Stops and stations: live departures, platforms, alerts, favourites with nicknames, pin a stop to the home screen - Routes: the route on a map, its stops each way, every bus on it now - Search across stops, places (Photon), routes, bus models and fleet numbers - Service alerts, yours first - Home: greeting, "leave in" countdowns, weather, favourites, stops near me - Tracking: a foreground notification that counts down to your bus and buzzes when it's time to leave - Home screen widget, quick settings tile, app shortcuts, akllive:// links - Six Material 3 themes named after Auckland things, Material You, pure black, light/dark - Quirks: shake to refresh, honk the bus, Kiwi mode, a fleet dex of the bus models you've spotted Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011C2fAvFFcMRkaF7qSvRA1v
1 parent ae1b23a commit 9525323

48 files changed

Lines changed: 6990 additions & 384 deletions

Some content is hidden

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

‎app/build.gradle.kts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ android {
4343

4444
buildTypes {
4545
release {
46-
isMinifyEnabled = false
46+
// R8 keeps the APK small (the full Material icon set is big unshrunk)
47+
isMinifyEnabled = true
48+
isShrinkResources = true
49+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
4750
signingConfig = if (keystore.exists()) signingConfigs.getByName("release")
4851
else signingConfigs.getByName("debug")
4952
}
@@ -69,11 +72,18 @@ dependencies {
6972
implementation("androidx.compose.ui:ui-graphics")
7073
implementation("androidx.compose.foundation:foundation")
7174
implementation("androidx.compose.material3:material3")
75+
implementation("androidx.compose.material:material-icons-extended")
7276
implementation("androidx.activity:activity-compose:1.9.3")
7377
implementation("androidx.core:core-ktx:1.15.0")
78+
implementation("androidx.core:core-splashscreen:1.0.1")
7479
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7")
7580
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.7")
81+
implementation("androidx.navigation:navigation-compose:2.8.5")
7682
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
83+
// home screen widget, and the background refresh behind it
84+
implementation("androidx.glance:glance-appwidget:1.1.1")
85+
implementation("androidx.glance:glance-material3:1.1.1")
86+
implementation("androidx.work:work-runtime-ktx:2.10.0")
7787
// open-source vector/raster maps (the satellite and street views)
7888
implementation("org.maplibre.gl:android-sdk:12.3.1")
7989
}

‎app/proguard-rules.pro‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# AKL Live. Compose, MapLibre, Glance and WorkManager bring their own rules;
2+
# these cover what's ours that the system creates by name.
3+
-keep class nz.aryan.akllive.system.** { *; }
4+
-keepclassmembers class * extends androidx.work.ListenableWorker { public <init>(...); }
5+
-keep class * implements androidx.glance.appwidget.action.ActionCallback { public <init>(); }
6+
# MapLibre's optional HTTP and location extras
7+
-dontwarn org.conscrypt.**
8+
-dontwarn org.bouncycastle.**
9+
-dontwarn org.openjsse.**
10+
-dontwarn com.google.android.gms.**

‎app/src/main/AndroidManifest.xml‎

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,70 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<uses-permission android:name="android.permission.INTERNET" />
6-
<!-- MapLibre asks for location; the app never shows where you are -->
7-
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" tools:node="remove" />
8-
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" tools:node="remove" />
5+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
6+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
7+
<uses-permission android:name="android.permission.VIBRATE" />
8+
<!-- "Near me": stops around you, and directions from where you are -->
9+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
10+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
11+
<!-- tracking a bus: a live notification that keeps counting down -->
12+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
13+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
914

1015
<application
1116
android:label="@string/app_name"
1217
android:icon="@mipmap/ic_launcher"
1318
android:roundIcon="@mipmap/ic_launcher_round"
1419
android:supportsRtl="true"
20+
android:enableOnBackInvokedCallback="true"
1521
android:theme="@style/Theme.AklLive">
22+
1623
<activity
1724
android:name=".MainActivity"
1825
android:exported="true"
19-
android:theme="@style/Theme.AklLive">
26+
android:launchMode="singleTop"
27+
android:windowSoftInputMode="adjustResize"
28+
android:theme="@style/Theme.AklLive.Starting">
2029
<intent-filter>
2130
<action android:name="android.intent.action.MAIN" />
2231
<category android:name="android.intent.category.LAUNCHER" />
2332
</intent-filter>
33+
<!-- akllive://stop/8669, akllive://plan ... from shortcuts, the widget and other apps -->
34+
<intent-filter>
35+
<action android:name="android.intent.action.VIEW" />
36+
<category android:name="android.intent.category.DEFAULT" />
37+
<category android:name="android.intent.category.BROWSABLE" />
38+
<data android:scheme="akllive" />
39+
</intent-filter>
40+
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
2441
</activity>
42+
43+
<service
44+
android:name=".system.TrackService"
45+
android:exported="false"
46+
android:foregroundServiceType="dataSync" />
47+
48+
<service
49+
android:name=".system.NextBusTile"
50+
android:exported="true"
51+
android:icon="@drawable/ic_stat_bus"
52+
android:label="@string/tile_label"
53+
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
54+
<intent-filter>
55+
<action android:name="android.service.quicksettings.action.QS_TILE" />
56+
</intent-filter>
57+
<meta-data android:name="android.service.quicksettings.ACTIVE_TILE" android:value="false" />
58+
</service>
59+
60+
<receiver
61+
android:name=".system.NextBusWidgetReceiver"
62+
android:exported="true"
63+
android:label="@string/widget_label">
64+
<intent-filter>
65+
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
66+
</intent-filter>
67+
<meta-data android:name="android.appwidget.provider" android:resource="@xml/next_bus_widget" />
68+
</receiver>
2569
</application>
2670
</manifest>

0 commit comments

Comments
 (0)