ImageButton.java revision 54b6cfa9a9e5b861a9930af873580d6dc20f773c
1/*
2 * Copyright (C) 2007 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.widget;
18
19import android.content.Context;
20import android.os.Handler;
21import android.os.Message;
22import android.util.AttributeSet;
23import android.view.MotionEvent;
24
25import java.util.Map;
26
27/**
28 * <p>
29 * An image button displays an image that can be pressed, or clicked, by the
30 * user.
31 * </p>
32 *
33 * <p><strong>XML attributes</strong></p>
34 * <p>
35 * See {@link android.R.styleable#ImageView Button Attributes},
36 * {@link android.R.styleable#View View Attributes}
37 * </p>
38 */
39public class ImageButton extends ImageView {
40    public ImageButton(Context context) {
41        this(context, null);
42    }
43
44    public ImageButton(Context context, AttributeSet attrs) {
45        this(context, attrs, com.android.internal.R.attr.imageButtonStyle);
46    }
47
48    public ImageButton(Context context, AttributeSet attrs, int defStyle) {
49        super(context, attrs, defStyle);
50        setFocusable(true);
51    }
52
53    @Override
54    protected boolean onSetAlpha(int alpha) {
55        return false;
56    }
57}
58