Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4182)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/firstrun/ImageCarousel.java

Issue 1574273002: Unify and Improve the Sign-In and Sync Confirmation Screens on Clank. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/firstrun/ImageCarousel.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ImageCarousel.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ImageCarousel.java
index df5a61f7a456b7fccc045f36258de5f03fb01d21..4fb92ef555e1b9fb6b4f26ba6e96a7f6b70673ce 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ImageCarousel.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ImageCarousel.java
@@ -220,25 +220,38 @@ public class ImageCarousel extends FrameLayout implements GestureDetector.OnGest
updateImageViews();
}
+ ImageView mCheckmark;
/**
- * Sets the ImageCarousel to signed in mode that disables scrolling, animates away the
- * background images, and displays a checkmark next to the account image that was chosen.
+ * Sets whether the ImageCarousel is in signed in mode. This mode disables scrolling, animates
+ * away the background images, and displays a checkmark next to the chosen account image.
+ * @param isSignedIn Whether the ImageCarousel should in signed in mode or not.
*/
- public void setSignedInMode() {
- mScrollingDisabled = true;
- mAccountSelected = true;
+ public void setSignedInMode(boolean isSignedIn) {
+ mScrollingDisabled = isSignedIn;
+ mAccountSelected = isSignedIn;
setPosition(getCenterPosition());
- ImageView checkmark = new ImageView(getContext());
- checkmark.setImageResource(R.drawable.verify_checkmark);
- setLayoutParamsForCheckmark(checkmark);
- addView(checkmark);
+ if (mCheckmark == null) {
+ // If the checkmark hasn't been created and we don't want to show it, exit early.
+ if (!isSignedIn) {
+ return;
+ }
+
+ mCheckmark = new ImageView(getContext());
+ mCheckmark.setImageResource(R.drawable.verify_checkmark);
+ setLayoutParamsForCheckmark(mCheckmark);
+ addView(mCheckmark);
+ }
if (mFadeInOutAnimator != null) mFadeInOutAnimator.cancel();
AnimatorSet animatorSet = new AnimatorSet();
- animatorSet.playTogether(
- ObjectAnimator.ofFloat(this, BACKGROUND_IMAGE_ALPHA, 0),
- ObjectAnimator.ofFloat(checkmark, View.ALPHA, 0.0f, 1.0f));
+ if (isSignedIn) {
+ animatorSet.playTogether(ObjectAnimator.ofFloat(this, BACKGROUND_IMAGE_ALPHA, 0),
+ ObjectAnimator.ofFloat(mCheckmark, View.ALPHA, 0.0f, 1.0f));
+ } else {
+ animatorSet.playTogether(ObjectAnimator.ofFloat(this, BACKGROUND_IMAGE_ALPHA, 1),
+ ObjectAnimator.ofFloat(mCheckmark, View.ALPHA, 1.0f, 0.0f));
+ }
mFadeInOutAnimator = animatorSet;
mFadeInOutAnimator.setDuration(ACCOUNT_SIGNED_IN_ANIMATION_DURATION_MS);
mFadeInOutAnimator.start();

Powered by Google App Engine
This is Rietveld 408576698