Reputation: 431
A long time ago i installed a package which gives me the height of the keyboard on an android device. Eventually the package didn't served well my purpose so i uninstalled it. A few days ago i tried to build my app but i got the following error:
Build file 'C:\Users\odedo\Documents\GitHub\tripper\app\platforms\android\app\build.gradle' line: 598
A problem occurred configuring project ':app'.
Could not GET 'https://dl.bintray.com/crysis21/Android/com/hold1/keyboardheightprovider/0.0.9/keyboardheightprovider-0.0.9.pom'. Received status code 403 from server: Forbidden
Command gradlew.bat failed with exit code 1
Apparently the package is no longer available and i should add this dependency to my code:
implementation 'ro.holdone:keyboardHeightProvider:1.0.3'
My questions are:
Here is the NPM: https://github.com/Crysis21/KeyboardHeightProvider And here is the same question asked here on Stack overflow which didn't helped at all: implementation 'com.hold1:keyboardheightprovider:0.0.9'
I am desperate for a solution... Please help
Upvotes: 0
Views: 201
Reputation: 742
I left a question for you as a comment above for clarifications, but generally dependencies are added to the build.gradle
files; either at the project- or app-level.
I would assume you need to add this dependency at the application-level Gradle file, as it is more usual, so look for the dependencies
portion of the build.gradle
file (usually at the bottom) and add it as such:
android {
...
}
dependencies {
...
implementation 'ro.holdone:keyboardHeightProvider:1.0.3'
}
UPDATE: As an alternative, I would recommend you simply move away from 3rd-party libraries that help you do or find things that Android already provides. There's two main ways I can think you can do this:
You can implement a GlobalLayoutListener
to figure out the total size of the application's layout, and from there deduce the total size that the soft-keyboard is occupying. This answer from a different question sort of explains this process.
The second way you can find out the size of your keyboard is mentioned in the link you shared above, and is by leveraging Android's WindowInsets
APIs from androidx
to get exact measurements you're looking for. I believe this solution may only be available for higher Android version, so choose your weapons wisely!
Upvotes: 1