add intent support for simple plain text
This commit is contained in:
@@ -62,6 +62,7 @@
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:label="WebLibre"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:taskAffinity="eu.weblibre.gecko.task"
|
||||
@@ -133,6 +134,12 @@
|
||||
<data android:mimeType="application/pdf" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.PROCESS_TEXT" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="text/plain" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.WEB_SEARCH" />
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ final _sharingIntentTransformer =
|
||||
StreamTransformer<Intent, ReceivedIntentParameter>.fromHandlers(
|
||||
handleData: (intent, sink) async {
|
||||
final data = switch (intent.action) {
|
||||
'android.intent.action.PROCESS_TEXT' =>
|
||||
intent.extra['android.intent.extra.PROCESS_TEXT'] as String?,
|
||||
'android.intent.action.WEB_SEARCH' =>
|
||||
intent.extra['query'] as String?,
|
||||
'android.intent.action.VIEW' => intent.data,
|
||||
|
||||
Reference in New Issue
Block a user