diff options
13 files changed, 84 insertions, 6 deletions
diff --git a/core/java/android/widget/EdgeGlow.java b/core/java/android/widget/EdgeGlow.java index c2cb0a053659..75cef3810ae8 100644 --- a/core/java/android/widget/EdgeGlow.java +++ b/core/java/android/widget/EdgeGlow.java @@ -260,7 +260,7 @@ public class EdgeGlow { glowHeight * MAX_GLOW_HEIGHT); if (mWidth < mMinWidth) { // Center the glow and clip it. - int glowLeft = (mWidth - glowWidth)/2; + int glowLeft = (mWidth - mMinWidth)/2; mGlow.setBounds(glowLeft, 0, mWidth - glowLeft, glowBottom); } else { // Stretch the glow to fit. @@ -274,7 +274,7 @@ public class EdgeGlow { int edgeBottom = (int) (edgeHeight * mEdgeScaleY); if (mWidth < mMinWidth) { // Center the edge and clip it. - int edgeLeft = (mWidth - edgeWidth)/2; + int edgeLeft = (mWidth - mMinWidth)/2; mEdge.setBounds(edgeLeft, 0, mWidth - edgeLeft, edgeBottom); } else { // Stretch the edge to fit. diff --git a/core/res/res/drawable-hdpi/stat_sys_adb.png b/core/res/res/drawable-hdpi/stat_sys_adb.png Binary files differindex 58c17468f7cd..af713e87a41f 100755 --- a/core/res/res/drawable-hdpi/stat_sys_adb.png +++ b/core/res/res/drawable-hdpi/stat_sys_adb.png diff --git a/core/res/res/drawable-ldpi/stat_sys_adb.png b/core/res/res/drawable-ldpi/stat_sys_adb.png Binary files differindex cdead240aab5..86b945b5f16b 100644 --- a/core/res/res/drawable-ldpi/stat_sys_adb.png +++ b/core/res/res/drawable-ldpi/stat_sys_adb.png diff --git a/core/res/res/drawable-mdpi/stat_sys_adb.png b/core/res/res/drawable-mdpi/stat_sys_adb.png Binary files differindex 255ce949ff02..2c4d2b575df3 100644 --- a/core/res/res/drawable-mdpi/stat_sys_adb.png +++ b/core/res/res/drawable-mdpi/stat_sys_adb.png diff --git a/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg.9.png b/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg.9.png Binary files differdeleted file mode 100644 index 85d9795d90d3..000000000000 --- a/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg.9.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg_normal.9.png b/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg_normal.9.png Binary files differnew file mode 100644 index 000000000000..2266d15c2b5b --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg_normal.9.png diff --git a/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg_pressed.9.png b/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg_pressed.9.png Binary files differnew file mode 100644 index 000000000000..4fc6b46a767d --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg_pressed.9.png diff --git a/packages/SystemUI/res/drawable-mdpi/status_bar_veto_pressed.png b/packages/SystemUI/res/drawable-mdpi/status_bar_veto_pressed.png Binary files differindex 3b7c9c7c9da5..653acbbe0c13 100644 --- a/packages/SystemUI/res/drawable-mdpi/status_bar_veto_pressed.png +++ b/packages/SystemUI/res/drawable-mdpi/status_bar_veto_pressed.png diff --git a/packages/SystemUI/res/drawable/notify_panel_clock_bg.xml b/packages/SystemUI/res/drawable/notify_panel_clock_bg.xml new file mode 100644 index 000000000000..c83d8783786c --- /dev/null +++ b/packages/SystemUI/res/drawable/notify_panel_clock_bg.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 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. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" + android:drawable="@drawable/notify_panel_clock_bg_pressed" /> + <item android:drawable="@drawable/notify_panel_clock_bg_normal" /> +</selector> + diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel_title.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel_title.xml index 0cf28a79da57..1afb2e3f1254 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel_title.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel_title.xml @@ -22,6 +22,7 @@ android:layout_height="0dp" android:orientation="vertical" android:background="@drawable/notify_panel_clock_bg" + android:clickable="true" > <LinearLayout android:id="@+id/icons" @@ -171,10 +172,12 @@ android:layout_marginLeft="32dp" /> - <Button + <view + class="com.android.systemui.statusbar.tablet.NotificationPanel$ModeToggle" android:id="@+id/mode_toggle" android:background="@null" android:layout_width="match_parent" android:layout_height="match_parent" + android:clickable="true" /> </RelativeLayout> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java index 8a88792a38e7..64a4f160830f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java @@ -28,7 +28,10 @@ import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.util.Slog; +import android.view.accessibility.AccessibilityEvent; import android.view.LayoutInflater; +import android.view.MotionEvent; +import android.view.SoundEffectConstants; import android.view.View; import android.view.ViewGroup; import android.view.animation.AccelerateInterpolator; @@ -51,7 +54,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, boolean mShowing; int mNotificationCount = 0; View mTitleArea; - View mModeToggle; + ModeToggle mModeToggle; View mSettingsButton; View mNotificationButton; View mNotificationScroller; @@ -65,6 +68,48 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, Choreographer mChoreo = new Choreographer(); + static class ModeToggle extends View { + NotificationPanel mPanel; + View mTitle; + public ModeToggle(Context context, AttributeSet attrs) { + super(context, attrs); + } + public void setPanel(NotificationPanel p) { + mPanel = p; + } + public void setTitleArea(View v) { + mTitle = v; + } + @Override + public boolean onTouchEvent(MotionEvent e) { + final int x = (int)e.getX(); + final int y = (int)e.getY(); + switch (e.getAction()) { + case MotionEvent.ACTION_DOWN: + mTitle.setPressed(true); + break; + case MotionEvent.ACTION_MOVE: + mTitle.setPressed(x >= 0 + && x < getWidth() + && y >= 0 + && y < getHeight()); + break; + case MotionEvent.ACTION_CANCEL: + mTitle.setPressed(false); + break; + case MotionEvent.ACTION_UP: + if (mTitle.isPressed()) { + sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED); + playSoundEffect(SoundEffectConstants.CLICK); + mPanel.swapPanels(); + mTitle.setPressed(false); + } + break; + } + return true; + } + } + public NotificationPanel(Context context, AttributeSet attrs) { this(context, attrs, 0); } @@ -82,8 +127,10 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, mContentParent = (ViewGroup)findViewById(R.id.content_parent); mContentParent.bringToFront(); mTitleArea = findViewById(R.id.title_area); - mModeToggle = findViewById(R.id.mode_toggle); + mModeToggle = (ModeToggle) findViewById(R.id.mode_toggle); mModeToggle.setOnClickListener(this); + mModeToggle.setPanel(this); + mModeToggle.setTitleArea(mTitleArea); mSettingsButton = (ImageView)findViewById(R.id.settings_button); mNotificationButton = (ImageView)findViewById(R.id.notification_button); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java index 1135b73c6736..737a52beab1f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java @@ -362,6 +362,9 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O mRecentsContainer.addFooterView(footer, null, false); mRecentsContainer.setAdapter(mListAdapter = new ActvityDescriptionAdapter(mContext)); mRecentsContainer.setOnItemClickListener(this); + final int leftPadding = mContext.getResources() + .getDimensionPixelOffset(R.dimen.status_bar_recents_thumbnail_left_margin); + mRecentsContainer.setOverScrollEffectPadding(leftPadding, 0); mRecentsGlowView = findViewById(R.id.recents_glow); mRecentsScrim = (View) findViewById(R.id.recents_bg_protect); diff --git a/services/java/com/android/server/usb/UsbDeviceSettingsManager.java b/services/java/com/android/server/usb/UsbDeviceSettingsManager.java index 9a96e7fe4c3d..b2d169aa03eb 100644 --- a/services/java/com/android/server/usb/UsbDeviceSettingsManager.java +++ b/services/java/com/android/server/usb/UsbDeviceSettingsManager.java @@ -615,8 +615,11 @@ class UsbDeviceSettingsManager { defaultPackage = mDevicePreferenceMap.get(new DeviceFilter(device)); } + int count = matches.size(); + // don't show the resolver activity if there are no choices available + if (count == 0) return; + if (defaultPackage != null) { - int count = matches.size(); for (int i = 0; i < count; i++) { ResolveInfo rInfo = matches.get(i); if (rInfo.activityInfo != null && |