diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 6c9f35c..e7df0ed 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -1,7 +1,7 @@
-
-
+
+ android:name="io.flutter.embedding.android.NormalTheme"
+ android:resource="@style/NormalTheme"/>
@@ -35,7 +34,7 @@
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
+ android:value="2"/>
-
-
+
+
diff --git a/android/app/src/main/kotlin/com/stormg/lumadrama/MainActivity.kt b/android/app/src/main/kotlin/com/stormg/lumadrama/MainActivity.kt
index 3fc470e..8f25c38 100644
--- a/android/app/src/main/kotlin/com/stormg/lumadrama/MainActivity.kt
+++ b/android/app/src/main/kotlin/com/stormg/lumadrama/MainActivity.kt
@@ -5,22 +5,44 @@ package com.stormg.lumadrama
import android.content.Intent
import android.app.PictureInPictureParams
import android.content.res.Configuration
+import android.graphics.Bitmap
+import android.media.MediaMetadataRetriever
+import android.net.Uri
import android.os.Build
+import android.os.Bundle
+import android.os.Handler
+import android.os.Looper
import android.util.Rational
import android.content.pm.PackageManager
+import android.view.WindowManager
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
+import java.io.ByteArrayOutputStream
+import java.util.concurrent.ExecutorService
+import java.util.concurrent.Executors
+import java.util.concurrent.atomic.AtomicBoolean
class MainActivity : FlutterActivity() {
private val shareRequestCode = 9041
+ private val thumbnailExecutor: ExecutorService = Executors.newSingleThreadExecutor()
+ private val thumbnailHandler = Handler(Looper.getMainLooper())
private var pendingShare: MethodChannel.Result? = null
private var pipChannel: MethodChannel? = null
private var keyboardChannel: MethodChannel? = null
+ private var thumbnailChannel: MethodChannel? = null
private var imeInset = 0
+ override fun onCreate(savedInstanceState: Bundle?) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
+ splashScreen.setOnExitAnimationListener { screen -> screen.remove() }
+ }
+ super.onCreate(savedInstanceState)
+ window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
+ }
+
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
pipChannel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "com.stormg.lumadrama/pip")
@@ -79,6 +101,47 @@ class MainActivity : FlutterActivity() {
emitImeInset(inset)
result.success(inset)
}
+ thumbnailChannel = MethodChannel(
+ flutterEngine.dartExecutor.binaryMessenger,
+ "com.stormg.lumadrama/thumbnail"
+ )
+ thumbnailChannel?.setMethodCallHandler { call, result ->
+ if (call.method != "frame") {
+ result.notImplemented()
+ return@setMethodCallHandler
+ }
+ val timeMs = (call.argument("timeMs"))?.toLong()
+ if (timeMs == null) {
+ result.success(null)
+ return@setMethodCallHandler
+ }
+ val localPath = call.argument("localPath").orEmpty()
+ val remoteUrl = call.argument("url").orEmpty()
+ val rawHeaders = call.argument