Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android v2 #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@
import android.animation.ValueAnimator;
import android.app.Activity;
import android.annotation.TargetApi;
import android.app.ActivityManager;
import android.content.Context;
import android.content.ContextWrapper;
import android.os.Build;
import android.util.Log;
import android.view.View;
import android.view.WindowInsets;
import android.view.WindowManager;

import androidx.annotation.NonNull;
import androidx.core.view.ViewCompat;

import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
Expand All @@ -20,20 +28,28 @@
/**
* FlutterStatusbarManagerPlugin
*/
public class FlutterStatusbarManagerPlugin implements MethodCallHandler {
private final Activity activity;

/**
* Plugin registration.
*/
public static void registerWith(Registrar registrar) {
MethodChannel channel = new MethodChannel(registrar.messenger(), "flutter_statusbar_manager");
FlutterStatusbarManagerPlugin instance = new FlutterStatusbarManagerPlugin(registrar);
channel.setMethodCallHandler(instance);
public class FlutterStatusbarManagerPlugin implements FlutterPlugin, MethodCallHandler, ActivityAware {
private Activity activity;
private MethodChannel channel;

@Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "plugin_test");
channel.setMethodCallHandler(this);
}

private FlutterStatusbarManagerPlugin(Registrar registrar) {
this.activity = registrar.activity();
@Override
public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
if (call.method.equals("getPlatformVersion")) {
result.success("Android " + android.os.Build.VERSION.RELEASE);
} else {
result.notImplemented();
}
}

@Override
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
channel.setMethodCallHandler(null);
}

@Override
Expand Down
1 change: 0 additions & 1 deletion example/.flutter-plugins-dependencies

This file was deleted.

9 changes: 0 additions & 9 deletions example/.gitignore

This file was deleted.

19 changes: 0 additions & 19 deletions example/.idea/libraries/Dart_SDK.xml

This file was deleted.

9 changes: 0 additions & 9 deletions example/.idea/libraries/Flutter_for_Android.xml

This file was deleted.

9 changes: 0 additions & 9 deletions example/.idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions example/.idea/runConfigurations/main_dart.xml

This file was deleted.

36 changes: 0 additions & 36 deletions example/.idea/workspace.xml

This file was deleted.

8 changes: 0 additions & 8 deletions example/.metadata

This file was deleted.

8 changes: 0 additions & 8 deletions example/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions example/android/.gitignore

This file was deleted.

51 changes: 0 additions & 51 deletions example/android/app/build.gradle

This file was deleted.

39 changes: 0 additions & 39 deletions example/android/app/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions example/android/app/src/main/res/drawable/launch_background.xml

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 0 additions & 8 deletions example/android/app/src/main/res/values/styles.xml

This file was deleted.

29 changes: 0 additions & 29 deletions example/android/build.gradle

This file was deleted.

4 changes: 0 additions & 4 deletions example/android/gradle.properties

This file was deleted.

Binary file removed example/android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 0 additions & 6 deletions example/android/gradle/wrapper/gradle-wrapper.properties

This file was deleted.

Loading