Skip to content

Commit bb9f2ff

Browse files
authored
Merge pull request #805 from firebase/version-2.1.0-dev
Version 2.1.0
2 parents dd34753 + 46ab4a7 commit bb9f2ff

File tree

197 files changed

+7632
-1497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+7632
-1497
lines changed

.idea/codeStyleSettings.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ libraries.
3939
```groovy
4040
dependencies {
4141
// FirebaseUI Database only
42-
compile 'com.firebaseui:firebase-ui-database:2.0.1'
42+
compile 'com.firebaseui:firebase-ui-database:2.1.0'
4343
4444
// FirebaseUI Auth only
45-
compile 'com.firebaseui:firebase-ui-auth:2.0.1'
45+
compile 'com.firebaseui:firebase-ui-auth:2.1.0'
4646
4747
// FirebaseUI Storage only
48-
compile 'com.firebaseui:firebase-ui-storage:2.0.1'
48+
compile 'com.firebaseui:firebase-ui-storage:2.1.0'
4949
5050
// Single target that includes all FirebaseUI libraries above
51-
compile 'com.firebaseui:firebase-ui:2.0.1'
51+
compile 'com.firebaseui:firebase-ui:2.1.0'
5252
}
5353
```
5454

@@ -63,7 +63,7 @@ After the project is synchronized, we're ready to start using Firebase functiona
6363
If you are using an old version of FirebaseUI and upgrading, please see the appropriate
6464
migration guide:
6565

66-
* [Upgrade from 1.2.0 to 2.0.x](./docs/upgrade-to-2.0.md)
66+
* [Upgrade from 1.2.0 to 2.x.x](./docs/upgrade-to-2.0.md)
6767

6868
## Dependencies
6969

@@ -91,6 +91,7 @@ For convenience, here are some recent examples:
9191

9292
| FirebaseUI Version | Firebase/Play Services Version |
9393
|--------------------|--------------------------------|
94+
| 2.1.0 | 11.0.2 |
9495
| 2.0.1 | 11.0.1 |
9596
| 1.2.0 | 10.2.0 |
9697
| 1.1.1 | 10.0.0 or 10.0.1 |

app/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ android {
2323
signingConfig signingConfigs.debug
2424
}
2525
}
26+
27+
lintOptions {
28+
disable 'MissingTranslation'
29+
}
2630
}
2731

2832
dependencies {

app/src/main/AndroidManifest.xml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,50 @@
44
xmlns:tools="http://schemas.android.com/tools"
55
package="com.firebase.uidemo">
66

7-
<uses-permission android:name="android.permission.INTERNET"/>
8-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
7+
<uses-permission android:name="android.permission.INTERNET" />
8+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
99

1010
<application
11-
android:name=".auth.LeakCatcher"
11+
android:name=".auth.FirebaseUIDemo"
12+
android:label="@string/app_name"
1213
android:allowBackup="true"
1314
android:fullBackupContent="true"
1415
android:icon="@mipmap/ic_launcher"
15-
android:label="@string/app_name"
16+
android:supportsRtl="true"
1617
android:theme="@style/AppTheme"
17-
android:supportsRtl="false"
1818
tools:ignore="GoogleAppIndexingWarning">
19+
1920
<activity android:name=".ChooserActivity">
2021
<intent-filter>
21-
<action android:name="android.intent.action.MAIN"/>
22-
<category android:name="android.intent.category.LAUNCHER"/>
22+
<action android:name="android.intent.action.MAIN" />
23+
<category android:name="android.intent.category.LAUNCHER" />
2324
</intent-filter>
2425
<meta-data
2526
android:name="android.app.shortcuts"
26-
android:resource="@xml/shortcuts"/>
27+
android:resource="@xml/shortcuts" />
2728
</activity>
2829

2930
<!-- Chat demo -->
3031
<activity
3132
android:name=".database.ChatActivity"
32-
android:label="@string/name_chat"/>
33+
android:label="@string/name_chat" />
3334
<activity
3435
android:name=".database.ChatIndexActivity"
35-
android:label="@string/name_chat"/>
36+
android:label="@string/name_chat" />
3637

3738
<!-- Auth UI demo -->
3839
<activity
3940
android:name=".auth.AuthUiActivity"
40-
android:label="@string/name_auth_ui"/>
41+
android:label="@string/name_auth_ui" />
4142
<activity
4243
android:name=".auth.SignedInActivity"
43-
android:label="@string/name_auth_ui"/>
44+
android:label="@string/name_auth_ui" />
4445

4546
<!-- Storage UI demo-->
4647
<activity
4748
android:name=".storage.ImageActivity"
48-
android:label="@string/name_image"/>
49+
android:label="@string/name_image" />
50+
4951
</application>
5052

5153
</manifest>

app/src/main/java/com/firebase/uidemo/auth/AuthUiActivity.java

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ public class AuthUiActivity extends AppCompatActivity {
137137
@BindView(R.id.google_scope_youtube_data)
138138
CheckBox mGoogleScopeYoutubeData;
139139

140+
public static Intent createIntent(Context context) {
141+
Intent in = new Intent();
142+
in.setClass(context, AuthUiActivity.class);
143+
return in;
144+
}
145+
140146
@Override
141147
public void onCreate(Bundle savedInstanceState) {
142148
super.onCreate(savedInstanceState);
@@ -150,7 +156,7 @@ public void onCreate(Bundle savedInstanceState) {
150156
return;
151157
}
152158

153-
if (!isGoogleConfigured()) {
159+
if (isGoogleMisconfigured()) {
154160
mUseGoogleProvider.setChecked(false);
155161
mUseGoogleProvider.setEnabled(false);
156162
mUseGoogleProvider.setText(R.string.google_label_missing_config);
@@ -165,7 +171,7 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
165171
});
166172
}
167173

168-
if (!isFacebookConfigured()) {
174+
if (isFacebookMisconfigured()) {
169175
mUseFacebookProvider.setChecked(false);
170176
mUseFacebookProvider.setEnabled(false);
171177
mUseFacebookProvider.setText(R.string.facebook_label_missing_config);
@@ -180,13 +186,13 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
180186
});
181187
}
182188

183-
if (!isTwitterConfigured()) {
189+
if (isTwitterMisconfigured()) {
184190
mUseTwitterProvider.setChecked(false);
185191
mUseTwitterProvider.setEnabled(false);
186192
mUseTwitterProvider.setText(R.string.twitter_label_missing_config);
187193
}
188194

189-
if (!isGoogleConfigured() || !isFacebookConfigured() || !isTwitterConfigured()) {
195+
if (isGoogleMisconfigured() || isFacebookMisconfigured() || isTwitterMisconfigured()) {
190196
showSnackbar(R.string.configuration_required);
191197
}
192198
}
@@ -359,25 +365,23 @@ private String getSelectedPrivacyPolicyUrl() {
359365
}
360366

361367
@MainThread
362-
private boolean isGoogleConfigured() {
363-
return !UNCHANGED_CONFIG_VALUE.equals(
364-
getString(R.string.default_web_client_id));
368+
private boolean isGoogleMisconfigured() {
369+
return UNCHANGED_CONFIG_VALUE.equals(getString(R.string.default_web_client_id));
365370
}
366371

367372
@MainThread
368-
private boolean isFacebookConfigured() {
369-
return !UNCHANGED_CONFIG_VALUE.equals(
370-
getString(R.string.facebook_application_id));
373+
private boolean isFacebookMisconfigured() {
374+
return UNCHANGED_CONFIG_VALUE.equals(getString(R.string.facebook_application_id));
371375
}
372376

373377
@MainThread
374-
private boolean isTwitterConfigured() {
378+
private boolean isTwitterMisconfigured() {
375379
List<String> twitterConfigs = Arrays.asList(
376380
getString(R.string.twitter_consumer_key),
377381
getString(R.string.twitter_consumer_secret)
378382
);
379383

380-
return !twitterConfigs.contains(UNCHANGED_CONFIG_VALUE);
384+
return twitterConfigs.contains(UNCHANGED_CONFIG_VALUE);
381385
}
382386

383387
@MainThread
@@ -408,10 +412,4 @@ private List<String> getGooglePermissions() {
408412
}
409413
return result;
410414
}
411-
412-
public static Intent createIntent(Context context) {
413-
Intent in = new Intent();
414-
in.setClass(context, AuthUiActivity.class);
415-
return in;
416-
}
417415
}

app/src/main/java/com/firebase/uidemo/auth/LeakCatcher.java renamed to app/src/main/java/com/firebase/uidemo/auth/FirebaseUIDemo.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@
22

33
import android.app.Application;
44
import android.content.Context;
5+
import android.support.v7.app.AppCompatDelegate;
56

67
import com.squareup.leakcanary.LeakCanary;
78
import com.squareup.leakcanary.RefWatcher;
89

9-
public class LeakCatcher extends Application {
10+
public class FirebaseUIDemo extends Application {
1011
private RefWatcher mRefWatcher;
1112

13+
static {
14+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO);
15+
}
16+
1217
public static RefWatcher getRefWatcher(Context context) {
13-
return ((LeakCatcher) context.getApplicationContext()).mRefWatcher;
18+
return ((FirebaseUIDemo) context.getApplicationContext()).mRefWatcher;
1419
}
1520

1621
@Override

app/src/main/java/com/firebase/uidemo/auth/SignedInActivity.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ public class SignedInActivity extends AppCompatActivity {
7979

8080
private SignedInConfig mSignedInConfig;
8181

82+
public static Intent createIntent(
83+
Context context,
84+
IdpResponse idpResponse,
85+
SignedInConfig signedInConfig) {
86+
Intent startIntent = idpResponse == null ? new Intent() : idpResponse.toIntent();
87+
88+
return startIntent.setClass(context, SignedInActivity.class)
89+
.putExtra(EXTRA_SIGNED_IN_CONFIG, signedInConfig);
90+
}
91+
8292
@Override
8393
public void onCreate(Bundle savedInstanceState) {
8494
super.onCreate(savedInstanceState);
@@ -220,8 +230,7 @@ private void populateIdpToken() {
220230

221231
@MainThread
222232
private void showSnackbar(@StringRes int errorMessageRes) {
223-
Snackbar.make(mRootView, errorMessageRes, Snackbar.LENGTH_LONG)
224-
.show();
233+
Snackbar.make(mRootView, errorMessageRes, Snackbar.LENGTH_LONG).show();
225234
}
226235

227236
static final class SignedInConfig implements Parcelable {
@@ -283,14 +292,4 @@ public void writeToParcel(Parcel dest, int flags) {
283292
dest.writeInt(isHintSelectorEnabled ? 1 : 0);
284293
}
285294
}
286-
287-
public static Intent createIntent(
288-
Context context,
289-
IdpResponse idpResponse,
290-
SignedInConfig signedInConfig) {
291-
Intent startIntent = idpResponse == null ? new Intent() : idpResponse.toIntent();
292-
293-
return startIntent.setClass(context, SignedInActivity.class)
294-
.putExtra(EXTRA_SIGNED_IN_CONFIG, signedInConfig);
295-
}
296295
}

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<string name="desc_image">Demonstrates displaying an image from Cloud Storage using Glide.</string>
1111

1212
<!-- strings for Auth UI demo activities -->
13-
<eat-comment/>
13+
<eat-comment />
1414
<string name="launch_title">FirebaseUI Auth Demo</string>
1515
<string name="sign_in">Start</string>
1616
<string name="green_theme">Green Theme</string>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<resources>
22

33
<!-- Base application theme. -->
4-
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
4+
<style name="AppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
55
<item name="colorPrimary">@color/colorPrimary</item>
66
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
77
<item name="colorAccent">@color/colorAccent</item>

auth/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Gradle, add the dependency:
4646
```groovy
4747
dependencies {
4848
// ...
49-
compile 'com.firebaseui:firebase-ui-auth:2.0.1'
49+
compile 'com.firebaseui:firebase-ui-auth:2.1.0'
5050
5151
// Required only if Facebook login support is required
5252
compile('com.facebook.android:facebook-android-sdk:4.22.1')
@@ -56,6 +56,26 @@ dependencies {
5656
}
5757
```
5858

59+
As of version `2.1.0` FirebaseUI includes translations for all string resources. In order to
60+
ensure that you only get the translations relevant to your application, we recommend changing the
61+
`resConfigs` of your application module:
62+
63+
```groovy
64+
android {
65+
66+
// ...
67+
68+
defaultConfig {
69+
// ...
70+
resConfigs "auto"
71+
}
72+
73+
}
74+
```
75+
76+
See the [Android documentation](https://developer.android.com/studio/build/shrink-code.html#unused-alt-resources)
77+
for more information.
78+
5979
### Identity provider configuration
6080

6181
In order to use either Google, Facebook or Twitter accounts with your app, ensure that

auth/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ android {
2727
}
2828
}
2929

30+
lintOptions {
31+
disable 'UnusedQuantity'
32+
}
33+
3034
testOptions {
3135
unitTests.all {
3236
testLogging {

0 commit comments

Comments
 (0)