QS: Add transient animations for bluetooth and wifi
Test: runtest systemui Change-Id: I04a81e1b36a6595bfb102603ad07b079c8b0ee77 Fixes: 26781226
This commit is contained in:
@@ -26,7 +26,9 @@ public class WifiStatusTracker {
|
||||
|
||||
private final WifiManager mWifiManager;
|
||||
public boolean enabled;
|
||||
public int state;
|
||||
public boolean connected;
|
||||
public boolean connecting;
|
||||
public String ssid;
|
||||
public int rssi;
|
||||
public int level;
|
||||
@@ -39,11 +41,18 @@ public class WifiStatusTracker {
|
||||
public void handleBroadcast(Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if (action.equals(WifiManager.WIFI_STATE_CHANGED_ACTION)) {
|
||||
state = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE,
|
||||
WifiManager.WIFI_STATE_UNKNOWN);
|
||||
enabled = state == WifiManager.WIFI_STATE_ENABLED;
|
||||
|
||||
|
||||
enabled = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE,
|
||||
WifiManager.WIFI_STATE_UNKNOWN) == WifiManager.WIFI_STATE_ENABLED;
|
||||
} else if (action.equals(WifiManager.NETWORK_STATE_CHANGED_ACTION)) {
|
||||
final NetworkInfo networkInfo = (NetworkInfo)
|
||||
intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);
|
||||
connecting = networkInfo != null && !networkInfo.isConnected()
|
||||
&& networkInfo.isConnectedOrConnecting();
|
||||
connected = networkInfo != null && networkInfo.isConnected();
|
||||
WifiInfo info = intent.getParcelableExtra(WifiManager.EXTRA_WIFI_INFO) != null
|
||||
? (WifiInfo) intent.getParcelableExtra(WifiManager.EXTRA_WIFI_INFO)
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<set
|
||||
android:ordering="sequentially" >
|
||||
<objectAnimator
|
||||
android:duration="83"
|
||||
android:propertyName="scaleX"
|
||||
android:valueFrom="1.0"
|
||||
android:valueTo="0.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
<objectAnimator
|
||||
android:duration="333"
|
||||
android:propertyName="scaleX"
|
||||
android:valueFrom="0.0"
|
||||
android:valueTo="0.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
<objectAnimator
|
||||
android:duration="83"
|
||||
android:propertyName="scaleX"
|
||||
android:valueFrom="0.0"
|
||||
android:valueTo="1.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
<objectAnimator
|
||||
android:duration="333"
|
||||
android:propertyName="scaleX"
|
||||
android:valueFrom="1.0"
|
||||
android:valueTo="1.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
</set>
|
||||
<set
|
||||
android:ordering="sequentially" >
|
||||
<objectAnimator
|
||||
android:duration="83"
|
||||
android:propertyName="scaleY"
|
||||
android:valueFrom="1.0"
|
||||
android:valueTo="0.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
<objectAnimator
|
||||
android:duration="333"
|
||||
android:propertyName="scaleY"
|
||||
android:valueFrom="0.0"
|
||||
android:valueTo="0.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
<objectAnimator
|
||||
android:duration="83"
|
||||
android:propertyName="scaleY"
|
||||
android:valueFrom="0.0"
|
||||
android:valueTo="1.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
</set>
|
||||
</set>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<set
|
||||
android:ordering="sequentially" >
|
||||
<objectAnimator
|
||||
android:duration="83"
|
||||
android:propertyName="scaleX"
|
||||
android:valueFrom="0.0"
|
||||
android:valueTo="1.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
<objectAnimator
|
||||
android:duration="333"
|
||||
android:propertyName="scaleX"
|
||||
android:valueFrom="1.0"
|
||||
android:valueTo="1.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@interpolator/ic_bluetooth_transient_animation_interpolator_0" />
|
||||
<objectAnimator
|
||||
android:duration="83"
|
||||
android:propertyName="scaleX"
|
||||
android:valueFrom="1.0"
|
||||
android:valueTo="0.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
</set>
|
||||
<set
|
||||
android:ordering="sequentially" >
|
||||
<objectAnimator
|
||||
android:duration="83"
|
||||
android:propertyName="scaleY"
|
||||
android:valueFrom="0.0"
|
||||
android:valueTo="1.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
<objectAnimator
|
||||
android:duration="333"
|
||||
android:propertyName="scaleY"
|
||||
android:valueFrom="1.0"
|
||||
android:valueTo="1.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@interpolator/ic_bluetooth_transient_animation_interpolator_0" />
|
||||
<objectAnimator
|
||||
android:duration="83"
|
||||
android:propertyName="scaleY"
|
||||
android:valueFrom="1.0"
|
||||
android:valueTo="0.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
</set>
|
||||
</set>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<set
|
||||
android:ordering="sequentially" >
|
||||
<objectAnimator
|
||||
android:duration="333"
|
||||
android:propertyName="pathData"
|
||||
android:valueFrom="M 0.0169982910156,18.4394989014 c 0.0,0.0 23.2140045166,-28.766998291 23.2140045166,-28.766998291 c -0.900009155273,-0.675003051758 -9.82899475098,-8.13400268555 -23.2320098877,-8.13400268555 c -13.4029998779,0.0 -22.3299865723,7.45899963379 -23.2299957275,8.13400268555 c 0.0,0.0 23.2140045166,28.766998291 23.2140045166,28.766998291 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:valueTo="M 0.0169982910156,18.4394989014 c 0.0,0.0 23.2140045166,-28.766998291 23.2140045166,-28.766998291 c -0.900009155273,-0.675003051758 -9.82899475098,-8.13400268555 -23.2320098877,-8.13400268555 c -13.4029998779,0.0 -22.3299865723,7.45899963379 -23.2299957275,8.13400268555 c 0.0,0.0 23.2140045166,28.766998291 23.2140045166,28.766998291 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:valueType="pathType"
|
||||
android:interpolator="@android:interpolator/linear" />
|
||||
<objectAnimator
|
||||
android:duration="16"
|
||||
android:propertyName="pathData"
|
||||
android:valueFrom="M 0.0169982910156,18.4394989014 c 0.0,0.0 23.2140045166,-28.766998291 23.2140045166,-28.766998291 c -0.900009155273,-0.675003051758 -9.82899475098,-8.13400268555 -23.2320098877,-8.13400268555 c -13.4029998779,0.0 -22.3299865723,7.45899963379 -23.2299957275,8.13400268555 c 0.0,0.0 23.2140045166,28.766998291 23.2140045166,28.766998291 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:valueTo="M 0.0169982910156,18.4394989014 c 0.0,0.0 9.55569458008,-11.8414916992 9.55569458008,-11.8414916992 c 0.0,0.0 -3.32373046875,-3.83329772949 -9.59307861328,-3.7864074707 c -6.26933288574,0.046875 -9.61039733887,3.71441650391 -9.61039733887,3.71441650391 c 0.0,0.0 9.61378479004,11.913482666 9.61378479004,11.913482666 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:valueType="pathType"
|
||||
android:interpolator="@android:interpolator/linear" />
|
||||
<objectAnimator
|
||||
android:duration="316"
|
||||
android:propertyName="pathData"
|
||||
android:valueFrom="M 0.0169982910156,18.4394989014 c 0.0,0.0 9.55569458008,-11.8414916992 9.55569458008,-11.8414916992 c 0.0,0.0 -3.32373046875,-3.83329772949 -9.59307861328,-3.7864074707 c -6.26933288574,0.046875 -9.61039733887,3.71441650391 -9.61039733887,3.71441650391 c 0.0,0.0 9.61378479004,11.913482666 9.61378479004,11.913482666 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:valueTo="M 0.0169982910156,18.4394989014 c 0.0,0.0 9.55569458008,-11.8414916992 9.55569458008,-11.8414916992 c 0.0,0.0 -3.32373046875,-3.83329772949 -9.59307861328,-3.7864074707 c -6.26933288574,0.046875 -9.61039733887,3.71441650391 -9.61039733887,3.71441650391 c 0.0,0.0 9.61378479004,11.913482666 9.61378479004,11.913482666 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:valueType="pathType"
|
||||
android:interpolator="@android:interpolator/linear" />
|
||||
<objectAnimator
|
||||
android:duration="16"
|
||||
android:propertyName="pathData"
|
||||
android:valueFrom="M 0.0169982910156,18.4394989014 c 0.0,0.0 9.55569458008,-11.8414916992 9.55569458008,-11.8414916992 c 0.0,0.0 -3.32373046875,-3.83329772949 -9.59307861328,-3.7864074707 c -6.26933288574,0.046875 -9.61039733887,3.71441650391 -9.61039733887,3.71441650391 c 0.0,0.0 9.61378479004,11.913482666 9.61378479004,11.913482666 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:valueTo="M 0.0169982910156,18.4394989014 c 0.0,0.0 16.9385528564,-20.9904174805 16.9385528564,-20.9904174805 c -0.486480712891,-0.364868164062 -6.84008789062,-6.15798950195 -16.9654541016,-6.13645935059 c -10.1253662109,0.0215454101562 -16.4858551025,5.73852539062 -16.9723510742,6.10339355469 c 0.0,0.0 16.9652557373,21.0234832764 16.9652557373,21.0234832764 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:valueType="pathType"
|
||||
android:interpolator="@android:interpolator/linear" />
|
||||
<objectAnimator
|
||||
android:duration="316"
|
||||
android:propertyName="pathData"
|
||||
android:valueFrom="M 0.0169982910156,18.4394989014 c 0.0,0.0 16.9385528564,-20.9904174805 16.9385528564,-20.9904174805 c -0.486480712891,-0.364868164062 -6.84008789062,-6.15798950195 -16.9654541016,-6.13645935059 c -10.1253662109,0.0215454101562 -16.4858551025,5.73852539062 -16.9723510742,6.10339355469 c 0.0,0.0 16.9652557373,21.0234832764 16.9652557373,21.0234832764 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:valueTo="M 0.0169982910156,18.4394989014 c 0.0,0.0 16.9385528564,-20.9904174805 16.9385528564,-20.9904174805 c -0.486480712891,-0.364868164062 -6.84008789062,-6.15798950195 -16.9654541016,-6.13645935059 c -10.1253662109,0.0215454101562 -16.4858551025,5.73852539062 -16.9723510742,6.10339355469 c 0.0,0.0 16.9652557373,21.0234832764 16.9652557373,21.0234832764 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:valueType="pathType"
|
||||
android:interpolator="@android:interpolator/linear" />
|
||||
<objectAnimator
|
||||
android:duration="16"
|
||||
android:propertyName="pathData"
|
||||
android:valueFrom="M 0.0169982910156,18.4394989014 c 0.0,0.0 16.9385528564,-20.9904174805 16.9385528564,-20.9904174805 c -0.486480712891,-0.364868164062 -6.84008789062,-6.15798950195 -16.9654541016,-6.13645935059 c -10.1253662109,0.0215454101562 -16.4858551025,5.73852539062 -16.9723510742,6.10339355469 c 0.0,0.0 16.9652557373,21.0234832764 16.9652557373,21.0234832764 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:valueTo="M 0.0169982910156,18.4394989014 c 0.0,0.0 23.2140045166,-28.766998291 23.2140045166,-28.766998291 c -0.900009155273,-0.675003051758 -9.82899475098,-8.13400268555 -23.2320098877,-8.13400268555 c -13.4029998779,0.0 -22.3299865723,7.45899963379 -23.2299957275,8.13400268555 c 0.0,0.0 23.2140045166,28.766998291 23.2140045166,28.766998291 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:valueType="pathType"
|
||||
android:interpolator="@android:interpolator/linear" />
|
||||
</set>
|
||||
<set
|
||||
android:ordering="sequentially" >
|
||||
<objectAnimator
|
||||
android:duration="333"
|
||||
android:propertyName="fillAlpha"
|
||||
android:valueFrom="0.0"
|
||||
android:valueTo="0.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/linear" />
|
||||
<objectAnimator
|
||||
android:duration="16"
|
||||
android:propertyName="fillAlpha"
|
||||
android:valueFrom="0.0"
|
||||
android:valueTo="1.0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/linear" />
|
||||
</set>
|
||||
</set>
|
||||
97
packages/SystemUI/res/drawable/ic_bluetooth_transient.xml
Normal file
97
packages/SystemUI/res/drawable/ic_bluetooth_transient.xml
Normal file
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="ic_bluetooth_transient"
|
||||
android:width="48dp"
|
||||
android:viewportWidth="48"
|
||||
android:height="48dp"
|
||||
android:viewportHeight="48" >
|
||||
<group
|
||||
android:name="ic_signal_wifi_4_bar_48px_outlines_"
|
||||
android:translateX="21.9995"
|
||||
android:translateY="25.73401" >
|
||||
<group
|
||||
android:name="ic_signal_wifi_4_bar_48px_outlines__pivot"
|
||||
android:translateX="-23.21545"
|
||||
android:translateY="-18.86649" >
|
||||
<group
|
||||
android:name="bluetooth"
|
||||
android:translateX="22.08789"
|
||||
android:translateY="18.72031" >
|
||||
<group
|
||||
android:name="bluetooth_pivot"
|
||||
android:translateX="-22.08789"
|
||||
android:translateY="-18.72031" >
|
||||
<group
|
||||
android:name="cross"
|
||||
android:rotation="-1.88453" >
|
||||
<path
|
||||
android:name="extented_cross"
|
||||
android:pathData="M 10.6188659668,6.56344604492 c 0.0,0.0 21.7386016846,23.1297454834 21.7386016846,23.1297454834"
|
||||
android:strokeColor="#FFFFFFFF"
|
||||
android:strokeWidth="4" />
|
||||
</group>
|
||||
<group
|
||||
android:name="bluetooth_0"
|
||||
android:translateX="23.38789"
|
||||
android:translateY="18.72031" >
|
||||
<path
|
||||
android:name="b_shape_merged"
|
||||
android:pathData="M 11.3999938965,-8.60000610352 c 0.0,0.0 -11.3999938965,-11.3999938965 -11.3999938965,-11.3999938965 c 0.0,0.0 -2.0,0.0 -2.0,0.0 c 0.0,0.0 0.0,15.1999969482 0.0,15.1999969482 c 0.0,0.0 -9.19999694824,-9.19999694824 -9.19999694824,-9.19999694824 c 0.0,0.0 -2.80000305176,2.80000305176 -2.80000305176,2.80000305176 c 0.0,0.0 11.1999969482,11.1999969482 11.1999969482,11.1999969482 c 0.0,0.0 -11.1999969482,11.1999969482 -11.1999969482,11.1999969482 c 0.0,0.0 2.80000305176,2.80000305176 2.80000305176,2.80000305176 c 0.0,0.0 9.19999694824,-9.19999694824 9.19999694824,-9.19999694824 c 0.0,0.0 0.0,15.1999969482 0.0,15.1999969482 c 0.0,0.0 2.0,0.0 2.0,0.0 c 0.0,0.0 11.3999938965,-11.3999938965 11.3999938965,-11.3999938965 c 0.0,0.0 -8.59999084473,-8.60000610352 -8.59999084473,-8.60000610352 c 0.0,0.0 8.59999084473,-8.60000610352 8.59999084473,-8.60000610352 Z M 2.0,-12.3000030518 c 0.0,0.0 3.80000305176,3.80000305176 3.80000305176,3.80000305176 c 0.0,0.0 -3.80000305176,3.69999694824 -3.80000305176,3.69999694824 c 0.0,0.0 0.0,-7.5 0.0,-7.5 Z M 5.80000305176,8.60000610352 c 0.0,0.0 -3.80000305176,3.69999694824 -3.80000305176,3.69999694824 c 0.0,0.0 0.0,-7.5 0.0,-7.5 c 0.0,0.0 3.80000305176,3.80000305176 3.80000305176,3.80000305176 Z"
|
||||
android:fillColor="#FFFFFFFF" />
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<group
|
||||
android:name="dot_left"
|
||||
android:translateX="20.16992"
|
||||
android:translateY="18.64258" >
|
||||
<group
|
||||
android:name="dot_left_pivot"
|
||||
android:translateX="-20.16992"
|
||||
android:translateY="-18.64258" >
|
||||
<group
|
||||
android:name="group_1"
|
||||
android:translateX="9.38789"
|
||||
android:translateY="18.72031" >
|
||||
<group
|
||||
android:name="group_1_pivot"
|
||||
android:translateX="-9.38789"
|
||||
android:translateY="-18.72031" >
|
||||
<path
|
||||
android:name="dot_left_0"
|
||||
android:pathData="M 13.3878936768,18.7203063965 c 0.0,0.0 -4.0,-4.0 -4.0,-4.0 c 0.0,0.0 -4.0,4.0 -4.0,4.0 c 0.0,0.0 4.0,4.0 4.0,4.0 c 0.0,0.0 4.0,-4.0 4.0,-4.0 Z"
|
||||
android:fillColor="#FFFFFFFF" />
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<group
|
||||
android:name="dot_right"
|
||||
android:translateX="26.16094"
|
||||
android:translateY="18.60898" >
|
||||
<group
|
||||
android:name="dot_right_pivot"
|
||||
android:translateX="-26.16094"
|
||||
android:translateY="-18.60898" >
|
||||
<group
|
||||
android:name="group_2"
|
||||
android:translateX="37.38789"
|
||||
android:translateY="18.72031"
|
||||
android:scaleX="0"
|
||||
android:scaleY="0" >
|
||||
<group
|
||||
android:name="group_1_pivot_0"
|
||||
android:translateX="-37.38789"
|
||||
android:translateY="-18.72031" >
|
||||
<path
|
||||
android:name="dot_right_0"
|
||||
android:pathData="M 37.3878936768,14.7203063965 c 0.0,0.0 -4.0,4.0 -4.0,4.0 c 0.0,0.0 4.0,4.0 4.0,4.0 c 0.0,0.0 4.0,-4.0 4.0,-4.0 c 0.0,0.0 -4.0,-4.0 -4.0,-4.0 Z"
|
||||
android:fillColor="#FFFFFFFF" />
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</vector>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:drawable="@drawable/ic_bluetooth_transient" >
|
||||
<target
|
||||
android:name="group_1"
|
||||
android:animation="@anim/ic_bluetooth_transient_group_1_animation" />
|
||||
<target
|
||||
android:name="group_2"
|
||||
android:animation="@anim/ic_bluetooth_transient_group_2_animation" />
|
||||
</animated-vector>
|
||||
39
packages/SystemUI/res/drawable/ic_signal_wifi_transient.xml
Normal file
39
packages/SystemUI/res/drawable/ic_signal_wifi_transient.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="ic_signal_wifi_transient"
|
||||
android:width="48dp"
|
||||
android:viewportWidth="48"
|
||||
android:height="48dp"
|
||||
android:viewportHeight="48" >
|
||||
<group
|
||||
android:name="ic_signal_wifi_4_bar_48px_2"
|
||||
android:translateX="24.25"
|
||||
android:translateY="25.73401" >
|
||||
<group
|
||||
android:name="ic_signal_wifi_4_bar_48px_2_pivot"
|
||||
android:translateX="-23.21545"
|
||||
android:translateY="-18.86649" >
|
||||
<group
|
||||
android:name="wifi_2"
|
||||
android:translateX="23.481"
|
||||
android:translateY="18.71151" >
|
||||
<path
|
||||
android:name="wifi"
|
||||
android:pathData="M 0.0169982910156,18.4394989014 c 0.0,0.0 23.2140045166,-28.766998291 23.2140045166,-28.766998291 c -0.900009155273,-0.675003051758 -9.82899475098,-8.13400268555 -23.2320098877,-8.13400268555 c -13.4029998779,0.0 -22.3299865723,7.45899963379 -23.2299957275,8.13400268555 c 0.0,0.0 23.2140045166,28.766998291 23.2140045166,28.766998291 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:fillAlpha="0.5" />
|
||||
</group>
|
||||
<group
|
||||
android:name="wifi_0"
|
||||
android:translateX="23.481"
|
||||
android:translateY="18.71151" >
|
||||
<path
|
||||
android:name="wifi_1"
|
||||
android:pathData="M 0.0169982910156,18.4394989014 c 0.0,0.0 23.2140045166,-28.766998291 23.2140045166,-28.766998291 c -0.900009155273,-0.675003051758 -9.82899475098,-8.13400268555 -23.2320098877,-8.13400268555 c -13.4029998779,0.0 -22.3299865723,7.45899963379 -23.2299957275,8.13400268555 c 0.0,0.0 23.2140045166,28.766998291 23.2140045166,28.766998291 c 0.0,0.0 0.0159912109375,0.0220031738281 0.0159912109375,0.0220031738281 c 0.0,0.0 0.00100708007812,-0.00100708007812 0.00100708007812,-0.0010070800781 c 0.0,0.0 0.00100708007812,0.00100708007812 0.00100708007812,0.0010070800781 c 0.0,0.0 0.0159912109375,-0.0220031738281 0.0159912109375,-0.0220031738281 Z"
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:fillAlpha="0" />
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</vector>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:drawable="@drawable/ic_signal_wifi_transient" >
|
||||
<target
|
||||
android:name="wifi_1"
|
||||
android:animation="@anim/ic_signal_wifi_transient_wifi_1_animation" />
|
||||
</animated-vector>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<pathInterpolator
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:pathData="M 0.0,0.0 c 0.16666666667,0.0 0.83333333333,1.0 1.0,1.0" />
|
||||
@@ -114,7 +114,8 @@ public class BluetoothTile extends QSTileImpl<BooleanState> {
|
||||
protected void handleUpdateState(BooleanState state, Object arg) {
|
||||
final boolean enabled = mController.isBluetoothEnabled();
|
||||
final boolean connected = mController.isBluetoothConnected();
|
||||
final boolean connecting = mController.isBluetoothConnecting();
|
||||
state.isTransient = mController.isBluetoothConnecting()
|
||||
|| mController.getBluetoothState() == BluetoothAdapter.STATE_TURNING_ON;
|
||||
state.dualTarget = true;
|
||||
state.value = enabled;
|
||||
if (enabled) {
|
||||
@@ -124,8 +125,8 @@ public class BluetoothTile extends QSTileImpl<BooleanState> {
|
||||
state.label = mController.getLastDeviceName();
|
||||
state.contentDescription = mContext.getString(
|
||||
R.string.accessibility_bluetooth_name, state.label);
|
||||
} else if (connecting) {
|
||||
state.icon = ResourceIcon.get(R.drawable.ic_qs_bluetooth_connecting);
|
||||
} else if (state.isTransient) {
|
||||
state.icon = ResourceIcon.get(R.drawable.ic_bluetooth_transient_animation);
|
||||
state.contentDescription = mContext.getString(
|
||||
R.string.accessibility_quick_settings_bluetooth_connecting);
|
||||
state.label = mContext.getString(R.string.quick_settings_bluetooth_label);
|
||||
|
||||
@@ -180,7 +180,7 @@ public class CellularTile extends QSTileImpl<SignalState> {
|
||||
private final CallbackInfo mInfo = new CallbackInfo();
|
||||
@Override
|
||||
public void setWifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon,
|
||||
boolean activityIn, boolean activityOut, String description) {
|
||||
boolean activityIn, boolean activityOut, String description, boolean isTransient) {
|
||||
mInfo.wifiEnabled = enabled;
|
||||
refreshState(mInfo);
|
||||
}
|
||||
|
||||
@@ -157,7 +157,10 @@ public class WifiTile extends QSTileImpl<SignalState> {
|
||||
state.activityOut = cb.enabled && cb.activityOut;
|
||||
final StringBuffer minimalContentDescription = new StringBuffer();
|
||||
final Resources r = mContext.getResources();
|
||||
if (!state.value) {
|
||||
if (cb.isTransient) {
|
||||
state.icon = ResourceIcon.get(R.drawable.ic_signal_wifi_transient_animation);
|
||||
state.label = r.getString(R.string.quick_settings_wifi_label);
|
||||
} else if (!state.value) {
|
||||
state.icon = ResourceIcon.get(R.drawable.ic_qs_wifi_disabled);
|
||||
state.label = r.getString(R.string.quick_settings_wifi_label);
|
||||
} else if (wifiConnected) {
|
||||
@@ -182,7 +185,7 @@ public class WifiTile extends QSTileImpl<SignalState> {
|
||||
state.dualLabelContentDescription = r.getString(
|
||||
R.string.accessibility_quick_settings_open_settings, getTileLabel());
|
||||
state.expandedAccessibilityClassName = Switch.class.getName();
|
||||
state.state = state.value ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
|
||||
state.state = state.value || cb.isTransient ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -226,6 +229,7 @@ public class WifiTile extends QSTileImpl<SignalState> {
|
||||
boolean activityIn;
|
||||
boolean activityOut;
|
||||
String wifiSignalContentDescription;
|
||||
boolean isTransient;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
@@ -237,6 +241,7 @@ public class WifiTile extends QSTileImpl<SignalState> {
|
||||
.append(",activityIn=").append(activityIn)
|
||||
.append(",activityOut=").append(activityOut)
|
||||
.append(",wifiSignalContentDescription=").append(wifiSignalContentDescription)
|
||||
.append(",isTransient=").append(isTransient)
|
||||
.append(']').toString();
|
||||
}
|
||||
}
|
||||
@@ -246,7 +251,7 @@ public class WifiTile extends QSTileImpl<SignalState> {
|
||||
|
||||
@Override
|
||||
public void setWifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon,
|
||||
boolean activityIn, boolean activityOut, String description) {
|
||||
boolean activityIn, boolean activityOut, String description, boolean isTransient) {
|
||||
if (DEBUG) Log.d(TAG, "onWifiSignalChanged enabled=" + enabled);
|
||||
mInfo.enabled = enabled;
|
||||
mInfo.connected = qsIcon.visible;
|
||||
@@ -255,6 +260,7 @@ public class WifiTile extends QSTileImpl<SignalState> {
|
||||
mInfo.activityIn = activityIn;
|
||||
mInfo.activityOut = activityOut;
|
||||
mInfo.wifiSignalContentDescription = qsIcon.contentDescription;
|
||||
mInfo.isTransient = isTransient;
|
||||
refreshState(mInfo);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -266,7 +266,7 @@ public class SignalClusterView extends LinearLayout implements NetworkController
|
||||
|
||||
@Override
|
||||
public void setWifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon,
|
||||
boolean activityIn, boolean activityOut, String description) {
|
||||
boolean activityIn, boolean activityOut, String description, boolean isTransient) {
|
||||
mWifiVisible = statusIcon.visible && !mBlockWifi;
|
||||
mWifiStrengthId = statusIcon.icon;
|
||||
mWifiBadgeId = statusIcon.iconOverlay;
|
||||
|
||||
@@ -109,13 +109,13 @@ public class CallbackHandler extends Handler implements EmergencyListener, Signa
|
||||
@Override
|
||||
public void setWifiIndicators(final boolean enabled, final IconState statusIcon,
|
||||
final IconState qsIcon, final boolean activityIn, final boolean activityOut,
|
||||
final String description) {
|
||||
final String description, boolean isTransient) {
|
||||
post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (SignalCallback callback : mSignalCallbacks) {
|
||||
callback.setWifiIndicators(enabled, statusIcon, qsIcon, activityIn, activityOut,
|
||||
description);
|
||||
description, isTransient);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -19,12 +19,10 @@ package com.android.systemui.statusbar.policy;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.telephony.SubscriptionInfo;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.settingslib.net.DataUsageController;
|
||||
import com.android.settingslib.wifi.AccessPoint;
|
||||
import com.android.systemui.DemoMode;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.statusbar.policy.NetworkController.SignalCallback;
|
||||
|
||||
import java.util.List;
|
||||
@@ -48,7 +46,7 @@ public interface NetworkController extends CallbackController<SignalCallback>, D
|
||||
|
||||
public interface SignalCallback {
|
||||
default void setWifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon,
|
||||
boolean activityIn, boolean activityOut, String description) {}
|
||||
boolean activityIn, boolean activityOut, String description, boolean isTransient) {}
|
||||
|
||||
default void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
|
||||
int qsType, boolean activityIn, boolean activityOut, String typeContentDescription,
|
||||
|
||||
@@ -150,7 +150,7 @@ public class WifiSignalController extends
|
||||
Utils.getWifiBadgeResource(mCurrentState.badgeEnum), contentDescription);
|
||||
callback.setWifiIndicators(mCurrentState.enabled, statusIcon, qsIcon,
|
||||
ssidPresent && mCurrentState.activityIn, ssidPresent && mCurrentState.activityOut,
|
||||
wifiDesc);
|
||||
wifiDesc, mCurrentState.isTransient);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -170,6 +170,9 @@ public class WifiSignalController extends
|
||||
mWifiTracker.handleBroadcast(intent);
|
||||
updateScoreCacheIfNecessary(previousNetworkKey);
|
||||
|
||||
mCurrentState.isTransient = mWifiTracker.state == WifiManager.WIFI_STATE_ENABLING
|
||||
|| mWifiTracker.state == WifiManager.WIFI_AP_STATE_DISABLING
|
||||
|| mWifiTracker.connecting;
|
||||
mCurrentState.enabled = mWifiTracker.enabled;
|
||||
mCurrentState.connected = mWifiTracker.connected;
|
||||
mCurrentState.ssid = mWifiTracker.ssid;
|
||||
@@ -252,6 +255,7 @@ public class WifiSignalController extends
|
||||
static class WifiState extends SignalController.State {
|
||||
String ssid;
|
||||
int badgeEnum;
|
||||
boolean isTransient;
|
||||
|
||||
@Override
|
||||
public void copyFrom(State s) {
|
||||
@@ -259,19 +263,23 @@ public class WifiSignalController extends
|
||||
WifiState state = (WifiState) s;
|
||||
ssid = state.ssid;
|
||||
badgeEnum = state.badgeEnum;
|
||||
isTransient = state.isTransient;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void toString(StringBuilder builder) {
|
||||
super.toString(builder);
|
||||
builder.append(',').append("ssid=").append(ssid);
|
||||
builder.append(',').append("badgeEnum=").append(badgeEnum);
|
||||
builder.append(',').append("isTransient=").append(isTransient);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return super.equals(o)
|
||||
&& Objects.equals(((WifiState) o).ssid, ssid)
|
||||
&& (((WifiState) o).badgeEnum == badgeEnum);
|
||||
&& (((WifiState) o).badgeEnum == badgeEnum)
|
||||
&& (((WifiState) o).isTransient == isTransient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class CallbackHandlerTest {
|
||||
boolean in = true;
|
||||
boolean out = true;
|
||||
String description = "Test";
|
||||
mHandler.setWifiIndicators(enabled, status, qs, in, out, description);
|
||||
mHandler.setWifiIndicators(enabled, status, qs, in, out, description, true);
|
||||
waitForCallbacks();
|
||||
|
||||
ArgumentCaptor<Boolean> enableArg = ArgumentCaptor.forClass(Boolean.class);
|
||||
@@ -88,15 +88,17 @@ public class CallbackHandlerTest {
|
||||
ArgumentCaptor<Boolean> inArg = ArgumentCaptor.forClass(Boolean.class);
|
||||
ArgumentCaptor<Boolean> outArg = ArgumentCaptor.forClass(Boolean.class);
|
||||
ArgumentCaptor<String> descArg = ArgumentCaptor.forClass(String.class);
|
||||
ArgumentCaptor<Boolean> isTransient = ArgumentCaptor.forClass(Boolean.class);
|
||||
Mockito.verify(mSignalCallback).setWifiIndicators(enableArg.capture(),
|
||||
statusArg.capture(), qsArg.capture(), inArg.capture(), outArg.capture(),
|
||||
descArg.capture());
|
||||
descArg.capture(), isTransient.capture());
|
||||
assertEquals(enabled, (boolean) enableArg.getValue());
|
||||
assertEquals(status, statusArg.getValue());
|
||||
assertEquals(qs, qsArg.getValue());
|
||||
assertEquals(in, (boolean) inArg.getValue());
|
||||
assertEquals(out, (boolean) outArg.getValue());
|
||||
assertEquals(description, descArg.getValue());
|
||||
assertTrue(isTransient.getValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -122,7 +122,7 @@ public class NetworkControllerWifiTest extends NetworkControllerBaseTest {
|
||||
ArgumentCaptor<IconState> iconArg = ArgumentCaptor.forClass(IconState.class);
|
||||
Mockito.verify(mCallbackHandler, Mockito.atLeastOnce()).setWifiIndicators(
|
||||
anyBoolean(), iconArg.capture(), any(), anyBoolean(), anyBoolean(),
|
||||
any());
|
||||
any(), anyBoolean());
|
||||
IconState iconState = iconArg.getValue();
|
||||
|
||||
assertEquals("Badged Wifi Resource is set",
|
||||
@@ -269,7 +269,7 @@ public class NetworkControllerWifiTest extends NetworkControllerBaseTest {
|
||||
ArgumentCaptor<Boolean> outArg = ArgumentCaptor.forClass(Boolean.class);
|
||||
|
||||
Mockito.verify(mCallbackHandler, Mockito.atLeastOnce()).setWifiIndicators(
|
||||
anyBoolean(), any(), any(), inArg.capture(), outArg.capture(), any());
|
||||
anyBoolean(), any(), any(), inArg.capture(), outArg.capture(), any(), anyBoolean());
|
||||
assertEquals("WiFi data in, in quick settings", in, (boolean) inArg.getValue());
|
||||
assertEquals("WiFi data out, in quick settings", out, (boolean) outArg.getValue());
|
||||
}
|
||||
@@ -282,7 +282,7 @@ public class NetworkControllerWifiTest extends NetworkControllerBaseTest {
|
||||
|
||||
Mockito.verify(mCallbackHandler, Mockito.atLeastOnce()).setWifiIndicators(
|
||||
enabledArg.capture(), any(), iconArg.capture(), anyBoolean(),
|
||||
anyBoolean(), descArg.capture());
|
||||
anyBoolean(), descArg.capture(), anyBoolean());
|
||||
IconState iconState = iconArg.getValue();
|
||||
assertEquals("WiFi enabled, in quick settings", enabled, (boolean) enabledArg.getValue());
|
||||
assertEquals("WiFi connected, in quick settings", connected, iconState.visible);
|
||||
@@ -295,7 +295,7 @@ public class NetworkControllerWifiTest extends NetworkControllerBaseTest {
|
||||
|
||||
Mockito.verify(mCallbackHandler, Mockito.atLeastOnce()).setWifiIndicators(
|
||||
anyBoolean(), iconArg.capture(), any(), anyBoolean(), anyBoolean(),
|
||||
any());
|
||||
any(), anyBoolean());
|
||||
IconState iconState = iconArg.getValue();
|
||||
assertEquals("WiFi visible, in status bar", visible, iconState.visible);
|
||||
assertEquals("WiFi signal, in status bar", icon, iconState.icon);
|
||||
|
||||
Reference in New Issue
Block a user