Skip to content

Commit b69e261

Browse files
TreeHugger RobotAndroid (Google) Code Review
authored andcommitted
Merge "DO NOT MERGE Remove focus on PasswordTextView" into rvc-qpr-dev
2 parents 5fc03a1 + 1a96556 commit b69e261

3 files changed

Lines changed: 46 additions & 2 deletions

File tree

packages/CarSystemUI/res-keyguard/layout-land/keyguard_pin_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
android:gravity="center"
5656
android:orientation="vertical">
5757

58-
<com.android.keyguard.PasswordTextView
58+
<com.android.systemui.car.keyguard.UnfocusablePasswordTextView
5959
android:id="@+id/pinEntry"
6060
android:layout_width="@dimen/keyguard_security_width"
6161
android:layout_height="@dimen/pin_entry_height"

packages/CarSystemUI/res-keyguard/layout/keyguard_pin_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
android:gravity="center"
4343
android:orientation="vertical">
4444

45-
<com.android.keyguard.PasswordTextView
45+
<com.android.systemui.car.keyguard.UnfocusablePasswordTextView
4646
android:id="@+id/pinEntry"
4747
android:layout_width="@dimen/keyguard_security_width"
4848
android:layout_height="@dimen/pin_entry_height"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (C) 2021 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.car.keyguard;
18+
19+
import android.content.Context;
20+
import android.util.AttributeSet;
21+
22+
import com.android.keyguard.PasswordTextView;
23+
24+
/** A version of {@link PasswordTextView} that is not focusable. */
25+
public class UnfocusablePasswordTextView extends PasswordTextView {
26+
public UnfocusablePasswordTextView(Context context) {
27+
this(context, null);
28+
}
29+
30+
public UnfocusablePasswordTextView(Context context, AttributeSet attrs) {
31+
this(context, attrs, 0);
32+
}
33+
34+
public UnfocusablePasswordTextView(Context context, AttributeSet attrs, int defStyleAttr) {
35+
this(context, attrs, defStyleAttr, 0);
36+
}
37+
38+
public UnfocusablePasswordTextView(Context context, AttributeSet attrs, int defStyleAttr,
39+
int defStyleRes) {
40+
super(context, attrs, defStyleAttr, defStyleRes);
41+
setFocusableInTouchMode(false);
42+
setFocusable(false);
43+
}
44+
}

0 commit comments

Comments
 (0)