Hide options button when user starts entering pattern
Test: cd tests/robotests && mma
Bug: 72409245
Change-Id: I82ab8822f13bc8bf8b74bc67f6d4d3a9fd2cc0c8
(cherry picked from commit ad554244b6
)
This commit is contained in:
@@ -20,7 +20,10 @@ import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -54,16 +57,20 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
|
||||
public static class SetupChooseLockPatternFragment extends ChooseLockPatternFragment
|
||||
implements ChooseLockTypeDialogFragment.OnLockTypeSelectedListener {
|
||||
|
||||
@Nullable
|
||||
private Button mOptionsButton;
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
public View onCreateView(
|
||||
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = super.onCreateView(inflater, container, savedInstanceState);
|
||||
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) ->
|
||||
mOptionsButton = view.findViewById(R.id.screen_lock_options);
|
||||
mOptionsButton.setOnClickListener((btn) ->
|
||||
ChooseLockTypeDialogFragment.newInstance(mUserId)
|
||||
.show(getChildFragmentManager(), null));
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -84,6 +91,16 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateStage(Stage stage) {
|
||||
super.updateStage(stage);
|
||||
if (!getResources().getBoolean(R.bool.config_lock_pattern_minimal_ui)
|
||||
&& mOptionsButton != null) {
|
||||
mOptionsButton.setVisibility(
|
||||
stage == Stage.Introduction ? View.VISIBLE : View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleLeftButton() {
|
||||
SetupSkipDialog dialog = SetupSkipDialog.newInstance(
|
||||
|
Reference in New Issue
Block a user