Skip to content

Fix broken auto styling #815

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 3 commits into from
Jul 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions auth/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="fui_colorPrimary">#3F51B5</color>
<color name="fui_colorPrimaryDark">#303F9F</color>
<color name="fui_colorAccent">#FF4081</color>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Eventually, we should remove these so the developer knows they have to style FirebaseUI -->
<color name="colorPrimary" tools:ignore="ResourceName">#3F51B5</color>
<color name="colorPrimaryDark" tools:ignore="ResourceName">#303F9F</color>
<color name="colorAccent" tools:ignore="ResourceName">#FF4081</color>

<color name="fui_errorColor">#DD2C00</color>
<color name="fui_linkColor">#4285F4</color>
Expand Down
6 changes: 3 additions & 3 deletions auth/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
tools:ignore="ResourceName">

<style name="FirebaseUI" parent="Theme.AppCompat.DayNight.DarkActionBar">
<item name="colorPrimary">@color/fui_colorPrimary</item>
<item name="colorPrimaryDark">@color/fui_colorPrimaryDark</item>
<item name="colorAccent">@color/fui_colorAccent</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@samtstern The reason we defined those colors was so that we could use them here. However, we are expecting them to be overridden so we don't actually need them to be fully defined colors, but my knowledge of the Android resource system wasn't that great back then. Anyway, now we just define them as ids of type color so the build will properly fail if devs using FirebaseUI don't define their colors and they'll be properly overridden if they are defined.

Copy link
Contributor

@WillieCubed WillieCubed Jul 22, 2017

Choose a reason for hiding this comment

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

Is the intended effect to require developers to override colorPrimary and etc.? I suppose that will work given we're recommending developers to use the AppCompat libraries.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@TheCraftKid Yeah, since FirebaseUI v2.0.0 they already do, but this got broken in #796

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See #696 (comment) for an in-depth explanation.

<item name="android:buttonStyle">@style/FirebaseUI.Button</item>
</style>

Expand Down