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

useAndroidX

parent 7a28edc0
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.LifecycleOwner;
import androidx.lifecycle.LifecycleRegistry;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
......@@ -15,10 +19,9 @@ import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.*;
import android.widget.*;
import com.idlefish.flutterboost.FlutterBoost;
import com.idlefish.flutterboost.interfaces.IFlutterViewContainer;
......@@ -34,7 +37,7 @@ import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
public class BoostFlutterActivity extends Activity
public class BoostFlutterActivity extends AppCompatActivity
implements FlutterActivityAndFragmentDelegate.Host,
LifecycleOwner {
......@@ -131,9 +134,10 @@ public class BoostFlutterActivity extends Activity
lifecycle = new LifecycleRegistry(this);
}
public IFlutterViewContainer getIFlutterViewContainer(){
public IFlutterViewContainer getIFlutterViewContainer() {
return delegate;
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
switchLaunchThemeForNormalTheme();
......@@ -290,6 +294,7 @@ public class BoostFlutterActivity extends Activity
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
delegate.onActivityResult(requestCode, resultCode, data);
}
......@@ -341,22 +346,10 @@ public class BoostFlutterActivity extends Activity
*/
@Override
@NonNull
public Activity getActivity() {
public AppCompatActivity getActivity() {
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} to obtain Flutter shell arguments when
......
buildscript {
repositories {
google()
jcenter()
maven{ url 'https://maven.aliyun.com/repository/google'}
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 {
......@@ -11,8 +18,11 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
maven{ url 'https://maven.aliyun.com/repository/google'}
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