diff options
| author | 2018-03-19 21:15:52 +0000 | |
|---|---|---|
| committer | 2018-03-19 21:15:52 +0000 | |
| commit | 12a9f78dd83816cb49985219e8f877291cdb2da8 (patch) | |
| tree | 624318f68568e0866bbfc4bc037965881810a35a | |
| parent | 4f59dce0f820262b21794ca9668bda476ac91ad8 (diff) | |
| parent | d8f546faf0d7c34d939445340682a278f84df562 (diff) | |
Merge "Move roaming icon to upper left." into pi-dev
4 files changed, 29 insertions, 34 deletions
diff --git a/packages/SystemUI/res/drawable/stat_sys_roaming.xml b/packages/SystemUI/res/drawable/stat_sys_roaming.xml index 4baa472acb88..bd2edf39d929 100644 --- a/packages/SystemUI/res/drawable/stat_sys_roaming.xml +++ b/packages/SystemUI/res/drawable/stat_sys_roaming.xml @@ -14,11 +14,15 @@ Copyright (C) 2014 The Android Open Source Project limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="8.5dp" - android:height="17dp" - android:viewportWidth="6.0" - android:viewportHeight="12.0"> + android:width="@dimen/signal_icon_size" + android:height="@dimen/signal_icon_size" + android:viewportWidth="24" + android:viewportHeight="24"> <path android:fillColor="#FFFFFFFF" - android:pathData="M2.800000,7.900000l-1.000000,0.000000L1.800000,11.000000L0.200000,11.000000L0.200000,2.500000l2.700000,0.000000c0.900000,0.000000 1.500000,0.200000 2.000000,0.700000s0.700000,1.100000 0.700000,1.900000c0.000000,0.600000 -0.100000,1.100000 -0.300000,1.500000S4.800000,7.200000 4.400000,7.400000l1.500000,3.500000L5.900000,11.000000L4.100000,11.000000L2.800000,7.900000zM1.800000,6.500000l1.100000,0.000000c0.400000,0.000000 0.600000,-0.100000 0.800000,-0.400000S4.000000,5.600000 4.000000,5.200000c0.000000,-0.400000 -0.100000,-0.800000 -0.300000,-1.000000S3.300000,3.800000 2.900000,3.800000L1.800000,3.800000L1.800000,6.500000z"/> -</vector> + android:pathData="M7.8,7.2L9,10H7L5.87,7.33H4V10H2V2h5c1.13,0,2,0.87,2,2v1.33C9,6.13,8.47,6.87,7.8,7.2z M7,4H4v1.33h3V4z" /> + <path + android:pathData="M 0 0 H 24 V 24 H 0 V 0 Z" /> + <path + android:pathData="M0,0h24v24H0V0z" /> +</vector>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/mobile_signal_group.xml b/packages/SystemUI/res/layout/mobile_signal_group.xml index 2e92042cc1c2..2da03d2590e7 100644 --- a/packages/SystemUI/res/layout/mobile_signal_group.xml +++ b/packages/SystemUI/res/layout/mobile_signal_group.xml @@ -51,33 +51,26 @@ android:layout_width="wrap_content" android:layout_gravity="center_vertical" android:visibility="gone" /> + <Space + android:id="@+id/mobile_roaming_space" + android:layout_height="match_parent" + android:layout_width="@dimen/roaming_icon_start_padding" + android:visibility="gone" + /> <FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical"> <com.android.systemui.statusbar.AnimatedImageView - android:theme="@style/DualToneLightTheme" android:id="@+id/mobile_signal" android:layout_height="wrap_content" android:layout_width="wrap_content" systemui:hasOverlappingRendering="false" /> - <com.android.systemui.statusbar.AnimatedImageView - android:theme="@style/DualToneDarkTheme" - android:id="@+id/mobile_signal_dark" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:alpha="0.0" - systemui:hasOverlappingRendering="false" - /> <ImageView android:id="@+id/mobile_roaming" android:layout_width="wrap_content" - android:layout_height="17dp" - android:paddingStart="22dp" - android:paddingTop="1.5dp" - android:paddingBottom="3dp" - android:scaleType="fitCenter" + android:layout_height="wrap_content" android:src="@drawable/stat_sys_roaming" android:contentDescription="@string/data_connection_roaming" android:visibility="gone" /> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index e30b86a6c4ef..cb3c282f703b 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -637,6 +637,10 @@ type icon is wide. --> <dimen name="wide_type_icon_start_padding">2dp</dimen> + <!-- Padding between the mobile signal indicator and the start icon when the roaming icon + is displayed in the upper left corner. --> + <dimen name="roaming_icon_start_padding">2dp</dimen> + <!-- Extra padding between multiple phone signal icons. --> <dimen name="secondary_telephony_padding">2dp</dimen> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java index 0f5e71e5235a..55a23e3dc0ea 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java @@ -611,12 +611,14 @@ public class SignalClusterView extends LinearLayout implements NetworkController private String mMobileDescription, mMobileTypeDescription; private ViewGroup mMobileGroup; - private ImageView mMobile, mMobileDark, mMobileType, mMobileRoaming; + private ImageView mMobile, mMobileType, mMobileRoaming; + private View mMobileRoamingSpace; public boolean mRoaming; private ImageView mMobileActivityIn; private ImageView mMobileActivityOut; public boolean mActivityIn; public boolean mActivityOut; + private SignalDrawable mMobileSignalDrawable; public PhoneState(int subId, Context context) { ViewGroup root = (ViewGroup) LayoutInflater.from(context) @@ -628,23 +630,19 @@ public class SignalClusterView extends LinearLayout implements NetworkController public void setViews(ViewGroup root) { mMobileGroup = root; mMobile = root.findViewById(R.id.mobile_signal); - mMobileDark = root.findViewById(R.id.mobile_signal_dark); mMobileType = root.findViewById(R.id.mobile_type); mMobileRoaming = root.findViewById(R.id.mobile_roaming); + mMobileRoamingSpace = root.findViewById(R.id.mobile_roaming_space); mMobileActivityIn = root.findViewById(R.id.mobile_in); mMobileActivityOut = root.findViewById(R.id.mobile_out); - // TODO: Remove the 2 instances because now the drawable can handle darkness. - mMobile.setImageDrawable(new SignalDrawable(mMobile.getContext())); - SignalDrawable drawable = new SignalDrawable(mMobileDark.getContext()); - drawable.setDarkIntensity(1); - mMobileDark.setImageDrawable(drawable); + mMobileSignalDrawable = new SignalDrawable(mMobile.getContext()); + mMobile.setImageDrawable(mMobileSignalDrawable); } public boolean apply(boolean isSecondaryIcon) { if (mMobileVisible && !mIsAirplaneMode) { if (mLastMobileStrengthId != mMobileStrengthId) { mMobile.getDrawable().setLevel(mMobileStrengthId); - mMobileDark.getDrawable().setLevel(mMobileStrengthId); mLastMobileStrengthId = mMobileStrengthId; } @@ -666,15 +664,13 @@ public class SignalClusterView extends LinearLayout implements NetworkController mMobile.setPaddingRelative( mIsMobileTypeIconWide ? mWideTypeIconStartPadding : mMobileDataIconStartPadding, 0, 0, 0); - mMobileDark.setPaddingRelative( - mIsMobileTypeIconWide ? mWideTypeIconStartPadding : mMobileDataIconStartPadding, - 0, 0, 0); if (DEBUG) Log.d(TAG, String.format("mobile: %s sig=%d typ=%d", (mMobileVisible ? "VISIBLE" : "GONE"), mMobileStrengthId, mMobileTypeId)); mMobileType.setVisibility(mMobileTypeId != 0 ? View.VISIBLE : View.GONE); mMobileRoaming.setVisibility(mRoaming ? View.VISIBLE : View.GONE); + mMobileRoamingSpace.setVisibility(mRoaming ? View.VISIBLE : View.GONE); mMobileActivityIn.setVisibility(mActivityIn ? View.VISIBLE : View.GONE); mMobileActivityOut.setVisibility(mActivityOut ? View.VISIBLE : View.GONE); @@ -689,9 +685,7 @@ public class SignalClusterView extends LinearLayout implements NetworkController } public void setIconTint(int tint, float darkIntensity, Rect tintArea) { - applyDarkIntensity( - DarkIconDispatcher.getDarkIntensity(tintArea, mMobile, darkIntensity), - mMobile, mMobileDark); + mMobileSignalDrawable.setDarkIntensity(darkIntensity); setTint(mMobileType, DarkIconDispatcher.getTint(tintArea, mMobileType, tint)); setTint(mMobileRoaming, DarkIconDispatcher.getTint(tintArea, mMobileRoaming, tint)); |