mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 00:15:32 +00:00
chore: add intent to broadcast font name
This commit is contained in:
parent
4b7829f978
commit
3264557bef
1 changed files with 17 additions and 0 deletions
|
|
@ -35,6 +35,7 @@ import android.view.inputmethod.ExtractedText;
|
|||
import android.view.inputmethod.ExtractedTextRequest;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
import android.widget.FrameLayout;
|
||||
import android.content.Intent;
|
||||
|
||||
import io.sentry.android.core.SentryAndroid;
|
||||
import io.sentry.Sentry;
|
||||
|
|
@ -139,6 +140,17 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven
|
|||
KMManager.updateSelectionRange(KMManager.KeyboardType.KEYBOARD_TYPE_SYSTEM);
|
||||
}
|
||||
|
||||
private void sendCurrentFontName() {
|
||||
Keyboard keyboardInfo = KMManager.getCurrentKeyboardInfo(this);
|
||||
if (keyboardInfo != null) {
|
||||
String fontName = keyboardInfo.getFont();
|
||||
|
||||
Intent intent = new Intent("com.keyman.android.keyboard_changed");
|
||||
intent.putExtra("fontName", fontName);
|
||||
sendBroadcast(intent);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the main point where we do our initialization of the input method
|
||||
* to begin operating on an application. At this point we have been
|
||||
|
|
@ -197,6 +209,10 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven
|
|||
if (KMManager.isNumericField(inputType)) {
|
||||
KMManager.setNumericLayer(KeyboardType.KEYBOARD_TYPE_SYSTEM);
|
||||
}
|
||||
|
||||
if (KMManager.isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM)) {
|
||||
sendCurrentFontName();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -264,6 +280,7 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven
|
|||
@Override
|
||||
public void onKeyboardChanged(String newKeyboard) {
|
||||
KMManager.showSystemKeyboard();
|
||||
sendCurrentFontName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue