Skip to content

Conversation

@SUPERCILEX
Copy link
Collaborator

@samtstern I didn't know this at the time, but we were never actually getting the true benefits of vector drawables because the build tools would just convert them to pngs at the end of the day. I went through the pains of figuring out how to enable true vector drawable support for my app and I'm bringing this knowledge over to FUI. Yay! 😄

Turns out we actually save quite a few kbs considering how few drawables we have:

Old New Diff % of original
496KB 468KB 28KB 94%

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

<style name="FirebaseUI.Button.AccountChooser.EmailButton">
<item name="android:drawableLeft">@drawable/fui_ic_mail_white_24dp</item>
<item name="drawableStartCompat">@drawable/fui_ic_mail_white_24dp</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.

Pre-L this will crash with a res not found exception if we don't manually get the drawable with AppCompatResources.getDrawable.

Copy link
Contributor

Choose a reason for hiding this comment

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

So is this the reason for the button subclass?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yup.

@samtstern
Copy link
Contributor

Oh nice! I'll take another look at this early next week (and your other PRs, I have been slacking on this repo). I remember when we went with vectors for Santa Tracker there were a bunch of gotchas and I just want to make sure they don't apply here (I think we're OK).

@SUPERCILEX
Copy link
Collaborator Author

@samtstern SGTM! (I also have another PR coming up 😊)

@puf
Copy link
Contributor

puf commented Jul 22, 2017

Very cool to see this change! #vectorallthethings

@samtstern samtstern added this to the 2.1.2 milestone Jul 25, 2017
@SUPERCILEX SUPERCILEX changed the base branch from version-2.1.1-dev to master July 25, 2017 19:28
@SUPERCILEX SUPERCILEX changed the base branch from master to version-2.1.2-dev July 26, 2017 17:24
@samtstern samtstern removed this from the 2.1.2 milestone Aug 2, 2017
@samtstern samtstern closed this Aug 2, 2017
@SUPERCILEX SUPERCILEX changed the base branch from version-2.1.2-dev to version-2.2.1-dev August 2, 2017 16:19
@SUPERCILEX
Copy link
Collaborator Author

@samtstern Was this closed by accident or did you decide against it?

@samtstern samtstern reopened this Aug 2, 2017
@samtstern
Copy link
Contributor

@SUPERCILEX accident! Sorry haha.

@SUPERCILEX
Copy link
Collaborator Author

@samtstern 😄👍

# Conflicts:
#	auth/src/main/res/layout/fui_phone_progress_dialog.xml
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
@SUPERCILEX SUPERCILEX mentioned this pull request Aug 3, 2017
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
how obfuscated, makes it vulnerable to being stolen.
-->
<string name="twitter_consumer_secret" translatable="false">CHANGE-ME</string>
<string name="twitter_consumer_secret" translatable="false">di6UQRwDaxsRQ7RT5M5QcUgq19Dn4NY04QLMjaDhyxqmUy92Pe</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a mistake haha

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh lol, yep.


import com.firebase.ui.auth.R;

public class SupportVectorDrawablesButton extends AppCompatButton {
Copy link
Contributor

Choose a reason for hiding this comment

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

This class seems to have some cool but non-obvious compatibility tricks. Can you add comments (class level and in the one big method) explaining what's going on?

@samtstern samtstern added this to the 2.2.1 milestone Aug 4, 2017
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
@samtstern
Copy link
Contributor

LGTM!

@samtstern samtstern merged commit e91edda into firebase:version-2.2.1-dev Aug 4, 2017
@SUPERCILEX SUPERCILEX deleted the vectors branch August 4, 2017 22:26
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