Commit 8d797657 authored by yangwu.jia's avatar yangwu.jia

fix the leak

parent f78fb4b9
...@@ -22,7 +22,7 @@ rootProject.allprojects { ...@@ -22,7 +22,7 @@ rootProject.allprojects {
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
android { android {
compileSdkVersion 26 compileSdkVersion 28
buildToolsVersion '27.0.3' buildToolsVersion '27.0.3'
defaultConfig { defaultConfig {
minSdkVersion 16 minSdkVersion 16
......
...@@ -54,7 +54,7 @@ public class BoostFlutterView extends FrameLayout { ...@@ -54,7 +54,7 @@ public class BoostFlutterView extends FrameLayout {
private BoostFlutterEngine mFlutterEngine; private BoostFlutterEngine mFlutterEngine;
private XFlutterView mFlutterView; private XFlutterView mFlutterView;
private PlatformPlugin mPlatformPlugin; private XPlatformPlugin mPlatformPlugin;
private Bundle mArguments; private Bundle mArguments;
...@@ -114,7 +114,7 @@ public class BoostFlutterView extends FrameLayout { ...@@ -114,7 +114,7 @@ public class BoostFlutterView extends FrameLayout {
if (mArguments == null) { if (mArguments == null) {
mArguments = new Bundle(); mArguments = new Bundle();
} }
mPlatformPlugin = new PlatformPlugin((Activity) getContext(), mFlutterEngine.getPlatformChannel()); mPlatformPlugin = new XPlatformPlugin((Activity) getContext(), mFlutterEngine.getPlatformChannel());
mFlutterView = new XFlutterView(getContext(), getRenderMode(), getTransparencyMode()); mFlutterView = new XFlutterView(getContext(), getRenderMode(), getTransparencyMode());
addView(mFlutterView, new FrameLayout.LayoutParams( addView(mFlutterView, new FrameLayout.LayoutParams(
...@@ -295,6 +295,7 @@ public class BoostFlutterView extends FrameLayout { ...@@ -295,6 +295,7 @@ public class BoostFlutterView extends FrameLayout {
mFlutterView.removeOnFirstFrameRenderedListener(mOnFirstFrameRenderedListener); mFlutterView.removeOnFirstFrameRenderedListener(mOnFirstFrameRenderedListener);
mFlutterView.release(); mFlutterView.release();
mPlatformPlugin.release();
} }
//混合栈的返回和原来Flutter的返回逻辑不同 //混合栈的返回和原来Flutter的返回逻辑不同
......
...@@ -13,6 +13,7 @@ public class XAndroidKeyProcessor { ...@@ -13,6 +13,7 @@ public class XAndroidKeyProcessor {
private final KeyEventChannel keyEventChannel; private final KeyEventChannel keyEventChannel;
@NonNull @NonNull
private final XTextInputPlugin textInputPlugin; private final XTextInputPlugin textInputPlugin;
private int combiningCharacter; private int combiningCharacter;
public XAndroidKeyProcessor(@NonNull KeyEventChannel keyEventChannel, @NonNull XTextInputPlugin textInputPlugin) { public XAndroidKeyProcessor(@NonNull KeyEventChannel keyEventChannel, @NonNull XTextInputPlugin textInputPlugin) {
...@@ -20,6 +21,7 @@ public class XAndroidKeyProcessor { ...@@ -20,6 +21,7 @@ public class XAndroidKeyProcessor {
this.textInputPlugin = textInputPlugin; this.textInputPlugin = textInputPlugin;
} }
public void onKeyUp(@NonNull KeyEvent keyEvent) { public void onKeyUp(@NonNull KeyEvent keyEvent) {
Character complexCharacter = applyCombiningCharacterToBaseCharacter(keyEvent.getUnicodeChar()); Character complexCharacter = applyCombiningCharacterToBaseCharacter(keyEvent.getUnicodeChar());
keyEventChannel.keyUp( keyEventChannel.keyUp(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment