This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #532 from OkunaOrg/feature/update-android-plugin-s…
…ystem 🚧 apply tutorial from flutter github to migrate
- Loading branch information
Showing
14 changed files
with
400 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
277 changes: 0 additions & 277 deletions
277
android/app/src/main/java/com/example/openbook/MainActivity.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
.../com/example/openbook/ImageConverter.java → ...a/social/openbook/app/ImageConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
android/app/src/main/java/social/openbook/app/MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package social.openbook.app; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import social.openbook.app.plugins.ImageConverterPlugin; | ||
import social.openbook.app.plugins.SharePlugin; | ||
import io.flutter.embedding.android.FlutterActivity; | ||
import io.flutter.embedding.engine.plugins.PluginRegistry; | ||
|
||
public class MainActivity extends FlutterActivity { | ||
private SharePlugin sharePlugin; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
// Register the ImageConverterPlugin manually. It won't register automatically since it isn't added as a plugin via | ||
// our pubspec.yaml. | ||
// Note: getFlutterEngine() should not be null here since it is created in super.onCreate(). | ||
PluginRegistry pluginRegistry = getFlutterEngine().getPlugins(); | ||
pluginRegistry.add(new ImageConverterPlugin()); | ||
sharePlugin = new SharePlugin(); | ||
pluginRegistry.add(sharePlugin); | ||
|
||
// Pass the intent that created this activity to the share plugin, | ||
// just in case it is an ACTION_SEND intent with share data. | ||
sharePlugin.handleIntent(getIntent()); | ||
} | ||
|
||
@Override | ||
protected void onNewIntent(Intent intent) { | ||
super.onNewIntent(intent); | ||
sharePlugin.handleIntent(intent); | ||
} | ||
} |
Oops, something went wrong.