Skip to content

Commit a9469ba

Browse files
committed
Merge branch 'master' into version-4.3.0-dev
2 parents 150f1fa + aa447a6 commit a9469ba

File tree

14 files changed

+122
-33
lines changed

14 files changed

+122
-33
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ libraries.
5050
```groovy
5151
dependencies {
5252
// FirebaseUI for Firebase Realtime Database
53-
implementation 'com.firebaseui:firebase-ui-database:4.2.0'
53+
implementation 'com.firebaseui:firebase-ui-database:4.2.1'
5454
5555
// FirebaseUI for Cloud Firestore
56-
implementation 'com.firebaseui:firebase-ui-firestore:4.2.0'
56+
implementation 'com.firebaseui:firebase-ui-firestore:4.2.1'
5757
5858
// FirebaseUI for Firebase Auth
59-
implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
59+
implementation 'com.firebaseui:firebase-ui-auth:4.2.1'
6060
6161
// FirebaseUI for Firebase Auth (GitHub provider)
62-
implementation 'com.firebaseui:firebase-ui-auth-github:4.2.0'
62+
implementation 'com.firebaseui:firebase-ui-auth-github:4.2.1'
6363
6464
// FirebaseUI for Cloud Storage
65-
implementation 'com.firebaseui:firebase-ui-storage:4.2.0'
65+
implementation 'com.firebaseui:firebase-ui-storage:4.2.1'
6666
}
6767
```
6868

@@ -105,15 +105,15 @@ versions. This means that FirebaseUI has independent dependencies on each of the
105105
For best results, your app should depend on a version of each dependency with the same major
106106
version number as the version used by FirebaseUI.
107107

108-
As of version `4.2.0`, FirebaseUI has the following dependency versions:
108+
As of version `4.2.1`, FirebaseUI has the following dependency versions:
109109

110110
| Library | Version |
111111
|----------------------|--------------------------------|
112-
| `firebase-auth` | 16.0.3 |
113-
| `play-services-auth` | 16.0.0 |
114-
| `firebase-database` | 16.0.2 |
115-
| `firebase-firestore` | 17.1.0 |
116-
| `firebase-storage` | 16.0.2 |
112+
| `firebase-auth` | 16.0.5 |
113+
| `play-services-auth` | 16.0.1 |
114+
| `firebase-database` | 16.0.3 |
115+
| `firebase-firestore` | 17.1.1 |
116+
| `firebase-storage` | 16.0.3 |
117117

118118
### Upgrading dependencies
119119

auth-github/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
android {
2+
lintOptions {
3+
disable("UnknownNullness") // TODO fix in future PR
4+
}
5+
}
6+
17
dependencies {
28
compileOnly(project(":auth")) { isTransitive = false }
39
compileOnly(Config.Libs.Firebase.auth) { isTransitive = false }

auth/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ Gradle, add the dependency:
6565
```groovy
6666
dependencies {
6767
// ...
68-
implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
68+
implementation 'com.firebaseui:firebase-ui-auth:4.2.1'
6969
7070
// Required only if GitHub OAuth support is required
71-
implementation 'com.firebaseui:firebase-ui-auth-github:4.2.0'
71+
implementation 'com.firebaseui:firebase-ui-auth-github:4.2.1'
7272
7373
// Required only if Facebook login support is required
7474
// Find the latest Facebook SDK releases here: https://goo.gl/Ce5L94

auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListAdapter.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@
3434
* Array adapter used to display a list of countries with section indices.
3535
*/
3636
final class CountryListAdapter extends ArrayAdapter<CountryInfo> implements SectionIndexer {
37+
38+
// Map from first letter --> position in the list
3739
private final HashMap<String, Integer> alphaIndex = new LinkedHashMap<>();
40+
41+
// Map from display name --> position in the list
3842
private final HashMap<String, Integer> countryPosition = new LinkedHashMap<>();
43+
3944
private String[] sections;
4045

4146
public CountryListAdapter(Context context) {
@@ -67,6 +72,11 @@ public void setData(List<CountryInfo> countries) {
6772
notifyDataSetChanged();
6873
}
6974

75+
@Override
76+
public int getCount() {
77+
return countryPosition.size();
78+
}
79+
7080
@Override
7181
public Object[] getSections() {
7282
return sections;
@@ -92,6 +102,16 @@ public int getPositionForSection(int index) {
92102

93103
@Override
94104
public int getSectionForPosition(int position) {
105+
if (sections == null) {
106+
return 0;
107+
}
108+
109+
for (int i = 0; i < sections.length; i++) {
110+
if (getPositionForSection(i) > position) {
111+
return i - 1;
112+
}
113+
}
114+
95115
return 0;
96116
}
97117

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item>
4+
<shape android:shape="rectangle">
5+
<corners android:radius="3dp" />
6+
<solid android:color="@color/fui_bgAnonymous" />
7+
</shape>
8+
</item>
9+
</layer-list>
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<vector
22
xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
43
android:width="24dp"
54
android:height="24dp"
65
android:viewportHeight="24.0"
7-
android:viewportWidth="24.0"
8-
tools:ignore="InvalidVectorPath">
6+
android:viewportWidth="24.0">
97
<path
108
android:fillColor="#FFFFFF"
11-
android:pathData="M12 5.9c1.16 0 2.1.94 2.1 2.1s-0.94 2.1-2.1 2.1S9.9 9.16 9.9 8s0.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-0.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z" />
9+
android:pathData="M12,5.9c1.16,0 2.1,0.94 2.1,2.1s-0.94,2.1 -2.1,2.1S9.9,9.16 9.9,8s0.94,-2.1 2.1,-2.1m0,9c2.97,0 6.1,1.46 6.1,2.1v1.1L5.9,18.1L5.9,17c0,-0.64 3.13,-2.1 6.1,-2.1M12,4C9.79,4 8,5.79 8,8s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM12,13c-2.67,0 -8,1.34 -8,4v3h16v-3c0,-2.66 -5.33,-4 -8,-4z" />
1210
</vector>

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
android:layout_height="wrap_content"
6060
android:layout_marginTop="@dimen/fui_field_padding_vert"
6161
android:text="@string/fui_trouble_signing_in"
62-
app:layout_constraintStart_toStartOf="parent"
6362
app:layout_constraintEnd_toStartOf="@+id/button_done"
63+
app:layout_constraintStart_toStartOf="parent"
6464
app:layout_constraintTop_toBottomOf="@+id/password_layout" />
6565

6666
<Button
@@ -75,7 +75,8 @@
7575
android:id="@+id/email_footer_tos_and_pp_text"
7676
style="@style/FirebaseUI.PrivacyFooter"
7777
app:layout_constraintTop_toBottomOf="@+id/button_done"
78-
app:layout_constraintBottom_toBottomOf="parent" />
78+
app:layout_constraintBottom_toBottomOf="parent"
79+
tools:text="Terms of Service and Privacy Policy" />
7980

8081
</android.support.constraint.ConstraintLayout>
8182

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@
1313
<dimen name="fui_button_inset_bottom">3dp</dimen>
1414
<dimen name="fui_button_inset_left">1dp</dimen>
1515
<dimen name="fui_button_inset_right">2dp</dimen>
16+
17+
<dimen name="fui_min_height_target">48dp</dimen>
1618
</resources>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@
146146
</style>
147147

148148
<style name="FirebaseUI.Text.Link">
149+
<item name="android:minHeight">@dimen/fui_min_height_target</item>
150+
<item name="android:gravity">center_vertical</item>
149151
<item name="android:textColor">@color/fui_linkColor</item>
150152
</style>
151153

@@ -256,7 +258,8 @@
256258
<item name="android:layout_height">wrap_content</item>
257259
<item name="android:layout_marginTop">@dimen/fui_field_padding_vert</item>
258260
<item name="android:layout_marginBottom">@dimen/fui_field_padding_vert</item>
259-
<item name="android:gravity">end</item>
261+
<item name="android:minHeight">@dimen/fui_min_height_target</item>
262+
<item name="android:gravity">end|center_vertical</item>
260263
<item name="android:textIsSelectable">false</item>
261264
</style>
262265

auth/src/test/java/com/firebase/ui/auth/testhelpers/TestHelper.java

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import android.content.Context;
1818
import android.content.res.Resources;
19+
import android.util.Log;
1920

2021
import com.firebase.ui.auth.AuthUI;
2122
import com.firebase.ui.auth.AuthUI.IdpConfig;
@@ -35,6 +36,7 @@
3536

3637
import org.robolectric.RuntimeEnvironment;
3738

39+
import java.lang.reflect.Field;
3840
import java.util.ArrayList;
3941
import java.util.Collection;
4042
import java.util.List;
@@ -46,13 +48,17 @@
4648
import static org.mockito.Mockito.when;
4749

4850
public final class TestHelper {
51+
52+
private static final String TAG = "TestHelper";
53+
private static final String DEFAULT_APP_NAME = "[DEFAULT]";
54+
4955
public static final FirebaseApp MOCK_APP;
5056

5157
static {
5258
FirebaseApp app = mock(FirebaseApp.class);
5359
when(app.get(eq(FirebaseAuth.class))).thenReturn(mock(FirebaseAuth.class));
5460
when(app.getApplicationContext()).thenReturn(RuntimeEnvironment.application);
55-
when(app.getName()).thenReturn(FirebaseApp.DEFAULT_APP_NAME);
61+
when(app.getName()).thenReturn(DEFAULT_APP_NAME);
5662
MOCK_APP = app;
5763
}
5864

@@ -141,7 +147,7 @@ public static FlowParameters getFlowParameters(Collection<String> providerIds,
141147
}
142148
}
143149
return new FlowParameters(
144-
FirebaseApp.DEFAULT_APP_NAME,
150+
DEFAULT_APP_NAME,
145151
idpConfigs,
146152
AuthUI.getDefaultTheme(),
147153
AuthUI.NO_LOGO,
@@ -154,5 +160,40 @@ public static FlowParameters getFlowParameters(Collection<String> providerIds,
154160
null);
155161
}
156162

163+
/**
164+
* Set a private, obfuscated field of an object.
165+
* @param obj the object to modify.
166+
* @param objClass the object's class.
167+
* @param fieldClass the class of the target field.
168+
* @param fieldValue the value to use for the field.
169+
*/
170+
public static <T, F> void setPrivateField(
171+
T obj,
172+
Class<T> objClass,
173+
Class<F> fieldClass,
174+
F fieldValue) {
175+
176+
Field targetField = null;
177+
Field[] classFields = objClass.getDeclaredFields();
178+
for (Field field : classFields) {
179+
if (field.getType().equals(fieldClass)) {
180+
if (targetField != null) {
181+
throw new IllegalStateException("Class " + objClass + " has multiple fields of type " + fieldClass);
182+
}
183+
184+
targetField = field;
185+
}
186+
}
187+
188+
if (targetField == null) {
189+
throw new IllegalStateException("Class " + objClass + " has no fields of type " + fieldClass);
190+
}
157191

192+
targetField.setAccessible(true);
193+
try {
194+
targetField.set(obj, fieldValue);
195+
} catch (IllegalAccessException e) {
196+
Log.w(TAG, "Error setting field", e);
197+
}
198+
}
158199
}

0 commit comments

Comments
 (0)