Skip to content

Commit 7612423

Browse files
adithya2306Genkzsz11
authored andcommitted
SystemUI: NetworkTraffic: Minor refinements
- remove unwanted padding on top of expanded statusbar traffic indicator and center it properly - reduce side padding of statusbar indicator - show /S in caps - reduce overall text size and increase line spacing Signed-off-by: NurKeinNeid <mralexman3000@gmail.com> Signed-off-by: Genkzsz11 <Genkzsz11@gmail.com>
1 parent 9689827 commit 7612423

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

packages/SystemUI/res/layout/quick_status_bar_header_system_icons.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@
6969
android:id="@+id/networkTraffic"
7070
android:layout_width="wrap_content"
7171
android:layout_height="match_parent"
72-
android:layout_marginStart="2dp"
73-
android:layout_marginEnd="2dp"
74-
android:paddingEnd="@dimen/status_bar_end_padding"
72+
android:layout_marginStart="6dp"
73+
android:layout_marginEnd="4dp"
7574
android:singleLine="false"
7675
android:lineSpacingMultiplier="1.2"
77-
systemui:showDark="false" />
76+
systemui:showDark="false"
77+
android:gravity="center_vertical|end"/>
7878
</LinearLayout>
7979

8080
<LinearLayout

packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ private StatusBarMobileView onCreateStatusBarMobileView(String slot) {
332332

333333
private NetworkTrafficSB onCreateNetworkTraffic(String slot) {
334334
NetworkTrafficSB view = new NetworkTrafficSB(mContext);
335-
view.setPadding(4, 0, 4, 0);
335+
view.setPadding(3, 0, 3, 0);
336336
return view;
337337
}
338338

packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkTraffic.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class NetworkTraffic extends TextView {
5050
private static final int KB = 1024;
5151
private static final int MB = KB * KB;
5252
private static final int GB = MB * KB;
53-
private static final String symbol = "/s";
53+
private static final String symbol = "/S";
5454

5555
protected boolean mIsEnabled;
5656
protected boolean mAttached;
@@ -320,11 +320,11 @@ protected void onDetachedFromWindow() {
320320
}
321321

322322
protected RelativeSizeSpan getSpeedRelativeSizeSpan() {
323-
return new RelativeSizeSpan(0.80f);
323+
return new RelativeSizeSpan(0.78f);
324324
}
325325

326326
protected RelativeSizeSpan getUnitRelativeSizeSpan() {
327-
return new RelativeSizeSpan(0.75f);
327+
return new RelativeSizeSpan(0.70f);
328328
}
329329

330330
private Runnable mRunnable = new Runnable() {
@@ -497,7 +497,7 @@ private void updateTextSize() {
497497
? (float)resources.getDimensionPixelSize(R.dimen.net_traffic_multi_text_size)
498498
: (float)resources.getDimensionPixelSize(R.dimen.net_traffic_single_text_size));
499499
setTypeface(Typeface.create(txtFont, Typeface.BOLD));
500-
setLineSpacing(0.80f, 0.80f);
500+
setLineSpacing(0.85f, 0.85f);
501501
}
502502

503503
protected void setSpacingAndFonts() {

packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkTrafficSB.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ protected void setMode() {
6969
protected void setSpacingAndFonts() {
7070
super.setSpacingAndFonts();
7171
setTypeface(Typeface.create(txtFont, Typeface.BOLD));
72-
setLineSpacing(0.75f, 0.75f);
72+
setLineSpacing(0.80f, 0.80f);
7373
}
7474

7575
@Override
7676
protected RelativeSizeSpan getSpeedRelativeSizeSpan() {
77-
return new RelativeSizeSpan(0.75f);
77+
return new RelativeSizeSpan(0.72f);
7878
}
7979

8080
@Override
8181
protected RelativeSizeSpan getUnitRelativeSizeSpan() {
82-
return new RelativeSizeSpan(0.7f);
82+
return new RelativeSizeSpan(0.60f);
8383
}
8484

8585
@Override

0 commit comments

Comments
 (0)