private SaveAndFinishWorker mSaveAndFinishWorker;
private int mRequestedQuality = DevicePolicyManager.PASSWORD_QUALITY_NUMERIC;
private ChooseLockSettingsHelper mChooseLockSettingsHelper;
- private Stage mUiStage = Stage.Introduction;
+ protected Stage mUiStage = Stage.Introduction;
private PasswordRequirementAdapter mPasswordRequirementAdapter;
private GlifLayout mLayout;
protected boolean mForFingerprint;
/**
* Update the hint based on current Stage and length of password entry
*/
- private void updateUi() {
+ protected void updateUi() {
final boolean canInput = mSaveAndFinishWorker == null;
String password = mPasswordEntry.getText().toString();
final int length = password.length();
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
+import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
@VisibleForTesting
static final int REQUEST_SCREEN_LOCK_OPTIONS = 1;
+ @Nullable
+ private Button mOptionsButton;
+
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
boolean showOptionsButton = getActivity().getIntent().getBooleanExtra(
ChooseLockGenericFragment.EXTRA_SHOW_OPTIONS_BUTTON, false);
if (showOptionsButton) {
- Button optionsButton = view.findViewById(R.id.screen_lock_options);
- optionsButton.setVisibility(View.VISIBLE);
- optionsButton.setOnClickListener(this);
+ mOptionsButton = view.findViewById(R.id.screen_lock_options);
+ mOptionsButton.setVisibility(View.VISIBLE);
+ mOptionsButton.setOnClickListener(this);
}
}
}
}
}
+
+ @Override
+ protected void updateUi() {
+ super.updateUi();
+ if (mOptionsButton != null) {
+ mOptionsButton.setVisibility(
+ mUiStage == Stage.Introduction ? View.VISIBLE : View.GONE);
+ }
+ }
}
}