Merge "Add scroll view for choose_lock_pattern in land mode"

This commit is contained in:
Lei Yu
2016-10-28 17:02:32 +00:00
committed by Android (Google) Code Review
2 changed files with 49 additions and 24 deletions

View File

@@ -27,6 +27,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import com.android.internal.logging.MetricsProto.MetricsEvent;
@@ -152,6 +153,9 @@ public class ChooseLockPattern extends SettingsActivity {
protected List<LockPatternView.Cell> mChosenPattern = null;
private boolean mHideDrawer = false;
// ScrollView that contains title and header, only exist in land mode
private ScrollView mTitleHeaderScrollView;
/**
* The patten used during the help screen to show how to draw a pattern.
*/
@@ -237,6 +241,15 @@ public class ChooseLockPattern extends SettingsActivity {
mFooterText.setText("");
mFooterLeftButton.setEnabled(false);
mFooterRightButton.setEnabled(false);
if (mTitleHeaderScrollView != null) {
mTitleHeaderScrollView.post(new Runnable() {
@Override
public void run() {
mTitleHeaderScrollView.fullScroll(ScrollView.FOCUS_DOWN);
}
});
}
}
};
@@ -415,6 +428,9 @@ public class ChooseLockPattern extends SettingsActivity {
mFooterLeftButton = (TextView) view.findViewById(R.id.footerLeftButton);
mFooterRightButton = (TextView) view.findViewById(R.id.footerRightButton);
mTitleHeaderScrollView = (ScrollView) view.findViewById(R.id
.scroll_layout_title_header);
mFooterLeftButton.setOnClickListener(this);
mFooterRightButton.setOnClickListener(this);