Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
David Daudelin committed Mar 27, 2020
2 parents 1341e4e + 2549552 commit 662b4aa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package com.amazonaws.mobile.auth.userpools;

import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
Expand All @@ -42,15 +43,7 @@ public class FormView extends LinearLayout {
private static final int FIELD_LEFT_RIGHT_MARGIN = dp(20);

/** Background Drawables for the form. */
private final Drawable[] backgroundDrawables = new Drawable[] {
// Border Shadow
createRoundedRectShape(FORM_CORNER_RADIUS, Color.DKGRAY, 10),
createRoundedRectShape(FORM_CORNER_RADIUS, Color.DKGRAY, 20),
createRoundedRectShape(FORM_CORNER_RADIUS, Color.DKGRAY, 30),
createRoundedRectShape(FORM_CORNER_RADIUS, Color.DKGRAY, 50),
createRoundedRectShape(FORM_CORNER_RADIUS, Color.DKGRAY, 80),
// Background Color
createRoundedRectShape(FORM_CORNER_RADIUS, Color.WHITE, 100)};
private final Drawable[] backgroundDrawables;

public FormView(final Context context) {
this(context, null);
Expand All @@ -62,6 +55,24 @@ public FormView(final Context context, @Nullable final AttributeSet attrs) {

public FormView(final Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);

boolean isDarkModeOn = (context.getResources().getConfiguration().uiMode &
Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;

backgroundDrawables = new Drawable[] {
// Border Shadow
createRoundedRectShape(FORM_CORNER_RADIUS, Color.DKGRAY, 10),
createRoundedRectShape(FORM_CORNER_RADIUS, Color.DKGRAY, 20),
createRoundedRectShape(FORM_CORNER_RADIUS, Color.DKGRAY, 30),
createRoundedRectShape(FORM_CORNER_RADIUS, Color.DKGRAY, 50),
createRoundedRectShape(FORM_CORNER_RADIUS, Color.DKGRAY, 80),
// Background color
createRoundedRectShape(FORM_CORNER_RADIUS,
isDarkModeOn
? Color.BLACK
: Color.WHITE
, 100)};

this.setOrientation(VERTICAL);
this.setBackgroundDrawable(getFormBackground());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ private Runnable _signIn(final String username,

this.signInCallback = callback;
signInState = null;
mStore.set(SIGN_IN_MODE, SignInMode.SIGN_IN.toString());

return new Runnable() {
@Override
Expand Down Expand Up @@ -1603,6 +1604,8 @@ private Runnable _federatedSignIn(final String providerKey,
final boolean assignState) {

final Map<String, String> loginsMap = new HashMap<String, String>();
mStore.set(SIGN_IN_MODE, SignInMode.FEDERATED_SIGN_IN.toString());

try {
loginsMap.put(providerKey, token);

Expand Down

0 comments on commit 662b4aa

Please sign in to comment.