am 89ba270c: Merge "Fixing various QS issues. (Bug 7216908, Bug 7217154)" into jb-mr1-dev

* commit '89ba270c6663c4f2c8076e21fa1a9f79a43e0b06':
  Fixing various QS issues. (Bug 7216908, Bug 7217154)
This commit is contained in:
Winson Chung
2012-09-25 12:50:33 -07:00
committed by Android Git Automerger
10 changed files with 31 additions and 13 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -265,7 +265,7 @@
<!-- Content description of the WIFI signal when it is three bars for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_wifi_three_bars">Wi-Fi three bars.</string>
<!-- Content description of the WIFI signal when it is full for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_wifi_signal_full">WiFi signal full.</string>
<string name="accessibility_wifi_signal_full">Wi-Fi signal full.</string>
<!-- Content description of the WiMAX signal when no signal for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_no_wimax">No WiMAX.</string>
@@ -439,15 +439,17 @@
<!-- QuickSettings: User [CHAR LIMIT=NONE] -->
<string name="quick_settings_user_label">Me</string>
<!-- QuickSettings: Wifi [CHAR LIMIT=NONE] -->
<string name="quick_settings_wifi_label">Wifi</string>
<string name="quick_settings_wifi_label">Wi-Fi</string>
<!-- QuickSettings: Wifi (Not connected) [CHAR LIMIT=NONE] -->
<string name="quick_settings_wifi_not_connected">Not Connected</string>
<!-- QuickSettings: Wifi (No network) [CHAR LIMIT=NONE] -->
<string name="quick_settings_wifi_no_network">No Network</string>
<!-- QuickSettings: Wifi (Off) [CHAR LIMIT=NONE] -->
<string name="quick_settings_wifi_off_label">Wifi Off</string>
<string name="quick_settings_wifi_off_label">Wi-Fi Off</string>
<!-- QuickSettings: Wifi display [CHAR LIMIT=NONE] -->
<string name="quick_settings_wifi_display_label">Wifi Display</string>
<string name="quick_settings_wifi_display_label">Wi-Fi Display</string>
<!-- QuickSettings: Wifi display [CHAR LIMIT=NONE] -->
<string name="quick_settings_wifi_display_no_connection_label">No Wifi Display Connection</string>
<string name="quick_settings_wifi_display_no_connection_label">No Wi-Fi Display Connection</string>
<!-- QuickSettings: Brightness dialog title [CHAR LIMIT=NONE] -->
<string name="quick_settings_brightness_dialog_title">Brightness</string>
<!-- QuickSettings: Brightness dialog auto brightness button [CHAR LIMIT=NONE] -->

View File

@@ -654,6 +654,7 @@ class QuickSettings {
}
private void dismissBrightnessDialog(int timeout) {
removeAllBrightnessDialogCallbacks();
if (mBrightnessDialog != null) {
mHandler.postDelayed(mDismissBrightnessDialogRunnable, timeout);
}

View File

@@ -64,7 +64,7 @@ class QuickSettingsContainerView extends FrameLayout {
int height = MeasureSpec.getSize(heightMeasureSpec);
int availableWidth = (int) (width - getPaddingLeft() - getPaddingRight() -
(mNumColumns - 1) * mCellGap);
float cellWidth = availableWidth / mNumColumns;
float cellWidth = (float) Math.ceil(((float) availableWidth) / mNumColumns);
// Update each of the children's widths accordingly to the cell width
int N = getChildCount();

View File

@@ -280,18 +280,33 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
}
return string;
}
// Remove the period from the network name
public static String removeTrailingPeriod(String string) {
if (string == null) return null;
final int length = string.length();
if (string.endsWith(".")) {
string.substring(0, length - 1);
}
return string;
}
// NetworkSignalChanged callback
@Override
public void onWifiSignalChanged(boolean enabled, int wifiSignalIconId, String enabledDesc) {
// TODO: If view is in awaiting state, disable
Resources r = mContext.getResources();
mWifiState.enabled = enabled;
mWifiState.iconId = enabled && (wifiSignalIconId > 0)
? wifiSignalIconId
: R.drawable.ic_qs_wifi_no_network;
mWifiState.label = enabled && (enabledDesc != null)
? removeDoubleQuotes(enabledDesc)
: r.getString(R.string.quick_settings_wifi_off_label);
boolean wifiConnected = enabled && (wifiSignalIconId > 0) && (enabledDesc != null);
boolean wifiNotConnected = enabled && (enabledDesc == null);
if (wifiConnected) {
mWifiState.iconId = wifiSignalIconId;
mWifiState.label = removeDoubleQuotes(enabledDesc);
} else if (wifiNotConnected) {
mWifiState.iconId = R.drawable.ic_qs_wifi_0;
mWifiState.label = r.getString(R.string.quick_settings_wifi_not_connected);
} else {
mWifiState.iconId = R.drawable.ic_qs_wifi_no_network;
mWifiState.label = r.getString(R.string.quick_settings_wifi_off_label);
}
mWifiCallback.refreshView(mWifiTile, mWifiState);
}
@@ -319,7 +334,7 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
? dataTypeIconId
: 0;
mRSSIState.label = enabled
? enabledDesc
? removeTrailingPeriod(enabledDesc)
: r.getString(R.string.quick_settings_rssi_emergency_only);
mRSSICallback.refreshView(mRSSITile, mRSSIState);
}