mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-30 15:17:25 +00:00

instead of coding it all in JNI This uses build.rs to compile the java code into bytecode that is then embedded in the binary and loaded at runtime
24 lines
925 B
Java
24 lines
925 B
Java
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
|
|
|
|
import android.view.View;
|
|
import android.content.Context;
|
|
import android.view.inputmethod.InputMethodManager;
|
|
import android.app.Activity;
|
|
|
|
public class SlintAndroidJavaHelper {
|
|
Activity mActivity;
|
|
|
|
public SlintAndroidJavaHelper(Activity activity) {
|
|
this.mActivity = activity;
|
|
}
|
|
public void show_keyboard() {
|
|
InputMethodManager imm = (InputMethodManager)mActivity.getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
imm.showSoftInput(mActivity.getWindow().getDecorView(), 0);
|
|
}
|
|
public void hide_keyboard() {
|
|
InputMethodManager imm = (InputMethodManager)mActivity.getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
imm.hideSoftInputFromWindow(mActivity.getWindow().getDecorView().getWindowToken(), 0);
|
|
}
|
|
|
|
}
|