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
+
1
5
## 0.3.1+6
2
6
3
7
* Remove the deprecated ` author: ` field from pubspec.yaml
Original file line number Diff line number Diff line change @@ -32,29 +32,3 @@ android {
32
32
disable ' InvalidPackage'
33
33
}
34
34
}
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) {
39
39
40
40
@ Override
41
41
public void onAttachedToEngine (FlutterPluginBinding binding ) {
42
- onAttachedToEngine (
43
- binding .getApplicationContext (), binding .getFlutterEngine ().getDartExecutor ());
42
+ onAttachedToEngine (binding .getApplicationContext (), binding .getBinaryMessenger ());
44
43
}
45
44
46
45
private void onAttachedToEngine (Context applicationContext , BinaryMessenger messenger ) {
Original file line number Diff line number Diff line change 6
6
7
7
import androidx .test .rule .ActivityTestRule ;
8
8
import dev .flutter .plugins .e2e .FlutterRunner ;
9
+ import io .flutter .embedding .android .FlutterActivity ;
9
10
import org .junit .Rule ;
10
11
import org .junit .runner .RunWith ;
11
12
12
13
@ 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 );
15
17
}
Original file line number Diff line number Diff line change 4
4
<uses-permission android : name =" android.permission.INTERNET" />
5
5
6
6
<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 "
8
8
android : launchMode =" singleTop"
9
9
android : theme =" @android:style/Theme.Black.NoTitleBar"
10
10
android : configChanges =" orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
22
22
android : hardwareAccelerated =" true"
23
23
android : windowSoftInputMode =" adjustResize" >
24
24
</activity >
25
+ <meta-data
26
+ android : name =" flutterEmbedding"
27
+ android : value =" 2" />
25
28
</application >
26
29
</manifest >
Original file line number Diff line number Diff line change 5
5
package io .flutter .plugins .batteryexample ;
6
6
7
7
import android .os .Bundle ;
8
+ import dev .flutter .plugins .e2e .E2EPlugin ;
8
9
import io .flutter .app .FlutterActivity ;
9
- import io .flutter .plugins .GeneratedPluginRegistrant ;
10
+ import io .flutter .plugins .battery . BatteryPlugin ;
10
11
11
12
public class EmbedderV1Activity extends FlutterActivity {
12
13
@ Override
13
14
protected void onCreate (Bundle savedInstanceState ) {
14
15
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" ));
16
18
}
17
19
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: battery
2
2
description : Flutter plugin for accessing information about the battery state
3
3
(full, charging, discharging) on Android and iOS.
4
4
homepage : https://github.com/flutter/plugins/tree/master/packages/battery
5
- version : 0.3.1+6
5
+ version : 0.3.1+7
6
6
7
7
flutter :
8
8
plugin :
You can’t perform that action at this time.
0 commit comments