mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 08:39:22 +01:00
Update PIN switch keyboard button to be more straightforward.
Addresses #12866.
This commit is contained in:
committed by
Nicholas Tinsley
parent
2dd0221680
commit
8ae115028e
@@ -14,12 +14,12 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.autofill.HintConstants;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.navigation.Navigation;
|
||||
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.signal.core.util.logging.Log;
|
||||
@@ -52,7 +52,7 @@ public class PinRestoreEntryFragment extends LoggingFragment {
|
||||
private View skipButton;
|
||||
private CircularProgressMaterialButton pinButton;
|
||||
private TextView errorLabel;
|
||||
private TextView keyboardToggle;
|
||||
private MaterialButton keyboardToggle;
|
||||
private PinRestoreViewModel viewModel;
|
||||
|
||||
@Override
|
||||
@@ -102,12 +102,12 @@ public class PinRestoreEntryFragment extends LoggingFragment {
|
||||
keyboardToggle.setOnClickListener((v) -> {
|
||||
PinKeyboardType keyboardType = getPinEntryKeyboardType();
|
||||
|
||||
keyboardToggle.setIconResource(keyboardType.getIconResource());
|
||||
|
||||
updateKeyboard(keyboardType.getOther());
|
||||
keyboardToggle.setText(resolveKeyboardToggleText(keyboardType));
|
||||
});
|
||||
|
||||
PinKeyboardType keyboardType = getPinEntryKeyboardType().getOther();
|
||||
keyboardToggle.setText(resolveKeyboardToggleText(keyboardType));
|
||||
keyboardToggle.setIconResource(getPinEntryKeyboardType().getOther().getIconResource());
|
||||
}
|
||||
|
||||
private void initViewModel() {
|
||||
@@ -260,14 +260,6 @@ public class PinRestoreEntryFragment extends LoggingFragment {
|
||||
pinEntry.getText().clear();
|
||||
}
|
||||
|
||||
private @StringRes static int resolveKeyboardToggleText(@NonNull PinKeyboardType keyboard) {
|
||||
if (keyboard == PinKeyboardType.ALPHA_NUMERIC) {
|
||||
return R.string.PinRestoreEntryFragment_enter_alphanumeric_pin;
|
||||
} else {
|
||||
return R.string.PinRestoreEntryFragment_enter_numeric_pin;
|
||||
}
|
||||
}
|
||||
|
||||
private void enableAndFocusPinEntry() {
|
||||
pinEntry.setEnabled(true);
|
||||
pinEntry.setFocusable(true);
|
||||
|
||||
Reference in New Issue
Block a user