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

Commit 6765a63b authored by Luca Stefani's avatar Luca Stefani Committed by Bruno Martins
Browse files

SystemUI: Update NFCTile to match P style

Change-Id: I8309eda6b2dbb28156dd463e667ff60545b37b7d
parent 1697d549
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>
+7 −5
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.nfc.NfcAdapter;
import android.provider.Settings;
import android.service.quicksettings.Tile;
import android.widget.Switch;

import com.android.internal.logging.MetricsLogger;
@@ -37,6 +38,8 @@ import com.android.systemui.qs.tileimpl.QSTileImpl;
/** 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;
@@ -96,15 +99,14 @@ public class NfcTile extends QSTileImpl<BooleanState> {

    @Override
    protected void handleUpdateState(BooleanState state, Object arg) {
        final Drawable mEnable = mContext.getDrawable(R.drawable.ic_qs_nfc_enabled);
        final Drawable mDisable = mContext.getDrawable(R.drawable.ic_qs_nfc_disabled);

        if (getAdapter() == null) return;

        state.value = getAdapter().isEnabled();
        state.label = mContext.getString(R.string.quick_settings_nfc_label);
        state.icon = new DrawableIcon(state.value ? mEnable : mDisable);
        state.expandedAccessibilityClassName = Switch.class.getName();
        state.icon = mIcon;
        state.contentDescription = state.label;
        state.expandedAccessibilityClassName = Switch.class.getName();
        state.state = state.value ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
    }

    @Override