Improve pattern layout for tiiiny screens

On small screens < sw400dp,
- Don't show icon
- Don't show "Screen lock options" button

Test: cd tests/robotests && mma
Bug: 72764729
Change-Id: I8d9863d43c877fcc18f504d91d3183760b3fafc2
This commit is contained in:
Maurice Lam
2018-02-14 16:02:33 -08:00
parent bee1a6d990
commit 212dd952a1
9 changed files with 58 additions and 22 deletions

View File

@@ -452,8 +452,15 @@ public class ChooseLockPattern extends SettingsActivity {
final GlifLayout layout = (GlifLayout) inflater.inflate(
R.layout.choose_lock_pattern, container, false);
layout.setHeaderText(getActivity().getTitle());
if (mForFingerprint) {
layout.setIcon(getActivity().getDrawable(R.drawable.ic_fingerprint_header));
if (getResources().getBoolean(R.bool.config_lock_pattern_minimal_ui)) {
View iconView = layout.findViewById(R.id.suw_layout_icon);
if (iconView != null) {
iconView.setVisibility(View.GONE);
}
} else {
if (mForFingerprint) {
layout.setIcon(getActivity().getDrawable(R.drawable.ic_fingerprint_header));
}
}
return layout;
}

View File

@@ -57,11 +57,13 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
Button optionsButton = (Button) view.findViewById(R.id.screen_lock_options);
optionsButton.setVisibility(View.VISIBLE);
optionsButton.setOnClickListener((btn) ->
ChooseLockTypeDialogFragment.newInstance(mUserId)
.show(getChildFragmentManager(), null));
if (!getResources().getBoolean(R.bool.config_lock_pattern_minimal_ui)) {
Button optionsButton = view.findViewById(R.id.screen_lock_options);
optionsButton.setVisibility(View.VISIBLE);
optionsButton.setOnClickListener((btn) ->
ChooseLockTypeDialogFragment.newInstance(mUserId)
.show(getChildFragmentManager(), null));
}
}
@Override