Skip to content

Merge version-1.1.0-dev into master #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 49 commits into from
Jan 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
5bb61d1
Complete rewrite/refactor of email sign in flow (#418)
SUPERCILEX Dec 6, 2016
ac1fb39
Add and enforce checkstyle, lint, findbugs, and pmd (#420)
SUPERCILEX Dec 6, 2016
44a4f27
Differentiate between user cancellation and actual errors (#426)
SUPERCILEX Dec 6, 2016
ff1e875
Fix typo in sample
SUPERCILEX Dec 7, 2016
7944823
Fb mem leak + remove BuildConfig.DEBUG (#442)
SUPERCILEX Dec 7, 2016
7ac1953
Merge pull request #444 from SUPERCILEX/patch-1
samtstern Dec 7, 2016
ff427d6
Remove unnecessary SignInActivity (#443)
SUPERCILEX Dec 7, 2016
18baedf
Refactor email flow into fragments
samtstern Dec 7, 2016
0783098
Add some better transitions/animations
samtstern Dec 8, 2016
1184b91
Review comments and lint checks
samtstern Dec 8, 2016
bc428ed
Fix RTL lint errors
samtstern Dec 8, 2016
57ee6c2
Fix travis
SUPERCILEX Dec 8, 2016
3276b1f
Move back to sudo in travis
samtstern Dec 8, 2016
014996f
Fix NPE in FacebookProvider.java
SUPERCILEX Dec 10, 2016
d1d678e
Merge pull request #453 from SUPERCILEX/fix-NPE
samtstern Dec 12, 2016
18d06ae
Update dependencies (#3)
SUPERCILEX Dec 14, 2016
c52387e
Request Twitter email (#452)
SUPERCILEX Dec 15, 2016
202c56e
Use vectors instead of pngs! (#459)
SUPERCILEX Dec 19, 2016
5b2fc22
Merge branch 'version-1.1.0-dev' into email-refactor
samtstern Dec 20, 2016
f6fb313
Fix a ton of bugs (#4)
SUPERCILEX Dec 20, 2016
2c7ffbc
Update ExtraConstants.java (#5)
SUPERCILEX Dec 21, 2016
e074fac
Merge pull request #447 from samtstern/email-refactor
samtstern Dec 22, 2016
81dbbca
Cleanup + make sure IdpResponse is never null if resultCode == Result…
SUPERCILEX Dec 22, 2016
63e3f95
Fix broken play services checks (#462)
SUPERCILEX Dec 22, 2016
ab9b801
Rename BaseDialog and BaseFragment to be like other bases in Firebase…
SUPERCILEX Jan 3, 2017
1df7d3d
Use native string formatter (#475)
SUPERCILEX Jan 3, 2017
a62f5ec
Make Snackbar dismissable in sample (#485)
SUPERCILEX Jan 3, 2017
48e138f
Fix create account title not showing up (and cleanup strings) (#484)
SUPERCILEX Jan 3, 2017
7415825
Cleanup (#470)
SUPERCILEX Jan 3, 2017
129c34c
Add android build cache to Travis
SUPERCILEX Jan 4, 2017
c29d25b
Merge pull request #489 from SUPERCILEX/cache
samtstern Jan 4, 2017
2a25978
Use lint to define what is public and what isn't (#491)
SUPERCILEX Jan 4, 2017
1d7076e
Make KickoffActivity truly transparent (#495)
samtstern Jan 5, 2017
a4a556a
Remove unnecessary theme attributes in AndroidManifest.xml (#496)
SUPERCILEX Jan 6, 2017
11ba2ee
Fix inflation errors
SUPERCILEX Jan 7, 2017
632b0e0
Merge pull request #500 from SUPERCILEX/inflate-errors
samtstern Jan 9, 2017
01f5c8f
Robolectic now supports api 25! (#494)
SUPERCILEX Jan 9, 2017
97ac613
fix : fix wrong colors in AuthUI EditText with NightMode (#504)
harshithdwivedi Jan 9, 2017
dd6dd6a
This change allows easy detection of the list being empty *and* respo…
puf Jan 10, 2017
1a6f7bb
Add info regarding tests, lint, and checkstyle (#509)
SUPERCILEX Jan 10, 2017
87b1c31
Fix documentation
SUPERCILEX Jan 11, 2017
56a45e3
Merge pull request #512 from SUPERCILEX/fix-docs
samtstern Jan 11, 2017
816ac10
Update dependencies and fix lint stuff (#511)
SUPERCILEX Jan 11, 2017
48a2fe4
Revert "fix : fix wrong colors in AuthUI EditText with NightMode (#504)"
samtstern Jan 12, 2017
baf6d33
Changes resulting from QA:
samtstern Jan 12, 2017
f89d06f
Fix lint issue.
samtstern Jan 12, 2017
7eaa457
Merge pull request #515 from samtstern/version-1.1.0-qa
samtstern Jan 12, 2017
ba6fb91
Version 1.1.0
samtstern Jan 12, 2017
608a9b2
Merge branch 'master' into version-1.1.0-dev
samtstern Jan 12, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
.gradle
/**/*.iml
/local.properties
.idea
.DS_Store
/build
/captures
/library/target
/**/*.iml
google-services.json
build/
25 changes: 19 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,27 @@ cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
android:
components:
- platform-tools
- tools
- build-tools-25.0.1
- build-tools-25.0.2
- android-25

# Extras
- extra-google-m2repository
- platform-tools
- extra-android-m2repository
script: ./gradlew clean :library:testAll :library:prepareArtifacts
- extra-google-m2repository
before_script: mv library/google-services.json app/google-services.json
script: ./gradlew clean assembleDebug check
after_failure:
# tests
- cat app/build/reports/tests/testDebugUnitTest/index.html
- cat auth/build/reports/tests/testDebugUnitTest/index.html
- cat database/build/reports/tests/testDebugUnitTest/index.html
- cat storage/build/reports/tests/testDebugUnitTest/index.html

# app
- cat app/build/reports/checkstyle.html
- cat app/build/reports/lint-results.xml
- cat app/build/reports/lint-results.html
- cat app/build/reports/findbugs.html
- cat app/build/reports/pmd.html
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ Feature parity (where it makes sense) is a strict requirement for feature develo
### Code reviews

All submissions, including submissions by project members, require review. We
use Github pull requests for this purpose. We adhere to the
use GitHub pull requests for this purpose. We adhere to the
[Google Java style guide](https://google.github.io/styleguide/javaguide.html).
In addition, style and lint checks are run on each Travis build to ensure quality. To run the full
suite of tests, checks, lint, etc, use `./gradlew check` (this will ensure the Travis build passes).

### The small print

Expand Down
1 change: 1 addition & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Hey there! So you want to contribute to FirebaseUI? Before you file this pull request, follow these steps:

* Read [the contribution guidelines](CONTRIBUTING.md).
* Run `./gradlew check` to ensure the Travis build passes.
* If this has been discussed in an issue, make sure to mention the issue number here. If not, go file an issue about this to make sure this is a desirable change.
* If this is a new feature please co-ordinate with someone on [FirebaseUI-iOS](https://github.com/firebase/firebaseui-ios) to make sure that we can implement this on both platforms and maintain feature parity.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ libraries.
```groovy
dependencies {
// FirebaseUI Database only
compile 'com.firebaseui:firebase-ui-database:1.0.1'
compile 'com.firebaseui:firebase-ui-database:1.1.0'

// FirebaseUI Auth only
compile 'com.firebaseui:firebase-ui-auth:1.0.1'
compile 'com.firebaseui:firebase-ui-auth:1.1.0'

// FirebaseUI Storage only
compile 'com.firebaseui:firebase-ui-storage:1.0.1'
compile 'com.firebaseui:firebase-ui-storage:1.1.0'

// Single target that includes all FirebaseUI libraries above
compile 'com.firebaseui:firebase-ui:1.0.1'
compile 'com.firebaseui:firebase-ui:1.1.0'
}
```

Expand Down Expand Up @@ -67,6 +67,7 @@ For convenience, here are some examples:

| FirebaseUI Version | Firebase/Play Services Version |
|--------------------|--------------------------------|
| 1.1.0 | 10.0.0 or 10.0.1 |
| 1.0.1 | 10.0.0 or 10.0.1 |
| 1.0.0 | 9.8.0 |
| 0.6.2 | 9.8.0 |
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply from: "../common/constants.gradle"
apply from: "../constants.gradle"
apply from: '../library/quality/quality.gradle'

android {
compileSdkVersion compileSdk
Expand Down Expand Up @@ -42,7 +43,6 @@ dependencies {
// The following dependencies are not required to use the Firebase UI library.
// They are used to make some aspects of the demo app implementation simpler for
// demonstrative purposes, and you may find them useful in your own apps; YMMV.
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'pub.devrel:easypermissions:0.2.1'
compile 'com.jakewharton:butterknife:8.4.0'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.firebase.uidemo">

<uses-permission android:name="android.permission.INTERNET"/>
Expand All @@ -9,9 +10,12 @@
<application
android:name=".auth.LeakCatcher"
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:supportsRtl="false"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".ChooserActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
Expand Down
9 changes: 4 additions & 5 deletions app/src/main/java/com/firebase/uidemo/ChooserActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,21 @@ public void onItemClick(int position) {
public static class MyArrayAdapter extends ArrayAdapter<Class> {

private Context mContext;
private Class[] mClasses;

public MyArrayAdapter(Context context, int resource, Class[] objects) {
public MyArrayAdapter(Context context, int resource, Class... objects) {
super(context, resource, objects);

mContext = context;
mClasses = objects;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
View view;

if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(android.R.layout.simple_list_item_2, null);
} else {
view = convertView;
}

((TextView) view.findViewById(android.R.id.text1)).setText(DESCRIPTION_NAMES[position]);
Expand Down
57 changes: 34 additions & 23 deletions app/src/main/java/com/firebase/uidemo/auth/AuthUiActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@

import com.firebase.ui.auth.AuthUI;
import com.firebase.ui.auth.AuthUI.IdpConfig;
import com.firebase.ui.auth.ErrorCodes;
import com.firebase.ui.auth.IdpResponse;
import com.firebase.ui.auth.ui.ResultCodes;
import com.firebase.ui.auth.ResultCodes;
import com.firebase.uidemo.R;
import com.google.android.gms.common.Scopes;
import com.google.firebase.auth.FirebaseAuth;
Expand All @@ -50,7 +51,7 @@
public class AuthUiActivity extends AppCompatActivity {
private static final String UNCHANGED_CONFIG_VALUE = "CHANGE-ME";
private static final String GOOGLE_TOS_URL = "https://www.google.com/policies/terms/";
private static final String FIREBASE_TOS_URL = "https://www.firebase.com/terms/terms-of-service.html";
private static final String FIREBASE_TOS_URL = "https://firebase.google.com/terms/";
private static final int RC_SIGN_IN = 100;

@BindView(R.id.default_theme)
Expand Down Expand Up @@ -86,7 +87,7 @@ public class AuthUiActivity extends AppCompatActivity {
@BindView(R.id.sign_in)
Button mSignIn;

@BindView(android.R.id.content)
@BindView(R.id.root)
View mRootView;

@BindView(R.id.firebase_logo)
Expand Down Expand Up @@ -199,20 +200,30 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {

@MainThread
private void handleSignInResponse(int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
startActivity(SignedInActivity.createIntent(this, IdpResponse.fromResultIntent(data)));
finish();
return;
}

if (resultCode == RESULT_CANCELED) {
showSnackbar(R.string.sign_in_cancelled);
return;
}
IdpResponse response = IdpResponse.fromResultIntent(data);

if (resultCode == ResultCodes.RESULT_NO_NETWORK) {
showSnackbar(R.string.no_internet_connection);
// Successfully signed in
if (resultCode == ResultCodes.OK) {
startActivity(SignedInActivity.createIntent(this, response));
finish();
return;
} else {
// Sign in failed
if (response == null) {
// User pressed back button
showSnackbar(R.string.sign_in_cancelled);
return;
}

if (response.getErrorCode() == ErrorCodes.NO_NETWORK) {
showSnackbar(R.string.no_internet_connection);
return;
}

if (response.getErrorCode() == ErrorCodes.UNKNOWN_ERROR) {
showSnackbar(R.string.unknown_error);
return;
}
}

showSnackbar(R.string.unknown_sign_in_response);
Expand Down Expand Up @@ -269,6 +280,10 @@ private List<IdpConfig> getSelectedProviders() {
selectedProviders.add(new IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build());
}

if (mUseTwitterProvider.isChecked()) {
selectedProviders.add(new IdpConfig.Builder(AuthUI.TWITTER_PROVIDER).build());
}

if (mUseFacebookProvider.isChecked()) {
selectedProviders.add(
new IdpConfig.Builder(AuthUI.FACEBOOK_PROVIDER)
Expand All @@ -283,10 +298,6 @@ private List<IdpConfig> getSelectedProviders() {
.build());
}

if (mUseTwitterProvider.isChecked()) {
selectedProviders.add(new IdpConfig.Builder(AuthUI.TWITTER_PROVIDER).build());
}

return selectedProviders;
}

Expand All @@ -302,20 +313,20 @@ private String getSelectedTosUrl() {
@MainThread
private boolean isGoogleConfigured() {
return !UNCHANGED_CONFIG_VALUE.equals(
getResources().getString(R.string.default_web_client_id));
getString(R.string.default_web_client_id));
}

@MainThread
private boolean isFacebookConfigured() {
return !UNCHANGED_CONFIG_VALUE.equals(
getResources().getString(R.string.facebook_application_id));
getString(R.string.facebook_application_id));
}

@MainThread
private boolean isTwitterConfigured() {
List<String> twitterConfigs = Arrays.asList(
getResources().getString(R.string.twitter_consumer_key),
getResources().getString(R.string.twitter_consumer_secret)
getString(R.string.twitter_consumer_key),
getString(R.string.twitter_consumer_secret)
);

return !twitterConfigs.contains(UNCHANGED_CONFIG_VALUE);
Expand Down
49 changes: 27 additions & 22 deletions app/src/main/java/com/firebase/uidemo/auth/SignedInActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

import com.bumptech.glide.Glide;
import com.firebase.ui.auth.AuthUI;
import com.firebase.ui.auth.IdpResponse;
Expand All @@ -42,11 +40,14 @@
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.auth.GoogleAuthProvider;

import java.util.Iterator;

public class SignedInActivity extends AppCompatActivity {
private static final String EXTRA_IDP_RESPONSE = "extra_idp_response";
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class SignedInActivity extends AppCompatActivity {
@BindView(android.R.id.content)
View mRootView;

Expand All @@ -62,6 +63,8 @@ public class SignedInActivity extends AppCompatActivity {
@BindView(R.id.user_enabled_providers)
TextView mEnabledProviders;

private IdpResponse mIdpResponse;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -73,6 +76,8 @@ public void onCreate(Bundle savedInstanceState) {
return;
}

mIdpResponse = IdpResponse.fromResultIntent(getIntent());

setContentView(R.layout.signed_in_layout);
ButterKnife.bind(this);
populateProfile();
Expand Down Expand Up @@ -144,7 +149,7 @@ private void populateProfile() {
mUserDisplayName.setText(
TextUtils.isEmpty(user.getDisplayName()) ? "No display name" : user.getDisplayName());

StringBuilder providerList = new StringBuilder();
StringBuilder providerList = new StringBuilder(100);

providerList.append("Providers used: ");

Expand Down Expand Up @@ -174,20 +179,21 @@ private void populateProfile() {
}

private void populateIdpToken() {
IdpResponse idpResponse = getIntent().getParcelableExtra(EXTRA_IDP_RESPONSE);
if (idpResponse != null) {
String token = idpResponse.getIdpToken();
String secret = idpResponse.getIdpSecret();
if (token == null) {
findViewById(R.id.idp_token_layout).setVisibility(View.GONE);
} else {
((TextView) findViewById(R.id.idp_token)).setText(token);
}
if (secret == null) {
findViewById(R.id.idp_secret_layout).setVisibility(View.GONE);
} else {
((TextView) findViewById(R.id.idp_secret)).setText(secret);
}
String token = null;
String secret = null;
if (mIdpResponse != null) {
token = mIdpResponse.getIdpToken();
secret = mIdpResponse.getIdpSecret();
}
if (token == null) {
findViewById(R.id.idp_token_layout).setVisibility(View.GONE);
} else {
((TextView) findViewById(R.id.idp_token)).setText(token);
}
if (secret == null) {
findViewById(R.id.idp_secret_layout).setVisibility(View.GONE);
} else {
((TextView) findViewById(R.id.idp_secret)).setText(secret);
}
}

Expand All @@ -198,9 +204,8 @@ private void showSnackbar(@StringRes int errorMessageRes) {
}

public static Intent createIntent(Context context, IdpResponse idpResponse) {
Intent in = new Intent();
Intent in = IdpResponse.getIntent(idpResponse);
in.setClass(context, SignedInActivity.class);
in.putExtra(EXTRA_IDP_RESPONSE, idpResponse);
return in;
}
}
Loading