Hide mobile RSSI on devices without mobile data.
Also fixes some minor layout glitches along that row of icons (Bluetooth vertical alignment & spacing, battery text width, inter-icon padding). Bug: 5895226 Change-Id: I303c2899bf21ddb7e28914d8fb36efd7090ac5e2
This commit is contained in:
committed by
Justin Ho
parent
70e21c927a
commit
639ed754bb
@@ -44,12 +44,13 @@
|
||||
<FrameLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/bluetooth"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:scaleType="centerInside"
|
||||
android:paddingRight="16dp"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@null"
|
||||
android:layout_gravity="center_vertical"
|
||||
@@ -61,7 +62,6 @@
|
||||
android:id="@+id/mobile_icon"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:paddingRight="4dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
>
|
||||
|
||||
@@ -86,8 +86,8 @@
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="8dp"
|
||||
android:layout_weight="1"
|
||||
android:paddingRight="12dp"
|
||||
android:paddingLeft="6dp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:text="@string/status_bar_settings_settings_button"
|
||||
@@ -98,7 +98,6 @@
|
||||
android:id="@+id/wifi_icon"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:paddingRight="4dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
>
|
||||
|
||||
@@ -123,7 +122,8 @@
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="8dp"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="12dp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:text="@string/status_bar_settings_settings_button"
|
||||
@@ -136,18 +136,17 @@
|
||||
android:scaleType="centerInside"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_alignBaseline="@id/wifi_signal"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:paddingRight="6dp"
|
||||
android:contentDescription="@null"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/battery_text"
|
||||
style="@style/StatusBarNotificationText"
|
||||
android:layout_width="56dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:paddingRight="8dp"
|
||||
android:paddingRight="2dp"
|
||||
android:singleLine="true"
|
||||
android:text="@string/status_bar_settings_settings_button"
|
||||
/>
|
||||
|
||||
@@ -888,7 +888,9 @@ public class NetworkController extends BroadcastReceiver {
|
||||
String mobileLabel = "";
|
||||
int N;
|
||||
|
||||
if (mDataConnected) {
|
||||
if (!mHasMobileDataFeature) {
|
||||
mDataSignalIconId = mPhoneSignalIconId = 0;
|
||||
} else if (mDataConnected) {
|
||||
mobileLabel = mNetworkName;
|
||||
if (DEBUG) {
|
||||
mobileLabel += "yyyyYYYYyyyyYYYY";
|
||||
@@ -1029,8 +1031,13 @@ public class NetworkController extends BroadcastReceiver {
|
||||
N = mPhoneSignalIconViews.size();
|
||||
for (int i=0; i<N; i++) {
|
||||
final ImageView v = mPhoneSignalIconViews.get(i);
|
||||
v.setImageResource(mPhoneSignalIconId);
|
||||
v.setContentDescription(mContentDescriptionPhoneSignal);
|
||||
if (mPhoneSignalIconId == 0) {
|
||||
v.setVisibility(View.GONE);
|
||||
} else {
|
||||
v.setVisibility(View.VISIBLE);
|
||||
v.setImageResource(mPhoneSignalIconId);
|
||||
v.setContentDescription(mContentDescriptionPhoneSignal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1136,14 +1143,24 @@ public class NetworkController extends BroadcastReceiver {
|
||||
N = mWifiLabelViews.size();
|
||||
for (int i=0; i<N; i++) {
|
||||
TextView v = mWifiLabelViews.get(i);
|
||||
v.setText(wifiLabel);
|
||||
if ("".equals(wifiLabel)) {
|
||||
v.setVisibility(View.GONE);
|
||||
} else {
|
||||
v.setVisibility(View.VISIBLE);
|
||||
v.setText(wifiLabel);
|
||||
}
|
||||
}
|
||||
|
||||
// mobile label
|
||||
N = mMobileLabelViews.size();
|
||||
for (int i=0; i<N; i++) {
|
||||
TextView v = mMobileLabelViews.get(i);
|
||||
v.setText(mobileLabel);
|
||||
if ("".equals(mobileLabel)) {
|
||||
v.setVisibility(View.GONE);
|
||||
} else {
|
||||
v.setVisibility(View.VISIBLE);
|
||||
v.setText(mobileLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user