diff options
Diffstat (limited to 'packages/SystemUI')
22 files changed, 250 insertions, 40 deletions
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_ime_default.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_ime_default.png Binary files differdeleted file mode 100644 index eb6eb0c..0000000 --- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_ime_default.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_ime_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_ime_pressed.png Binary files differdeleted file mode 100644 index 11f66f5..0000000 --- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_ime_pressed.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_ime_default.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_ime_default.png Binary files differdeleted file mode 100644 index f907de7..0000000 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_ime_default.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_ime_pressed.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_ime_pressed.png Binary files differdeleted file mode 100644 index 36f8853..0000000 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_ime_pressed.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_ime_default.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_ime_default.png Binary files differnew file mode 100644 index 0000000..1a9d88c --- /dev/null +++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_ime_default.png diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_ime_pressed.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_ime_pressed.png Binary files differnew file mode 100644 index 0000000..a6d7507 --- /dev/null +++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_ime_pressed.png diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_default.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_default.png Binary files differindex e2584e3..1e1324a 100644 --- a/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_default.png +++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_default.png diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_pressed.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_pressed.png Binary files differindex 58b8510..e4e13c5 100644 --- a/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_pressed.png +++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/ic_sysbar_zoom_pressed.png diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_ime_default.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_ime_default.png Binary files differnew file mode 100644 index 0000000..33edce0 --- /dev/null +++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_ime_default.png diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_ime_pressed.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_ime_pressed.png Binary files differnew file mode 100644 index 0000000..8bab6cf --- /dev/null +++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_ime_pressed.png diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_default.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_default.png Binary files differindex 2795c34..89d486f 100644 --- a/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_default.png +++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_default.png diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_pressed.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_pressed.png Binary files differindex bbed6a6..b134436 100644 --- a/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_pressed.png +++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/ic_sysbar_zoom_pressed.png diff --git a/packages/SystemUI/res/drawable/ic_sysbar_zoom.xml b/packages/SystemUI/res/drawable/ic_sysbar_zoom.xml index 977e002..97d0348 100644 --- a/packages/SystemUI/res/drawable/ic_sysbar_zoom.xml +++ b/packages/SystemUI/res/drawable/ic_sysbar_zoom.xml @@ -16,6 +16,7 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/ic_sysbar_zoom_pressed" /> + <item android:state_selected="true" android:drawable="@drawable/ic_sysbar_zoom_pressed" /> <item android:drawable="@drawable/ic_sysbar_zoom_default" /> </selector> diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar.xml b/packages/SystemUI/res/layout-sw600dp/status_bar.xml index 707a8cb..d9f3f23 100644 --- a/packages/SystemUI/res/layout-sw600dp/status_bar.xml +++ b/packages/SystemUI/res/layout-sw600dp/status_bar.xml @@ -75,13 +75,6 @@ systemui:keyCode="82" android:visibility="invisible" /> - <com.android.systemui.statusbar.policy.CompatModeButton - android:id="@+id/compat_button" - android:layout_width="80dip" - android:layout_height="match_parent" - android:src="@drawable/ic_sysbar_zoom" - android:visibility="invisible" - /> </LinearLayout> <!-- fake space bar zone --> diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar_compat_mode_panel.xml b/packages/SystemUI/res/layout-sw600dp/status_bar_compat_mode_panel.xml new file mode 100644 index 0000000..c151565 --- /dev/null +++ b/packages/SystemUI/res/layout-sw600dp/status_bar_compat_mode_panel.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +** +** Copyright 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. +*/ +--> + +<com.android.systemui.statusbar.tablet.CompatModePanel + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:paddingBottom="@dimen/panel_float" + android:paddingRight="20dp" + > + <RadioGroup android:id="@+id/compat_mode_radio_group" + android:background="@*android:drawable/dialog_full_holo_dark" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:orientation="vertical" + android:padding="10dp" + > + <RadioButton android:id="@+id/compat_mode_on_radio" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/compat_mode_on" /> + <RadioButton android:id="@+id/compat_mode_off_radio" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/compat_mode_off" /> + </RadioGroup> +</com.android.systemui.statusbar.tablet.CompatModePanel> diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar_notification_area.xml b/packages/SystemUI/res/layout-sw600dp/status_bar_notification_area.xml index f53b29e..fecfe7f 100644 --- a/packages/SystemUI/res/layout-sw600dp/status_bar_notification_area.xml +++ b/packages/SystemUI/res/layout-sw600dp/status_bar_notification_area.xml @@ -27,7 +27,7 @@ > <LinearLayout - android:id="@+id/notificationAndImeArea" + android:id="@+id/feedbackIconArea" android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="horizontal" @@ -41,7 +41,16 @@ android:src="@drawable/ic_sysbar_ime_default" android:visibility="gone" /> - + + <com.android.systemui.statusbar.policy.CompatModeButton + android:id="@+id/compatModeButton" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_marginLeft="8dip" + android:src="@drawable/ic_sysbar_zoom" + android:visibility="gone" + /> + <com.android.systemui.statusbar.tablet.NotificationIconArea android:id="@+id/notificationIcons" android:layout_width="wrap_content" @@ -144,4 +153,3 @@ </LinearLayout> </LinearLayout> </LinearLayout> - diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml index dec8b67..944e0ee 100644 --- a/packages/SystemUI/res/values-sw600dp/dimens.xml +++ b/packages/SystemUI/res/values-sw600dp/dimens.xml @@ -26,5 +26,6 @@ <dimen name="notification_panel_width">512dp</dimen> <!-- The minimum height of the notification panel window --> <dimen name="notification_panel_min_height">770dp</dimen> + <!-- Bottom margin (from display edge) for status bar panels --> + <dimen name="panel_float">56dp</dimen> </resources> - diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 446827b..973a4b2 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -143,4 +143,11 @@ <!-- Checkbox label for USB accessory dialogs. [CHAR LIMIT=50] --> <string name="always_use_accessory">Use by default for this USB accessory</string> + <!-- Checkbox label for application compatibility mode ON (zooming app to look like it's running + on a phone). [CHAR LIMIT=25] --> + <string name="compat_mode_on">Zoom to fill screen</string> + + <!-- Checkbox label for application compatibility mode OFF (normal mode on tablets). + [CHAR LIMIT=25] --> + <string name="compat_mode_off">Stretch to fill screen</string> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java index c3052e8..7fbf734 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java @@ -27,7 +27,8 @@ import android.widget.ImageView; import com.android.systemui.R; -public class CompatModeButton extends ImageView implements View.OnClickListener { +public class CompatModeButton extends ImageView { + private static final boolean DEBUG = false; private static final String TAG = "StatusBar.CompatModeButton"; private ActivityManager mAM; @@ -43,22 +44,14 @@ public class CompatModeButton extends ImageView implements View.OnClickListener mAM = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); - setOnClickListener(this); - refresh(); } - @Override - public void onClick(View v) { - mAM.setFrontActivityScreenCompatMode(ActivityManager.COMPAT_MODE_TOGGLE); - } - public void refresh() { int mode = mAM.getFrontActivityScreenCompatMode(); - setVisibility((mode == ActivityManager.COMPAT_MODE_NEVER - || mode == ActivityManager.COMPAT_MODE_ALWAYS) - ? View.GONE - : View.VISIBLE - ); + final boolean vis = (mode != ActivityManager.COMPAT_MODE_NEVER + && mode != ActivityManager.COMPAT_MODE_ALWAYS); + if (DEBUG) Slog.d(TAG, "compat mode is " + mode + "; icon will " + (vis ? "show" : "hide")); + setVisibility(vis ? View.VISIBLE : View.GONE); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/CompatModePanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/CompatModePanel.java new file mode 100644 index 0000000..5a82d1b --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/CompatModePanel.java @@ -0,0 +1,115 @@ +/* + * 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. + */ + +package com.android.systemui.statusbar.tablet; + +import android.app.ActivityManager; +import android.content.Context; +import android.content.res.TypedArray; +import android.os.RemoteException; +import android.util.AttributeSet; +import android.util.Slog; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.RadioButton; +import android.widget.RadioGroup; + +import com.android.systemui.R; + +public class CompatModePanel extends FrameLayout implements StatusBarPanel, + View.OnClickListener { + private static final boolean DEBUG = TabletStatusBar.DEBUG; + private static final String TAG = "CompatModePanel"; + + private ActivityManager mAM; + + private boolean mAttached = false; + private Context mContext; + private RadioButton mOnButton, mOffButton; + + private View mTrigger; +// private InputMethodButton mInputMethodSwitchButton; + + public CompatModePanel(Context context, AttributeSet attrs) { + super(context, attrs); + mContext = context; + mAM = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + } + + @Override + public void onFinishInflate() { + mOnButton = (RadioButton) findViewById(R.id.compat_mode_on_radio); + mOffButton = (RadioButton) findViewById(R.id.compat_mode_off_radio); + mOnButton.setOnClickListener(this); + mOffButton.setOnClickListener(this); + + refresh(); + } + + @Override + protected void onDetachedFromWindow() { + super.onDetachedFromWindow(); + if (mAttached) { + mAttached = false; + } + } + + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + if (!mAttached) { + mAttached = true; + } + } + + @Override + public void onClick(View v) { + if (v == mOnButton) { + mAM.setFrontActivityScreenCompatMode(ActivityManager.COMPAT_MODE_ENABLED); + } else if (v == mOffButton) { + mAM.setFrontActivityScreenCompatMode(ActivityManager.COMPAT_MODE_DISABLED); + } + } + + @Override + public boolean isInContentArea(int x, int y) { + return false; + } + + public void setTrigger(View v) { + mTrigger = v; + } + + public void openPanel() { + setVisibility(View.VISIBLE); + if (mTrigger != null) mTrigger.setSelected(true); + refresh(); + } + + public void closePanel() { + setVisibility(View.GONE); + if (mTrigger != null) mTrigger.setSelected(false); + } + + private void refresh() { + int mode = mAM.getFrontActivityScreenCompatMode(); + final boolean on = (mode == ActivityManager.COMPAT_MODE_ENABLED); + mOnButton.setChecked(on); + mOffButton.setChecked(!on); + } + +} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index 68eade0..d006258 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -93,6 +93,8 @@ public class TabletStatusBar extends StatusBar implements public static final int MSG_HIDE_CHROME = 1031; public static final int MSG_OPEN_INPUT_METHODS_PANEL = 1040; public static final int MSG_CLOSE_INPUT_METHODS_PANEL = 1041; + public static final int MSG_OPEN_COMPAT_MODE_PANEL = 1050; + public static final int MSG_CLOSE_COMPAT_MODE_PANEL = 1051; public static final int MSG_STOP_TICKER = 2000; // Fitts' Law assistance for LatinIME; see policy.EventHole @@ -126,8 +128,9 @@ public class TabletStatusBar extends StatusBar implements View mMenuButton; View mRecentButton; - ViewGroup mNotificationAndImeArea; + ViewGroup mFeedbackIconArea; // notification icons, IME icon, compat icon InputMethodButton mInputMethodSwitchButton; + CompatModeButton mCompatModeButton; NotificationPanel mNotificationPanel; WindowManager.LayoutParams mNotificationPanelParams; @@ -166,6 +169,7 @@ public class TabletStatusBar extends StatusBar implements private RecentsPanelView mRecentsPanel; private InputMethodsPanel mInputMethodsPanel; + private CompatModePanel mCompatModePanel; public Context getContext() { return mContext; } @@ -305,6 +309,29 @@ public class TabletStatusBar extends StatusBar implements lp.windowAnimations = R.style.Animation_RecentPanel; WindowManagerImpl.getDefault().addView(mInputMethodsPanel, lp); + + // Compatibility mode selector panel + mCompatModePanel = (CompatModePanel) View.inflate(context, + R.layout.status_bar_compat_mode_panel, null); + mCompatModePanel.setOnTouchListener(new TouchOutsideListener( + MSG_CLOSE_COMPAT_MODE_PANEL, mCompatModePanel)); + mCompatModePanel.setTrigger(mCompatModeButton); + mCompatModePanel.setVisibility(View.GONE); + mStatusBarView.setIgnoreChildren(4, mCompatModeButton, mCompatModePanel); + lp = new WindowManager.LayoutParams( + 250, + ViewGroup.LayoutParams.WRAP_CONTENT, + WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, + WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN + | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM + | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH + | WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, + PixelFormat.TRANSLUCENT); + lp.gravity = Gravity.BOTTOM | Gravity.RIGHT; + lp.setTitle("CompatModePanel"); + lp.windowAnimations = android.R.style.Animation_Dialog; + + WindowManagerImpl.getDefault().addView(mCompatModePanel, lp); } private int getNotificationPanelHeight() { @@ -431,11 +458,14 @@ public class TabletStatusBar extends StatusBar implements mNavigationArea.setLayoutTransition(mBarContentsLayoutTransition); // The bar contents buttons - mNotificationAndImeArea = (ViewGroup)sb.findViewById(R.id.notificationAndImeArea); + mFeedbackIconArea = (ViewGroup)sb.findViewById(R.id.feedbackIconArea); mInputMethodSwitchButton = (InputMethodButton) sb.findViewById(R.id.imeSwitchButton); // Overwrite the lister mInputMethodSwitchButton.setOnClickListener(mOnClickListener); + mCompatModeButton = (CompatModeButton) sb.findViewById(R.id.compatModeButton); + mCompatModeButton.setOnClickListener(mOnClickListener); + // for redirecting errant bar taps to the IME mFakeSpaceBar = sb.findViewById(R.id.fake_space_bar); @@ -647,6 +677,14 @@ public class TabletStatusBar extends StatusBar implements if (DEBUG) Slog.d(TAG, "closing input methods panel"); if (mInputMethodsPanel != null) mInputMethodsPanel.closePanel(false); break; + case MSG_OPEN_COMPAT_MODE_PANEL: + if (DEBUG) Slog.d(TAG, "opening compat panel"); + if (mCompatModePanel != null) mCompatModePanel.openPanel(); + break; + case MSG_CLOSE_COMPAT_MODE_PANEL: + if (DEBUG) Slog.d(TAG, "closing compat panel"); + if (mCompatModePanel != null) mCompatModePanel.closePanel(); + break; case MSG_SHOW_CHROME: if (DEBUG) Slog.d(TAG, "hiding shadows (lights on)"); mBarContents.setVisibility(View.VISIBLE); @@ -915,14 +953,14 @@ public class TabletStatusBar extends StatusBar implements if (0 == (mDisabled & (StatusBarManager.DISABLE_NOTIFICATION_ICONS | StatusBarManager.DISABLE_NOTIFICATION_TICKER))) { mTicker.add(key, n); - mNotificationAndImeArea.setVisibility(View.GONE); + mFeedbackIconArea.setVisibility(View.GONE); } } } // called by TabletTicker when it's done with all queued ticks public void doneTicking() { - mNotificationAndImeArea.setVisibility(View.VISIBLE); + mFeedbackIconArea.setVisibility(View.VISIBLE); } public void animateExpand() { @@ -940,6 +978,8 @@ public class TabletStatusBar extends StatusBar implements mHandler.sendEmptyMessage(MSG_CLOSE_RECENTS_PANEL); mHandler.removeMessages(MSG_CLOSE_INPUT_METHODS_PANEL); mHandler.sendEmptyMessage(MSG_CLOSE_INPUT_METHODS_PANEL); + mHandler.removeMessages(MSG_CLOSE_COMPAT_MODE_PANEL); + mHandler.sendEmptyMessage(MSG_CLOSE_COMPAT_MODE_PANEL); mHandler.removeMessages(MSG_CLOSE_NOTIFICATION_PEEK); mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PEEK); } @@ -966,9 +1006,8 @@ public class TabletStatusBar extends StatusBar implements // See above re: lights-out policy for legacy apps. if (windowVisible) setLightsOn(true); - // XXX: HACK: not sure if this is the best way to catch a new activity that might require a - // change in compatibility features, but it's a start. - ((CompatModeButton) mBarContents.findViewById(R.id.compat_button)).refresh(); + // XXX: this is broken: http://b/4603422 + mCompatModeButton.refresh(); } public void setImeWindowStatus(IBinder token, int vis, int backDisposition) { @@ -1061,6 +1100,8 @@ public class TabletStatusBar extends StatusBar implements onClickRecentButton(); } else if (v == mInputMethodSwitchButton) { onClickInputMethodSwitchButton(); + } else if (v == mCompatModeButton) { + onClickCompatModeButton(); } } }; @@ -1103,6 +1144,13 @@ public class TabletStatusBar extends StatusBar implements mHandler.sendEmptyMessage(msg); } + public void onClickCompatModeButton() { + int msg = (mCompatModePanel.getVisibility() == View.GONE) ? + MSG_OPEN_COMPAT_MODE_PANEL : MSG_CLOSE_COMPAT_MODE_PANEL; + mHandler.removeMessages(msg); + mHandler.sendEmptyMessage(msg); + } + public NotificationClicker makeClicker(PendingIntent intent, String pkg, String tag, int id) { return new NotificationClicker(intent, pkg, tag, id); } @@ -1439,13 +1487,13 @@ public class TabletStatusBar extends StatusBar implements ArrayList<View> toShow = new ArrayList<View>(); - // When IME button is visible, the number of notification icons should be decremented - // to fit the upper limit. - // IME switcher icon is big and occupy width of one icon - final int maxNotificationIconsImeButtonVisible = mMaxNotificationIcons - 1; - final int maxNotificationIconsCount = - (mInputMethodSwitchButton.getVisibility() != View.GONE) ? - maxNotificationIconsImeButtonVisible : mMaxNotificationIcons; + // Extra Special Icons + // The IME switcher and compatibility mode icons take the place of notifications. You didn't + // need to see all those new emails, did you? + int maxNotificationIconsCount = mMaxNotificationIcons; + if (mInputMethodSwitchButton.getVisibility() != View.GONE) maxNotificationIconsCount --; + if (mCompatModeButton.getVisibility() != View.GONE) maxNotificationIconsCount --; + for (int i=0; i< maxNotificationIconsCount; i++) { if (i>=N) break; toShow.add(mNotificationData.get(N-i-1).icon); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java index 4e2faf7..dff1f6a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java @@ -27,8 +27,9 @@ import android.widget.FrameLayout; public class TabletStatusBarView extends FrameLayout { private Handler mHandler; - private final View[] mIgnoreChildren = new View[4]; - private final View[] mPanels = new View[4]; + private final int MAX_PANELS = 5; + private final View[] mIgnoreChildren = new View[MAX_PANELS]; + private final View[] mPanels = new View[MAX_PANELS]; private final int[] mPos = new int[2]; public TabletStatusBarView(Context context) { |