Skip to content

Commit e9518e3

Browse files
adithya2306aswin7469
authored andcommitted
SystemUI: Fix HD calling icon for RTL layout
The mobile signal icon mirrors itself in RTL mode, so the HD icon needs to be moved from top left to top right. Before: https://i.imgur.com/tUGTtC2.jpg After: https://i.imgur.com/0VWMOrC.jpg Fixes: 1b894eb5f6 ("SystemUI: Introduce HD & wifi calling statusbar icons") Change-Id: I20a6c6205c20e189247023b0f4429a27871765dc Signed-off-by: aswin7469 <aswinas@pixysos.com>
1 parent 7cd3abc commit e9518e3

4 files changed

Lines changed: 24 additions & 8 deletions

File tree

packages/SystemUI/res-keyguard/layout/status_bar_mobile_signal_group_inner.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,13 @@
8383
/>
8484
<ImageView
8585
android:id="@+id/mobile_hd"
86-
android:layout_width="wrap_content"
87-
android:layout_height="wrap_content"
86+
android:layout_width="12dp"
87+
android:layout_height="8dp"
88+
android:layout_marginTop="1dp"
89+
android:layout_gravity="start|top"
8890
android:src="@drawable/ic_hd_calling"
91+
android:adjustViewBounds="true"
92+
android:gravity="start|top"
8993
android:visibility="gone" />
9094
</FrameLayout>
9195
<ImageView
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<vector
22
xmlns:android="http://schemas.android.com/apk/res/android"
3-
android:width="@dimen/signal_icon_size"
4-
android:height="@dimen/signal_icon_size"
5-
android:viewportWidth="24"
6-
android:viewportHeight="24">
3+
android:width="12dp"
4+
android:height="8dp"
5+
android:viewportWidth="12"
6+
android:viewportHeight="8">
77
<path
8-
android:pathData="M 5.4024 8.2 L 4.2252 8.2 L 4.2252 5.0008 L 1.182 5.0008 L 1.182 8.2 L 0 8.2 L 0 1 L 1.182 1 L 1.182 3.9964 L 4.2252 3.9964 L 4.2252 1 L 5.4024 1 L 5.4024 8.2 Z"
8+
android:pathData="M 5.402 7.6 L 4.225 7.6 L 4.225 4.401 L 1.182 4.401 L 1.182 7.6 L 0 7.6 L 0 0.4 L 1.182 0.4 L 1.182 3.396 L 4.225 3.396 L 4.225 0.4 L 5.402 0.4 L 5.402 7.6 Z"
99
android:fillColor="#000000"/>
1010
<path
11-
android:pathData="M 6.924 8.2 L 6.924 1 L 8.934 1 C 9.535 1 10.068 1.142 10.532 1.425 C 10.999 1.709 11.362 2.111 11.617 2.632 C 11.872 3.153 12 3.749 12 4.422 L 12 4.782 C 12 5.465 11.87 6.065 11.612 6.582 C 11.357 7.101 10.991 7.499 10.513 7.78 C 10.04 8.06 9.497 8.2 8.882 8.2 L 6.924 8.2 Z M 8.107 2.009 L 8.107 7.202 L 8.878 7.202 C 9.498 7.202 9.973 6.996 10.303 6.588 C 10.637 6.176 10.807 5.585 10.813 4.817 L 10.813 4.418 C 10.813 3.635 10.652 3.039 10.332 2.627 C 10.01 2.214 9.545 2.009 8.934 2.009 L 8.107 2.009 Z"
11+
android:pathData="M 6.924 7.6 L 6.924 0.4 L 8.934 0.4 C 9.535 0.4 10.068 0.542 10.532 0.825 C 10.999 1.109 11.362 1.511 11.617 2.032 C 11.872 2.553 12 3.149 12 3.822 L 12 4.182 C 12 4.865 11.87 5.465 11.612 5.982 C 11.357 6.501 10.991 6.899 10.513 7.18 C 10.04 7.46 9.497 7.6 8.882 7.6 L 6.924 7.6 Z M 8.107 1.409 L 8.107 6.602 L 8.878 6.602 C 9.498 6.602 9.973 6.396 10.303 5.988 C 10.637 5.576 10.807 4.985 10.813 4.217 L 10.813 3.818 C 10.813 3.035 10.652 2.439 10.332 2.027 C 10.01 1.614 9.545 1.409 8.934 1.409 L 8.107 1.409 Z"
1212
android:fillColor="#000000"/>
1313
</vector>

packages/SystemUI/res/values/pixys_dimens.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@
3131

3232
<!-- Maximum vertical offset of statusbar for burn-in protection -->
3333
<dimen name="status_bar_offset_max_y">4dp</dimen>
34+
35+
<!-- HD calling icon -->
36+
<dimen name="signal_icon_viewport_size">24dp</dimen>
3437
</resources>

packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,15 @@ private void init() {
129129
mMobileDrawable = new SignalDrawable(getContext());
130130
mMobile.setImageDrawable(mMobileDrawable);
131131

132+
float signalSize = mContext.getResources().getDimensionPixelSize(
133+
R.dimen.signal_icon_size);
134+
float viewportSize = mContext.getResources().getDimensionPixelSize(
135+
R.dimen.signal_icon_viewport_size);
136+
LayoutParams lp = (LayoutParams) mMobileHd.getLayoutParams();
137+
lp.height = Math.round(lp.height * (signalSize / viewportSize));
138+
lp.width = Math.round(lp.width * (signalSize / viewportSize));
139+
mMobileHd.setLayoutParams(lp);
140+
132141
initDotView();
133142
}
134143

0 commit comments

Comments
 (0)