Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
Merge pull request #532 from OkunaOrg/feature/update-android-plugin-s…
Browse files Browse the repository at this point in the history
…ystem

🚧 apply tutorial from flutter github to migrate
  • Loading branch information
lifenautjoe authored May 25, 2020
2 parents cdb8b6c + e03bfec commit b05a72e
Show file tree
Hide file tree
Showing 14 changed files with 400 additions and 337 deletions.
21 changes: 13 additions & 8 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,31 @@
FlutterApplication and put your custom class here. -->
<application
android:requestLegacyExternalStorage="true"
android:name="io.flutter.app.FlutterApplication"
android:label="Okuna"
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true"
>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<!-- Specify that the launch screen should continue being displayed -->
<!-- until Flutter renders its first frame. -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true"/>
<!-- App Links -->
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />

<!-- Theme to apply as soon as Flutter begins rendering frames -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
Expand Down
277 changes: 0 additions & 277 deletions android/app/src/main/java/com/example/openbook/MainActivity.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.openbook;
package social.openbook.app;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
Expand Down
35 changes: 35 additions & 0 deletions android/app/src/main/java/social/openbook/app/MainActivity.java
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);
}
}
Loading

0 comments on commit b05a72e

Please sign in to comment.