1 package android.inputmethodservice; 2 3 import android.content.Context; 4 import android.util.AttributeSet; 5 import android.widget.Button; 6 7 /*** 8 * Specialization of {@link Button} that ignores the window not being focused. 9 */ 10 class ExtractButton extends Button { ExtractButton(Context context)11 public ExtractButton(Context context) { 12 super(context, null); 13 } 14 ExtractButton(Context context, AttributeSet attrs)15 public ExtractButton(Context context, AttributeSet attrs) { 16 super(context, attrs, com.android.internal.R.attr.buttonStyle); 17 } 18 ExtractButton(Context context, AttributeSet attrs, int defStyle)19 public ExtractButton(Context context, AttributeSet attrs, int defStyle) { 20 super(context, attrs, defStyle); 21 } 22 23 /** 24 * Pretend like the window this view is in always has focus, so it will 25 * highlight when selected. 26 */ hasWindowFocus()27 @Override public boolean hasWindowFocus() { 28 return this.isEnabled() ? true : false; 29 } 30 } 31