summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2015-06-05 21:28:17 +0200
committerMartijn Coenen <maco@google.com>2015-06-05 21:35:55 +0200
commitcbcc76e8d32f95690d08258a91d58136cd9fb056 (patch)
tree83942e483e23f1e7fec4810a5f6d2fa099f5b002
parentfb32790adc9ed647ad4e77c9613a860f9b76e855 (diff)
downloadpackages_apps_Settings-cbcc76e8d32f95690d08258a91d58136cd9fb056.tar.gz
packages_apps_Settings-cbcc76e8d32f95690d08258a91d58136cd9fb056.tar.bz2
packages_apps_Settings-cbcc76e8d32f95690d08258a91d58136cd9fb056.zip
Add NFC payment "how it works" screens.
Bug: 21239081 Bug: 21305138 Bug: 21305420 Change-Id: Ic9ea1b7e9b842299f2fb6b26f61a927855981e67
-rw-r--r--AndroidManifest.xml6
-rw-r--r--res/drawable-mdpi/nfc_how_it_works.pngbin0 -> 16293 bytes
-rw-r--r--res/drawable-xhdpi/nfc_how_it_works.pngbin0 -> 38565 bytes
-rw-r--r--res/drawable-xxhdpi/nfc_how_it_works.pngbin0 -> 63923 bytes
-rw-r--r--res/drawable-xxxhdpi/nfc_how_it_works.pngbin0 -> 93244 bytes
-rw-r--r--res/layout/nfc_payment_empty.xml1
-rw-r--r--res/layout/nfc_payment_how_it_works.xml74
-rw-r--r--res/values/strings.xml6
-rw-r--r--src/com/android/settings/nfc/HowItWorks.java30
-rw-r--r--src/com/android/settings/nfc/PaymentSettings.java6
10 files changed, 121 insertions, 2 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 674dfc99a..c686acc1b 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2227,6 +2227,12 @@
android:value="true" />
</activity>
+ <activity android:name=".nfc.HowItWorks"
+ android:label="@string/nfc_payment_settings_title"
+ android:parentActivityName="Settings$PaymentSettingsActivity">
+ android:excludeFromRecents="true">
+ </activity>
+
<activity android:name=".SmsDefaultDialog"
android:label="@string/sms_application_title"
android:excludeFromRecents="true"
diff --git a/res/drawable-mdpi/nfc_how_it_works.png b/res/drawable-mdpi/nfc_how_it_works.png
new file mode 100644
index 000000000..ef3cd8cf9
--- /dev/null
+++ b/res/drawable-mdpi/nfc_how_it_works.png
Binary files differ
diff --git a/res/drawable-xhdpi/nfc_how_it_works.png b/res/drawable-xhdpi/nfc_how_it_works.png
new file mode 100644
index 000000000..874d32f18
--- /dev/null
+++ b/res/drawable-xhdpi/nfc_how_it_works.png
Binary files differ
diff --git a/res/drawable-xxhdpi/nfc_how_it_works.png b/res/drawable-xxhdpi/nfc_how_it_works.png
new file mode 100644
index 000000000..748ad6a0b
--- /dev/null
+++ b/res/drawable-xxhdpi/nfc_how_it_works.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/nfc_how_it_works.png b/res/drawable-xxxhdpi/nfc_how_it_works.png
new file mode 100644
index 000000000..d970daed5
--- /dev/null
+++ b/res/drawable-xxxhdpi/nfc_how_it_works.png
Binary files differ
diff --git a/res/layout/nfc_payment_empty.xml b/res/layout/nfc_payment_empty.xml
index 42e2fa90a..e89d865c5 100644
--- a/res/layout/nfc_payment_empty.xml
+++ b/res/layout/nfc_payment_empty.xml
@@ -30,6 +30,7 @@
android:id="@+id/nfc_payment_empty_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="?android:attr/textColorSecondary"
android:paddingTop="32dp"
diff --git a/res/layout/nfc_payment_how_it_works.xml b/res/layout/nfc_payment_how_it_works.xml
new file mode 100644
index 000000000..ac48e4e72
--- /dev/null
+++ b/res/layout/nfc_payment_how_it_works.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/trusted_devices_prompt_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="#FF80CBC4" >
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="200dp"
+ android:background="#FFB2DFDB" >
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/nfc_how_it_works_image_text"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:paddingTop="72dp"
+ android:orientation="vertical">
+
+ <ImageView
+ android:id="@+id/nfc_how_it_works_image"
+ android:layout_width="match_parent"
+ android:layout_height="188dp"
+ android:gravity="center"
+ android:src="@drawable/nfc_how_it_works" />
+
+ <TextView
+ android:id="@+id/nfc_how_it_works_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/nfc_how_it_works_title"
+ android:paddingLeft="74dp"
+ android:paddingRight="74dp"
+ android:textColor="#FF263238"
+ android:textSize="24sp" />
+
+ <TextView
+ android:id="@+id/nfc_how_it_works_content"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="10dp"
+ android:paddingBottom="18dp"
+ android:paddingLeft="74dp"
+ android:paddingRight="74dp"
+ android:text="@string/nfc_how_it_works_content"
+ android:textColor="#FF263238"
+ android:textSize="20sp" />
+ </LinearLayout>
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="48dp"
+ android:layout_alignParentBottom="true"
+ android:background="#FFB2DFDB" >
+ <Button
+ android:id="@+id/nfc_how_it_works_button"
+ android:background="?android:attr/selectableItemBackground"
+ android:layout_alignParentRight="true"
+ android:layout_width="wrap_content"
+ android:layout_height="48dp"
+ android:layout_marginRight="20dp"
+ android:text="@string/nfc_how_it_works_got_it"
+ android:textSize="14sp"
+ android:textColor="#263238"
+ style="?android:attr/borderlessButtonStyle" />
+ </RelativeLayout>
+ </RelativeLayout>
+</FrameLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 9569b5c19..919b1a1da 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5563,6 +5563,12 @@
<string name="nfc_payment_favor_default_default_unknown">Still use default</string>
<!-- Header for a dialog asking the user which payment app to use -->
<string name="nfc_payment_pay_with">At a Tap &amp; pay terminal, pay with:</string>
+ <!-- Header for text explaning how to pay at a payment terminal in a store -->
+ <string name="nfc_how_it_works_title">Paying at the terminal</string>
+ <!-- Content for text explaning how to pay at a payment terminal in a store -->
+ <string name="nfc_how_it_works_content">Once you\'ve set up a Tap &amp; pay app and your phone is powered on, tap your phone on any terminal with the Tap &amp; pay logo on it to make a purchase.</string>
+ <!-- Button the user can click to indicate he understood and dismiss the screen -->
+ <string name="nfc_how_it_works_got_it">Got it</string>
<!-- NFC More... title. [CHAR LIMIT=40] -->
<string name="nfc_more_title">More...</string>
<!-- Label for the dialog that is shown when the user is asked to set a
diff --git a/src/com/android/settings/nfc/HowItWorks.java b/src/com/android/settings/nfc/HowItWorks.java
new file mode 100644
index 000000000..310a7e104
--- /dev/null
+++ b/src/com/android/settings/nfc/HowItWorks.java
@@ -0,0 +1,30 @@
+package com.android.settings.nfc;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+
+import com.android.settings.R;
+public class HowItWorks extends Activity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.nfc_payment_how_it_works);
+ getActionBar().setDisplayHomeAsUpEnabled(true);
+ Button gotIt = (Button) findViewById(R.id.nfc_how_it_works_button);
+ gotIt.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ finish();
+ }
+ });
+ }
+
+ @Override
+ public boolean onNavigateUp() {
+ finish();
+ return true;
+ }
+
+}
diff --git a/src/com/android/settings/nfc/PaymentSettings.java b/src/com/android/settings/nfc/PaymentSettings.java
index ca38d9206..bc438d160 100644
--- a/src/com/android/settings/nfc/PaymentSettings.java
+++ b/src/com/android/settings/nfc/PaymentSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.nfc;
+import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
@@ -88,7 +89,8 @@ public class PaymentSettings extends SettingsPreferenceFragment {
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
MenuItem menuItem = menu.add(R.string.nfc_payment_how_it_works);
- menuItem.setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_ALWAYS);
- // TODO link to tutorial screen
+ Intent howItWorksIntent = new Intent(getActivity(), HowItWorks.class);
+ menuItem.setIntent(howItWorksIntent);
+ menuItem.setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_NEVER);
}
}