-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Update README.md to include app_name and color requirements #862
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
Conversation
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.
@TheCraftKid Sorry for the deluge of comments, I'm a little OCD about README
quality. 😄
auth/README.md
Outdated
For example, something like this goes in your `strings.xml`: | ||
```xml | ||
<resources> | ||
<!-- ... --> |
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.
nit: can we put the ...
after app_name
since the latter should in theory be first?
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.
In the Android Studio template, app_name
is first... Will do.
auth/README.md
Outdated
|
||
This goes in your `styles.xml`: | ||
```xml | ||
<style name="AppTheme" parent="FirebaseUI"> |
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.
The parent should be something like Theme.AppCompat.DayNight.DarkActionBar
or Theme.AppCompat.Light.DarkActionBar
, not FirebaseUI
.
auth/README.md
Outdated
<!-- Required for sign-in flow styling --> | ||
<item name="colorPrimary">@color/material_green_500</item> | ||
<item name="colorPrimaryDark">@color/material_green_700</item> | ||
<item name="colorAccent">@color/material_purple_a700</item> |
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.
The standard code Android Studio generates has the app style reference each color name like so instead of referencing the color directly:
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
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.
Whoops, I knew I forgot to change something while copy-pasting.
auth/README.md
Outdated
AppCompat color attributes in your app. | ||
|
||
For example, something like this goes in your `strings.xml`: | ||
```xml |
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.
nit: to follow the existing style in this README
, we should have a space between all the ```
and their text.
auth/README.md
Outdated
To use FirebaseUI Auth's sign-in flows, you must provide an `app_name` string and use the | ||
AppCompat color attributes in your app. | ||
|
||
For example, something like this goes in your `strings.xml`: |
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.
Could we improve the clarity of this statement to something like this?
First, ensure an `app_name` resource is defined your `strings.xml` file like so:
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.
Yeah, phrasing this was a problem for me. That is way better.
auth/README.md
Outdated
``` | ||
|
||
This goes in your `styles.xml`: | ||
```xml |
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.
Could we improve the clarity of this statement to something like this?
Second, ensure the three standard AppCompat color resources are defined with your own values:
nit: add line break
auth/README.md
Outdated
redefine a string to change it, for example: | ||
If you wish to change the string messages, the existing strings can be overridden | ||
by name in your application. See the module's [strings.xml](src/main/res/values/strings.xml) file | ||
and simply redefine a string to change it, for example: |
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.
We could simplify this to and simply redefine a string to change it:
auth/README.md
Outdated
</resources> | ||
``` | ||
Note: String resource names are internal to the library and there are currently no | ||
guarantees that they won't change between updates. |
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 be a little scarier: 👻😆
**Note:** string resource names aren't considered part of the public API and might
therefore change and break your app between library updates. We recommend looking
at a diff of the `strings.xml` file before updating FirebaseUI.
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.
And I thought mine was too abrasive. 😆
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.
@TheCraftKid haha, yeah. We've broken the strings without remorse several times now, so we want to make sure devs understand that we aren't kidding. 😄
|
||
```xml | ||
<resources> | ||
<!-- was "Signing up..." --> | ||
<string name="progress_dialog_signing_up">Creating your shiny new account...</string> | ||
<string name="fui_progress_dialog_signing_up">Creating your shiny new account...</string> |
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.
👍
auth/README.md
Outdated
Note: If your app is already using an AppCompat theme, you don't have to create | ||
a new theme, but you can still optionally style other parts of the sign-in flow. | ||
Standard material design colorand typography properties will take effect as expected. | ||
For example, to define a green theme: |
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.
I think this paragraph up to You don't have to call...
should be replaced with something simpler since we don't talk about setTheme
anywhere else:
If you would like more control over FirebaseUI's styling, you can define your own custom style to
override certain or all styling attributes. For example, a green sign-in theme:
PS: we don't talk about setTheme
anywhere except here which we should remove.
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.
Instead of removing the earlier mention completely, why don't we just provide a link to the lower section?
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.
@TheCraftKid Hmmm, the problem I see with this section is that it feels kinda like an "upgrade guide" of sorts. I'm trying to think of it from a newcomer's perspective, and for all they care, we've always auto-styled FirebaseUI so why would they have to call setTheme()
? If you believe a newcomer would find this information useful, then feel free to keep it around.
I just want to say I love seeing a PR where I am neither the author nor the reviewer! I'll merge this once you two have worked through the comments. |
Hey, do we still require the Fabric Maven repo in the |
@TheCraftKid we only require it if you're using Twitter auth, since you need it to resolve the twitter dependency. |
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.
@TheCraftKid Two last comments, everything else LGTM! 😄
auth/README.md
Outdated
</resources> | ||
``` | ||
**Note:** String resource names aren't considered part of the public API and might |
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.
nit: add space between text and ```
.
auth/README.md
Outdated
startActivityForResult( | ||
AuthUI.getInstance(this).createSignInIntentBuilder() | ||
.build()); | ||
``` |
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 you sure you want to keep this section?
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.
@TheCraftKid awesome! 😀👍
@samtstern LGTM!
This adds some information that has been discussed in #696, #815 and others.