Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMA-8827-password-input-view #191

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

emmaatkins
Copy link
Contributor

@emmaatkins emmaatkins commented Sep 5, 2024

📝 Description

HMA-8827

  • Updated CHANGELOG
  • Updated README

🛠 Testing Notes

Check text input view, currency input view, password input view

📸 Screenshots

passwordinputss

@@ -16,6 +16,10 @@ Allowed headings:

## [Unreleased]

### Added

* `PasswordInputView` component added with show/hide feature
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should mention the new requiresSequenceSpacing parameter here

visualTransformation: VisualTransformation,
trailingIcon: @Composable() (() -> Unit)? = null,
textStyle: TextStyle = typography.body,
colors: TextFieldColors,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this above the parameters which have defaults set? That way, it is possible to create an instance of TextField without requiring named parameters if we're not overriding the defaults.

See here for the Google guidelines on parameter ordering: https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-component-api-guidelines.md#parameters-order

@@ -40,6 +41,7 @@ fun CurrencyInputView(
singleLine: Boolean = true,
enableDecimal: Boolean = true,
maxChars: Int? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to expose this as a parameter for the CurrencyInputView? Will we ever need it? I think you only needed to add it to the password to do very custom behaviour for the focus colours, so I don't think we need to declare it here as we have the default parameter set on the TextInputView already.

singleLine: Boolean = true,
numericOnly: Boolean = false,
maxChars: Int? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be a parameter here or can we just declare it inside the function? Will we ever need to pass in a new value for it?

numericOnly: Boolean = false,
maxChars: Int? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
requiredSequencesSpacing: Boolean = false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want the default to be true for passwords?

@@ -33,6 +33,7 @@ val HmrcPink = Color(0xFFCA2B75)
val HmrcYellow = Color(0xFFFFBF47)
val HmrcAlwaysBlack = Color(0xFF0B0C0C)
val HmrcDonutBlue = Color(0xFF003078)
val hmrcTransparent = Color.Transparent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val hmrcTransparent = Color.Transparent
val HmrcTransparent = Color.Transparent

Comment on lines +22 to +23
<string name="passwordTextInputView_hide">Hide</string>
<string name="passwordTextInputView_show">Show</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to include these in the actual component library package, but they can be declared in the sample package so we can use them in the examples.

@@ -0,0 +1,48 @@
/*
* Copyright 2023 HM Revenue & Customs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Copyright 2023 HM Revenue & Customs
* Copyright 2024 HM Revenue & Customs

onInputValueChange = { placeholderValue = it },
labelText = stringResource(id = R.string.password_input_placeholder_label),
hintText = stringResource(id = R.string.password_input_placeholder_hint),
placeholderText = stringResource(id = R.string.password_input_placeholder_placeholder),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This placeholder text isn't needed

labelText = stringResource(id = R.string.password_input_example_3_label),
hintText = stringResource(id = R.string.password_input_example_3_hint),
)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add an example that showcases all the accessibility stuff so it can be tested, like adding different content descriptions and button text?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants