Home | History | Annotate | Download | only in widget
      1 /*
      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 
     17 package com.android.internal.widget;
     18 
     19 import android.content.Context;
     20 import android.inputmethodservice.KeyboardView;
     21 import android.util.AttributeSet;
     22 
     23 public class PasswordEntryKeyboardView extends KeyboardView {
     24 
     25     static final int KEYCODE_OPTIONS = -100;
     26     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 
     31     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 
     39     @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 
     50 }
     51