Android Open Source - minak I M E View






From Project

Back to project page minak.

License

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.

Java Source Code

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);
  }
}




Java Source Code List

us.minak.IMEGestureOverlayView.java
us.minak.IMEModifier.java
us.minak.IMEModifiers.java
us.minak.IMEService.java
us.minak.IMEView.java
us.minak.InputConnectionGetter.java
us.minak.SettingsActivity.java
us.minak.SettingsCreateGestureActivity.java
us.minak.SettingsUtil.java