Skip to content

Commit 5c6a0d6

Browse files
authored
Version 7.1.1
Version 7.1.1
2 parents 7f2d6a5 + 778aaa8 commit 5c6a0d6

17 files changed

+135
-18
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ libraries.
4848
```groovy
4949
dependencies {
5050
// FirebaseUI for Firebase Realtime Database
51-
implementation 'com.firebaseui:firebase-ui-database:7.1.0'
51+
implementation 'com.firebaseui:firebase-ui-database:7.1.1'
5252
5353
// FirebaseUI for Cloud Firestore
54-
implementation 'com.firebaseui:firebase-ui-firestore:7.1.0'
54+
implementation 'com.firebaseui:firebase-ui-firestore:7.1.1'
5555
5656
// FirebaseUI for Firebase Auth
57-
implementation 'com.firebaseui:firebase-ui-auth:7.1.0'
57+
implementation 'com.firebaseui:firebase-ui-auth:7.1.1'
5858
5959
// FirebaseUI for Cloud Storage
60-
implementation 'com.firebaseui:firebase-ui-storage:7.1.0'
60+
implementation 'com.firebaseui:firebase-ui-storage:7.1.1'
6161
}
6262
```
6363

app/src/main/res/layout-land/auth_method_picker_custom_layout.xml

+6-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@
9090

9191
</FrameLayout>
9292

93-
<Button
93+
<!--
94+
NOTE: This sample app uses this class from the FirebaseUI library to show the Google Sign
95+
in button. However this button is NOT considered part of the public API and you should not
96+
use it in your own app.
97+
-->
98+
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
9499
android:id="@+id/custom_google_signin_button"
95100
style="@style/FirebaseUI.Button.AccountChooser.GoogleButton"
96101
android:layout_width="wrap_content"

app/src/main/res/layout/auth_method_picker_custom_layout.xml

+6-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@
7373

7474
</FrameLayout>
7575

76-
<Button
76+
<!--
77+
NOTE: This sample app uses this class from the FirebaseUI library to show the Google Sign
78+
in button. However this button is NOT considered part of the public API and you should not
79+
use it in your own app.
80+
-->
81+
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
7782
android:id="@+id/custom_google_signin_button"
7883
style="@style/FirebaseUI.Button.AccountChooser.GoogleButton"
7984
android:layout_width="wrap_content"

auth/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Gradle, add the dependency:
6666
```groovy
6767
dependencies {
6868
// ...
69-
implementation 'com.firebaseui:firebase-ui-auth:7.1.0'
69+
implementation 'com.firebaseui:firebase-ui-auth:7.1.1'
7070
7171
// Required only if Facebook login support is required
7272
// Find the latest Facebook SDK releases here: https://github.com/facebook/facebook-android-sdk/blob/master/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
package com.firebase.ui.auth.util.ui;
2+
3+
import android.content.Context;
4+
import android.content.res.TypedArray;
5+
import android.graphics.drawable.Drawable;
6+
import android.os.Build;
7+
import android.util.AttributeSet;
8+
9+
import com.firebase.ui.auth.R;
10+
11+
import androidx.annotation.RestrictTo;
12+
import androidx.appcompat.content.res.AppCompatResources;
13+
import androidx.appcompat.widget.AppCompatButton;
14+
import androidx.core.widget.TextViewCompat;
15+
16+
/**
17+
* A custom button that supports using vector drawables with the {@code
18+
* android:drawable[Start/End/Top/Bottom]} attribute pre-L.
19+
* <p>
20+
* AppCompat can only load vector drawables with srcCompat pre-L and doesn't provide a similar
21+
* compatibility attribute for compound drawables. Thus, we must load compound drawables at runtime
22+
* using AppCompat and inject them into the button to support pre-L devices.
23+
*/
24+
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
25+
public class SupportVectorDrawablesButton extends AppCompatButton {
26+
public SupportVectorDrawablesButton(Context context) {
27+
super(context);
28+
}
29+
30+
public SupportVectorDrawablesButton(Context context, AttributeSet attrs) {
31+
super(context, attrs);
32+
initSupportVectorDrawablesAttrs(attrs);
33+
}
34+
35+
public SupportVectorDrawablesButton(Context context, AttributeSet attrs, int defStyleAttr) {
36+
super(context, attrs, defStyleAttr);
37+
initSupportVectorDrawablesAttrs(attrs);
38+
}
39+
40+
/**
41+
* Loads the compound drawables natively on L+ devices and using AppCompat pre-L.
42+
* <p>
43+
* <i>Note:</i> If we ever need a TextView with compound drawables, this same technique is
44+
* applicable.
45+
*/
46+
private void initSupportVectorDrawablesAttrs(AttributeSet attrs) {
47+
if (attrs == null) { return; }
48+
49+
TypedArray attributeArray = getContext().obtainStyledAttributes(
50+
attrs,
51+
R.styleable.SupportVectorDrawablesButton);
52+
53+
Drawable drawableStart = null;
54+
Drawable drawableEnd = null;
55+
Drawable drawableTop = null;
56+
Drawable drawableBottom = null;
57+
58+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
59+
drawableStart = attributeArray.getDrawable(
60+
R.styleable.SupportVectorDrawablesButton_drawableStartCompat);
61+
drawableEnd = attributeArray.getDrawable(
62+
R.styleable.SupportVectorDrawablesButton_drawableEndCompat);
63+
drawableTop = attributeArray.getDrawable(
64+
R.styleable.SupportVectorDrawablesButton_drawableTopCompat);
65+
drawableBottom = attributeArray.getDrawable(
66+
R.styleable.SupportVectorDrawablesButton_drawableBottomCompat);
67+
} else {
68+
int drawableStartId = attributeArray.getResourceId(
69+
R.styleable.SupportVectorDrawablesButton_drawableStartCompat, -1);
70+
int drawableEndId = attributeArray.getResourceId(
71+
R.styleable.SupportVectorDrawablesButton_drawableEndCompat, -1);
72+
int drawableTopId = attributeArray.getResourceId(
73+
R.styleable.SupportVectorDrawablesButton_drawableTopCompat, -1);
74+
int drawableBottomId = attributeArray.getResourceId(
75+
R.styleable.SupportVectorDrawablesButton_drawableBottomCompat, -1);
76+
77+
if (drawableStartId != -1) {
78+
drawableStart = AppCompatResources.getDrawable(getContext(), drawableStartId);
79+
}
80+
if (drawableEndId != -1) {
81+
drawableEnd = AppCompatResources.getDrawable(getContext(), drawableEndId);
82+
}
83+
if (drawableTopId != -1) {
84+
drawableTop = AppCompatResources.getDrawable(getContext(), drawableTopId);
85+
}
86+
if (drawableBottomId != -1) {
87+
drawableBottom = AppCompatResources.getDrawable(getContext(), drawableBottomId);
88+
}
89+
}
90+
91+
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(
92+
this, drawableStart, drawableTop, drawableEnd, drawableBottom);
93+
94+
attributeArray.recycle();
95+
}
96+
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Button xmlns:android="http://schemas.android.com/apk/res/android"
1+
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton xmlns:android="http://schemas.android.com/apk/res/android"
22
android:id="@+id/apple_signin_button"
33
style="@style/FirebaseUI.Button.AccountChooser.AppleButton"
44
android:text="@string/fui_sign_in_with_apple"/>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
<Button xmlns:android="http://schemas.android.com/apk/res/android"
1+
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
2+
xmlns:android="http://schemas.android.com/apk/res/android"
23
style="@style/FirebaseUI.Button.AccountChooser.FacebookButton"
34
android:text="@string/fui_sign_in_with_facebook" />
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
<Button xmlns:android="http://schemas.android.com/apk/res/android"
1+
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
2+
xmlns:android="http://schemas.android.com/apk/res/android"
23
style="@style/FirebaseUI.Button.AccountChooser.GitHubButton"
34
android:text="@string/fui_sign_in_with_github" />
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
<Button xmlns:android="http://schemas.android.com/apk/res/android"
1+
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
2+
xmlns:android="http://schemas.android.com/apk/res/android"
23
style="@style/FirebaseUI.Button.AccountChooser.GoogleButton"
34
android:text="@string/fui_sign_in_with_google" />
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Button xmlns:android="http://schemas.android.com/apk/res/android"
1+
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton xmlns:android="http://schemas.android.com/apk/res/android"
22
android:id="@+id/microsoft_signin_button"
33
style="@style/FirebaseUI.Button.AccountChooser.MicrosoftButton"
44
android:text="@string/fui_sign_in_with_microsoft"/>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
<Button xmlns:android="http://schemas.android.com/apk/res/android"
1+
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
2+
xmlns:android="http://schemas.android.com/apk/res/android"
23
style="@style/FirebaseUI.Button.AccountChooser.TwitterButton"
34
android:text="@string/fui_sign_in_with_twitter" />
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Button xmlns:android="http://schemas.android.com/apk/res/android"
1+
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton xmlns:android="http://schemas.android.com/apk/res/android"
22
android:id="@+id/yahoo_signin_button"
33
style="@style/FirebaseUI.Button.AccountChooser.YahooButton"
44
android:text="@string/fui_sign_in_with_yahoo" />

auth/src/main/res/layout/fui_provider_button_anonymous.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Button
2+
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
android:id="@+id/anonymous_button"
55
style="@style/FirebaseUI.Button.AccountChooser.AnonymousButton"

auth/src/main/res/layout/fui_provider_button_email.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Button
2+
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:id="@+id/email_button"

auth/src/main/res/layout/fui_provider_button_phone.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Button
2+
<com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:id="@+id/phone_button"

auth/src/main/res/values/attrs.xml

+7
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,11 @@
55
<attr name="spacingProportion" format="float" />
66
</declare-styleable>
77

8+
<declare-styleable name="SupportVectorDrawablesButton">
9+
<attr name="drawableStartCompat" format="reference" />
10+
<attr name="drawableEndCompat" format="reference" />
11+
<attr name="drawableTopCompat" format="reference" />
12+
<attr name="drawableBottomCompat" format="reference" />
13+
</declare-styleable>
14+
815
</resources>

buildSrc/src/main/kotlin/Config.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
object Config {
2-
const val version = "7.1.0"
2+
const val version = "7.1.1"
33
val submodules = listOf("auth", "common", "firestore", "database", "storage")
44

55
private const val kotlinVersion = "1.3.72"

0 commit comments

Comments
 (0)