diff options
-rw-r--r-- | res/drawable-hdpi/tap1.png | bin | 0 -> 23793 bytes | |||
-rw-r--r-- | res/drawable-hdpi/tap2.png | bin | 0 -> 24183 bytes | |||
-rw-r--r-- | res/drawable-hdpi/tap3.png | bin | 0 -> 23148 bytes | |||
-rw-r--r-- | res/drawable-hdpi/tap4.png | bin | 0 -> 18867 bytes | |||
-rw-r--r-- | res/drawable-hdpi/tap5.png | bin | 0 -> 16269 bytes | |||
-rw-r--r-- | res/drawable-hdpi/tap6.png | bin | 0 -> 15119 bytes | |||
-rw-r--r-- | res/drawable/sharetap_anim.xml | 28 | ||||
-rw-r--r-- | res/layout/sharetap.xml (renamed from res/layout/zeroclick.xml) | 22 | ||||
-rw-r--r-- | res/values/strings.xml | 11 | ||||
-rw-r--r-- | res/xml/wireless_settings.xml | 2 | ||||
-rw-r--r-- | src/com/android/settings/nfc/ShareTap.java (renamed from src/com/android/settings/nfc/ZeroClick.java) | 28 |
11 files changed, 79 insertions, 12 deletions
diff --git a/res/drawable-hdpi/tap1.png b/res/drawable-hdpi/tap1.png Binary files differnew file mode 100644 index 0000000..2395c0f --- /dev/null +++ b/res/drawable-hdpi/tap1.png diff --git a/res/drawable-hdpi/tap2.png b/res/drawable-hdpi/tap2.png Binary files differnew file mode 100644 index 0000000..afaa243 --- /dev/null +++ b/res/drawable-hdpi/tap2.png diff --git a/res/drawable-hdpi/tap3.png b/res/drawable-hdpi/tap3.png Binary files differnew file mode 100644 index 0000000..a6b530e --- /dev/null +++ b/res/drawable-hdpi/tap3.png diff --git a/res/drawable-hdpi/tap4.png b/res/drawable-hdpi/tap4.png Binary files differnew file mode 100644 index 0000000..b07d8a6 --- /dev/null +++ b/res/drawable-hdpi/tap4.png diff --git a/res/drawable-hdpi/tap5.png b/res/drawable-hdpi/tap5.png Binary files differnew file mode 100644 index 0000000..f1c8825 --- /dev/null +++ b/res/drawable-hdpi/tap5.png diff --git a/res/drawable-hdpi/tap6.png b/res/drawable-hdpi/tap6.png Binary files differnew file mode 100644 index 0000000..cc22a0b --- /dev/null +++ b/res/drawable-hdpi/tap6.png diff --git a/res/drawable/sharetap_anim.xml b/res/drawable/sharetap_anim.xml new file mode 100644 index 0000000..6aa7d4f --- /dev/null +++ b/res/drawable/sharetap_anim.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2011, 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. +*/ +--> +<animation-list + xmlns:android="http://schemas.android.com/apk/res/android" + android:oneshot="false"> + <item android:drawable="@drawable/tap1" android:duration="200" /> + <item android:drawable="@drawable/tap2" android:duration="200" /> + <item android:drawable="@drawable/tap3" android:duration="200" /> + <item android:drawable="@drawable/tap4" android:duration="200" /> + <item android:drawable="@drawable/tap5" android:duration="200" /> + <item android:drawable="@drawable/tap6" android:duration="600" /> +</animation-list> diff --git a/res/layout/zeroclick.xml b/res/layout/sharetap.xml index d039e89..fb31d83 100644 --- a/res/layout/zeroclick.xml +++ b/res/layout/sharetap.xml @@ -30,15 +30,31 @@ android:layout_height="wrap_content" android:orientation="vertical"> - <TextView android:id="@+id/zeroclick_explained" + <TextView android:id="@+id/sharetap_explained" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="20dip" android:gravity="top" android:text="@string/zeroclick_explained" /> - - + <ImageView android:id="@+id/sharetap_image" + android:layout_width="match_parent" + android:layout_height="wrap_content" + /> + <TextView android:id="@+id/sharetap_safety" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="20dip" + android:gravity="top" + android:text="@string/zeroclick_top" + /> + <TextView android:id="@+id/sharetap_safety" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="20dip" + android:gravity="top" + android:text="@string/zeroclick_safety" + /> </LinearLayout> </ScrollView> diff --git a/res/values/strings.xml b/res/values/strings.xml index b777fd7..821ebd4 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1098,15 +1098,16 @@ <!-- NFC settings --> <!-- Used in the 1st-level settings screen to turn on NFC --> <string name="nfc_quick_toggle_title">NFC</string> - <!-- Used to enter the Zero-click sharing preferences screen --> - <string name="zeroclick_settings_title">Tap to share</string> + <!-- Used to enter the ShareTap sharing preferences screen --> + <string name="zeroclick_settings_title">ShareTap</string> <string name="zeroclick_settings_summary"></string> <string name="zeroclick_on_summary">On</string> <string name="zeroclick_off_summary">Off</string> <!-- Used in the zero-click sharing preferences screen --> - <string name="zeroclick_label">Zero-click sharing</string> - <string name="zeroclick_explained">Tap to share allows you to share content from applications, just by tapping your NFC-enabled device to another.</string> - + <string name="zeroclick_label">ShareTap</string> + <string name="zeroclick_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.</string> + <string name="zeroclick_safety">Your data is safe: nothing is shared unless both devices are on and unlocked.</string> <!-- Wi-Fi Settings --> <skip /> <!-- Used in the 1st-level settings screen to turn on Wi-Fi --> <string name="wifi_quick_toggle_title">Wi-Fi</string> diff --git a/res/xml/wireless_settings.xml b/res/xml/wireless_settings.xml index 1e85b9a..d908fd7 100644 --- a/res/xml/wireless_settings.xml +++ b/res/xml/wireless_settings.xml @@ -39,7 +39,7 @@ android:persistent="false" /> <PreferenceScreen - android:fragment="com.android.settings.nfc.ZeroClick" + android:fragment="com.android.settings.nfc.ShareTap" android:key="zeroclick_settings" android:title="@string/zeroclick_settings_title" android:summary="@string/zeroclick_settings_summary" > diff --git a/src/com/android/settings/nfc/ZeroClick.java b/src/com/android/settings/nfc/ShareTap.java index 1b59b52..e434781 100644 --- a/src/com/android/settings/nfc/ZeroClick.java +++ b/src/com/android/settings/nfc/ShareTap.java @@ -19,20 +19,25 @@ package com.android.settings.nfc; import android.app.ActionBar; import android.app.Activity; import android.app.Fragment; +import android.graphics.drawable.AnimationDrawable; import android.nfc.NfcAdapter; import android.os.Bundle; +import android.os.Handler; import android.preference.PreferenceActivity; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.CompoundButton; +import android.widget.ImageView; import android.widget.Switch; import com.android.settings.R; -public class ZeroClick extends Fragment +public class ShareTap extends Fragment implements CompoundButton.OnCheckedChangeListener { private View mView; + private AnimationDrawable mAnimation; + private ImageView mImageView; private NfcAdapter mNfcAdapter; private Switch mActionBarSwitch; @@ -69,25 +74,42 @@ public class ZeroClick extends Fragment @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - mView = inflater.inflate(R.layout.zeroclick, container, false); + mView = inflater.inflate(R.layout.sharetap, container, false); initView(mView); return mView; } private void initView(View view) { - mNfcAdapter = NfcAdapter.getDefaultAdapter(getActivity()); mActionBarSwitch.setOnCheckedChangeListener(this); mActionBarSwitch.setChecked(mNfcAdapter.isZeroClickEnabled()); } @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + + mImageView = (ImageView) getActivity().findViewById(R.id.sharetap_image); + mImageView.setBackgroundResource(R.drawable.sharetap_anim); + mAnimation = (AnimationDrawable) mImageView.getBackground(); + + } + + @Override public void onPause() { super.onPause(); + mAnimation.stop(); } @Override public void onResume() { super.onResume(); + // This is nasty: the animation can only be started once the fragment + // is attached to the window, and there are no callbacks for that. + mImageView.post(new Runnable() { + public void run() { + mAnimation.start(); + } + }); } @Override |