Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a925293 authored by Tim Schumacher's avatar Tim Schumacher Committed by Luca Stefani
Browse files

SystemUI: Enable NFC tile

Author: Thecrazyskull <anaskarbila@gmail.com>
Date:   Tue Jan 17 10:56:39 2017 -0600

    SystemUI: Enable NFC tile

    Change-Id: Ib21f927d336fcb5e460552786828b79551b235fa

Author: Luca Stefani <luca.stefani.ge1@gmail.com>
Date:   Tue Sep 4 10:07:17 2018 +0200

    SystemUI: Update NFCTile to match P style

    Change-Id: I8309eda6b2dbb28156dd463e667ff60545b37b7d

Change-Id: Ia06b923ee15e91a9c84a806d4c69755478df2063
parent 0a6937f4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@
     limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:width="48dp"
    android:height="48dp"
    android:viewportWidth="24"
    android:viewportHeight="24">

+0 −31
Original line number Diff line number Diff line
<!--
     Copyright (C) 2016 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="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">

    <path
        android:pathData="M4 20h16V4H4v16z" />
    <path
        android:fillColor="#4DFFFFFF"
        android:pathData="M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1 .9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0
18H4V4h16v16zM18 6h-5c-1.1 0-2 .9-2 2v2.28c-.6 .35 -1 .98-1 1.72 0 1.1 .9 2 2
2s2-.9 2-2c0-.74-.4-1.38-1-1.72V8h3v8H8V8h2V6H6v12h12V6z" />
    <path
        android:pathData="M0 0h24v24H0z" />
</vector>
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@

    <!-- Tiles native to System UI. Order should match "quick_settings_tiles_default" -->
    <string name="quick_settings_tiles_stock" translatable="false">
        wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,location,hotspot,inversion,saver,dark,work,cast,night
        wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,nfc,location,hotspot,inversion,saver,dark,work,cast,night
    </string>

    <!-- The tiles to display in QuickSettings -->
+3 −2
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ import javax.inject.Inject;
/** Quick settings tile: Enable/Disable NFC **/
public class NfcTile extends QSTileImpl<BooleanState> {

    private final Icon mIcon = ResourceIcon.get(R.drawable.ic_qs_nfc);

    private NfcAdapter mAdapter;

    private boolean mListening;
@@ -105,8 +107,7 @@ public class NfcTile extends QSTileImpl<BooleanState> {
        state.state = getAdapter() == null
                ? Tile.STATE_UNAVAILABLE
                : state.value ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
        state.icon = ResourceIcon.get(
                state.value ? R.drawable.ic_qs_nfc_enabled : R.drawable.ic_qs_nfc_disabled);
        state.icon = mIcon;
        state.label = mContext.getString(R.string.quick_settings_nfc_label);
        state.expandedAccessibilityClassName = Switch.class.getName();
        state.contentDescription = state.label;