Minor fixes

This commit is contained in:
hajdam
2025-10-29 01:06:58 +01:00
parent 1488bc7276
commit 74a1a7778e
3 changed files with 56 additions and 2 deletions
@@ -24,7 +24,6 @@ import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.BaseInputConnection;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.widget.RelativeLayout;
@@ -311,6 +310,9 @@ public abstract class CodeAreaCore extends ViewGroup implements CodeAreaControl
@Nonnull
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
return new BaseInputConnection(this, true);
outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
outAttrs.inputType = EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
return new CodeAreaInputConnection(this, true);
}
}
@@ -0,0 +1,51 @@
/*
* Copyright (C) ExBin Project
*
* 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
*
* https://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.
*/
package org.exbin.bined.android;
import android.view.KeyEvent;
import android.view.inputmethod.BaseInputConnection;
import javax.annotation.ParametersAreNonnullByDefault;
/**
* Binary viewer/editor component input connection.
*
* @author ExBin Project (https://exbin.org)
*/
@ParametersAreNonnullByDefault
public class CodeAreaInputConnection extends BaseInputConnection {
protected final CodeAreaCore codeArea;
public CodeAreaInputConnection(CodeAreaCore codeArea, boolean fullEditor) {
super(codeArea, fullEditor);
this.codeArea = codeArea;
}
@Override
public boolean commitText(CharSequence text, int newCursorPosition) {
for (int i = 0; i < text.length(); i++) {
codeArea.getCommandHandler().keyTyped(text.charAt(i), new KeyEvent(KeyEvent.ACTION_DOWN, text.charAt(i)));
}
return true;
}
@Override
public boolean sendKeyEvent(KeyEvent keyEvent) {
codeArea.dispatchKeyEvent(keyEvent);
return true;
}
}
+1
View File
@@ -1,5 +1,6 @@
0.2.9
- Added edit selection dialog
- Bug fixes
0.2.8 (2025-10-18)
- Added go-to dialog / go-to relative position