Loading packages/SystemUI/src/com/android/systemui/ExpandHelper.java +19 −5 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { private int mGravity; private View mScrollView; private ScrollAdapter mScrollAdapter; private OnScaleGestureListener mScaleGestureListener = new ScaleGestureDetector.SimpleOnScaleGestureListener() { Loading Loading @@ -301,8 +301,8 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { mGravity = gravity; } public void setScrollView(View scrollView) { mScrollView = scrollView; public void setScrollAdapter(ScrollAdapter adapter) { mScrollAdapter = adapter; } private float calculateGlow(float target, float actual) { Loading Loading @@ -384,7 +384,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { } return true; } if (mScrollView != null && mScrollView.getScrollY() > 0) { if (mScrollAdapter != null && !mScrollAdapter.isScrolledToTop()) { return false; } // Now look for other gestures Loading @@ -407,7 +407,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { } case MotionEvent.ACTION_DOWN: mWatchingForPull = isInside(mScrollView, x, y); mWatchingForPull = isInside(mScrollAdapter.getHostView(), x, y); mLastMotionY = y; break; Loading Loading @@ -608,5 +608,19 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { } mVibrator.vibrate(duration, AudioManager.STREAM_SYSTEM); } public interface ScrollAdapter { /** * @return Whether the view returned by {@link #getHostView()} is scrolled to the top * and can therefore be expanded by a single finger drag */ public boolean isScrolledToTop(); /** * @return The view in which the scrolling is performed */ public View getHostView(); } } packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +25 −6 Original line number Diff line number Diff line Loading @@ -27,11 +27,11 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewRootImpl; import android.widget.FrameLayout; import android.widget.ScrollView; import com.android.systemui.ExpandHelper; import com.android.systemui.R; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.stack.NotificationStackScrollLayout; public class StatusBarWindowView extends FrameLayout Loading @@ -42,7 +42,7 @@ public class StatusBarWindowView extends FrameLayout private ExpandHelper mExpandHelper; private ViewGroup latestItems; private NotificationPanelView mNotificationPanel; private ScrollView mScrollView; private View mNotificationScroller; PhoneStatusBar mService; Loading @@ -56,19 +56,37 @@ public class StatusBarWindowView extends FrameLayout protected void onAttachedToWindow () { super.onAttachedToWindow(); ExpandHelper.ScrollAdapter scrollAdapter; if (BaseStatusBar.ENABLE_NOTIFICATION_STACK) { latestItems = (ViewGroup) findViewById(R.id.notification_stack_scroller); NotificationStackScrollLayout stackScrollLayout = (NotificationStackScrollLayout) findViewById(R.id.notification_stack_scroller); // ScrollView and notification container are unified in a single view now. latestItems = stackScrollLayout; scrollAdapter = stackScrollLayout; mNotificationScroller = stackScrollLayout; } else { latestItems = (ViewGroup) findViewById(R.id.latestItems); mNotificationScroller = findViewById(R.id.scroll); scrollAdapter = new ExpandHelper.ScrollAdapter() { @Override public boolean isScrolledToTop() { return mNotificationScroller.getScrollY() == 0; } @Override public View getHostView() { return mNotificationScroller; } }; } mScrollView = (ScrollView) findViewById(R.id.scroll); mNotificationPanel = (NotificationPanelView) findViewById(R.id.notification_panel); int minHeight = getResources().getDimensionPixelSize(R.dimen.notification_row_min_height); int maxHeight = getResources().getDimensionPixelSize(R.dimen.notification_row_max_height); mExpandHelper = new ExpandHelper(getContext(), (ExpandHelper.Callback) latestItems, minHeight, maxHeight); mExpandHelper.setEventSource(this); mExpandHelper.setScrollView(mScrollView); mExpandHelper.setScrollAdapter(scrollAdapter); // We really need to be able to animate while window animations are going on // so that activities may be started asynchronously from panel animations Loading @@ -94,7 +112,8 @@ public class StatusBarWindowView extends FrameLayout @Override public boolean onInterceptTouchEvent(MotionEvent ev) { boolean intercept = false; if (mNotificationPanel.isFullyExpanded() && mScrollView.getVisibility() == View.VISIBLE) { if (mNotificationPanel.isFullyExpanded() && mNotificationScroller.getVisibility() == View.VISIBLE) { intercept = mExpandHelper.onInterceptTouchEvent(ev); } if (!intercept) { Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +11 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ import com.android.systemui.statusbar.ExpandableNotificationRow; * A layout which handles a dynamic amount of notifications and presents them in a scrollable stack. */ public class NotificationStackScrollLayout extends ViewGroup implements SwipeHelper.Callback, ExpandHelper.Callback { implements SwipeHelper.Callback, ExpandHelper.Callback, ExpandHelper.ScrollAdapter { private static final String TAG = "NotificationStackScrollLayout"; private static final boolean DEBUG = false; Loading Loading @@ -813,4 +813,14 @@ public class NotificationStackScrollLayout extends ViewGroup mSwipeHelper.removeLongPressCallback(); } } @Override public boolean isScrolledToTop() { return mOwnScrollY == 0; } @Override public View getHostView() { return this; } } packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +3 −3 File changed.Contains only whitespace changes. Show changes Loading
packages/SystemUI/src/com/android/systemui/ExpandHelper.java +19 −5 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { private int mGravity; private View mScrollView; private ScrollAdapter mScrollAdapter; private OnScaleGestureListener mScaleGestureListener = new ScaleGestureDetector.SimpleOnScaleGestureListener() { Loading Loading @@ -301,8 +301,8 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { mGravity = gravity; } public void setScrollView(View scrollView) { mScrollView = scrollView; public void setScrollAdapter(ScrollAdapter adapter) { mScrollAdapter = adapter; } private float calculateGlow(float target, float actual) { Loading Loading @@ -384,7 +384,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { } return true; } if (mScrollView != null && mScrollView.getScrollY() > 0) { if (mScrollAdapter != null && !mScrollAdapter.isScrolledToTop()) { return false; } // Now look for other gestures Loading @@ -407,7 +407,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { } case MotionEvent.ACTION_DOWN: mWatchingForPull = isInside(mScrollView, x, y); mWatchingForPull = isInside(mScrollAdapter.getHostView(), x, y); mLastMotionY = y; break; Loading Loading @@ -608,5 +608,19 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { } mVibrator.vibrate(duration, AudioManager.STREAM_SYSTEM); } public interface ScrollAdapter { /** * @return Whether the view returned by {@link #getHostView()} is scrolled to the top * and can therefore be expanded by a single finger drag */ public boolean isScrolledToTop(); /** * @return The view in which the scrolling is performed */ public View getHostView(); } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +25 −6 Original line number Diff line number Diff line Loading @@ -27,11 +27,11 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewRootImpl; import android.widget.FrameLayout; import android.widget.ScrollView; import com.android.systemui.ExpandHelper; import com.android.systemui.R; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.stack.NotificationStackScrollLayout; public class StatusBarWindowView extends FrameLayout Loading @@ -42,7 +42,7 @@ public class StatusBarWindowView extends FrameLayout private ExpandHelper mExpandHelper; private ViewGroup latestItems; private NotificationPanelView mNotificationPanel; private ScrollView mScrollView; private View mNotificationScroller; PhoneStatusBar mService; Loading @@ -56,19 +56,37 @@ public class StatusBarWindowView extends FrameLayout protected void onAttachedToWindow () { super.onAttachedToWindow(); ExpandHelper.ScrollAdapter scrollAdapter; if (BaseStatusBar.ENABLE_NOTIFICATION_STACK) { latestItems = (ViewGroup) findViewById(R.id.notification_stack_scroller); NotificationStackScrollLayout stackScrollLayout = (NotificationStackScrollLayout) findViewById(R.id.notification_stack_scroller); // ScrollView and notification container are unified in a single view now. latestItems = stackScrollLayout; scrollAdapter = stackScrollLayout; mNotificationScroller = stackScrollLayout; } else { latestItems = (ViewGroup) findViewById(R.id.latestItems); mNotificationScroller = findViewById(R.id.scroll); scrollAdapter = new ExpandHelper.ScrollAdapter() { @Override public boolean isScrolledToTop() { return mNotificationScroller.getScrollY() == 0; } @Override public View getHostView() { return mNotificationScroller; } }; } mScrollView = (ScrollView) findViewById(R.id.scroll); mNotificationPanel = (NotificationPanelView) findViewById(R.id.notification_panel); int minHeight = getResources().getDimensionPixelSize(R.dimen.notification_row_min_height); int maxHeight = getResources().getDimensionPixelSize(R.dimen.notification_row_max_height); mExpandHelper = new ExpandHelper(getContext(), (ExpandHelper.Callback) latestItems, minHeight, maxHeight); mExpandHelper.setEventSource(this); mExpandHelper.setScrollView(mScrollView); mExpandHelper.setScrollAdapter(scrollAdapter); // We really need to be able to animate while window animations are going on // so that activities may be started asynchronously from panel animations Loading @@ -94,7 +112,8 @@ public class StatusBarWindowView extends FrameLayout @Override public boolean onInterceptTouchEvent(MotionEvent ev) { boolean intercept = false; if (mNotificationPanel.isFullyExpanded() && mScrollView.getVisibility() == View.VISIBLE) { if (mNotificationPanel.isFullyExpanded() && mNotificationScroller.getVisibility() == View.VISIBLE) { intercept = mExpandHelper.onInterceptTouchEvent(ev); } if (!intercept) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +11 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ import com.android.systemui.statusbar.ExpandableNotificationRow; * A layout which handles a dynamic amount of notifications and presents them in a scrollable stack. */ public class NotificationStackScrollLayout extends ViewGroup implements SwipeHelper.Callback, ExpandHelper.Callback { implements SwipeHelper.Callback, ExpandHelper.Callback, ExpandHelper.ScrollAdapter { private static final String TAG = "NotificationStackScrollLayout"; private static final boolean DEBUG = false; Loading Loading @@ -813,4 +813,14 @@ public class NotificationStackScrollLayout extends ViewGroup mSwipeHelper.removeLongPressCallback(); } } @Override public boolean isScrolledToTop() { return mOwnScrollY == 0; } @Override public View getHostView() { return this; } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +3 −3 File changed.Contains only whitespace changes. Show changes