blob: b37adff291d9c5bcc5996f5e59ba01db9477803e [file] [log] [blame]
Jim Miller0b319702010-02-05 18:51:59 -08001/*
2 * Copyright (C) 2010 Google Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
6 * 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, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16
17package com.android.internal.widget;
18
19import android.content.Context;
Jim Miller0b319702010-02-05 18:51:59 -080020import android.inputmethodservice.KeyboardView;
21import android.util.AttributeSet;
Jim Miller0b319702010-02-05 18:51:59 -080022
23public class PasswordEntryKeyboardView extends KeyboardView {
24
Jim Miller280b6022010-02-09 19:05:02 -080025 static final int KEYCODE_OPTIONS = -100;
Jim Miller0b319702010-02-05 18:51:59 -080026 static final int KEYCODE_SHIFT_LONGPRESS = -101;
27 static final int KEYCODE_VOICE = -102;
28 static final int KEYCODE_F1 = -103;
29 static final int KEYCODE_NEXT_LANGUAGE = -104;
30
Jim Miller0b319702010-02-05 18:51:59 -080031 public PasswordEntryKeyboardView(Context context, AttributeSet attrs) {
32 super(context, attrs);
33 }
34
35 public PasswordEntryKeyboardView(Context context, AttributeSet attrs, int defStyle) {
36 super(context, attrs, defStyle);
37 }
38
Jim Miller6465f772011-01-19 22:01:25 -080039 @Override
40 public boolean setShifted(boolean shifted) {
41 boolean result = super.setShifted(shifted);
42 // invalidate both shift keys
43 int[] indices = getKeyboard().getShiftKeyIndices();
44 for (int index : indices) {
45 invalidateKey(index);
46 }
47 return result;
48 }
49
Jim Miller0b319702010-02-05 18:51:59 -080050}