1717package com.reactnativekeyboardcontroller
1818
1919import android.content.Context
20+ import android.util.Log
2021import androidx.core.graphics.Insets
2122import androidx.core.view.ViewCompat
2223import androidx.core.view.WindowInsetsAnimationCompat
@@ -56,6 +57,7 @@ class TranslateDeferringInsetsAnimationCallback(
5657 dispatchMode : Int = DISPATCH_MODE_STOP ,
5758 val context : ReactApplicationContext ?
5859) : WindowInsetsAnimationCompat.Callback(dispatchMode) {
60+ private val TAG = TranslateDeferringInsetsAnimationCallback ::class .qualifiedName
5961 private var persistentKeyboardHeight = 0
6062
6163 init {
@@ -81,8 +83,8 @@ class TranslateDeferringInsetsAnimationCallback(
8183 params.putInt(" height" , keyboardHeight)
8284 context?.getJSModule(DeviceEventManagerModule .RCTDeviceEventEmitter ::class .java)?.emit(" KeyboardController::" + if (! isKeyboardVisible) " keyboardWillHide" else " keyboardWillShow" , params)
8385
84- println ( " KeyboardController::" + if (! isKeyboardVisible) " keyboardWillHide" else " keyboardWillShow" )
85- println ( " HEIGHT:: " + keyboardHeight)
86+ Log .i( TAG , " KeyboardController::" + if (! isKeyboardVisible) " keyboardWillHide" else " keyboardWillShow" )
87+ Log .i( TAG , " HEIGHT:: $ keyboardHeight" )
8688
8789 return super .onStart(animation, bounds)
8890 }
@@ -95,7 +97,7 @@ class TranslateDeferringInsetsAnimationCallback(
9597 val params: WritableMap = Arguments .createMap()
9698 context?.getJSModule(DeviceEventManagerModule .RCTDeviceEventEmitter ::class .java)?.emit(" KeyboardController::" + if (! isKeyboardVisible) " keyboardDidHide" else " keyboardDidShow" , params)
9799
98- println ( " KeyboardController::" + if (! isKeyboardVisible) " keyboardDidHide" else " keyboardDidShow" )
100+ Log .i( TAG , " KeyboardController::" + if (! isKeyboardVisible) " keyboardDidHide" else " keyboardDidShow" )
99101 }
100102
101103 private fun isKeyboardVisible (): Boolean {
@@ -138,7 +140,7 @@ class TranslateDeferringInsetsAnimationCallback(
138140 } catch (e: ArithmeticException ) {
139141 // do nothing, send progress as 0
140142 }
141- println ( " DiffY: " + diffY + " " + height)
143+ Log .i( TAG , " DiffY: $ diffY $ height" )
142144
143145 context
144146 .getNativeModule(UIManagerModule ::class .java)
0 commit comments