Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Intent from android-intent crate #63

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
354 changes: 354 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions android-activity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ native-activity = []

[dependencies]
log = "0.4"
jni = "0.20.0"
jni-sys = "0.3"
ndk = "0.7"
ndk-sys = "0.4"
Expand Down
16 changes: 16 additions & 0 deletions android-activity/src/intent/action.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// Action to invoke with an intent
pub enum Action {
Send,
Edit,
Chooser,
}

impl AsRef<str> for Action {
fn as_ref(&self) -> &str {
match self {
Self::Send => "ACTION_SEND",
Self::Edit => "ACTION_EDIT",
Self::Chooser => "ACTION_CHOOSER",
}
}
}
12 changes: 12 additions & 0 deletions android-activity/src/intent/extra.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// Extra data to include with an intent
pub enum Extra {
Text,
}

impl AsRef<str> for Extra {
fn as_ref(&self) -> &str {
match self {
Self::Text => "android.intent.extra.TEXT",
}
}
}
Loading