This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +18
-50
lines changed
src/main/java/io/flutter/plugins/battery
androidTest/java/io/flutter/plugins/battery
java/io/flutter/plugins/batteryexample Expand file tree Collapse file tree 8 files changed +18
-50
lines changed Original file line number Diff line number Diff line change 1+ ## 0.3.1+7
2+
3+ * Clean up various Android workarounds no longer needed after framework v1.12.
4+
15## 0.3.1+6
26
37* Remove the deprecated ` author: ` field from pubspec.yaml
Original file line number Diff line number Diff line change @@ -32,29 +32,3 @@ android {
3232 disable ' InvalidPackage'
3333 }
3434}
35-
36- // TODO(amirh): Remove this hack once androidx.lifecycle is included on stable. https://github.com/flutter/flutter/issues/42348
37- afterEvaluate {
38- def containsEmbeddingDependencies = false
39- for (def configuration : configurations. all) {
40- for (def dependency : configuration. dependencies) {
41- if (dependency. group == ' io.flutter' &&
42- dependency. name. startsWith(' flutter_embedding' ) &&
43- dependency. isTransitive())
44- {
45- containsEmbeddingDependencies = true
46- break
47- }
48- }
49- }
50- if (! containsEmbeddingDependencies) {
51- android {
52- dependencies {
53- def lifecycle_version = " 1.1.1"
54- compileOnly " android.arch.lifecycle:runtime:$lifecycle_version "
55- compileOnly " android.arch.lifecycle:common:$lifecycle_version "
56- compileOnly " android.arch.lifecycle:common-java8:$lifecycle_version "
57- }
58- }
59- }
60- }
Original file line number Diff line number Diff line change @@ -39,8 +39,7 @@ public static void registerWith(PluginRegistry.Registrar registrar) {
3939
4040 @ Override
4141 public void onAttachedToEngine (FlutterPluginBinding binding ) {
42- onAttachedToEngine (
43- binding .getApplicationContext (), binding .getFlutterEngine ().getDartExecutor ());
42+ onAttachedToEngine (binding .getApplicationContext (), binding .getBinaryMessenger ());
4443 }
4544
4645 private void onAttachedToEngine (Context applicationContext , BinaryMessenger messenger ) {
Original file line number Diff line number Diff line change 66
77import androidx .test .rule .ActivityTestRule ;
88import dev .flutter .plugins .e2e .FlutterRunner ;
9+ import io .flutter .embedding .android .FlutterActivity ;
910import org .junit .Rule ;
1011import org .junit .runner .RunWith ;
1112
1213@ RunWith (FlutterRunner .class )
13- public class MainActivityTest {
14- @ Rule public ActivityTestRule <MainActivity > rule = new ActivityTestRule <>(MainActivity .class );
14+ public class FlutterActivityTest {
15+ @ Rule
16+ public ActivityTestRule <FlutterActivity > rule = new ActivityTestRule <>(FlutterActivity .class );
1517}
Original file line number Diff line number Diff line change 44 <uses-permission android : name =" android.permission.INTERNET" />
55
66 <application android : name =" io.flutter.app.FlutterApplication" android : label =" battery_example" android : icon =" @mipmap/ic_launcher" >
7- <activity android : name =" .MainActivity "
7+ <activity android : name =" io.flutter.embedding.android.FlutterActivity "
88 android : launchMode =" singleTop"
99 android : theme =" @android:style/Theme.Black.NoTitleBar"
1010 android : configChanges =" orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
2222 android : hardwareAccelerated =" true"
2323 android : windowSoftInputMode =" adjustResize" >
2424 </activity >
25+ <meta-data
26+ android : name =" flutterEmbedding"
27+ android : value =" 2" />
2528 </application >
2629</manifest >
Original file line number Diff line number Diff line change 55package io .flutter .plugins .batteryexample ;
66
77import android .os .Bundle ;
8+ import dev .flutter .plugins .e2e .E2EPlugin ;
89import io .flutter .app .FlutterActivity ;
9- import io .flutter .plugins .GeneratedPluginRegistrant ;
10+ import io .flutter .plugins .battery . BatteryPlugin ;
1011
1112public class EmbedderV1Activity extends FlutterActivity {
1213 @ Override
1314 protected void onCreate (Bundle savedInstanceState ) {
1415 super .onCreate (savedInstanceState );
15- GeneratedPluginRegistrant .registerWith (this );
16+ BatteryPlugin .registerWith (registrarFor ("io.flutter.plugins.battery.BatteryPlugin" ));
17+ E2EPlugin .registerWith (registrarFor ("dev.flutter.plugins.e2e.E2EPlugin" ));
1618 }
1719}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: battery
22description : Flutter plugin for accessing information about the battery state
33 (full, charging, discharging) on Android and iOS.
44homepage : https://github.com/flutter/plugins/tree/master/packages/battery
5- version : 0.3.1+6
5+ version : 0.3.1+7
66
77flutter :
88 plugin :
You can’t perform that action at this time.
0 commit comments