Rename {zeroclick, share_tap} -> ndef_push in code.
Not sure what the product name will be, but ndef push seems to be a nice neutral name for the code. Text strings are left as "Share Tap" for now. Change-Id: I9dbf82eda2273220c23f443710a340c2c93e8291
This commit is contained in:
@@ -967,7 +967,7 @@
|
|||||||
|
|
||||||
<!-- NFC settings -->
|
<!-- NFC settings -->
|
||||||
<activity android:name="Settings$NfcSharingSettingsActivity"
|
<activity android:name="Settings$NfcSharingSettingsActivity"
|
||||||
android:label="@string/zeroclick_settings_title"
|
android:label="@string/ndef_push_settings_title"
|
||||||
android:clearTaskOnLaunch="true">
|
android:clearTaskOnLaunch="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
@@ -975,7 +975,7 @@
|
|||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
|
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
|
||||||
android:value="com.android.settings.nfc.ShareTap" />
|
android:value="com.android.settings.nfc.NdefPush" />
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<!-- Accessibility tutorial -->
|
<!-- Accessibility tutorial -->
|
||||||
|
@@ -30,23 +30,23 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView android:id="@+id/sharetap_explained"
|
<TextView android:id="@+id/ndef_push_explained"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dip"
|
android:layout_marginTop="20dip"
|
||||||
android:gravity="top"
|
android:gravity="top"
|
||||||
android:text="@string/zeroclick_explained"
|
android:text="@string/ndef_push_explained"
|
||||||
/>
|
/>
|
||||||
<ImageView android:id="@+id/sharetap_image"
|
<ImageView android:id="@+id/ndef_push_image"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
/>
|
/>
|
||||||
<TextView android:id="@+id/sharetap_safety"
|
<TextView android:id="@+id/ndef_push_safety"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dip"
|
android:layout_marginTop="20dip"
|
||||||
android:gravity="top"
|
android:gravity="top"
|
||||||
android:text="@string/zeroclick_top"
|
android:text="@string/ndef_push_top"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@@ -1098,15 +1098,15 @@
|
|||||||
<!-- NFC settings -->
|
<!-- NFC settings -->
|
||||||
<!-- Used in the 1st-level settings screen to turn on NFC -->
|
<!-- Used in the 1st-level settings screen to turn on NFC -->
|
||||||
<string name="nfc_quick_toggle_title">NFC</string>
|
<string name="nfc_quick_toggle_title">NFC</string>
|
||||||
<!-- Used to enter the ShareTap sharing preferences screen -->
|
<!-- Used to enter the NdefPush sharing preferences screen -->
|
||||||
<string name="zeroclick_settings_title">ShareTap</string>
|
<string name="ndef_push_settings_title">ShareTap</string>
|
||||||
<string name="zeroclick_settings_summary"></string>
|
<string name="ndef_push_settings_summary"></string>
|
||||||
<string name="zeroclick_on_summary">On</string>
|
<string name="ndef_push_on_summary">On</string>
|
||||||
<string name="zeroclick_off_summary">Off</string>
|
<string name="ndef_push_off_summary">Off</string>
|
||||||
<!-- Used in the zero-click sharing preferences screen -->
|
<!-- Used in the NdefPush sharing preferences screen -->
|
||||||
<string name="zeroclick_label">ShareTap</string>
|
<string name="ndef_push_label">ShareTap</string>
|
||||||
<string name="zeroclick_explained">Share content by touching two NFC-enabled devices back to back.</string>
|
<string name="ndef_push_explained">Share content by touching two NFC-enabled devices back to back.</string>
|
||||||
<string name="zeroclick_top">The app on the top device\'s screen sends content to the bottom device.\n\nYour data is safe: nothing is shared unless both devices are on and unlocked.\n\nYou can turn this feature off in Settings > More > ShareTap.</string>
|
<string name="ndef_push_top">The app on the top device\'s screen sends content to the bottom device.\n\nYour data is safe: nothing is shared unless both devices are on and unlocked.\n\nYou can turn this feature off in Settings > More > ShareTap.</string>
|
||||||
<!-- Wi-Fi Settings --> <skip />
|
<!-- Wi-Fi Settings --> <skip />
|
||||||
<!-- Used in the 1st-level settings screen to turn on Wi-Fi -->
|
<!-- Used in the 1st-level settings screen to turn on Wi-Fi -->
|
||||||
<string name="wifi_quick_toggle_title">Wi-Fi</string>
|
<string name="wifi_quick_toggle_title">Wi-Fi</string>
|
||||||
|
@@ -39,10 +39,10 @@
|
|||||||
android:persistent="false" />
|
android:persistent="false" />
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:fragment="com.android.settings.nfc.ShareTap"
|
android:fragment="com.android.settings.nfc.NdefPush"
|
||||||
android:key="zeroclick_settings"
|
android:key="ndef_push_settings"
|
||||||
android:title="@string/zeroclick_settings_title"
|
android:title="@string/ndef_push_settings_title"
|
||||||
android:summary="@string/zeroclick_settings_summary" >
|
android:summary="@string/ndef_push_settings_summary" >
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
|
@@ -41,7 +41,7 @@ public class WirelessSettings extends SettingsPreferenceFragment {
|
|||||||
|
|
||||||
private static final String KEY_TOGGLE_AIRPLANE = "toggle_airplane";
|
private static final String KEY_TOGGLE_AIRPLANE = "toggle_airplane";
|
||||||
private static final String KEY_TOGGLE_NFC = "toggle_nfc";
|
private static final String KEY_TOGGLE_NFC = "toggle_nfc";
|
||||||
private static final String KEY_ZEROCLICK_SETTINGS = "zeroclick_settings";
|
private static final String KEY_NDEF_PUSH_SETTINGS = "ndef_push_settings";
|
||||||
private static final String KEY_VPN_SETTINGS = "vpn_settings";
|
private static final String KEY_VPN_SETTINGS = "vpn_settings";
|
||||||
private static final String KEY_WIFI_P2P_SETTINGS = "wifi_p2p_settings";
|
private static final String KEY_WIFI_P2P_SETTINGS = "wifi_p2p_settings";
|
||||||
private static final String KEY_TETHER_SETTINGS = "tether_settings";
|
private static final String KEY_TETHER_SETTINGS = "tether_settings";
|
||||||
@@ -96,10 +96,10 @@ public class WirelessSettings extends SettingsPreferenceFragment {
|
|||||||
final Activity activity = getActivity();
|
final Activity activity = getActivity();
|
||||||
mAirplaneModePreference = (CheckBoxPreference) findPreference(KEY_TOGGLE_AIRPLANE);
|
mAirplaneModePreference = (CheckBoxPreference) findPreference(KEY_TOGGLE_AIRPLANE);
|
||||||
CheckBoxPreference nfc = (CheckBoxPreference) findPreference(KEY_TOGGLE_NFC);
|
CheckBoxPreference nfc = (CheckBoxPreference) findPreference(KEY_TOGGLE_NFC);
|
||||||
PreferenceScreen zeroclick = (PreferenceScreen) findPreference(KEY_ZEROCLICK_SETTINGS);
|
PreferenceScreen ndefPush = (PreferenceScreen) findPreference(KEY_NDEF_PUSH_SETTINGS);
|
||||||
|
|
||||||
mAirplaneModeEnabler = new AirplaneModeEnabler(activity, mAirplaneModePreference);
|
mAirplaneModeEnabler = new AirplaneModeEnabler(activity, mAirplaneModePreference);
|
||||||
mNfcEnabler = new NfcEnabler(activity, nfc, zeroclick);
|
mNfcEnabler = new NfcEnabler(activity, nfc, ndefPush);
|
||||||
|
|
||||||
String toggleable = Settings.System.getString(activity.getContentResolver(),
|
String toggleable = Settings.System.getString(activity.getContentResolver(),
|
||||||
Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
|
Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
|
||||||
@@ -117,14 +117,14 @@ public class WirelessSettings extends SettingsPreferenceFragment {
|
|||||||
// Manually set dependencies for NFC when not toggleable.
|
// Manually set dependencies for NFC when not toggleable.
|
||||||
if (toggleable == null || !toggleable.contains(Settings.System.RADIO_NFC)) {
|
if (toggleable == null || !toggleable.contains(Settings.System.RADIO_NFC)) {
|
||||||
findPreference(KEY_TOGGLE_NFC).setDependency(KEY_TOGGLE_AIRPLANE);
|
findPreference(KEY_TOGGLE_NFC).setDependency(KEY_TOGGLE_AIRPLANE);
|
||||||
findPreference(KEY_ZEROCLICK_SETTINGS).setDependency(KEY_TOGGLE_AIRPLANE);
|
findPreference(KEY_NDEF_PUSH_SETTINGS).setDependency(KEY_TOGGLE_AIRPLANE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove NFC if its not available
|
// Remove NFC if its not available
|
||||||
mNfcAdapter = NfcAdapter.getDefaultAdapter(activity);
|
mNfcAdapter = NfcAdapter.getDefaultAdapter(activity);
|
||||||
if (mNfcAdapter == null) {
|
if (mNfcAdapter == null) {
|
||||||
getPreferenceScreen().removePreference(nfc);
|
getPreferenceScreen().removePreference(nfc);
|
||||||
getPreferenceScreen().removePreference(zeroclick);
|
getPreferenceScreen().removePreference(ndefPush);
|
||||||
mNfcEnabler = null;
|
mNfcEnabler = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,7 +33,7 @@ import android.widget.ImageView;
|
|||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
|
||||||
public class ShareTap extends Fragment
|
public class NdefPush extends Fragment
|
||||||
implements CompoundButton.OnCheckedChangeListener {
|
implements CompoundButton.OnCheckedChangeListener {
|
||||||
private View mView;
|
private View mView;
|
||||||
private AnimationDrawable mAnimation;
|
private AnimationDrawable mAnimation;
|
||||||
@@ -61,35 +61,35 @@ public class ShareTap extends Fragment
|
|||||||
ActionBar.LayoutParams.WRAP_CONTENT,
|
ActionBar.LayoutParams.WRAP_CONTENT,
|
||||||
ActionBar.LayoutParams.WRAP_CONTENT,
|
ActionBar.LayoutParams.WRAP_CONTENT,
|
||||||
Gravity.CENTER_VERTICAL | Gravity.RIGHT));
|
Gravity.CENTER_VERTICAL | Gravity.RIGHT));
|
||||||
activity.getActionBar().setTitle(R.string.zeroclick_settings_title);
|
activity.getActionBar().setTitle(R.string.ndef_push_settings_title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mActionBarSwitch.setOnCheckedChangeListener(this);
|
mActionBarSwitch.setOnCheckedChangeListener(this);
|
||||||
|
|
||||||
mNfcAdapter = NfcAdapter.getDefaultAdapter(getActivity());
|
mNfcAdapter = NfcAdapter.getDefaultAdapter(getActivity());
|
||||||
mActionBarSwitch.setChecked(mNfcAdapter.isZeroClickEnabled());
|
mActionBarSwitch.setChecked(mNfcAdapter.isNdefPushEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
mView = inflater.inflate(R.layout.sharetap, container, false);
|
mView = inflater.inflate(R.layout.ndefpush, container, false);
|
||||||
initView(mView);
|
initView(mView);
|
||||||
return mView;
|
return mView;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initView(View view) {
|
private void initView(View view) {
|
||||||
mActionBarSwitch.setOnCheckedChangeListener(this);
|
mActionBarSwitch.setOnCheckedChangeListener(this);
|
||||||
mActionBarSwitch.setChecked(mNfcAdapter.isZeroClickEnabled());
|
mActionBarSwitch.setChecked(mNfcAdapter.isNdefPushEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
|
|
||||||
mImageView = (ImageView) getActivity().findViewById(R.id.sharetap_image);
|
mImageView = (ImageView) getActivity().findViewById(R.id.ndef_push_image);
|
||||||
mImageView.setBackgroundResource(R.drawable.sharetap_anim);
|
mImageView.setBackgroundResource(R.drawable.ndef_push_anim);
|
||||||
mAnimation = (AnimationDrawable) mImageView.getBackground();
|
mAnimation = (AnimationDrawable) mImageView.getBackground();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -117,9 +117,9 @@ public class ShareTap extends Fragment
|
|||||||
boolean success = false;
|
boolean success = false;
|
||||||
mActionBarSwitch.setEnabled(false);
|
mActionBarSwitch.setEnabled(false);
|
||||||
if (desiredState) {
|
if (desiredState) {
|
||||||
success = mNfcAdapter.enableZeroClick();
|
success = mNfcAdapter.enableNdefPush();
|
||||||
} else {
|
} else {
|
||||||
success = mNfcAdapter.disableZeroClick();
|
success = mNfcAdapter.disableNdefPush();
|
||||||
}
|
}
|
||||||
if (success) {
|
if (success) {
|
||||||
mActionBarSwitch.setChecked(desiredState);
|
mActionBarSwitch.setChecked(desiredState);
|
@@ -39,7 +39,7 @@ public class NfcEnabler implements Preference.OnPreferenceChangeListener {
|
|||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final CheckBoxPreference mCheckbox;
|
private final CheckBoxPreference mCheckbox;
|
||||||
private final PreferenceScreen mZeroClick;
|
private final PreferenceScreen mNdefPush;
|
||||||
private final NfcAdapter mNfcAdapter;
|
private final NfcAdapter mNfcAdapter;
|
||||||
private final IntentFilter mIntentFilter;
|
private final IntentFilter mIntentFilter;
|
||||||
private final Handler mHandler = new Handler();
|
private final Handler mHandler = new Handler();
|
||||||
@@ -56,16 +56,16 @@ public class NfcEnabler implements Preference.OnPreferenceChangeListener {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public NfcEnabler(Context context, CheckBoxPreference checkBoxPreference,
|
public NfcEnabler(Context context, CheckBoxPreference checkBoxPreference,
|
||||||
PreferenceScreen zeroclick) {
|
PreferenceScreen ndefPush) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mCheckbox = checkBoxPreference;
|
mCheckbox = checkBoxPreference;
|
||||||
mZeroClick = zeroclick;
|
mNdefPush = ndefPush;
|
||||||
mNfcAdapter = NfcAdapter.getDefaultAdapter(context);
|
mNfcAdapter = NfcAdapter.getDefaultAdapter(context);
|
||||||
|
|
||||||
if (mNfcAdapter == null) {
|
if (mNfcAdapter == null) {
|
||||||
// NFC is not supported
|
// NFC is not supported
|
||||||
mCheckbox.setEnabled(false);
|
mCheckbox.setEnabled(false);
|
||||||
mZeroClick.setEnabled(false);
|
mNdefPush.setEnabled(false);
|
||||||
mIntentFilter = null;
|
mIntentFilter = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -109,28 +109,28 @@ public class NfcEnabler implements Preference.OnPreferenceChangeListener {
|
|||||||
case NfcAdapter.STATE_OFF:
|
case NfcAdapter.STATE_OFF:
|
||||||
mCheckbox.setChecked(false);
|
mCheckbox.setChecked(false);
|
||||||
mCheckbox.setEnabled(true);
|
mCheckbox.setEnabled(true);
|
||||||
mZeroClick.setEnabled(false);
|
mNdefPush.setEnabled(false);
|
||||||
mZeroClick.setSummary(R.string.zeroclick_off_summary);
|
mNdefPush.setSummary(R.string.ndef_push_settings_summary);
|
||||||
break;
|
break;
|
||||||
case NfcAdapter.STATE_ON:
|
case NfcAdapter.STATE_ON:
|
||||||
mCheckbox.setChecked(true);
|
mCheckbox.setChecked(true);
|
||||||
mCheckbox.setEnabled(true);
|
mCheckbox.setEnabled(true);
|
||||||
mZeroClick.setEnabled(true);
|
mNdefPush.setEnabled(true);
|
||||||
if (mNfcAdapter.isZeroClickEnabled()) {
|
if (mNfcAdapter.isNdefPushEnabled()) {
|
||||||
mZeroClick.setSummary(R.string.zeroclick_on_summary);
|
mNdefPush.setSummary(R.string.ndef_push_on_summary);
|
||||||
} else {
|
} else {
|
||||||
mZeroClick.setSummary(R.string.zeroclick_off_summary);
|
mNdefPush.setSummary(R.string.ndef_push_off_summary);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NfcAdapter.STATE_TURNING_ON:
|
case NfcAdapter.STATE_TURNING_ON:
|
||||||
mCheckbox.setChecked(true);
|
mCheckbox.setChecked(true);
|
||||||
mCheckbox.setEnabled(false);
|
mCheckbox.setEnabled(false);
|
||||||
mZeroClick.setEnabled(false);
|
mNdefPush.setEnabled(false);
|
||||||
break;
|
break;
|
||||||
case NfcAdapter.STATE_TURNING_OFF:
|
case NfcAdapter.STATE_TURNING_OFF:
|
||||||
mCheckbox.setChecked(false);
|
mCheckbox.setChecked(false);
|
||||||
mCheckbox.setEnabled(false);
|
mCheckbox.setEnabled(false);
|
||||||
mZeroClick.setEnabled(false);
|
mNdefPush.setEnabled(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user