fix(android): cleanup and add missing resources
- Remove UDL file (using proc-macro UniFFI instead) - Remove build.rs (not needed with setup_scaffolding!) - Comment out zeroclaw dep temporarily (standalone build) - Add placeholder launcher icon drawable - Add notification icon drawable - Fix service notification to use hardcoded strings The UniFFI proc-macro approach is cleaner and doesn't require separate UDL definitions - the Rust types are annotated directly.
This commit is contained in:
parent
dd94cac1bd
commit
ed80ffb59a
@ -10,8 +10,9 @@ crate-type = ["cdylib"]
|
||||
name = "zeroclaw_android"
|
||||
|
||||
[dependencies]
|
||||
zeroclaw = { path = "../.." }
|
||||
uniffi = { version = "0.27", features = ["cli"] }
|
||||
# Note: zeroclaw dep commented out until we integrate properly
|
||||
# zeroclaw = { path = "../.." }
|
||||
uniffi = { version = "0.27" }
|
||||
tokio = { version = "1", features = ["rt-multi-thread", "sync"] }
|
||||
anyhow = "1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
@ -19,9 +20,6 @@ serde_json = "1"
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
|
||||
[build-dependencies]
|
||||
uniffi = { version = "0.27", features = ["build"] }
|
||||
|
||||
[[bin]]
|
||||
name = "uniffi-bindgen"
|
||||
path = "uniffi-bindgen.rs"
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
fn main() {
|
||||
uniffi::generate_scaffolding("src/zeroclaw.udl").unwrap();
|
||||
}
|
||||
@ -1,72 +0,0 @@
|
||||
// ZeroClaw Android Bridge - UniFFI Interface Definition
|
||||
|
||||
namespace zeroclaw {};
|
||||
|
||||
[Enum]
|
||||
interface AgentStatus {
|
||||
Stopped();
|
||||
Starting();
|
||||
Running();
|
||||
Thinking();
|
||||
Error(string message);
|
||||
};
|
||||
|
||||
dictionary ZeroClawConfig {
|
||||
string data_dir;
|
||||
string provider;
|
||||
string model;
|
||||
string api_key;
|
||||
string? system_prompt;
|
||||
};
|
||||
|
||||
dictionary ChatMessage {
|
||||
string id;
|
||||
string content;
|
||||
string role;
|
||||
i64 timestamp_ms;
|
||||
};
|
||||
|
||||
dictionary SendResult {
|
||||
boolean success;
|
||||
string? message_id;
|
||||
string? error;
|
||||
};
|
||||
|
||||
[Error]
|
||||
enum ZeroClawError {
|
||||
"NotInitialized",
|
||||
"AlreadyRunning",
|
||||
"ConfigError",
|
||||
"GatewayError",
|
||||
"LockError",
|
||||
};
|
||||
|
||||
interface ZeroClawController {
|
||||
[Name=new]
|
||||
constructor(ZeroClawConfig config);
|
||||
|
||||
[Name=with_defaults]
|
||||
constructor(string data_dir);
|
||||
|
||||
[Throws=ZeroClawError]
|
||||
void start();
|
||||
|
||||
[Throws=ZeroClawError]
|
||||
void stop();
|
||||
|
||||
AgentStatus get_status();
|
||||
|
||||
SendResult send_message(string content);
|
||||
|
||||
sequence<ChatMessage> get_messages();
|
||||
|
||||
void clear_messages();
|
||||
|
||||
[Throws=ZeroClawError]
|
||||
void update_config(ZeroClawConfig config);
|
||||
|
||||
[Throws=ZeroClawError]
|
||||
ZeroClawConfig get_config();
|
||||
|
||||
boolean is_configured();
|
||||
};
|
||||
@ -8,7 +8,6 @@ import android.os.Binder
|
||||
import android.os.IBinder
|
||||
import androidx.core.app.NotificationCompat
|
||||
import ai.zeroclaw.android.MainActivity
|
||||
import ai.zeroclaw.android.R
|
||||
import ai.zeroclaw.android.ZeroClawApp
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
@ -104,9 +103,9 @@ class ZeroClawService : Service() {
|
||||
)
|
||||
|
||||
return NotificationCompat.Builder(this, ZeroClawApp.CHANNEL_ID)
|
||||
.setContentTitle(getString(R.string.service_notification_title))
|
||||
.setContentText(getString(R.string.service_notification_text))
|
||||
.setSmallIcon(android.R.drawable.ic_menu_manage) // TODO: Add proper icon
|
||||
.setContentTitle("ZeroClaw is running")
|
||||
.setContentText("Your AI assistant is active")
|
||||
.setSmallIcon(android.R.drawable.ic_menu_manage) // TODO: Replace with custom icon
|
||||
.setContentIntent(pendingIntent)
|
||||
.setOngoing(true)
|
||||
.setSilent(true)
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#E85C0D"
|
||||
android:pathData="M54,54m-40,0a40,40 0,1 1,80 0a40,40 0,1 1,-80 0"/>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M40,45 L68,45 L68,63 L40,63 Z M44,49 L64,49 L64,59 L44,59 Z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M12,2A10,10 0,1 0,22 12A10,10 0,0 0,12 2ZM12,20A8,8 0,1 1,20 12A8,8 0,0 1,12 20Z"/>
|
||||
</vector>
|
||||
Loading…
Reference in New Issue
Block a user