mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 08:46:18 +01:00
Refactor: update variable naming
This commit is contained in:
parent
865f22a682
commit
53802f0211
6 changed files with 44 additions and 44 deletions
|
@ -19,28 +19,28 @@ class NpPlatformImageProcessorPlugin : FlutterPlugin {
|
|||
override fun onAttachedToEngine(
|
||||
@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding
|
||||
) {
|
||||
val imageProcessorHandler = ImageProcessorChannelHandler(
|
||||
val handler = ImageProcessorChannelHandler(
|
||||
flutterPluginBinding.applicationContext
|
||||
)
|
||||
imageProcessorEventChannel = EventChannel(
|
||||
eventChannel = EventChannel(
|
||||
flutterPluginBinding.binaryMessenger,
|
||||
ImageProcessorChannelHandler.EVENT_CHANNEL
|
||||
)
|
||||
imageProcessorEventChannel.setStreamHandler(imageProcessorHandler)
|
||||
imageProcessorMethodChannel = MethodChannel(
|
||||
eventChannel.setStreamHandler(handler)
|
||||
methodChannel = MethodChannel(
|
||||
flutterPluginBinding.binaryMessenger,
|
||||
ImageProcessorChannelHandler.METHOD_CHANNEL
|
||||
)
|
||||
imageProcessorMethodChannel.setMethodCallHandler(imageProcessorHandler)
|
||||
methodChannel.setMethodCallHandler(handler)
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(
|
||||
@NonNull binding: FlutterPlugin.FlutterPluginBinding
|
||||
) {
|
||||
imageProcessorEventChannel.setStreamHandler(null)
|
||||
imageProcessorMethodChannel.setMethodCallHandler(null)
|
||||
eventChannel.setStreamHandler(null)
|
||||
methodChannel.setMethodCallHandler(null)
|
||||
}
|
||||
|
||||
private lateinit var imageProcessorMethodChannel: MethodChannel
|
||||
private lateinit var imageProcessorEventChannel: EventChannel
|
||||
private lateinit var methodChannel: MethodChannel
|
||||
private lateinit var eventChannel: EventChannel
|
||||
}
|
||||
|
|
|
@ -8,20 +8,20 @@ class NpPlatformLockPlugin : FlutterPlugin {
|
|||
override fun onAttachedToEngine(
|
||||
@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding
|
||||
) {
|
||||
lockChannelHandler = LockChannelHandler()
|
||||
lockChannel = MethodChannel(
|
||||
handler = LockChannelHandler()
|
||||
methodChannel = MethodChannel(
|
||||
flutterPluginBinding.binaryMessenger, LockChannelHandler.CHANNEL
|
||||
)
|
||||
lockChannel.setMethodCallHandler(lockChannelHandler)
|
||||
methodChannel.setMethodCallHandler(handler)
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(
|
||||
@NonNull binding: FlutterPlugin.FlutterPluginBinding
|
||||
) {
|
||||
lockChannelHandler.dismiss()
|
||||
lockChannel.setMethodCallHandler(null)
|
||||
handler.dismiss()
|
||||
methodChannel.setMethodCallHandler(null)
|
||||
}
|
||||
|
||||
private lateinit var lockChannel: MethodChannel
|
||||
private lateinit var lockChannelHandler: LockChannelHandler
|
||||
private lateinit var methodChannel: MethodChannel
|
||||
private lateinit var handler: LockChannelHandler
|
||||
}
|
||||
|
|
|
@ -8,19 +8,19 @@ class NpPlatformLogPlugin : FlutterPlugin {
|
|||
override fun onAttachedToEngine(
|
||||
@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding
|
||||
) {
|
||||
val logcatChannelHandler = LogcatChannelHandler()
|
||||
logcatMethodChannel = MethodChannel(
|
||||
val handler = LogcatChannelHandler()
|
||||
methodChannel = MethodChannel(
|
||||
flutterPluginBinding.binaryMessenger,
|
||||
LogcatChannelHandler.METHOD_CHANNEL
|
||||
)
|
||||
logcatMethodChannel.setMethodCallHandler(logcatChannelHandler)
|
||||
methodChannel.setMethodCallHandler(handler)
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(
|
||||
@NonNull binding: FlutterPlugin.FlutterPluginBinding
|
||||
) {
|
||||
logcatMethodChannel.setMethodCallHandler(null)
|
||||
methodChannel.setMethodCallHandler(null)
|
||||
}
|
||||
|
||||
private lateinit var logcatMethodChannel: MethodChannel
|
||||
private lateinit var methodChannel: MethodChannel
|
||||
}
|
||||
|
|
|
@ -9,17 +9,17 @@ class NpPlatformMessageRelayPlugin : FlutterPlugin {
|
|||
override fun onAttachedToEngine(
|
||||
@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding
|
||||
) {
|
||||
val messageRelayHandler = MessageRelayChannelHandler()
|
||||
val handler = MessageRelayChannelHandler()
|
||||
eventChannel = EventChannel(
|
||||
flutterPluginBinding.binaryMessenger,
|
||||
MessageRelayChannelHandler.EVENT_CHANNEL
|
||||
)
|
||||
eventChannel.setStreamHandler(messageRelayHandler)
|
||||
eventChannel.setStreamHandler(handler)
|
||||
methodChannel = MethodChannel(
|
||||
flutterPluginBinding.binaryMessenger,
|
||||
MessageRelayChannelHandler.METHOD_CHANNEL
|
||||
)
|
||||
methodChannel.setMethodCallHandler(messageRelayHandler)
|
||||
methodChannel.setMethodCallHandler(handler)
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(
|
||||
|
|
|
@ -19,29 +19,29 @@ class NpPlatformPermissionPlugin : FlutterPlugin, ActivityAware,
|
|||
override fun onAttachedToEngine(
|
||||
@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding
|
||||
) {
|
||||
permissionChannelHandler =
|
||||
handler =
|
||||
PermissionChannelHandler(flutterPluginBinding.applicationContext)
|
||||
permissionChannel = EventChannel(
|
||||
eventChannel = EventChannel(
|
||||
flutterPluginBinding.binaryMessenger,
|
||||
PermissionChannelHandler.EVENT_CHANNEL
|
||||
)
|
||||
permissionChannel.setStreamHandler(permissionChannelHandler)
|
||||
permissionMethodChannel = MethodChannel(
|
||||
eventChannel.setStreamHandler(handler)
|
||||
methodChannel = MethodChannel(
|
||||
flutterPluginBinding.binaryMessenger,
|
||||
PermissionChannelHandler.METHOD_CHANNEL
|
||||
)
|
||||
permissionMethodChannel.setMethodCallHandler(permissionChannelHandler)
|
||||
methodChannel.setMethodCallHandler(handler)
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(
|
||||
@NonNull binding: FlutterPlugin.FlutterPluginBinding
|
||||
) {
|
||||
permissionChannel.setStreamHandler(null)
|
||||
permissionMethodChannel.setMethodCallHandler(null)
|
||||
eventChannel.setStreamHandler(null)
|
||||
methodChannel.setMethodCallHandler(null)
|
||||
}
|
||||
|
||||
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
|
||||
permissionChannelHandler.onAttachedToActivity(binding)
|
||||
handler.onAttachedToActivity(binding)
|
||||
pluginBinding = binding
|
||||
binding.addRequestPermissionsResultListener(this)
|
||||
}
|
||||
|
@ -49,18 +49,18 @@ class NpPlatformPermissionPlugin : FlutterPlugin, ActivityAware,
|
|||
override fun onReattachedToActivityForConfigChanges(
|
||||
binding: ActivityPluginBinding
|
||||
) {
|
||||
permissionChannelHandler.onReattachedToActivityForConfigChanges(binding)
|
||||
handler.onReattachedToActivityForConfigChanges(binding)
|
||||
pluginBinding = binding
|
||||
binding.addRequestPermissionsResultListener(this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromActivity() {
|
||||
permissionChannelHandler.onDetachedFromActivity()
|
||||
handler.onDetachedFromActivity()
|
||||
pluginBinding?.removeRequestPermissionsResultListener(this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromActivityForConfigChanges() {
|
||||
permissionChannelHandler.onDetachedFromActivityForConfigChanges()
|
||||
handler.onDetachedFromActivityForConfigChanges()
|
||||
pluginBinding?.removeRequestPermissionsResultListener(this)
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ class NpPlatformPermissionPlugin : FlutterPlugin, ActivityAware,
|
|||
return try {
|
||||
when (requestCode) {
|
||||
PermissionUtil.REQUEST_CODE -> {
|
||||
permissionChannelHandler.onRequestPermissionsResult(
|
||||
handler.onRequestPermissionsResult(
|
||||
requestCode, permissions, grantResults
|
||||
)
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ class NpPlatformPermissionPlugin : FlutterPlugin, ActivityAware,
|
|||
|
||||
private var pluginBinding: ActivityPluginBinding? = null
|
||||
|
||||
private lateinit var permissionChannel: EventChannel
|
||||
private lateinit var permissionMethodChannel: MethodChannel
|
||||
private lateinit var permissionChannelHandler: PermissionChannelHandler
|
||||
private lateinit var eventChannel: EventChannel
|
||||
private lateinit var methodChannel: MethodChannel
|
||||
private lateinit var handler: PermissionChannelHandler
|
||||
}
|
||||
|
|
|
@ -8,20 +8,20 @@ class NpPlatformRawImagePlugin : FlutterPlugin {
|
|||
override fun onAttachedToEngine(
|
||||
@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding
|
||||
) {
|
||||
val imageLoaderChannelHandler =
|
||||
val handler =
|
||||
ImageLoaderChannelHandler(flutterPluginBinding.applicationContext)
|
||||
imageLoaderMethodChannel = MethodChannel(
|
||||
methodChannel = MethodChannel(
|
||||
flutterPluginBinding.binaryMessenger,
|
||||
ImageLoaderChannelHandler.METHOD_CHANNEL
|
||||
)
|
||||
imageLoaderMethodChannel.setMethodCallHandler(imageLoaderChannelHandler)
|
||||
methodChannel.setMethodCallHandler(handler)
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(
|
||||
@NonNull binding: FlutterPlugin.FlutterPluginBinding
|
||||
) {
|
||||
imageLoaderMethodChannel.setMethodCallHandler(null)
|
||||
methodChannel.setMethodCallHandler(null)
|
||||
}
|
||||
|
||||
private lateinit var imageLoaderMethodChannel: MethodChannel
|
||||
private lateinit var methodChannel: MethodChannel
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue