Skip to content

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

Merged
merged 4 commits into from
Aug 10, 2017

Conversation

WillieCubed
Copy link
Contributor

This adds some information that has been discussed in #696, #815 and others.

Copy link
Collaborator

@SUPERCILEX SUPERCILEX left a 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>
<!-- ... -->
Copy link
Collaborator

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?

Copy link
Contributor Author

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">
Copy link
Collaborator

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>
Copy link
Collaborator

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>

Copy link
Contributor Author

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
Copy link
Collaborator

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`:
Copy link
Collaborator

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:

Copy link
Contributor Author

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
Copy link
Collaborator

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:
Copy link
Collaborator

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.
Copy link
Collaborator

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.

Copy link
Contributor Author

@WillieCubed WillieCubed Aug 9, 2017

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. 😆

Copy link
Collaborator

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>
Copy link
Collaborator

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:
Copy link
Collaborator

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.

Copy link
Contributor Author

@WillieCubed WillieCubed Aug 9, 2017

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?

Copy link
Collaborator

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.

@samtstern
Copy link
Contributor

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.

@WillieCubed
Copy link
Contributor Author

Hey, do we still require the Fabric Maven repo in the build.gradle for FirebaseUI Auth?

@samtstern
Copy link
Contributor

@TheCraftKid we only require it if you're using Twitter auth, since you need it to resolve the twitter dependency.

Copy link
Collaborator

@SUPERCILEX SUPERCILEX left a 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
Copy link
Collaborator

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());
```
Copy link
Collaborator

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?

Copy link
Collaborator

@SUPERCILEX SUPERCILEX left a 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!

@samtstern samtstern merged commit 49ca5e1 into firebase:master Aug 10, 2017
@WillieCubed WillieCubed deleted the patch-1 branch August 11, 2017 05:23
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.

3 participants