Depend on support lib preferences

Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
This commit is contained in:
Jason Monk
2015-09-10 15:52:51 -04:00
parent 136ed7b6b2
commit 39b467482d
308 changed files with 2684 additions and 1762 deletions

View File

@@ -22,9 +22,9 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.nfc.NfcAdapter;
import android.os.UserManager;
import android.preference.Preference;
import android.preference.PreferenceScreen;
import android.preference.SwitchPreference;
import android.support.v14.preference.SwitchPreference;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceScreen;
import com.android.settings.R;

View File

@@ -20,7 +20,7 @@ import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.preference.DialogPreference;
import android.support.v7.preference.PreferenceViewHolder;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -29,13 +29,15 @@ import android.widget.BaseAdapter;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.RadioButton;
import com.android.settings.CustomDialogPreference;
import com.android.settings.R;
import com.android.settings.nfc.PaymentBackend.PaymentAppInfo;
import java.util.List;
public class NfcPaymentPreference extends DialogPreference implements
DialogInterface.OnClickListener, PaymentBackend.Callback, View.OnClickListener {
public class NfcPaymentPreference extends CustomDialogPreference implements
PaymentBackend.Callback, View.OnClickListener {
private static final String TAG = "NfcPaymentPreference";
@@ -61,8 +63,8 @@ public class NfcPaymentPreference extends DialogPreference implements
}
@Override
protected void onBindView(View view) {
super.onBindView(view);
public void onBindViewHolder(PreferenceViewHolder view) {
super.onBindViewHolder(view);
mSettingsButtonView = (ImageView) view.findViewById(R.id.settings_button);
mSettingsButtonView.setOnClickListener(this);
@@ -90,10 +92,11 @@ public class NfcPaymentPreference extends DialogPreference implements
}
@Override
protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
super.onPrepareDialogBuilder(builder);
protected void onPrepareDialogBuilder(AlertDialog.Builder builder,
DialogInterface.OnClickListener listener) {
super.onPrepareDialogBuilder(builder, listener);
builder.setSingleChoiceItems(mAdapter, 0, this);
builder.setSingleChoiceItems(mAdapter, 0, listener);
}
@Override

View File

@@ -16,7 +16,6 @@
package com.android.settings.nfc;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -25,13 +24,11 @@ import android.graphics.drawable.Drawable;
import android.nfc.NfcAdapter;
import android.nfc.cardemulation.ApduServiceInfo;
import android.nfc.cardemulation.CardEmulation;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.UserHandle;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.util.Log;
import com.android.internal.content.PackageMonitor;
import java.util.ArrayList;

View File

@@ -18,13 +18,14 @@ package com.android.settings.nfc;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import android.support.v7.preference.PreferenceManager;
import android.support.v7.preference.PreferenceScreen;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import com.android.internal.logging.MetricsLogger;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
@@ -56,7 +57,7 @@ public class PaymentSettings extends SettingsPreferenceFragment {
View emptyView = getActivity().getLayoutInflater().inflate(
R.layout.nfc_payment_empty, contentRoot, false);
contentRoot.addView(emptyView);
getListView().setEmptyView(emptyView);
setEmptyView(emptyView);
PreferenceManager manager = getPreferenceManager();
PreferenceScreen screen = manager.createPreferenceScreen(getActivity());
@@ -64,9 +65,10 @@ public class PaymentSettings extends SettingsPreferenceFragment {
List<PaymentAppInfo> appInfos = mPaymentBackend.getPaymentAppInfos();
if (appInfos != null && appInfos.size() > 0) {
NfcPaymentPreference preference =
new NfcPaymentPreference(getActivity(), mPaymentBackend);
new NfcPaymentPreference(getPrefContext(), mPaymentBackend);
preference.setKey("payment");
screen.addPreference(preference);
NfcForegroundPreference foreground = new NfcForegroundPreference(getActivity(),
NfcForegroundPreference foreground = new NfcForegroundPreference(getPrefContext(),
mPaymentBackend);
screen.addPreference(foreground);
}