Merge "Clean up activity a bit and disable it by default" into oc-dev am: 1df5ca5911

am: eae4ab352e

Change-Id: I161a6acef191800f1f491864061a06c8794af9cb
This commit is contained in:
Jason Monk
2017-04-12 00:15:07 +00:00
committed by android-build-merger
6 changed files with 166 additions and 79 deletions

View File

@@ -0,0 +1,24 @@
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="5dp"
android:height="17.0dp"
android:viewportWidth="7.1"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M3.6000004,13.2l-3.6,0.0 3.6,7.3 0.0,0.0 0.0,0.0 0.0,0.0 0.0,0.0 3.5,-7.3z"/>
</vector>

View File

@@ -0,0 +1,24 @@
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="5dp"
android:height="17.0dp"
android:viewportWidth="7.1"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M3.6000004,10.8l3.5,0.0 -3.5,-7.3 0.0,0.0 0.0,0.0 0.0,0.0 0.0,0.0 -3.6,7.3z"/>
</vector>

View File

@@ -16,48 +16,67 @@
** limitations under the License.
*/
-->
<FrameLayout
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res-auto"
android:id="@+id/mobile_combo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<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_type"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
/>
<ImageView
android:id="@+id/mobile_roaming"
android:layout_width="wrap_content"
<FrameLayout
android:layout_height="17dp"
android:paddingStart="22dp"
android:paddingTop="1.5dp"
android:paddingBottom="3dp"
android:scaleType="fitCenter"
android:src="@drawable/stat_sys_roaming"
android:contentDescription="@string/accessibility_data_connection_roaming"
android:visibility="gone" />
<ImageView
android:id="@+id/mobile_inout"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<ImageView
android:id="@+id/mobile_in"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/ic_activity_down"
android:visibility="gone"
android:paddingEnd="2dp"
/>
<ImageView
android:id="@+id/mobile_out"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/ic_activity_up"
android:paddingEnd="2dp"
android:visibility="gone"
/>
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
android:visibility="gone"
/>
</FrameLayout>
android:layout_height="wrap_content">
<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_type"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
/>
<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:src="@drawable/stat_sys_roaming"
android:contentDescription="@string/accessibility_data_connection_roaming"
android:visibility="gone" />
</FrameLayout>
</LinearLayout>

View File

@@ -52,6 +52,26 @@
android:alpha="0.0"
/>
</FrameLayout>
<FrameLayout
android:layout_height="17dp"
android:layout_width="wrap_content">
<ImageView
android:id="@+id/wifi_in"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/ic_activity_down"
android:visibility="gone"
android:paddingEnd="2dp"
/>
<ImageView
android:id="@+id/wifi_out"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/ic_activity_up"
android:paddingEnd="2dp"
android:visibility="gone"
/>
</FrameLayout>
<FrameLayout
android:id="@+id/wifi_combo"
android:layout_height="wrap_content"

View File

@@ -335,4 +335,7 @@
<!-- Whether or the notifications can be shown and dismissed with a drag. -->
<bool name="config_enableNotificationShadeDrag">true</bool>
<!-- Whether to show activity indicators in the status bar -->
<bool name="config_showActivity">false</bool>
</resources>

View File

@@ -83,7 +83,8 @@ public class SignalClusterView extends LinearLayout implements NetworkController
private int mWifiStrengthId = 0;
private int mLastWifiBadgeId = -1;
private int mLastWifiStrengthId = -1;
private int mWifiActivityId = 0;
private boolean mWifiIn;
private boolean mWifiOut;
private int mLastWifiActivityId = -1;
private boolean mIsAirplaneMode = false;
private int mAirplaneIconId = 0;
@@ -99,7 +100,8 @@ public class SignalClusterView extends LinearLayout implements NetworkController
ViewGroup mEthernetGroup, mWifiGroup;
View mNoSimsCombo;
ImageView mVpn, mEthernet, mWifi, mAirplane, mNoSims, mEthernetDark, mWifiDark, mNoSimsDark;
ImageView mWifiActivity;
ImageView mWifiActivityIn;
ImageView mWifiActivityOut;
View mWifiAirplaneSpacer;
View mWifiSignalSpacer;
LinearLayout mMobileSignalGroup;
@@ -116,6 +118,7 @@ public class SignalClusterView extends LinearLayout implements NetworkController
private boolean mBlockMobile;
private boolean mBlockWifi;
private boolean mBlockEthernet;
private boolean mActivityEnabled;
public SignalClusterView(Context context) {
this(context, null);
@@ -144,6 +147,7 @@ public class SignalClusterView extends LinearLayout implements NetworkController
mIconScaleFactor = typedValue.getFloat();
mNetworkController = Dependency.get(NetworkController.class);
mSecurityController = Dependency.get(SecurityController.class);
updateActivityEnabled();
}
@Override
@@ -180,7 +184,8 @@ public class SignalClusterView extends LinearLayout implements NetworkController
mWifiGroup = (ViewGroup) findViewById(R.id.wifi_combo);
mWifi = (ImageView) findViewById(R.id.wifi_signal);
mWifiDark = (ImageView) findViewById(R.id.wifi_signal_dark);
mWifiActivity = (ImageView) findViewById(R.id.wifi_inout);
mWifiActivityIn = (ImageView) findViewById(R.id.wifi_in);
mWifiActivityOut= (ImageView) findViewById(R.id.wifi_out);
mAirplane = (ImageView) findViewById(R.id.airplane);
mNoSims = (ImageView) findViewById(R.id.no_sims);
mNoSimsDark = (ImageView) findViewById(R.id.no_sims_dark);
@@ -264,6 +269,10 @@ public class SignalClusterView extends LinearLayout implements NetworkController
});
}
private void updateActivityEnabled() {
mActivityEnabled = mContext.getResources().getBoolean(R.bool.config_showActivity);
}
@Override
public void setWifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon,
boolean activityIn, boolean activityOut, String description, boolean isTransient) {
@@ -271,10 +280,8 @@ public class SignalClusterView extends LinearLayout implements NetworkController
mWifiStrengthId = statusIcon.icon;
mWifiBadgeId = statusIcon.iconOverlay;
mWifiDescription = statusIcon.contentDescription;
mWifiActivityId = activityIn && activityOut ? R.drawable.stat_sys_wifi_inout
: activityIn ? R.drawable.stat_sys_wifi_in
: activityOut ? R.drawable.stat_sys_wifi_out
: 0;
mWifiIn = activityIn && mActivityEnabled;
mWifiOut = activityOut && mActivityEnabled;
apply();
}
@@ -294,10 +301,8 @@ public class SignalClusterView extends LinearLayout implements NetworkController
state.mMobileTypeDescription = typeContentDescription;
state.mIsMobileTypeIconWide = statusType != 0 && isWide;
state.mRoaming = roaming;
state.mMobileActivityId = activityIn && activityOut ? R.drawable.stat_sys_signal_inout
: activityIn ? R.drawable.stat_sys_signal_in
: activityOut ? R.drawable.stat_sys_signal_out
: 0;
state.mActivityIn = activityIn && mActivityEnabled;
state.mActivityOut = activityOut && mActivityEnabled;
apply();
}
@@ -421,10 +426,6 @@ public class SignalClusterView extends LinearLayout implements NetworkController
mLastWifiStrengthId = -1;
mLastWifiBadgeId = -1;
}
if (mWifiActivity != null) {
mWifiActivity.setImageDrawable(null);
mLastWifiActivityId = -1;
}
for (PhoneState state : mPhoneStates) {
if (state.mMobile != null) {
@@ -441,10 +442,6 @@ public class SignalClusterView extends LinearLayout implements NetworkController
state.mMobileType.setImageDrawable(null);
state.mLastMobileTypeId = -1;
}
if (state.mMobileActivity != null) {
state.mMobileActivity.setImageDrawable(null);
state.mLastMobileActivityId = -1;
}
}
if (mAirplane != null) {
@@ -504,12 +501,6 @@ public class SignalClusterView extends LinearLayout implements NetworkController
mLastWifiStrengthId = mWifiStrengthId;
mLastWifiBadgeId = mWifiBadgeId;
}
if (mWifiActivityId != mLastWifiActivityId) {
if (mWifiActivityId != 0) {
setIconForView(mWifiActivity, mWifiActivityId);
}
mLastWifiActivityId = mWifiActivityId;
}
mWifiGroup.setContentDescription(mWifiDescription);
mWifiGroup.setVisibility(View.VISIBLE);
} else {
@@ -521,7 +512,8 @@ public class SignalClusterView extends LinearLayout implements NetworkController
(mWifiVisible ? "VISIBLE" : "GONE"),
mWifiStrengthId));
mWifiActivity.setVisibility(mWifiActivityId != 0 ? View.VISIBLE : View.GONE);
mWifiActivityIn.setVisibility(mWifiIn ? View.VISIBLE : View.GONE);
mWifiActivityOut.setVisibility(mWifiOut ? View.VISIBLE : View.GONE);
boolean anyMobileVisible = false;
int firstMobileTypeId = 0;
@@ -631,8 +623,10 @@ public class SignalClusterView extends LinearLayout implements NetworkController
applyDarkIntensity(
DarkIconDispatcher.getDarkIntensity(mTintArea, mWifi, mDarkIntensity),
mWifi, mWifiDark);
setTint(mWifiActivity,
DarkIconDispatcher.getTint(mTintArea, mWifiActivity, mIconTint));
setTint(mWifiActivityIn,
DarkIconDispatcher.getTint(mTintArea, mWifiActivityIn, mIconTint));
setTint(mWifiActivityOut,
DarkIconDispatcher.getTint(mTintArea, mWifiActivityOut, mIconTint));
applyDarkIntensity(
DarkIconDispatcher.getDarkIntensity(mTintArea, mEthernet, mDarkIntensity),
mEthernet, mEthernetDark);
@@ -657,7 +651,7 @@ public class SignalClusterView extends LinearLayout implements NetworkController
private class PhoneState {
private final int mSubId;
private boolean mMobileVisible = false;
private int mMobileStrengthId = 0, mMobileTypeId = 0, mMobileActivityId = 0;
private int mMobileStrengthId = 0, mMobileTypeId = 0;
private int mLastMobileStrengthId = -1;
private int mLastMobileTypeId = -1;
private int mLastMobileActivityId = -1;
@@ -667,7 +661,10 @@ public class SignalClusterView extends LinearLayout implements NetworkController
private ViewGroup mMobileGroup;
private ImageView mMobile, mMobileDark, mMobileType, mMobileRoaming;
public boolean mRoaming;
private ImageView mMobileActivity;
private ImageView mMobileActivityIn;
private ImageView mMobileActivityOut;
public boolean mActivityIn;
public boolean mActivityOut;
public PhoneState(int subId, Context context) {
ViewGroup root = (ViewGroup) LayoutInflater.from(context)
@@ -678,11 +675,12 @@ public class SignalClusterView extends LinearLayout implements NetworkController
public void setViews(ViewGroup root) {
mMobileGroup = root;
mMobile = (ImageView) root.findViewById(R.id.mobile_signal);
mMobileDark = (ImageView) root.findViewById(R.id.mobile_signal_dark);
mMobileType = (ImageView) root.findViewById(R.id.mobile_type);
mMobileRoaming = (ImageView) root.findViewById(R.id.mobile_roaming);
mMobileActivity = (ImageView) root.findViewById(R.id.mobile_inout);
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);
mMobileActivityIn = root.findViewById(R.id.mobile_in);
mMobileActivityOut = root.findViewById(R.id.mobile_out);
}
public boolean apply(boolean isSecondaryIcon) {
@@ -698,10 +696,6 @@ public class SignalClusterView extends LinearLayout implements NetworkController
mLastMobileTypeId = mMobileTypeId;
}
if (mLastMobileActivityId != mMobileActivityId) {
mMobileActivity.setImageResource(mMobileActivityId);
mLastMobileActivityId = mMobileActivityId;
}
mMobileGroup.setContentDescription(mMobileTypeDescription
+ " " + mMobileDescription);
mMobileGroup.setVisibility(View.VISIBLE);
@@ -724,7 +718,8 @@ public class SignalClusterView extends LinearLayout implements NetworkController
mMobileType.setVisibility(mMobileTypeId != 0 ? View.VISIBLE : View.GONE);
mMobileRoaming.setVisibility(mRoaming ? View.VISIBLE : View.GONE);
mMobileActivity.setVisibility(mMobileActivityId != 0 ? View.VISIBLE : View.GONE);
mMobileActivityIn.setVisibility(mActivityIn ? View.VISIBLE : View.GONE);
mMobileActivityOut.setVisibility(mActivityOut ? View.VISIBLE : View.GONE);
return mMobileVisible;
}
@@ -786,8 +781,10 @@ public class SignalClusterView extends LinearLayout implements NetworkController
setTint(mMobileType, DarkIconDispatcher.getTint(tintArea, mMobileType, tint));
setTint(mMobileRoaming, DarkIconDispatcher.getTint(tintArea, mMobileRoaming,
tint));
setTint(mMobileActivity,
DarkIconDispatcher.getTint(tintArea, mMobileActivity, tint));
setTint(mMobileActivityIn,
DarkIconDispatcher.getTint(tintArea, mMobileActivityIn, tint));
setTint(mMobileActivityOut,
DarkIconDispatcher.getTint(tintArea, mMobileActivityOut, tint));
}
}
}