MCPcopy Index your code
hub / github.com/AzimoLabs/AndroidKeyboardWatcher

github.com/AzimoLabs/AndroidKeyboardWatcher @v.0.1.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v.0.1.3 ↗ · + Follow
25 symbols 45 edges 6 files 5 documented · 20%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

AndroidKeyboardWatcher

Software keyboard open/close watcher for Android.

Android SDK doesn't provide direct way to track open/close events from software keyboard. This small library does it for you.

AndroidKeyboardWatcher

Usage

Make sure that you use adjustResize windowSoftInputMode in your Acitivty configuration in AndroidManifest.xml:

<activity
    android:name=".MainActivity"
    android:windowSoftInputMode="adjustResize" />

Bind KeyboardWatcher in your Activity.onCreate() method. To prevent memory leaks make sure to unbind it in onDestroy() method.

public class MainActivity extends Activity implements KeyboardWatcher.OnKeyboardToggleListener {
    private KeyboardWatcher keyboardWatcher;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //...
        keyboardWatcher = new KeyboardWatcher(this);
        keyboardWatcher.setListener(this);
    }

    @Override
    protected void onDestroy() {
        keyboardWatcher.destroy();
        super.onDestroy();
    }

    @Override
    public void onKeyboardShown(int keyboardSize) {

    }

    @Override
    public void onKeyboardClosed() {

    }
}

Download

Java code

If you don't want to add another dependency to your project, just copy KeyboardWatcher.java to your source directory.

Library dependency

dependencies {
  compile 'com.azimolabs.keyboardwatcher:keyboardwatcher:0.1.2'
}

License

Copyright (C) 2016 Azimo

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Extension points exported contracts — how you extend this code

OnKeyboardToggleListener (Interface)
(no doc) [1 implementers]
keyboardwatcher/src/main/java/com/azimolabs/keyboardwatcher/KeyboardWatcher.java

Core symbols most depended-on inside this repo

setListener
called by 1
keyboardwatcher/src/main/java/com/azimolabs/keyboardwatcher/KeyboardWatcher.java
destroy
called by 1
keyboardwatcher/src/main/java/com/azimolabs/keyboardwatcher/KeyboardWatcher.java
initialize
called by 1
keyboardwatcher/src/main/java/com/azimolabs/keyboardwatcher/KeyboardWatcher.java
hasAdjustResizeInputMode
called by 1
keyboardwatcher/src/main/java/com/azimolabs/keyboardwatcher/KeyboardWatcher.java
onKeyboardShown
called by 1
keyboardwatcher/src/main/java/com/azimolabs/keyboardwatcher/KeyboardWatcher.java
onKeyboardClosed
called by 1
keyboardwatcher/src/main/java/com/azimolabs/keyboardwatcher/KeyboardWatcher.java
KeyboardWatcher
called by 0
keyboardwatcher/src/main/java/com/azimolabs/keyboardwatcher/KeyboardWatcher.java
onGlobalLayout
called by 0
keyboardwatcher/src/main/java/com/azimolabs/keyboardwatcher/KeyboardWatcher.java

Shape

Method 17
Class 7
Interface 1

Languages

Java100%

Modules by API surface

keyboardwatcher/src/main/java/com/azimolabs/keyboardwatcher/KeyboardWatcher.java12 symbols
sample/src/main/java/com/azimolabs/keyboardwatcher/sample/MainActivity.java5 symbols
sample/src/test/java/com/azimolabs/keyboardwatcher/ExampleUnitTest.java2 symbols
sample/src/androidTest/java/com/azimolabs/keyboardwatcher/ApplicationTest.java2 symbols
keyboardwatcher/src/test/java/com/azimolabs/keyboardwatcher/ExampleUnitTest.java2 symbols
keyboardwatcher/src/androidTest/java/com/azimolabs/keyboardwatcher/ApplicationTest.java2 symbols

For agents

$ claude mcp add AndroidKeyboardWatcher \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact