mirror of
https://github.com/oasisfeng/deagle.git
synced 2025-01-09 04:10:03 +08:00
ADD: IntentFilters.forAction() & withDataScheme().
This commit is contained in:
parent
4d8d360c30
commit
6a25096c71
@ -13,15 +13,9 @@ public class IntentFilters {
|
||||
|
||||
public static class FluentIntentFilter extends IntentFilter {
|
||||
|
||||
public FluentIntentFilter withAction(final String action) {
|
||||
super.addAction(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FluentIntentFilter withActions(final String... actions) {
|
||||
for (final String action : actions) super.addAction(action);
|
||||
return this;
|
||||
}
|
||||
public FluentIntentFilter withAction(final String action) { addAction(action); return this; }
|
||||
public FluentIntentFilter withActions(final String... actions) { for (final String action : actions) addAction(action); return this; }
|
||||
public IntentFilter withDataScheme(final String scheme) { addDataScheme(scheme); return this; }
|
||||
|
||||
public FluentIntentFilter(final IntentFilter filter) { super(filter); }
|
||||
public FluentIntentFilter() {}
|
||||
@ -36,6 +30,10 @@ public class IntentFilters {
|
||||
|
||||
public static FluentIntentFilter build() { return new FluentIntentFilter(); }
|
||||
|
||||
public static FluentIntentFilter forAction(final String action) {
|
||||
return new FluentIntentFilter().withAction(action);
|
||||
}
|
||||
|
||||
public static FluentIntentFilter forActions(final String... actions) {
|
||||
return new FluentIntentFilter().withActions(actions);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user