Loading packages/SystemUI/src/com/android/systemui/qs/tiles/NfcTile.java +10 −6 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -77,6 +78,9 @@ public class NfcTile extends QSTileImpl<BooleanState> { @Override protected void handleClick() { if (getAdapter() == null) { return; } if (!getAdapter().isEnabled()) { getAdapter().enable(); } else { Loading @@ -96,13 +100,13 @@ 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.value = getAdapter() != null && getAdapter().isEnabled(); 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.label = mContext.getString(R.string.quick_settings_nfc_label); state.icon = new DrawableIcon(state.value ? mEnable : mDisable); state.expandedAccessibilityClassName = Switch.class.getName(); state.contentDescription = state.label; } Loading Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/NfcTile.java +10 −6 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -77,6 +78,9 @@ public class NfcTile extends QSTileImpl<BooleanState> { @Override protected void handleClick() { if (getAdapter() == null) { return; } if (!getAdapter().isEnabled()) { getAdapter().enable(); } else { Loading @@ -96,13 +100,13 @@ 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.value = getAdapter() != null && getAdapter().isEnabled(); 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.label = mContext.getString(R.string.quick_settings_nfc_label); state.icon = new DrawableIcon(state.value ? mEnable : mDisable); state.expandedAccessibilityClassName = Switch.class.getName(); state.contentDescription = state.label; } Loading