-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Refactor chooseAccountActivity #357
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
Changes from all commits
05ce3b5
2391efb
05a476a
2c0eaf5
8adeee1
11f3c2b
cb826f4
3b788f5
9eaa4cd
3b76ac6
86d58a9
6ad0021
550acc9
b9d3ca5
a8b5cf5
83e13d8
c529171
5142dec
361d308
9a4921e
6af7674
35d94bb
64728b2
dde4160
2d5dfdc
f3bd0f1
f06845b
9782793
7d1d1c6
20413ee
7842c48
135d2c5
23ae513
25eb137
be7e0c3
07beeb3
13122c3
862b884
a7b3336
db96c91
19bde41
96027d0
9511a6d
cbe0cfb
a81bf5a
db05831
8c96216
d333302
cb6efad
af644be
4152c23
2cc8adf
c138a51
f88aab3
ad115f0
0a161d7
8813c8c
6f0f4da
099ef6d
517f4ce
24ef137
9b568ec
4a449d5
a6553d5
00126d1
a9c895e
8566118
f5738b1
1fb5c08
1793dbd
ca10f6c
a0355b5
e60bb5e
7fcf057
121919a
a78480e
a94aedc
cda7bfd
83a0551
4613154
058d4fe
c1418ef
6d0bf2f
4998691
e7627fa
ee5810a
9bb8353
aff9984
a39eb0f
c5878d2
be88ece
8866f60
cc22d28
d0ef556
ea2434d
c77ea5b
d4278e7
e6ff3ef
3cbfed5
3210e7e
eed92af
80a4cb0
e25e64e
42d695c
e8d5bbe
be698da
ac0a78e
6cce271
6870518
bb09653
151b8d3
707f51a
6b678e4
52d27a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.firebase.uidemo.auth; | ||
|
||
import android.app.Application; | ||
import android.content.Context; | ||
|
||
import com.squareup.leakcanary.LeakCanary; | ||
import com.squareup.leakcanary.RefWatcher; | ||
|
||
public class LeakCatcher extends Application { | ||
private RefWatcher mRefWatcher; | ||
|
||
public static RefWatcher getRefWatcher(Context context) { | ||
return ((LeakCatcher) context.getApplicationContext()).mRefWatcher; | ||
} | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
if (LeakCanary.isInAnalyzerProcess(this)) { | ||
// This process is dedicated to LeakCanary for heap analysis. | ||
// You should not init your app in this process. | ||
return; | ||
} | ||
mRefWatcher = LeakCanary.install(this); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,16 +16,16 @@ | |
android:value="@string/twitter_consumer_secret"/> | ||
|
||
<activity | ||
android:name="com.firebase.ui.auth.ui.email.ConfirmRecoverPasswordActivity" | ||
android:label="@string/title_confirm_recover_password_activity" | ||
android:name=".KickoffActivity" | ||
android:label="@string/default_toolbar_title" | ||
android:exported="false" | ||
android:theme="@style/FirebaseUI.Dialog"/> | ||
android:theme="@style/Theme.AppCompat.NoActionBar"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this make the Activity visible? Any reason not to use the totally transparent theme from my gist? I'm sure an AppCompat-based one could be made as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Neither your solution nor mine works. Everything I tried had no effect; even the actionbar is still there. I think something is going on with the style not being applied properly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok we can address that separately, since having a kickoff activity is not a regression. |
||
|
||
<activity | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See below, this was useless. (You guys were a bit too heavy on activities while writing this library! 😄) |
||
android:name=".ui.email.EmailHintContainerActivity" | ||
android:label="@string/default_toolbar_title" | ||
android:exported="false" | ||
android:theme="@style/FirebaseUI.Translucent"/> | ||
android:theme="@style/Theme.AppCompat.NoActionBar"/> | ||
|
||
<activity | ||
android:name=".ui.email.RecoverPasswordActivity" | ||
|
@@ -69,23 +69,11 @@ | |
android:exported="false" | ||
android:theme="@style/FirebaseUI"/> | ||
|
||
<activity | ||
android:name=".ui.idp.IdpSignInContainerActivity" | ||
android:label="@string/default_toolbar_title" | ||
android:exported="false" | ||
android:theme="@style/FirebaseUI.Translucent"/> | ||
|
||
<activity | ||
android:name=".ui.ChooseAccountActivity" | ||
android:label="@string/default_toolbar_title" | ||
android:exported="false" | ||
android:theme="@style/FirebaseUI.Translucent"/> | ||
|
||
<activity | ||
android:name="com.facebook.FacebookActivity" | ||
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" | ||
android:label="@string/app_name" | ||
android:theme="@style/FirebaseUI.Translucent" | ||
android:theme="@style/Theme.AppCompat.NoActionBar" | ||
tools:replace="android:theme"/> | ||
|
||
<activity | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.firebase.ui.auth; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
|
||
import com.firebase.ui.auth.ui.ActivityHelper; | ||
import com.firebase.ui.auth.ui.AppCompatBase; | ||
import com.firebase.ui.auth.ui.ExtraConstants; | ||
import com.firebase.ui.auth.ui.FlowParameters; | ||
import com.firebase.ui.auth.util.signincontainer.SignInDelegate; | ||
|
||
public class KickoffActivity extends AppCompatBase { | ||
@Override | ||
protected void onCreate(Bundle savedInstance) { | ||
super.onCreate(savedInstance); | ||
if (savedInstance == null) { | ||
SignInDelegate.delegate(this, mActivityHelper.getFlowParams()); | ||
} | ||
} | ||
|
||
@Override | ||
public void onSaveInstanceState(Bundle outState) { | ||
// It doesn't matter what we put here, we just don't want outState to be empty | ||
outState.putBoolean(ExtraConstants.HAS_EXISTING_INSTANCE, true); | ||
super.onSaveInstanceState(outState); | ||
} | ||
|
||
@Override | ||
protected void onActivityResult(int requestCode, int resultCode, Intent data) { | ||
super.onActivityResult(requestCode, resultCode, data); | ||
SignInDelegate delegate = SignInDelegate.getInstance(this); | ||
if (delegate != null) { | ||
delegate.onActivityResult(requestCode, resultCode, data); | ||
} | ||
} | ||
|
||
public static Intent createIntent(Context context, FlowParameters flowParams) { | ||
return ActivityHelper.createBaseIntent(context, KickoffActivity.class, flowParams); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to keeping LeakCanary around
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!