Back to project page minak.
The source code is released under:
GNU General Public License
If you think the Android project minak listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package us.minak; // w w w.j a v a 2s . co m import android.content.Context; import android.util.AttributeSet; import android.widget.Button; import android.widget.RelativeLayout; import android.view.View; import android.view.inputmethod.InputConnection; /** * Represents the container for the drawing space and the two side panels. */ public class IMEView extends RelativeLayout implements InputConnectionGetter { public IMEView(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onFinishInflate() { IMEGestureOverlayView gestureOverlayView = (IMEGestureOverlayView) findViewById(R.id.drawing_space); gestureOverlayView.setInputConnectionGetter(this); final Button backspaceButton = (Button) findViewById(R.id.backspace_btn); backspaceButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { backspace(); } }); } private InputConnectionGetter icGetter = new InputConnectionGetter.NullGetter(); public void setInputConnectionGetter(InputConnectionGetter icGetter) { this.icGetter = icGetter; } @Override public InputConnection getCurrentInputConnection() { return icGetter.getCurrentInputConnection(); } private void backspace() { InputConnection ic = getCurrentInputConnection(); if (ic != null) ic.deleteSurroundingText(1, 0); } }