Kevin Chyn | 6cf54e8 | 2018-09-18 19:13:27 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2018 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 | |
| 17 | package com.android.systemui.biometrics; |
| 18 | |
| 19 | import android.content.Context; |
| 20 | import android.graphics.drawable.Drawable; |
| 21 | import android.widget.ImageView; |
| 22 | |
| 23 | import com.android.systemui.R; |
| 24 | |
| 25 | /** |
| 26 | * This class loads the view for the system-provided dialog. The view consists of: |
| 27 | * Application Icon, Title, Subtitle, Description, Fingerprint Icon, Error/Help message area, |
| 28 | * and positive/negative buttons. |
| 29 | */ |
| 30 | public class FaceDialogView extends BiometricDialogView { |
| 31 | public FaceDialogView(Context context, |
| 32 | DialogViewCallback callback) { |
| 33 | super(context, callback); |
| 34 | } |
| 35 | |
| 36 | @Override |
| 37 | protected int getHintStringResourceId() { |
| 38 | return R.string.face_dialog_looking_for_face; |
| 39 | } |
| 40 | |
| 41 | @Override |
| 42 | protected int getAuthenticatedAccessibilityResourceId() { |
| 43 | if (mRequireConfirmation) { |
| 44 | return com.android.internal.R.string.face_authenticated_confirmation_required; |
| 45 | } else { |
| 46 | return com.android.internal.R.string.face_authenticated_no_confirmation_required; |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | @Override |
| 51 | protected int getIconDescriptionResourceId() { |
| 52 | return R.string.accessibility_face_dialog_face_icon; |
| 53 | } |
| 54 | |
| 55 | @Override |
| 56 | protected void updateIcon(int lastState, int newState) { |
| 57 | Drawable icon = mContext.getDrawable(R.drawable.face_dialog_icon); |
| 58 | |
| 59 | final ImageView faceIcon = getLayout().findViewById(R.id.biometric_icon); |
| 60 | faceIcon.setImageDrawable(icon); |
| 61 | } |
| 62 | } |