Skip to content

Commit

Permalink
Merge PR #151 (fix #56)
Browse files Browse the repository at this point in the history
Fix #56
  • Loading branch information
note11g authored Jan 5, 2024
2 parents 097616d + 59a5d2d commit 6bcff30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.note11.flutter_naver_map.flutter_naver_map

import android.app.Activity
import android.content.Context
import dev.note11.flutter_naver_map.flutter_naver_map.sdk.SdkInitializer
import dev.note11.flutter_naver_map.flutter_naver_map.view.NaverMapViewFactory
Expand Down Expand Up @@ -28,14 +29,19 @@ internal class FlutterNaverMapPlugin : FlutterPlugin, ActivityAware {
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) = Unit

override fun onAttachedToActivity(binding: ActivityPluginBinding) {
val activity = binding.activity
val naverMapViewFactory =
NaverMapViewFactory(binding.activity, pluginBinding.binaryMessenger)
NaverMapViewFactory(activity, pluginBinding.binaryMessenger)
correctDisplayOnFlutterNavigatorStackWithActivityBackgroundMode(activity)
pluginBinding.platformViewRegistry.registerViewFactory(
MAP_VIEW_TYPE_ID,
naverMapViewFactory
MAP_VIEW_TYPE_ID, naverMapViewFactory
)
}

private fun correctDisplayOnFlutterNavigatorStackWithActivityBackgroundMode(activity: Activity) {
activity.intent.putExtra("background_mode", "transparent")
}

override fun onDetachedFromActivityForConfigChanges() = Unit

override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) = Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@ package dev.note11.flutter_naver_map.flutter_naver_map_example
import android.os.Bundle
import io.flutter.embedding.android.FlutterActivity

class MainActivity : FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
intent.putExtra("background_mode", "transparent")
super.onCreate(savedInstanceState)
}
}
class MainActivity : FlutterActivity() {}

0 comments on commit 6bcff30

Please sign in to comment.