am 5485ff61: Reduce the number of notification icons on narrow screens.
* commit '5485ff6141ccebad2c171a9a51ffdbcb72703bd7': Reduce the number of notification icons on narrow screens.
This commit is contained in:
25
packages/SystemUI/res/values-sw600dp-port/config.xml
Normal file
25
packages/SystemUI/res/values-sw600dp-port/config.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?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.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- These resources are around just to allow their values to be customized
|
||||||
|
for different hardware and product builds. -->
|
||||||
|
<resources>
|
||||||
|
<integer name="config_maxNotificationIcons">3</integer>
|
||||||
|
</resources>
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
* Copyright (c) 2010, The Android Open Source Project
|
* Copyright (c) 2011, The Android Open Source Project
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -17,6 +17,6 @@
|
|||||||
-->
|
-->
|
||||||
<resources>
|
<resources>
|
||||||
<!-- gap on either side of status bar notification icons -->
|
<!-- gap on either side of status bar notification icons -->
|
||||||
<dimen name="status_bar_icon_padding">2dp</dimen>
|
<dimen name="status_bar_icon_padding">0dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
|
|||||||
22
packages/SystemUI/res/values-sw720dp-port/dimens.xml
Normal file
22
packages/SystemUI/res/values-sw720dp-port/dimens.xml
Normal file
@@ -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.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<resources>
|
||||||
|
<!-- gap on either side of status bar notification icons -->
|
||||||
|
<dimen name="status_bar_icon_padding">2dp</dimen>
|
||||||
|
</resources>
|
||||||
|
|
||||||
25
packages/SystemUI/res/values-sw720dp/config.xml
Normal file
25
packages/SystemUI/res/values-sw720dp/config.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?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.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- These resources are around just to allow their values to be customized
|
||||||
|
for different hardware and product builds. -->
|
||||||
|
<resources>
|
||||||
|
<integer name="config_maxNotificationIcons">5</integer>
|
||||||
|
</resources>
|
||||||
|
|
||||||
@@ -36,5 +36,9 @@
|
|||||||
<!-- Whether or not we show the number in the bar. -->
|
<!-- Whether or not we show the number in the bar. -->
|
||||||
<bool name="config_statusBarShowNumber">true</bool>
|
<bool name="config_statusBarShowNumber">true</bool>
|
||||||
|
|
||||||
|
<!-- How many icons may be shown at once in the system bar. Includes any
|
||||||
|
slots that may be reused for things like IME control. -->
|
||||||
|
<integer name="config_maxNotificationIcons">5</integer>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
|
|||||||
@@ -80,9 +80,6 @@ public class TabletStatusBar extends StatusBar implements
|
|||||||
public static final boolean DEBUG = false;
|
public static final boolean DEBUG = false;
|
||||||
public static final String TAG = "TabletStatusBar";
|
public static final String TAG = "TabletStatusBar";
|
||||||
|
|
||||||
public static final int MAX_NOTIFICATION_ICONS = 5;
|
|
||||||
// IME switcher icon is big and occupy width of two icons
|
|
||||||
public static final int MAX_NOTIFICATION_ICONS_IME_BUTTON_VISIBLE = MAX_NOTIFICATION_ICONS - 1;
|
|
||||||
|
|
||||||
public static final int MSG_OPEN_NOTIFICATION_PANEL = 1000;
|
public static final int MSG_OPEN_NOTIFICATION_PANEL = 1000;
|
||||||
public static final int MSG_CLOSE_NOTIFICATION_PANEL = 1001;
|
public static final int MSG_CLOSE_NOTIFICATION_PANEL = 1001;
|
||||||
@@ -104,6 +101,7 @@ public class TabletStatusBar extends StatusBar implements
|
|||||||
int mNaturalBarHeight = -1;
|
int mNaturalBarHeight = -1;
|
||||||
int mIconSize = -1;
|
int mIconSize = -1;
|
||||||
int mIconHPadding = -1;
|
int mIconHPadding = -1;
|
||||||
|
private int mMaxNotificationIcons = 5;
|
||||||
|
|
||||||
H mHandler = new H();
|
H mHandler = new H();
|
||||||
|
|
||||||
@@ -343,6 +341,13 @@ public class TabletStatusBar extends StatusBar implements
|
|||||||
mIconSize = newIconSize;
|
mIconSize = newIconSize;
|
||||||
reloadAllNotificationIcons(); // reload the tray
|
reloadAllNotificationIcons(); // reload the tray
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final int numIcons = res.getInteger(R.integer.config_maxNotificationIcons);
|
||||||
|
if (numIcons != mMaxNotificationIcons) {
|
||||||
|
mMaxNotificationIcons = numIcons;
|
||||||
|
if (DEBUG) Slog.d(TAG, "max notification icons: " + mMaxNotificationIcons);
|
||||||
|
reloadAllNotificationIcons();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected View makeStatusBarView() {
|
protected View makeStatusBarView() {
|
||||||
@@ -1429,9 +1434,11 @@ public class TabletStatusBar extends StatusBar implements
|
|||||||
|
|
||||||
// When IME button is visible, the number of notification icons should be decremented
|
// When IME button is visible, the number of notification icons should be decremented
|
||||||
// to fit the upper limit.
|
// to fit the upper limit.
|
||||||
|
// IME switcher icon is big and occupy width of one icon
|
||||||
|
final int maxNotificationIconsImeButtonVisible = mMaxNotificationIcons - 1;
|
||||||
final int maxNotificationIconsCount =
|
final int maxNotificationIconsCount =
|
||||||
(mInputMethodSwitchButton.getVisibility() != View.GONE) ?
|
(mInputMethodSwitchButton.getVisibility() != View.GONE) ?
|
||||||
MAX_NOTIFICATION_ICONS_IME_BUTTON_VISIBLE : MAX_NOTIFICATION_ICONS;
|
maxNotificationIconsImeButtonVisible : mMaxNotificationIcons;
|
||||||
for (int i=0; i< maxNotificationIconsCount; i++) {
|
for (int i=0; i< maxNotificationIconsCount; i++) {
|
||||||
if (i>=N) break;
|
if (i>=N) break;
|
||||||
toShow.add(mNotificationData.get(N-i-1).icon);
|
toShow.add(mNotificationData.get(N-i-1).icon);
|
||||||
|
|||||||
Reference in New Issue
Block a user