diff options
| author | 2017-04-13 19:37:31 +0000 | |
|---|---|---|
| committer | 2017-04-13 19:37:36 +0000 | |
| commit | 99856429db5f0733cb2af8f61f66c3b1ed3aec0c (patch) | |
| tree | 98e8a16be3d03ccd30ab645b754fa74228d9388e | |
| parent | 117ac766a931e1893fb4a61a95670d23c409f140 (diff) | |
| parent | 6d21855e1629e3b8aa486161d4abf41255259e50 (diff) | |
Merge "Update mobile data icon" into oc-dev
4 files changed, 96 insertions, 12 deletions
diff --git a/packages/SystemUI/res/drawable/ic_data_off.xml b/packages/SystemUI/res/drawable/ic_data_off.xml new file mode 100644 index 000000000000..b97ddaef6418 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_data_off.xml @@ -0,0 +1,27 @@ +<!-- + 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="24.0dp" + android:height="24.0dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:pathData="M21.6,21.6L10.8,10.9L2.1,2.1L0.8,3.4l3.3,3.3C3.1,8.2 2.5,10.0 2.5,12.0c0.0,5.2 4.3,9.5 9.5,9.5c2.0,0.0 3.8,-0.6 5.3,-1.6l3.0,3.0L21.6,21.6zM9.6,12.2l0.7,0.7L9.6,12.9L9.6,12.2zM13.9,18.6c-0.2,0.2 -0.5,0.2 -0.6,0.0l-2.4,-3.7l1.5,0.0l2.4,2.4L13.9,18.6z" + android:fillColor="#ffffff"/> + <path + android:pathData="M12.0,2.5c-2.0,0.0 -3.8,0.6 -5.3,1.6l2.5,2.5L10.0,5.4c0.2,-0.2 0.5,-0.2 0.6,0.0L13.0,9.1l-1.4,0.0l2.0,2.0l0.6,0.0l0.0,0.6l5.6,5.6c1.0,-1.5 1.6,-3.3 1.6,-5.3C21.5,6.8 17.2,2.5 12.0,2.5z" + android:fillColor="#ffffff"/> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_data_on.xml b/packages/SystemUI/res/drawable/ic_data_on.xml new file mode 100644 index 000000000000..a65dc7922ceb --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_data_on.xml @@ -0,0 +1,26 @@ +<!-- + 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="24.0dp" + android:height="24.0dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:pathData="M12.0,12.0m-9.5,0.0a9.5,9.5 0.0,1.0 1.0,19.0 0.0a9.5,9.5 0.0,1.0 1.0,-19.0 0.0 + M10.6,5.4c-0.2,-0.2 -0.5,-0.2 -0.6,0.0L7.6,9.1l2.0,0.0l0.0,3.8L11.0,12.900001L11.0,9.1l2.0,0.0L10.6,5.4z + M13.3,18.6c0.2,0.2 0.5,0.2 0.6,0.0l2.4,-3.7l-2.0,0.0l0.0,-3.8l-1.4,0.0l0.0,3.8l-2.0,0.0L13.3,18.6z" + android:fillColor="#ffffff"/> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_data_unavailable.xml b/packages/SystemUI/res/drawable/ic_data_unavailable.xml new file mode 100644 index 000000000000..27a769724912 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_data_unavailable.xml @@ -0,0 +1,32 @@ +<!-- + 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. + M12.0,12.0m-9.5,0.0a9.5,9.5 0.0,1.0 1.0,19.0 0.0a9.5,9.5 0.0,1.0 1.0,-19.0 0.0 +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24.0dp" + android:height="24.0dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:pathData="M12.0,2.5c-5.246705,0.0 -9.5,4.253295 -9.5,9.5 0.0,5.246705 4.253295,9.5 9.5,9.5 2.771732,0.0 5.263364,-1.200342 7.0,-3.09375l0.0,-0.21875 0.0,-7.5 0.0,-1.0 1.0,0.0 1.1875,0.0C20.148497,5.5674677 16.442669,2.5 12.0,2.5zm9.1875,7.1875c-14.125,9.541667 -7.0625,4.770833 0.0,0.0z + M10.6,5.4C10.4,5.2 10.1,5.2 10.0,5.4L7.6,9.1l2.0,0.0l0.0,3.8L11.0,12.900001L11.0,9.1l2.0,0.0L10.6,5.4z + M13.3,18.6c0.2,0.2 0.5,0.2 0.6,0.0l2.4,-3.7l-2.0,0.0l0.0,-3.8l-1.4,0.0l0.0,3.8l-2.0,0.0l2.4,3.7z + M21.7,24.0c-0.5,0.0 -0.8,-0.1 -1.1,-0.4c-0.3,-0.3 -0.4,-0.6 -0.4,-1.0c0.0,-0.4 0.1,-0.8 0.4,-1.0c0.3,-0.3 0.7,-0.4 1.1,-0.4s0.8,0.1 1.1,0.4c0.3,0.3 0.4,0.6 0.4,1.0c0.0,0.4 -0.1,0.7 -0.4,1.0 + C22.6,23.8 22.2,24 21.7,24z + M20.4,19.7l0.0,-8.5L23.0,11.2l0.0,8.5L20.4,19.7z + " + android:fillType="evenOdd" + android:fillColor="#231F20"/> +</vector> diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java index 9b3ee30a3ab0..1151c8cb4b50 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java @@ -35,8 +35,8 @@ import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.qs.DetailAdapter; import com.android.systemui.plugins.qs.QSIconView; import com.android.systemui.plugins.qs.QSTile.SignalState; -import com.android.systemui.qs.CellTileView; import com.android.systemui.qs.QSHost; +import com.android.systemui.qs.SignalTileView; import com.android.systemui.qs.tileimpl.QSTileImpl; import com.android.systemui.statusbar.policy.NetworkController; import com.android.systemui.statusbar.policy.NetworkController.IconState; @@ -83,7 +83,7 @@ public class CellularTile extends QSTileImpl<SignalState> { @Override public QSIconView createTileView(Context context) { - return new CellTileView(context); + return new SignalTileView(context); } @Override @@ -118,15 +118,6 @@ public class CellularTile extends QSTileImpl<SignalState> { } final Resources r = mContext.getResources(); - final int iconId = cb.noSim ? R.drawable.ic_qs_no_sim - : !cb.enabled || cb.airplaneModeEnabled ? R.drawable.ic_qs_signal_disabled - : cb.mobileSignalIconId > 0 ? cb.mobileSignalIconId - : R.drawable.ic_qs_signal_no_signal; - if (cb.dataTypeIconId != 0) { - state.icon = ResourceIcon.get(cb.dataTypeIconId); - } else { - state.icon = ResourceIcon.get(iconId); - } state.activityIn = cb.enabled && cb.activityIn; state.activityOut = cb.enabled && cb.activityOut; @@ -136,8 +127,16 @@ public class CellularTile extends QSTileImpl<SignalState> { state.expandedAccessibilityClassName = Switch.class.getName(); state.value = mDataController.isMobileDataSupported() && mDataController.isMobileDataEnabled(); - state.state = cb.airplaneModeEnabled ? Tile.STATE_UNAVAILABLE + state.icon = ResourceIcon.get(R.drawable.ic_data_unavailable); + state.state = cb.airplaneModeEnabled || !cb.enabled ? Tile.STATE_UNAVAILABLE : state.value ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE; + if (state.state == Tile.STATE_ACTIVE) { + state.icon = ResourceIcon.get(R.drawable.ic_data_on); + } else if (state.state == Tile.STATE_INACTIVE) { + state.icon = ResourceIcon.get(R.drawable.ic_data_off); + } else { + state.icon = ResourceIcon.get(R.drawable.ic_data_unavailable); + } } @Override |