-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix small issues left in version 4.2.1 #1495
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
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
647cedd
Build fixes
samtstern 24bb15c
Add v21 version of anonymous button background
samtstern 7042f21
Fix touch target sizes
samtstern 52af1a4
Bump some dependencies, fix lint
samtstern b82ca5b
Fix phone auth scroll bar
samtstern 043f363
Merge branch 'version-4.2.1-dev' into ss-version-4.2.1
samtstern 2e7aeb6
Fix anonymous icon
samtstern ff62cf3
Add testing hack
samtstern 4a14a50
Review nits:
samtstern File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
auth/src/main/res/drawable-v21/fui_idp_button_background_anonymous.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
lsirac marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="rectangle"> | ||
<corners android:radius="3dp" /> | ||
<solid android:color="@color/fui_bgAnonymous" /> | ||
</shape> | ||
</item> | ||
</layer-list> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
<vector | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportHeight="24.0" | ||
android:viewportWidth="24.0" | ||
tools:ignore="InvalidVectorPath"> | ||
android:viewportWidth="24.0"> | ||
<path | ||
android:fillColor="#FFFFFF" | ||
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" /> | ||
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" /> | ||
lsirac marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</vector> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
|
||
import android.content.Context; | ||
import android.content.res.Resources; | ||
import android.util.Log; | ||
|
||
import com.firebase.ui.auth.AuthUI; | ||
import com.firebase.ui.auth.AuthUI.IdpConfig; | ||
|
@@ -34,6 +35,7 @@ | |
|
||
import org.robolectric.RuntimeEnvironment; | ||
|
||
import java.lang.reflect.Field; | ||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.List; | ||
|
@@ -44,13 +46,17 @@ | |
import static org.mockito.Mockito.when; | ||
|
||
public final class TestHelper { | ||
|
||
private static final String TAG = "TestHelper"; | ||
private static final String DEFAULT_APP_NAME = "[DEFAULT]"; | ||
lsirac marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
public static final FirebaseApp MOCK_APP; | ||
|
||
static { | ||
FirebaseApp app = mock(FirebaseApp.class); | ||
when(app.get(eq(FirebaseAuth.class))).thenReturn(mock(FirebaseAuth.class)); | ||
when(app.getApplicationContext()).thenReturn(RuntimeEnvironment.application); | ||
when(app.getName()).thenReturn(FirebaseApp.DEFAULT_APP_NAME); | ||
when(app.getName()).thenReturn(DEFAULT_APP_NAME); | ||
MOCK_APP = app; | ||
} | ||
|
||
|
@@ -134,7 +140,7 @@ public static FlowParameters getFlowParameters(Collection<String> providerIds, | |
} | ||
} | ||
return new FlowParameters( | ||
FirebaseApp.DEFAULT_APP_NAME, | ||
DEFAULT_APP_NAME, | ||
idpConfigs, | ||
AuthUI.getDefaultTheme(), | ||
AuthUI.NO_LOGO, | ||
|
@@ -146,5 +152,40 @@ public static FlowParameters getFlowParameters(Collection<String> providerIds, | |
false); | ||
} | ||
|
||
/** | ||
* Set a private, obfuscated field of an object. | ||
* @param obj the object to modify. | ||
* @param objClass the object's class. | ||
* @param fieldClass the class of the target field. | ||
* @param fieldValue the value to use for the field. | ||
*/ | ||
public static <T, F> void setPrivateField( | ||
T obj, | ||
Class<T> objClass, | ||
Class<F> fieldClass, | ||
F fieldValue) { | ||
|
||
Field targetField = null; | ||
Field[] classFields = objClass.getDeclaredFields(); | ||
for (Field field : classFields) { | ||
if (field.getType().equals(fieldClass)) { | ||
if (targetField != null) { | ||
throw new IllegalStateException("Class " + objClass + " has multiple fields of type " + fieldClass); | ||
} | ||
|
||
targetField = field; | ||
} | ||
} | ||
|
||
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. Nit: extra space & I would name f "field" instead |
||
if (targetField == null) { | ||
throw new IllegalStateException("Class " + objClass + " has no fields of type " + fieldClass); | ||
} | ||
|
||
targetField.setAccessible(true); | ||
try { | ||
targetField.set(obj, fieldValue); | ||
} catch (IllegalAccessException e) { | ||
Log.w(TAG, "Error setting field", e); | ||
} | ||
} | ||
samtstern marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// This empty file along with settings.gradle help Android Studio recognize the project | ||
// as a gradle project, despite the use of .gradle.kts scripts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
rootProject.buildFileName = 'build.gradle.kts' | ||
|
||
include( | ||
":app", ":library", | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since we were using "fast scrolling" this method had to be implemented to get the scroll bar to work correctly.
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.
I tested this, and it seems a bit jumpy. If you scroll all the way down, and go back up, it immediately jumps to a quarter of the way up. If you can fix that, it'd be perfect. Otherwise, still a big improvement over what we had.
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.
The scrollbar also doesn't show up unless we start scrolling - is that the intended behavior?
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.
Yeah won't show up till you start scrolling, that's normal. There's nothing I can figure out to fix the jumpiness, will maybe look into it again later if people report it.