Skip to content

Commit bba5289

Browse files
authored
[RNKC-039] - println to Log (#10)
1 parent fe9c47f commit bba5289

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

android/src/main/java/com/reactnativekeyboardcontroller/TranslateDeferringInsetsAnimationCallback.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.reactnativekeyboardcontroller
1818

1919
import android.content.Context
20+
import android.util.Log
2021
import androidx.core.graphics.Insets
2122
import androidx.core.view.ViewCompat
2223
import 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

Comments
 (0)