summaryrefslogtreecommitdiffstats
path: root/core/java/android/inputmethodservice/ExtractButton.java
blob: d6fe38d3ea4a4b2502df2acc7ade068e7e69b057 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package android.inputmethodservice;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;

/***
 * Specialization of {@link Button} that ignores the window not being focused.
 */
class ExtractButton extends Button {
    public ExtractButton(Context context) {
        super(context, null);
    }

    public ExtractButton(Context context, AttributeSet attrs) {
        super(context, attrs, com.android.internal.R.attr.buttonStyle);
    }

    public ExtractButton(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }
    
    /**
     * Pretend like the window this view is in always has focus, so it will
     * highlight when selected.
     */
    @Override public boolean hasWindowFocus() {
        return this.isEnabled() ? true : false;
    }
}