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

Removing MainActivity from plugin #22

Closed
wants to merge 2 commits 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
61 changes: 0 additions & 61 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,64 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.techind.flutter_sharing_intent">

<application>
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="true"
android:theme="@style/LaunchTheme"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait"
android:launchMode="singleTask">

<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/*" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="video/*" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="video/*" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>

<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class FlutterSharingIntentPlugin: FlutterPlugin, ActivityAware, MethodCallHandle

/// The MethodChannel that will the communication between Flutter and native Android
private lateinit var channel : MethodChannel
private lateinit var eventChannel: EventChannel

private var eventSinkSharing: EventChannel.EventSink? = null

Expand All @@ -54,8 +55,8 @@ class FlutterSharingIntentPlugin: FlutterPlugin, ActivityAware, MethodCallHandle
channel = MethodChannel(binaryMessenger, "flutter_sharing_intent")
channel.setMethodCallHandler(this)

val eChannelSharing = EventChannel(binaryMessenger, EVENTS_CHANNEL_MEDIA)
eChannelSharing.setStreamHandler(this)
eventChannel = EventChannel(binaryMessenger, EVENTS_CHANNEL_MEDIA)
eventChannel.setStreamHandler(this)

}

Expand Down Expand Up @@ -83,6 +84,7 @@ class FlutterSharingIntentPlugin: FlutterPlugin, ActivityAware, MethodCallHandle

override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
channel.setMethodCallHandler(null)
eventChannel.setStreamHandler(null)
}

private fun handleIntent(intent: Intent, initial: Boolean) {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion lib/model/sharing_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SharedFile {
this.type = SharedMediaType.OTHER});

SharedFile.fromJson(Map<String, dynamic> json)
: value = json['path'],
: value = json['value'],
thumbnail = json['thumbnail'],
duration = json['duration'],
type = SharedMediaType.values[json['type']];
Expand Down