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

Commit 88f00b6a authored by Roman Birg's avatar Roman Birg
Browse files

SystemUI: add NFC tile



Change-Id: I884b3492b1d81c39235df1660e4e0e06653abce2
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent 8c00a8dd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ public class QSConstants {
    public static final String TILE_PROFILES = "profiles";
    public static final String TILE_PERFORMANCE = "performance";
    public static final String TILE_ADB_NETWORK = "adb_network";
    public static final String TILE_NFC = "nfc";

    // Order matters
    protected static final ArrayList<String> TILES_DEFAULT = new ArrayList<String>();
@@ -68,5 +69,6 @@ public class QSConstants {
        TILES_AVAILABLE.add(TILE_PROFILES);
        TILES_AVAILABLE.add(TILE_PERFORMANCE);
        TILES_AVAILABLE.add(TILE_ADB_NETWORK);
        TILES_AVAILABLE.add(TILE_NFC);
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraManager;
import android.net.ConnectivityManager;
import android.nfc.NfcAdapter;
import android.telephony.TelephonyManager;
import android.text.TextUtils;

@@ -74,6 +75,9 @@ public class QSUtils {
                    case QSConstants.TILE_BLUETOOTH:
                        removeTile = !deviceSupportsBluetooth();
                        break;
                    case QSConstants.TILE_NFC:
                        removeTile = !deviceSupportsNfc(context);
                        break;
                }
                if (removeTile) {
                    iterator.remove();
@@ -102,6 +106,10 @@ public class QSUtils {
        return BluetoothAdapter.getDefaultAdapter() != null;
    }

    public static boolean deviceSupportsNfc(Context context) {
        return NfcAdapter.getDefaultAdapter(context) != null;
    }

    public static boolean deviceSupportsFlashLight(Context context) {
        CameraManager cameraManager = (CameraManager) context.getSystemService(
                Context.CAMERA_SERVICE);
+15 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="64dp"
    android:height="64dp"
    android:viewportWidth="48"
    android:viewportHeight="48">

    <path
        android:fillColor="#4DFFFFFF"
        android:pathData="M16.4,8l-4-4H40c2.2,0,4,1.8,4,4v27.6l-4-4V8H16.4Z
M26,12c-1.5,0-2.8,0.9-3.5,2.1l3.5,3.5 V16h6v7.6l4,4V12H26z
M43.8,41.1c-0.5,1.7-2,2.9-3.8,2.9H8c-2.2,0-4-1.8-4-4V8c0-1.8,1.3-3.4,2.9-3.8L32,29.2l4,4L43.8,41.1z
M25,27.9c-0.3,0.1-0.7,0.1-1,0.1c-2.2,0-4-1.8-4-4c0-0.4,0-0.7,0.1-1L16,18.8V32h13.2L25,27.9z
M37.2,40l-4-4H12V14.8l-4-4V40H37.2 z" />
</vector>
 No newline at end of file
+14 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="64dp"
    android:height="64dp"
    android:viewportWidth="48"
    android:viewportHeight="48">

    <path
        android:fillColor="#FFFFFF"
        android:pathData="M40,4H8C5.8,4,4,5.8,4,8v32c0,2.2,1.8,4,4,4h32c2.2,0,4-1.8,4-4V8C44,5.8,42.2,4,40,4Z
M40,40H8V8h32V40z
M36,12H26c-2.2,0-4,1.8-4,4v4.6c-1.2,0.7-2,2-2,3.4c0,2.2,1.8,4,4,4s4-1.8,4-4c0-1.5-0.8-2.8-2-3.4V16h6v16H16
V16h4v-4h-8v24h24V12z" />
</vector>
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -85,6 +85,8 @@
    <!-- [CHAR LIMIT=130] Location detail panel, description for sensors only mode -->
    <string name="quick_settings_location_detail_mode_sensors_only_description">Use GPS to determine your location</string>

    <string name="quick_settings_nfc">NFC</string>
    <string name="quick_settings_nfc_off">NFC off</string>
    <string name="quick_settings_profile_detail_menu_title">Select Profile:</string>
    <string name="quick_settings_profiles_title">System profiles</string>
    <string name="quick_settings_profiles_disabled">Profiles disabled</string>
Loading