Skip to content

Commit

Permalink
Version 7.1.1
Browse files Browse the repository at this point in the history
Version 7.1.1
  • Loading branch information
samtstern committed Dec 1, 2020
2 parents 7f2d6a5 + 778aaa8 commit 5c6a0d6
Show file tree
Hide file tree
Showing 17 changed files with 135 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ libraries.
```groovy
dependencies {
// FirebaseUI for Firebase Realtime Database
implementation 'com.firebaseui:firebase-ui-database:7.1.0'
implementation 'com.firebaseui:firebase-ui-database:7.1.1'
// FirebaseUI for Cloud Firestore
implementation 'com.firebaseui:firebase-ui-firestore:7.1.0'
implementation 'com.firebaseui:firebase-ui-firestore:7.1.1'
// FirebaseUI for Firebase Auth
implementation 'com.firebaseui:firebase-ui-auth:7.1.0'
implementation 'com.firebaseui:firebase-ui-auth:7.1.1'
// FirebaseUI for Cloud Storage
implementation 'com.firebaseui:firebase-ui-storage:7.1.0'
implementation 'com.firebaseui:firebase-ui-storage:7.1.1'
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@

</FrameLayout>

<Button
<!--
NOTE: This sample app uses this class from the FirebaseUI library to show the Google Sign
in button. However this button is NOT considered part of the public API and you should not
use it in your own app.
-->
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
android:id="@+id/custom_google_signin_button"
style="@style/FirebaseUI.Button.AccountChooser.GoogleButton"
android:layout_width="wrap_content"
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/layout/auth_method_picker_custom_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@

</FrameLayout>

<Button
<!--
NOTE: This sample app uses this class from the FirebaseUI library to show the Google Sign
in button. However this button is NOT considered part of the public API and you should not
use it in your own app.
-->
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
android:id="@+id/custom_google_signin_button"
style="@style/FirebaseUI.Button.AccountChooser.GoogleButton"
android:layout_width="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Gradle, add the dependency:
```groovy
dependencies {
// ...
implementation 'com.firebaseui:firebase-ui-auth:7.1.0'
implementation 'com.firebaseui:firebase-ui-auth:7.1.1'
// Required only if Facebook login support is required
// Find the latest Facebook SDK releases here: https://github.com/facebook/facebook-android-sdk/blob/master/CHANGELOG.md
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
package com.firebase.ui.auth.util.ui;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;

import com.firebase.ui.auth.R;

import androidx.annotation.RestrictTo;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.appcompat.widget.AppCompatButton;
import androidx.core.widget.TextViewCompat;

/**
* A custom button that supports using vector drawables with the {@code
* android:drawable[Start/End/Top/Bottom]} attribute pre-L.
* <p>
* AppCompat can only load vector drawables with srcCompat pre-L and doesn't provide a similar
* compatibility attribute for compound drawables. Thus, we must load compound drawables at runtime
* using AppCompat and inject them into the button to support pre-L devices.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class SupportVectorDrawablesButton extends AppCompatButton {
public SupportVectorDrawablesButton(Context context) {
super(context);
}

public SupportVectorDrawablesButton(Context context, AttributeSet attrs) {
super(context, attrs);
initSupportVectorDrawablesAttrs(attrs);
}

public SupportVectorDrawablesButton(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initSupportVectorDrawablesAttrs(attrs);
}

/**
* Loads the compound drawables natively on L+ devices and using AppCompat pre-L.
* <p>
* <i>Note:</i> If we ever need a TextView with compound drawables, this same technique is
* applicable.
*/
private void initSupportVectorDrawablesAttrs(AttributeSet attrs) {
if (attrs == null) { return; }

TypedArray attributeArray = getContext().obtainStyledAttributes(
attrs,
R.styleable.SupportVectorDrawablesButton);

Drawable drawableStart = null;
Drawable drawableEnd = null;
Drawable drawableTop = null;
Drawable drawableBottom = null;

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
drawableStart = attributeArray.getDrawable(
R.styleable.SupportVectorDrawablesButton_drawableStartCompat);
drawableEnd = attributeArray.getDrawable(
R.styleable.SupportVectorDrawablesButton_drawableEndCompat);
drawableTop = attributeArray.getDrawable(
R.styleable.SupportVectorDrawablesButton_drawableTopCompat);
drawableBottom = attributeArray.getDrawable(
R.styleable.SupportVectorDrawablesButton_drawableBottomCompat);
} else {
int drawableStartId = attributeArray.getResourceId(
R.styleable.SupportVectorDrawablesButton_drawableStartCompat, -1);
int drawableEndId = attributeArray.getResourceId(
R.styleable.SupportVectorDrawablesButton_drawableEndCompat, -1);
int drawableTopId = attributeArray.getResourceId(
R.styleable.SupportVectorDrawablesButton_drawableTopCompat, -1);
int drawableBottomId = attributeArray.getResourceId(
R.styleable.SupportVectorDrawablesButton_drawableBottomCompat, -1);

if (drawableStartId != -1) {
drawableStart = AppCompatResources.getDrawable(getContext(), drawableStartId);
}
if (drawableEndId != -1) {
drawableEnd = AppCompatResources.getDrawable(getContext(), drawableEndId);
}
if (drawableTopId != -1) {
drawableTop = AppCompatResources.getDrawable(getContext(), drawableTopId);
}
if (drawableBottomId != -1) {
drawableBottom = AppCompatResources.getDrawable(getContext(), drawableBottomId);
}
}

TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(
this, drawableStart, drawableTop, drawableEnd, drawableBottom);

attributeArray.recycle();
}
}
2 changes: 1 addition & 1 deletion auth/src/main/res/layout/fui_idp_button_apple.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Button xmlns:android="http://schemas.android.com/apk/res/android"
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/apple_signin_button"
style="@style/FirebaseUI.Button.AccountChooser.AppleButton"
android:text="@string/fui_sign_in_with_apple"/>
3 changes: 2 additions & 1 deletion auth/src/main/res/layout/fui_idp_button_facebook.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<Button xmlns:android="http://schemas.android.com/apk/res/android"
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/FirebaseUI.Button.AccountChooser.FacebookButton"
android:text="@string/fui_sign_in_with_facebook" />
3 changes: 2 additions & 1 deletion auth/src/main/res/layout/fui_idp_button_github.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<Button xmlns:android="http://schemas.android.com/apk/res/android"
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/FirebaseUI.Button.AccountChooser.GitHubButton"
android:text="@string/fui_sign_in_with_github" />
3 changes: 2 additions & 1 deletion auth/src/main/res/layout/fui_idp_button_google.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<Button xmlns:android="http://schemas.android.com/apk/res/android"
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/FirebaseUI.Button.AccountChooser.GoogleButton"
android:text="@string/fui_sign_in_with_google" />
2 changes: 1 addition & 1 deletion auth/src/main/res/layout/fui_idp_button_microsoft.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Button xmlns:android="http://schemas.android.com/apk/res/android"
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/microsoft_signin_button"
style="@style/FirebaseUI.Button.AccountChooser.MicrosoftButton"
android:text="@string/fui_sign_in_with_microsoft"/>
3 changes: 2 additions & 1 deletion auth/src/main/res/layout/fui_idp_button_twitter.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<Button xmlns:android="http://schemas.android.com/apk/res/android"
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/FirebaseUI.Button.AccountChooser.TwitterButton"
android:text="@string/fui_sign_in_with_twitter" />
2 changes: 1 addition & 1 deletion auth/src/main/res/layout/fui_idp_button_yahoo.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Button xmlns:android="http://schemas.android.com/apk/res/android"
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/yahoo_signin_button"
style="@style/FirebaseUI.Button.AccountChooser.YahooButton"
android:text="@string/fui_sign_in_with_yahoo" />
2 changes: 1 addition & 1 deletion auth/src/main/res/layout/fui_provider_button_anonymous.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Button
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/anonymous_button"
style="@style/FirebaseUI.Button.AccountChooser.AnonymousButton"
Expand Down
2 changes: 1 addition & 1 deletion auth/src/main/res/layout/fui_provider_button_email.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Button
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/email_button"
Expand Down
2 changes: 1 addition & 1 deletion auth/src/main/res/layout/fui_provider_button_phone.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Button
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/phone_button"
Expand Down
7 changes: 7 additions & 0 deletions auth/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@
<attr name="spacingProportion" format="float" />
</declare-styleable>

<declare-styleable name="SupportVectorDrawablesButton">
<attr name="drawableStartCompat" format="reference" />
<attr name="drawableEndCompat" format="reference" />
<attr name="drawableTopCompat" format="reference" />
<attr name="drawableBottomCompat" format="reference" />
</declare-styleable>

</resources>
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
object Config {
const val version = "7.1.0"
const val version = "7.1.1"
val submodules = listOf("auth", "common", "firestore", "database", "storage")

private const val kotlinVersion = "1.3.72"
Expand Down

0 comments on commit 5c6a0d6

Please sign in to comment.