Update lock pattern for landscape

- Using GlifLayout api to set title and description
- Hide the header area for landscape mode

Bug: 179317709
Test: visual verified
1) Settings -> Security -> Screen lock -> Pattern
2) Try setting screen lock if there's no pattern
3) Rotate the screen during the settings flow and see if there's
an empty space leaving in the left side
4) Settings -> Security -> Fingerprint
5) Device will display a confirm lock pattern page
6) Rotate the screen and see if there's an empty space left

Change-Id: I16f614eceb873f40b7c48583223aedcbcbd7447d
This commit is contained in:
Mill Chen
2021-03-30 03:12:10 +08:00
parent dc96037cea
commit 0cbd13d0df
6 changed files with 37 additions and 22 deletions

View File

@@ -32,6 +32,7 @@ import android.util.Pair;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ScrollView;
@@ -508,6 +509,12 @@ public class ChooseLockPattern extends SettingsActivity {
Bundle savedInstanceState) {
final GlifLayout layout = (GlifLayout) inflater.inflate(
R.layout.choose_lock_pattern, container, false);
switch(getContext().getDisplay().getRotation()) {
case Surface.ROTATION_90:
case Surface.ROTATION_270:
layout.setLandscapeHeaderAreaVisible(false /* visible */);
break;
}
layout.setHeaderText(getActivity().getTitle());
if (getResources().getBoolean(R.bool.config_lock_pattern_minimal_ui)) {
View iconView = layout.findViewById(R.id.sud_layout_icon);