forked from firka/flutter
Rename native_driver to android_{driver_extensions|engine_test} (#161263)
Towards https://github.com/flutter/flutter/issues/161261 (before I add more tests). This is a 1:1 move, with massaging of `run_flutter_driver_android_tests.dart` to be more automated as tests are added. /cc @reidbaker
This commit is contained in:
14
dev/integration_tests/android_engine_test/android/.gitignore
vendored
Normal file
14
dev/integration_tests/android_engine_test/android/.gitignore
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
gradle-wrapper.jar
|
||||
/.gradle
|
||||
/captures/
|
||||
/gradlew
|
||||
/gradlew.bat
|
||||
/local.properties
|
||||
GeneratedPluginRegistrant.java
|
||||
.cxx/
|
||||
|
||||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/to/reference-keystore
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
||||
@@ -0,0 +1,56 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
plugins {
|
||||
id "com.android.application"
|
||||
id "kotlin-android"
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.android_engine_test"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
|
||||
// Flutter's CI installs the NDK at a non-standard path.
|
||||
// This non-standard structure is initially created by
|
||||
// https://github.com/flutter/engine/blob/3.27.0/tools/android_sdk/create_cipd_packages.sh.
|
||||
String systemNdkPath = System.getenv("ANDROID_NDK_PATH")
|
||||
if (systemNdkPath != null) {
|
||||
ndkVersion = flutter.ndkVersion
|
||||
ndkPath = systemNdkPath
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "com.example.android_engine_test"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
Use of this source code is governed by a BSD-style license that can be
|
||||
found in the LICENSE file. -->
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
@@ -0,0 +1,49 @@
|
||||
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
Use of this source code is governed by a BSD-style license that can be
|
||||
found in the LICENSE file. -->
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application
|
||||
android:label="android_engine_test"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:taskAffinity=""
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
the Android process has started. This theme is visible to the user
|
||||
while the Flutter UI initializes. After that, this theme continues
|
||||
to determine the Window background behind the Flutter UI. -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"
|
||||
/>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
</application>
|
||||
<!-- Required to query activities that can process text, see:
|
||||
https://developer.android.com/training/package-visibility and
|
||||
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
||||
|
||||
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.PROCESS_TEXT"/>
|
||||
<data android:mimeType="text/plain"/>
|
||||
</intent>
|
||||
</queries>
|
||||
</manifest>
|
||||
@@ -0,0 +1,49 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@file:Suppress("PackageName")
|
||||
|
||||
package com.example.android_engine_test
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.WindowInsetsControllerCompat
|
||||
import com.example.android_engine_test.extensions.NativeDriverSupportPlugin
|
||||
import com.example.android_engine_test.fixtures.BlueOrangeGradientPlatformViewFactory
|
||||
import com.example.android_engine_test.fixtures.ChangingColorButtonPlatformViewFactory
|
||||
import com.example.android_engine_test.fixtures.SmileyFaceTexturePlugin
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
import io.flutter.embedding.engine.FlutterEngine
|
||||
|
||||
class MainActivity : FlutterActivity() {
|
||||
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
||||
// Intentionally do not use GeneratedPluginRegistrant.
|
||||
|
||||
flutterEngine
|
||||
.plugins
|
||||
.apply {
|
||||
add(SmileyFaceTexturePlugin())
|
||||
add(NativeDriverSupportPlugin())
|
||||
}
|
||||
|
||||
flutterEngine
|
||||
.platformViewsController
|
||||
.registry
|
||||
.apply {
|
||||
registerViewFactory("blue_orange_gradient_platform_view", BlueOrangeGradientPlatformViewFactory())
|
||||
registerViewFactory("changing_color_button_platform_view", ChangingColorButtonPlatformViewFactory())
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
// https://developer.android.com/training/system-ui
|
||||
val windowInsetsController = WindowCompat.getInsetsController(window, window.decorView)
|
||||
windowInsetsController.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
||||
windowInsetsController.hide(WindowInsetsCompat.Type.systemBars())
|
||||
actionBar?.hide()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@file:Suppress("PackageName")
|
||||
|
||||
package com.example.android_engine_test.extensions
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.SystemClock
|
||||
import android.view.MotionEvent
|
||||
import io.flutter.Log
|
||||
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
|
||||
|
||||
class NativeDriverSupportPlugin :
|
||||
ActivityAware,
|
||||
FlutterPlugin,
|
||||
MethodCallHandler {
|
||||
private val tag = "NativeDriverSupportPlugin"
|
||||
private lateinit var channel: MethodChannel
|
||||
private var activity: Activity? = null
|
||||
|
||||
override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
channel = MethodChannel(binding.binaryMessenger, "native_driver")
|
||||
channel.setMethodCallHandler(this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
channel.setMethodCallHandler(null)
|
||||
}
|
||||
|
||||
override fun onMethodCall(
|
||||
call: MethodCall,
|
||||
result: MethodChannel.Result
|
||||
) {
|
||||
val activity = this.activity
|
||||
if (activity == null) {
|
||||
Log.w(tag, "Received method channel, but no current activity")
|
||||
return
|
||||
}
|
||||
when (call.method) {
|
||||
"ping" -> {
|
||||
result.success(null)
|
||||
}
|
||||
"tap_view" -> {
|
||||
// Decode the selector.
|
||||
val kind = call.argument<String>("kind")
|
||||
lateinit var selector: NativeSelector
|
||||
when (kind) {
|
||||
"byNativeAccessibilityLabel" -> {
|
||||
selector = NativeSelector.ByContentDescription(call.argument("label")!!)
|
||||
}
|
||||
"byNativeIntegerId" -> {
|
||||
selector = NativeSelector.ByViewId(call.argument("id")!!)
|
||||
}
|
||||
else -> {
|
||||
result.error("INVALID_SELECTOR", "Not supported", kind)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Fail if not found.
|
||||
val found = selector.find(activity.window.decorView.rootView)
|
||||
if (found == null) {
|
||||
result.error("VIEW_NOT_FOUND", "No view was found", call.arguments())
|
||||
return
|
||||
}
|
||||
|
||||
// Send tap event.
|
||||
val x = found.x + found.width / 2
|
||||
val y = found.y + found.height / 2
|
||||
val downTime = SystemClock.uptimeMillis()
|
||||
|
||||
val pressDown = MotionEvent.obtain(downTime, downTime, MotionEvent.ACTION_DOWN, x, y, 0)
|
||||
found.dispatchTouchEvent(pressDown)
|
||||
pressDown.recycle()
|
||||
|
||||
val pressUp = MotionEvent.obtain(downTime, downTime, MotionEvent.ACTION_UP, x, y, 0)
|
||||
found.dispatchTouchEvent(pressUp)
|
||||
pressUp.recycle()
|
||||
result.success(null)
|
||||
}
|
||||
else -> {
|
||||
result.notImplemented()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
|
||||
activity = binding.activity
|
||||
}
|
||||
|
||||
override fun onDetachedFromActivityForConfigChanges() {
|
||||
activity = null
|
||||
}
|
||||
|
||||
override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {
|
||||
activity = binding.activity
|
||||
}
|
||||
|
||||
override fun onDetachedFromActivity() {
|
||||
activity = null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@file:Suppress("PackageName")
|
||||
|
||||
package com.example.android_engine_test.extensions
|
||||
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.children
|
||||
|
||||
// / Finds a native view using serialized data provided by a driver script.
|
||||
sealed class NativeSelector {
|
||||
// / Finds a native view by a {@code contentDescription} attribute.
|
||||
data class ByContentDescription(
|
||||
val contentDescription: String
|
||||
) : NativeSelector() {
|
||||
override fun find(root: View): View? {
|
||||
val found = ArrayList<View>()
|
||||
findRecursive(root, found)
|
||||
if (found.isEmpty()) {
|
||||
return null
|
||||
}
|
||||
if (found.size > 1) {
|
||||
throw IllegalStateException("Expected a single matching view, got ${found.size}")
|
||||
}
|
||||
return found[0]
|
||||
}
|
||||
|
||||
private fun findRecursive(
|
||||
parent: View,
|
||||
found: ArrayList<View>
|
||||
) {
|
||||
if (contentDescription == parent.contentDescription) {
|
||||
found.add(parent)
|
||||
}
|
||||
if (parent is ViewGroup) {
|
||||
for (child in parent.children) {
|
||||
findRecursive(child, found)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// / Finds a native view by a {@code id} attribute.
|
||||
data class ByViewId(
|
||||
val id: Int
|
||||
) : NativeSelector() {
|
||||
override fun find(root: View): View? = root.findViewById(id)
|
||||
}
|
||||
|
||||
// / Given a root view, returns the only view that matches this selector.
|
||||
// /
|
||||
// / If no view is found, returns null.
|
||||
abstract fun find(root: View): View?
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@file:Suppress("PackageName")
|
||||
|
||||
package com.example.android_engine_test.fixtures
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.graphics.LinearGradient
|
||||
import android.graphics.Paint
|
||||
import android.graphics.Shader
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import io.flutter.plugin.platform.PlatformView
|
||||
import io.flutter.plugin.platform.PlatformViewFactory
|
||||
|
||||
class BlueOrangeGradientPlatformViewFactory : PlatformViewFactory(null) {
|
||||
override fun create(
|
||||
context: Context,
|
||||
viewId: Int,
|
||||
args: Any?
|
||||
): PlatformView = GradientPlatformView(context)
|
||||
}
|
||||
|
||||
private class GradientPlatformView(
|
||||
context: Context
|
||||
) : View(context),
|
||||
PlatformView {
|
||||
val paint = Paint()
|
||||
|
||||
init {
|
||||
layoutParams =
|
||||
ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
}
|
||||
|
||||
override fun getView(): View = this
|
||||
|
||||
override fun dispose() {}
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
canvas.drawRect(0f, 0f, width.toFloat(), height.toFloat(), paint)
|
||||
super.onDraw(canvas)
|
||||
}
|
||||
|
||||
override fun onSizeChanged(
|
||||
w: Int,
|
||||
h: Int,
|
||||
oldw: Int,
|
||||
oldh: Int
|
||||
) {
|
||||
paint.shader =
|
||||
LinearGradient(
|
||||
0f,
|
||||
0f,
|
||||
w.toFloat(),
|
||||
h.toFloat(),
|
||||
intArrayOf(
|
||||
Color.rgb(0x41, 0x69, 0xE1),
|
||||
Color.rgb(0xFF, 0xA5, 0x00)
|
||||
),
|
||||
null,
|
||||
Shader.TileMode.CLAMP
|
||||
)
|
||||
super.onSizeChanged(w, h, oldw, oldh)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@file:Suppress("PackageName")
|
||||
|
||||
package com.example.android_engine_test.fixtures
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.graphics.Paint
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import io.flutter.plugin.platform.PlatformView
|
||||
import io.flutter.plugin.platform.PlatformViewFactory
|
||||
|
||||
class ChangingColorButtonPlatformViewFactory : PlatformViewFactory(null) {
|
||||
override fun create(
|
||||
context: Context,
|
||||
viewId: Int,
|
||||
args: Any?
|
||||
): PlatformView = ChangingColorButtonPlatformView(context)
|
||||
}
|
||||
|
||||
private class ChangingColorButtonPlatformView(
|
||||
context: Context
|
||||
) : View(context),
|
||||
PlatformView {
|
||||
private val paintRed =
|
||||
Paint().apply {
|
||||
color = Color.RED
|
||||
style = Paint.Style.FILL
|
||||
}
|
||||
private val paintBlue =
|
||||
Paint().apply {
|
||||
color = Color.BLUE
|
||||
style = Paint.Style.FILL
|
||||
}
|
||||
|
||||
private var isBlue = false
|
||||
|
||||
init {
|
||||
layoutParams =
|
||||
ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
|
||||
contentDescription = "Change color"
|
||||
|
||||
setOnClickListener {
|
||||
run {
|
||||
isBlue = !isBlue
|
||||
invalidate() // Force a redraw
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getView(): View = this
|
||||
|
||||
override fun dispose() {}
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
super.onDraw(canvas)
|
||||
canvas.drawRect(0f, 0f, width.toFloat(), height.toFloat(), if (isBlue) paintBlue else paintRed)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@file:Suppress("PackageName")
|
||||
|
||||
package com.example.android_engine_test.fixtures
|
||||
|
||||
import android.graphics.Color
|
||||
import android.graphics.Paint
|
||||
import android.os.Build
|
||||
import android.view.Surface
|
||||
import io.flutter.Log
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding
|
||||
import io.flutter.plugin.common.MethodCall
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
|
||||
import io.flutter.view.TextureRegistry.SurfaceProducer
|
||||
|
||||
class SmileyFaceTexturePlugin :
|
||||
FlutterPlugin,
|
||||
MethodCallHandler,
|
||||
SurfaceProducer.Callback {
|
||||
private val tag = "SmileyFaceTexturePlugin"
|
||||
private lateinit var channel: MethodChannel
|
||||
private lateinit var binding: FlutterPluginBinding
|
||||
private lateinit var producer: SurfaceProducer
|
||||
|
||||
private var surface: Surface? = null
|
||||
|
||||
override fun onAttachedToEngine(binding: FlutterPluginBinding) {
|
||||
this.binding = binding
|
||||
channel = MethodChannel(binding.binaryMessenger, "smiley_face_texture")
|
||||
channel.setMethodCallHandler(this)
|
||||
producer = binding.textureRegistry.createSurfaceProducer()
|
||||
producer.setCallback(this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(binding: FlutterPluginBinding) {
|
||||
channel.setMethodCallHandler(null)
|
||||
producer.release()
|
||||
}
|
||||
|
||||
override fun onMethodCall(
|
||||
call: MethodCall,
|
||||
result: MethodChannel.Result
|
||||
) {
|
||||
if (call.method == "initTexture") {
|
||||
val height = call.argument<Int>("height") ?: 1
|
||||
val width = call.argument<Int>("width") ?: 1
|
||||
producer.setSize(width, height)
|
||||
result.success(updateTexture())
|
||||
} else {
|
||||
result.notImplemented()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateTexture(): Long {
|
||||
var surface = this.surface
|
||||
if (surface == null) {
|
||||
surface = producer.surface
|
||||
this.surface = surface
|
||||
}
|
||||
drawOnSurface(producer.surface)
|
||||
return producer.id()
|
||||
}
|
||||
|
||||
private fun drawOnSurface(surface: Surface) {
|
||||
val canvas =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
surface.lockHardwareCanvas()
|
||||
} else {
|
||||
surface.lockCanvas(null)
|
||||
}
|
||||
|
||||
// Yellow background
|
||||
canvas.drawRGB(255, 230, 15)
|
||||
|
||||
val paint = Paint()
|
||||
paint.style = Paint.Style.FILL
|
||||
|
||||
// Black eyes
|
||||
paint.color = Color.BLACK
|
||||
canvas.drawRect(200f, 200f, 250f, 250f, paint) // Left eye
|
||||
canvas.drawRect(400f, 200f, 450f, 250f, paint) // Right eye
|
||||
|
||||
// Black mouth
|
||||
paint.color = Color.BLACK
|
||||
canvas.drawRect(250f, 400f, 400f, 420f, paint) // Simple mouth
|
||||
|
||||
surface.unlockCanvasAndPost(canvas)
|
||||
}
|
||||
|
||||
override fun onSurfaceCreated() {
|
||||
Log.i(tag, "onSurfaceCreated()")
|
||||
updateTexture()
|
||||
}
|
||||
|
||||
override fun onSurfaceDestroyed() {
|
||||
Log.i(tag, "onSurfaceDestroyed()")
|
||||
surface?.release()
|
||||
surface = null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
Use of this source code is governed by a BSD-style license that can be
|
||||
found in the LICENSE file. -->
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="?android:colorBackground" />
|
||||
</layer-list>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
Use of this source code is governed by a BSD-style license that can be
|
||||
found in the LICENSE file. -->
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@android:color/white" />
|
||||
</layer-list>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 544 B |
Binary file not shown.
|
After Width: | Height: | Size: 442 B |
Binary file not shown.
|
After Width: | Height: | Size: 721 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
Use of this source code is governed by a BSD-style license that can be
|
||||
found in the LICENSE file. -->
|
||||
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
Use of this source code is governed by a BSD-style license that can be
|
||||
found in the LICENSE file. -->
|
||||
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
Use of this source code is governed by a BSD-style license that can be
|
||||
found in the LICENSE file. -->
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
@@ -0,0 +1,22 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.layout.buildDirectory.value(rootProject.layout.buildDirectory.dir("../../build").get())
|
||||
subprojects {
|
||||
project.layout.buildDirectory.value(rootProject.layout.buildDirectory.dir(project.name).get())
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.layout.buildDirectory
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
5
dev/integration_tests/android_engine_test/android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
5
dev/integration_tests/android_engine_test/android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
|
||||
@@ -0,0 +1,29 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
pluginManagement {
|
||||
def flutterSdkPath = {
|
||||
def properties = new Properties()
|
||||
file("local.properties").withInputStream { properties.load(it) }
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
return flutterSdkPath
|
||||
}()
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version "8.1.0" apply false
|
||||
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
|
||||
}
|
||||
|
||||
include ":app"
|
||||
Reference in New Issue
Block a user