Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

For #9857: Create button style #9858

Merged
merged 3 commits into from
Apr 15, 2020
Merged

Conversation

sblatz
Copy link
Contributor

@sblatz sblatz commented Apr 10, 2020

Note: this is the first step for implementing this. Ideally this will live in AC, but I want to get something merged in for now so we don't make the problem worse!

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

After merge

  • Milestone: Make sure issues finished by this pull request are added to the milestone of the version currently in development.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

Copy link
Contributor

@kglazko kglazko left a comment

Choose a reason for hiding this comment

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

Code looks great! One question and one thing to note, which I commented. I still need to compare some things to Master visually before I can approve.

app:icon="@drawable/ic_tab_collection"
app:iconGravity="textStart"
app:iconPadding="8dp"
app:fontFamily="@font/metropolis_medium"
Copy link
Contributor

Choose a reason for hiding this comment

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

You may want to verify with UX cases like this here in that this button was one of the few and only cases in which semi-bold was too bold and they requested medium instead. We have iterated on this a couple of times though, but may want to check with them to see whether they're happy with it in semi-bold or medium. In your implementation, you inherit the styling for the positive button from the neutral one, there may be a couple more cases like this as you go through headers etc. later where it may require a different font than from the default button.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will check with them before I get UX sign off! 😄

<style name="ThemeIndependentMaterialGreyButton" parent="Widget.MaterialComponents.Button.TextButton">
<!-- UI button styling -->
<style name="NeutralButton" parent="Widget.MaterialComponents.Button.TextButton">
<item name="iconTint">@color/button_text_color</item>
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you adding new styling for icons in buttons here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding from UX is that the icons should match the text tint :) another thing I will confirm in the style guide before it's formalized.

<item name="android:textStyle">bold</item>
<item name="android:textAllCaps">false</item>
<item name="backgroundTint">@color/grey_button_color</item>
<item name="android:textColor">@color/button_text_color</item>
<item name="rippleColor">?secondaryText</item>
<item name="android:letterSpacing">0</item>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did the letter spacing need to be specified here and/or is different from the other styles?

Copy link
Contributor Author

@sblatz sblatz Apr 10, 2020

Choose a reason for hiding this comment

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

The letters looked super spread out when I didn't change this. It's defined as "0" in several places throughout the app, and I think it should be a consistent thing. I will confirm with UX and file a follow up for addressing this, but I think 0 is fine for now?

import com.android.tools.lint.detector.api.Severity
import com.android.tools.lint.detector.api.XmlContext
import org.w3c.dom.Element

Copy link
Contributor

Choose a reason for hiding this comment

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

A KDOC here would be nice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added 😄

@codecov-io
Copy link

codecov-io commented Apr 10, 2020

Codecov Report

Merging #9858 into master will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #9858   +/-   ##
=========================================
  Coverage     19.16%   19.17%           
  Complexity      521      521           
=========================================
  Files           337      337           
  Lines         13738    13738           
  Branches       1839     1839           
=========================================
+ Hits           2633     2634    +1     
  Misses        10865    10865           
+ Partials        240      239    -1     
Impacted Files Coverage Δ Complexity Δ
...c/main/java/org/mozilla/fenix/components/Search.kt 100.00% <0.00%> (+8.33%) 2.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c23840...e97a019. Read the comment docs.

@sblatz sblatz changed the title For #9857: Create button style For #9857: Create button style RUN Apr 13, 2020
@sblatz sblatz changed the title For #9857: Create button style RUN For #9857: Create button style Apr 13, 2020
@ekager
Copy link
Contributor

ekager commented Apr 15, 2020

Looks like there are some parts of the app that use a TextView embedded in a FrameLayout with background to get the look of a MaterialButton. Not really sure why... But could we try fix these to adopt the same styles as well?
For example, this is in onboarding_private_browsing and onboarding_privacy_notice. Those are the only two I saw with a quick search but there could be more :/
Screenshot_1586905198

@sblatz sblatz merged commit 8185ba7 into mozilla-mobile:master Apr 15, 2020
@liuche liuche mentioned this pull request Apr 28, 2020
32 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants