Commit 2bb3e0ee authored by 李增强's avatar 李增强

useAndroidX

parent 7a28edc0
package com.idlefish.flutterboost.containers; package com.idlefish.flutterboost.containers;
import android.app.Activity; import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner; import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleRegistry; import androidx.lifecycle.LifecycleRegistry;
import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo;
...@@ -15,10 +19,9 @@ import android.graphics.drawable.ColorDrawable; ...@@ -15,10 +19,9 @@ import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.*; import android.view.*;
import android.widget.*; import android.widget.*;
import com.idlefish.flutterboost.FlutterBoost; import com.idlefish.flutterboost.FlutterBoost;
import com.idlefish.flutterboost.interfaces.IFlutterViewContainer; import com.idlefish.flutterboost.interfaces.IFlutterViewContainer;
...@@ -34,7 +37,7 @@ import java.io.Serializable; ...@@ -34,7 +37,7 @@ import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class BoostFlutterActivity extends Activity public class BoostFlutterActivity extends AppCompatActivity
implements FlutterActivityAndFragmentDelegate.Host, implements FlutterActivityAndFragmentDelegate.Host,
LifecycleOwner { LifecycleOwner {
...@@ -131,9 +134,10 @@ public class BoostFlutterActivity extends Activity ...@@ -131,9 +134,10 @@ public class BoostFlutterActivity extends Activity
lifecycle = new LifecycleRegistry(this); lifecycle = new LifecycleRegistry(this);
} }
public IFlutterViewContainer getIFlutterViewContainer(){ public IFlutterViewContainer getIFlutterViewContainer() {
return delegate; return delegate;
} }
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
switchLaunchThemeForNormalTheme(); switchLaunchThemeForNormalTheme();
...@@ -290,6 +294,7 @@ public class BoostFlutterActivity extends Activity ...@@ -290,6 +294,7 @@ public class BoostFlutterActivity extends Activity
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
delegate.onActivityResult(requestCode, resultCode, data); delegate.onActivityResult(requestCode, resultCode, data);
} }
...@@ -341,22 +346,10 @@ public class BoostFlutterActivity extends Activity ...@@ -341,22 +346,10 @@ public class BoostFlutterActivity extends Activity
*/ */
@Override @Override
@NonNull @NonNull
public Activity getActivity() { public AppCompatActivity getActivity() {
return this; return this;
} }
/**
* {@link FlutterActivityAndFragmentDelegate.Host} method that is used by
* {@link FlutterActivityAndFragmentDelegate} to obtain a {@code Lifecycle} reference as
* needed. This reference is used by the delegate to provide Flutter plugins with access
* to lifecycle events.
*/
@Override
@NonNull
public Lifecycle getLifecycle() {
return lifecycle;
}
/** /**
* {@link FlutterActivityAndFragmentDelegate.Host} method that is used by * {@link FlutterActivityAndFragmentDelegate.Host} method that is used by
* {@link FlutterActivityAndFragmentDelegate} to obtain Flutter shell arguments when * {@link FlutterActivityAndFragmentDelegate} to obtain Flutter shell arguments when
......
buildscript { buildscript {
repositories { repositories {
google() maven{ url 'https://maven.aliyun.com/repository/google'}
jcenter()
maven{ url 'http://maven.aliyun.com/repository/gradle-plugin'}
maven{ url 'https://maven.aliyun.com/repository/public'}
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
} }
dependencies { dependencies {
...@@ -11,8 +18,11 @@ buildscript { ...@@ -11,8 +18,11 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
google() maven{ url 'https://maven.aliyun.com/repository/google'}
jcenter() maven{ url 'http://maven.aliyun.com/repository/gradle-plugin'}
maven{ url 'https://maven.aliyun.com/repository/public'}
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
maven { url "https://jitpack.io" }
} }
} }
......
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