-
Notifications
You must be signed in to change notification settings - Fork 916
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
Update Settings design: Add new SettingsListItem #5318
Update Settings design: Add new SettingsListItem #5318
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
8d2f2e6
to
abf33e2
Compare
abf33e2
to
38b133a
Compare
Android CI Test failing (not related to this work) but a fix has been raised: #5316 |
38b133a
to
0782d10
Compare
0782d10
to
d8f02fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When several status indicators are displayed vertically, you can see how they go out of alignment if the text (On/Off) is different. The issue is much more visible if you use another languages.
context: Context, | ||
attrs: AttributeSet? = null, | ||
defStyleAttr: Int = R.attr.oneLineListItemStyle, | ||
) : ConstraintLayout(context, attrs, defStyleAttr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should implement DaxListItem
. Look at BookmarksListItem
for reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't using DaxListItem
enforce using Views I actually do not need? i.e. secondaryText
, trailingSwitch
Also the spacing for the trailingIcon was not suitable for the StatusIndicator
and I did not want to mess around with that too much considering how widely it's used.
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:gravity="center_vertical" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice spot 👍
~ limitations under the License. | ||
--> | ||
|
||
<selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the colors the same in light and dark? seems odd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the colour of the indicator does not change based on light/dark mode from checking iOS
} | ||
|
||
fun setStatus(isOn: Boolean) { | ||
statusIndicator.setStatus(isOn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need a different View
just for the status indicator? I think you can have it all in here. The status indicator is part of the Item, and won’t be used separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the StatusIndicator
will be used on sub-screens as well. It's developed further for the sub-screens in another PR
Also adding all the new icons, removing secondary text and itemState, and adding the new isOn for search and web tracking settings Next commit we'll ensure the indicators are on/off
I've removed appTrackingProtectionOnboardingShown state as only have 2 states now, on/off, but I will follow up and ask Thomas if this is expected
I think this is worth having on the ADS screen, even if not officially a component. Happy to move it if needs be.
ea26e05
to
26b24c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments, good work!
Task/Issue URL: https://app.asana.com/0/1207908166761516/1208785622935231/f
Description
Steps to test this PR
Pre-requisites:
newSettings
feature flag must be enabledDefault Browser On/Off
off
⚪on
🟢off
⚪Private Search
on
and is always onWeb Tracking Protection
on
and is always onCookie Pop-Up Protection
on
🟢off
⚪on
🟢App Tracking Protection
off
⚪on
🟢off
⚪Email Protection
off
⚪on
🟢off
⚪UI changes
Demo
Screen_recording_20241126_145018.mp4