| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.signin; | 5 package org.chromium.chrome.browser.signin; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.util.AttributeSet; | 8 import android.util.AttributeSet; |
| 9 import android.view.View; | 9 import android.view.View; |
| 10 import android.widget.LinearLayout; | 10 import android.widget.LinearLayout; |
| 11 import android.widget.RelativeLayout; | 11 import android.widget.RelativeLayout; |
| 12 import android.widget.ScrollView; | 12 import android.widget.ScrollView; |
| 13 | 13 |
| 14 import org.chromium.chrome.R; | 14 import org.chromium.chrome.R; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * This view allows the user to confirm signed in account, sync, and service pers
onalization. | 17 * This view allows the user to confirm signed in account, sync, and service pers
onalization. |
| 18 */ | 18 */ |
| 19 public class AccountSigninConfirmationView extends ScrollView { | 19 public class AccountSigninConfirmationView extends ScrollView { |
| 20 private Observer mObserver; | 20 private Observer mObserver; |
| 21 private boolean mScrolledToBottom = false; | 21 private boolean mScrolledToBottom; |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * Scrolled to bottom observer. | 24 * Scrolled to bottom observer. |
| 25 */ | 25 */ |
| 26 public interface Observer { | 26 public interface Observer { |
| 27 /** | 27 /** |
| 28 * On scrolled to bottom. This is called only once when showing the view. | 28 * On scrolled to bottom. This is called only once when showing the view. |
| 29 */ | 29 */ |
| 30 void onScrolledToBottom(); | 30 void onScrolledToBottom(); |
| 31 } | 31 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 int distance = (getChildAt(getChildCount() - 1).getBottom() - (getHeight
() + getScrollY())); | 103 int distance = (getChildAt(getChildCount() - 1).getBottom() - (getHeight
() + getScrollY())); |
| 104 if (distance <= findViewById(R.id.signin_settings_control).getPaddingBot
tom()) { | 104 if (distance <= findViewById(R.id.signin_settings_control).getPaddingBot
tom()) { |
| 105 mObserver.onScrolledToBottom(); | 105 mObserver.onScrolledToBottom(); |
| 106 mScrolledToBottom = true; | 106 mScrolledToBottom = true; |
| 107 } else { | 107 } else { |
| 108 mScrolledToBottom = false; | 108 mScrolledToBottom = false; |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 } | 111 } |
| OLD | NEW |