From 50a531337e7d6d49b40a1c96636962507ccf6c61 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Wed, 24 Oct 2012 15:02:27 -0400 Subject: [PATCH 1/2] Missing copyright headers. Change-Id: I0fac062ffa52fc21f32d25d3f0a38e263e701c46 --- .../src/com/android/systemui/BeanBagDream.java | 16 ++++++++++++++++ .../systemui/statusbar/RotationToggle.java | 16 ++++++++++++++++ .../systemui/statusbar/phone/PanelBar.java | 16 ++++++++++++++++ .../systemui/statusbar/phone/PanelHolder.java | 18 +++++++++++++++++- .../systemui/statusbar/phone/PanelView.java | 16 ++++++++++++++++ .../statusbar/policy/CurrentUserTracker.java | 16 ++++++++++++++++ 6 files changed, 97 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/BeanBagDream.java b/packages/SystemUI/src/com/android/systemui/BeanBagDream.java index a367367157f32..39e472711cd8d 100644 --- a/packages/SystemUI/src/com/android/systemui/BeanBagDream.java +++ b/packages/SystemUI/src/com/android/systemui/BeanBagDream.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.android.systemui; import android.service.dreams.DreamService; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/RotationToggle.java b/packages/SystemUI/src/com/android/systemui/statusbar/RotationToggle.java index 5dd45a40e3b21..735ee254563b1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/RotationToggle.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/RotationToggle.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.android.systemui.statusbar; import android.content.Context; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java index c9a137ceb47af..4b07b00cce98e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.android.systemui.statusbar.phone; import java.util.ArrayList; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelHolder.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelHolder.java index 241ac3e0d6917..8a543476d0e0e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelHolder.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelHolder.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.android.systemui.statusbar.phone; import android.content.Context; @@ -63,4 +79,4 @@ public class PanelHolder extends FrameLayout { public void setBar(PanelBar panelBar) { mBar = panelBar; } -} \ No newline at end of file +} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index 6184e3017a8ec..6dee015f8fb74 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.android.systemui.statusbar.phone; import android.animation.ObjectAnimator; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CurrentUserTracker.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CurrentUserTracker.java index 7a2f25a8d8188..225ebc1af788b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CurrentUserTracker.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CurrentUserTracker.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.android.systemui.statusbar.policy; import android.app.ActivityManager; From be2cf3206eb6fdc81cb5619ce36e3f9d5a9e9c15 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Wed, 24 Oct 2012 15:23:42 -0400 Subject: [PATCH 2/2] Be a little more lenient with panel-open gestures. The code would not consider any drag that did not complete the "peek" distance (the distance the panel opens when you press and hold on the status bar; on tablets this is statusbarheight + closehandleheight, and on phones it's headerheight + closehandleheight) as a candidate for a fling, and set that drag's effective velocity to 0. This CL just removes that check. Now a fling must meet the minimum linear velocity and minimum Y distance thresholds (100dp/sec and 20dp, respectively) to change the position of the panel (closed->open or open->closed). Bug: 7390976 Change-Id: Ia0c2450f9fdf3f27b890aab240a155dad1ab052f --- .../src/com/android/systemui/statusbar/phone/PanelView.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index 6dee015f8fb74..703500696959c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -336,7 +336,7 @@ public class PanelView extends FrameLayout { final float deltaY = Math.abs(mFinalTouchY - mInitialTouchY); if (deltaY < mFlingGestureMinDistPx || vel < mFlingExpandMinVelocityPx - || mJustPeeked) { + ) { vel = 0; } @@ -344,10 +344,8 @@ public class PanelView extends FrameLayout { vel = -vel; } - if (DEBUG) LOG("gesture: dy=%f vraw=(%f,%f) vnorm=(%f,%f) vlinear=%f", + if (DEBUG) LOG("gesture: dy=%f vel=(%f,%f) vlinear=%f", deltaY, - mVelocityTracker.getXVelocity(), - mVelocityTracker.getYVelocity(), xVel, yVel, vel);