android:gravity="center_horizontal"
android:orientation="vertical">
- <!-- header text ('Enter Pin') -->
- <TextView
- android:id="@+id/headerText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:accessibilityLiveRegion="polite"
- android:gravity="center"
- android:lines="2"
- android:textAppearance="?android:attr/textAppearanceMedium"/>
-
<LinearLayout
android:id="@+id/password_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical"
private ChooseLockSettingsHelper mChooseLockSettingsHelper;
private Stage mUiStage = Stage.Introduction;
private PasswordRequirementAdapter mPasswordRequirementAdapter;
+ private GlifLayout mLayout;
- private TextView mHeaderText;
private String mFirstPin;
private RecyclerView mPasswordRestrictionView;
protected boolean mIsAlphaMode;
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
+ mLayout = (GlifLayout) view;
+
// Make the password container consume the optical insets so the edit text is aligned
// with the sides of the parent visually.
ViewGroup container = view.findViewById(R.id.password_container);
mPasswordEntryInputDisabler = new TextViewInputDisabler(mPasswordEntry);
final Activity activity = getActivity();
- mHeaderText = (TextView) view.findViewById(R.id.headerText);
int currentType = mPasswordEntry.getInputType();
mPasswordEntry.setInputType(mIsAlphaMode ? currentType
: R.string.lockpassword_choose_your_pin_header;
CharSequence title = getText(id);
sa.setTitle(title);
- ((GlifLayout) view).setHeaderText(title);
+ mLayout.setHeaderText(title);
}
}
// If the stage changed, announce the header for accessibility. This
// is a no-op when accessibility is disabled.
if (previousStage != stage) {
- mHeaderText.announceForAccessibility(mHeaderText.getText());
+ mLayout.announceForAccessibility(mLayout.getHeaderText());
}
}
private void setHeaderText(String text) {
// Only set the text if it is different than the existing one to avoid announcing again.
- if (!TextUtils.isEmpty(mHeaderText.getText())
- && mHeaderText.getText().toString().equals(text)) {
+ if (!TextUtils.isEmpty(mLayout.getHeaderText())
+ && mLayout.getHeaderText().toString().equals(text)) {
return;
}
- mHeaderText.setText(text);
+ mLayout.setHeaderText(text);
}
public void afterTextChanged(Editable s) {