Loading packages/SystemUI/res/layout/quick_settings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ limitations under the License. --> <com.android.systemui.statusbar.phone.PanelView <com.android.systemui.statusbar.phone.SettingsPanelView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" Loading Loading @@ -42,4 +42,4 @@ android:src="@drawable/status_bar_close" /> </LinearLayout> </com.android.systemui.statusbar.phone.PanelView> No newline at end of file </com.android.systemui.statusbar.phone.SettingsPanelView > No newline at end of file packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +1 −3 Original line number Diff line number Diff line Loading @@ -22,15 +22,13 @@ import android.util.AttributeSet; public class NotificationPanelView extends PanelView { public NotificationPanelView(Context context, AttributeSet attrs) { super(context, attrs); android.util.Slog.v("NotificationPanelView", "ctor"); } @Override public void fling(float vel, boolean always) { ((PhoneStatusBarView) mBar).mBar.getGestureRecorder().tag( "fling " + ((vel > 0) ? "open" : "closed"), "v=" + vel); "notifications,v=" + vel); super.fling(vel, always); } } packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java +7 −4 Original line number Diff line number Diff line Loading @@ -64,15 +64,18 @@ public class PanelBar extends FrameLayout { return getMeasuredHeight(); } public PanelView selectPanelForTouchX(float x) { final int N = mPanels.size(); return mPanels.get((int)(N * x / getMeasuredWidth())); } @Override public boolean onTouchEvent(MotionEvent event) { // figure out which panel needs to be talked to here if (event.getAction() == MotionEvent.ACTION_DOWN) { final int N = mPanels.size(); final int i = (int)(N * event.getX() / getMeasuredWidth()); mTouchingPanel = mPanels.get(i); mTouchingPanel = selectPanelForTouchX(event.getX()); mPanelHolder.setSelectedPanel(mTouchingPanel); LOG("PanelBar.onTouch: state=%d ACTION_DOWN: panel %d", mState, i); LOG("PanelBar.onTouch: state=%d ACTION_DOWN: panel %s", mState, mTouchingPanel.getName()); if (mState == STATE_CLOSED || mState == STATE_OPEN) { go(STATE_TRANSITIONING); onPanelPeeked(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +2 −2 Original line number Diff line number Diff line Loading @@ -223,7 +223,7 @@ public class PanelView extends FrameLayout { xVel, yVel, vel); fling(vel, false); fling(vel, true); mVelocityTracker.recycle(); mVelocityTracker = null; Loading @@ -238,7 +238,7 @@ public class PanelView extends FrameLayout { public void fling(float vel, boolean always) { mVel = vel; if (mVel != 0) { if (always||mVel != 0) { animationTick(0); // begin the animation } } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +25 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class PhoneStatusBarView extends PanelBar { PhoneStatusBar mBar; int mScrimColor; PanelView mFadingPanel = null; PanelView mNotificationPanel, mSettingsPanel; public PhoneStatusBarView(Context context, AttributeSet attrs) { super(context, attrs); Loading @@ -58,6 +59,16 @@ public class PhoneStatusBarView extends PanelBar { mScrimColor = res.getColor(R.color.notification_panel_scrim_color); } @Override public void addPanel(PanelView pv) { super.addPanel(pv); if (pv.getId() == R.id.notification_panel) { mNotificationPanel = pv; } else if (pv.getId() == R.id.settings_panel){ mSettingsPanel = pv; } } @Override public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) { if (super.onRequestSendAccessibilityEvent(child, event)) { Loading @@ -73,6 +84,20 @@ public class PhoneStatusBarView extends PanelBar { return false; } @Override public PanelView selectPanelForTouchX(float x) { // We split the status bar into thirds: the left 2/3 are for notifications, and the // right 1/3 for quick settings. If you pull the status bar down a second time you'll // toggle panels no matter where you pull it down. final float w = (float) getMeasuredWidth(); final float f = x / w; if (f > 0.67f && mSettingsPanel.getExpandedFraction() != 1.0f || mNotificationPanel.getExpandedFraction() == 1.0f) { return mSettingsPanel; } return mNotificationPanel; } @Override public void onPanelPeeked() { super.onPanelPeeked(); Loading Loading
packages/SystemUI/res/layout/quick_settings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ limitations under the License. --> <com.android.systemui.statusbar.phone.PanelView <com.android.systemui.statusbar.phone.SettingsPanelView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" Loading Loading @@ -42,4 +42,4 @@ android:src="@drawable/status_bar_close" /> </LinearLayout> </com.android.systemui.statusbar.phone.PanelView> No newline at end of file </com.android.systemui.statusbar.phone.SettingsPanelView > No newline at end of file
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +1 −3 Original line number Diff line number Diff line Loading @@ -22,15 +22,13 @@ import android.util.AttributeSet; public class NotificationPanelView extends PanelView { public NotificationPanelView(Context context, AttributeSet attrs) { super(context, attrs); android.util.Slog.v("NotificationPanelView", "ctor"); } @Override public void fling(float vel, boolean always) { ((PhoneStatusBarView) mBar).mBar.getGestureRecorder().tag( "fling " + ((vel > 0) ? "open" : "closed"), "v=" + vel); "notifications,v=" + vel); super.fling(vel, always); } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java +7 −4 Original line number Diff line number Diff line Loading @@ -64,15 +64,18 @@ public class PanelBar extends FrameLayout { return getMeasuredHeight(); } public PanelView selectPanelForTouchX(float x) { final int N = mPanels.size(); return mPanels.get((int)(N * x / getMeasuredWidth())); } @Override public boolean onTouchEvent(MotionEvent event) { // figure out which panel needs to be talked to here if (event.getAction() == MotionEvent.ACTION_DOWN) { final int N = mPanels.size(); final int i = (int)(N * event.getX() / getMeasuredWidth()); mTouchingPanel = mPanels.get(i); mTouchingPanel = selectPanelForTouchX(event.getX()); mPanelHolder.setSelectedPanel(mTouchingPanel); LOG("PanelBar.onTouch: state=%d ACTION_DOWN: panel %d", mState, i); LOG("PanelBar.onTouch: state=%d ACTION_DOWN: panel %s", mState, mTouchingPanel.getName()); if (mState == STATE_CLOSED || mState == STATE_OPEN) { go(STATE_TRANSITIONING); onPanelPeeked(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +2 −2 Original line number Diff line number Diff line Loading @@ -223,7 +223,7 @@ public class PanelView extends FrameLayout { xVel, yVel, vel); fling(vel, false); fling(vel, true); mVelocityTracker.recycle(); mVelocityTracker = null; Loading @@ -238,7 +238,7 @@ public class PanelView extends FrameLayout { public void fling(float vel, boolean always) { mVel = vel; if (mVel != 0) { if (always||mVel != 0) { animationTick(0); // begin the animation } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +25 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class PhoneStatusBarView extends PanelBar { PhoneStatusBar mBar; int mScrimColor; PanelView mFadingPanel = null; PanelView mNotificationPanel, mSettingsPanel; public PhoneStatusBarView(Context context, AttributeSet attrs) { super(context, attrs); Loading @@ -58,6 +59,16 @@ public class PhoneStatusBarView extends PanelBar { mScrimColor = res.getColor(R.color.notification_panel_scrim_color); } @Override public void addPanel(PanelView pv) { super.addPanel(pv); if (pv.getId() == R.id.notification_panel) { mNotificationPanel = pv; } else if (pv.getId() == R.id.settings_panel){ mSettingsPanel = pv; } } @Override public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) { if (super.onRequestSendAccessibilityEvent(child, event)) { Loading @@ -73,6 +84,20 @@ public class PhoneStatusBarView extends PanelBar { return false; } @Override public PanelView selectPanelForTouchX(float x) { // We split the status bar into thirds: the left 2/3 are for notifications, and the // right 1/3 for quick settings. If you pull the status bar down a second time you'll // toggle panels no matter where you pull it down. final float w = (float) getMeasuredWidth(); final float f = x / w; if (f > 0.67f && mSettingsPanel.getExpandedFraction() != 1.0f || mNotificationPanel.getExpandedFraction() == 1.0f) { return mSettingsPanel; } return mNotificationPanel; } @Override public void onPanelPeeked() { super.onPanelPeeked(); Loading