aboutsummaryrefslogtreecommitdiff
path: root/input
diff options
context:
space:
mode:
authorDouglas Sigelbaum <sigelbaum@google.com>2017-06-15 11:56:24 -0700
committerDouglas Sigelbaum <sigelbaum@google.com>2017-07-08 11:03:50 -0700
commit34f6bf753c7979a3e60ff4ec70d8831eef06b645 (patch)
tree05e3019750e97e8cdc5cf363907fb8e0d6e4d1fd /input
parent8e4f496dd1b41d0fe2b30496dd473e168daf95fe (diff)
downloadandroid-34f6bf753c7979a3e60ff4ec70d8831eef06b645.tar.gz
Autofill sample: make UI nicer.
Also add info dialogs in the app explaining what each client page is showcasing. Bug: 38182790 Test: manual Change-Id: I779f8152ce8f13a1bac28b6964bc7edbd85760af
Diffstat (limited to 'input')
-rw-r--r--input/autofill/AutofillFramework/Application/build.gradle11
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/AndroidManifest.xml5
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CreditCardActivity.java26
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/InfoButton.java54
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/MainActivity.java56
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/NavigationItem.java78
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/StandardAutoCompleteSignInActivity.java5
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/WelcomeActivity.java24
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/MyAutofillService.java3
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/datasource/SharedPrefsAutofillRepository.java7
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillField.java8
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillFieldCollection.java3
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/drawable-hdpi/ic_launcher.pngbin0 -> 4199 bytes
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/drawable-hdpi/tile.9.pngbin0 -> 196 bytes
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/drawable-mdpi/ic_launcher.pngbin0 -> 2535 bytes
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/drawable-xhdpi/ic_launcher.pngbin0 -> 6022 bytes
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/drawable-xxhdpi/ic_launcher.pngbin0 -> 11040 bytes
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_autocomplete_logo_24dp.xml24
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_custom_virtual_logo_24dp.xml24
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_edittexts_logo_24dp.xml24
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_info_black_24dp.xml24
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_lock_black_24dp.xml15
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_spinners_logo_24dp.xml24
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/layout/activity_main.xml77
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/layout/credit_card_activity.xml201
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/layout/login_activity.xml184
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/layout/login_with_autocomplete_activity.xml183
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/layout/multidataset_service_auth_activity.xml83
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/layout/multidataset_service_list_item.xml5
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/layout/navigation_button.xml44
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/layout/navigation_item.xml67
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/layout/virtual_login_activity.xml96
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/layout/welcome_activity.xml29
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/values/attrs.xml27
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/values/dimens.xml2
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/values/strings.xml33
-rw-r--r--input/autofill/AutofillFramework/Application/src/main/res/values/styles.xml6
-rw-r--r--input/autofill/AutofillFramework/build.gradle2
-rw-r--r--input/autofill/AutofillFramework/gradle/wrapper/gradle-wrapper.properties4
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/build.gradle12
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/AndroidManifest.xml5
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/InfoButton.kt41
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/MainActivity.kt9
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/NavigationItem.kt58
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/WelcomeActivity.kt20
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/StructureParser.kt2
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillFieldCollection.kt1
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_autocomplete_logo_24dp.xml24
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_custom_virtual_logo_24dp.xml24
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_edittexts_logo_24dp.xml24
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_info_black_24dp.xml24
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_lock_black_24dp.xml15
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_spinners_logo_24dp.xml24
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/activity_main.xml77
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/credit_card_activity.xml201
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/login_activity.xml184
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/login_with_autocomplete_activity.xml171
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/multidataset_service_auth_activity.xml83
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/multidataset_service_list_item.xml5
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/navigation_button.xml44
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/navigation_item.xml67
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/virtual_login_activity.xml92
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/welcome_activity.xml29
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/attrs.xml27
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/dimens.xml2
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/strings.xml35
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/styles.xml6
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/build.gradle2
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/gradle/wrapper/gradle-wrapper.properties4
69 files changed, 2070 insertions, 700 deletions
diff --git a/input/autofill/AutofillFramework/Application/build.gradle b/input/autofill/AutofillFramework/Application/build.gradle
index 1af47e6b..4a818508 100644
--- a/input/autofill/AutofillFramework/Application/build.gradle
+++ b/input/autofill/AutofillFramework/Application/build.gradle
@@ -1,10 +1,11 @@
apply plugin: 'com.android.application'
dependencies {
- compile "com.android.support:support-v4:26.0.0-beta2"
- compile "com.android.support:support-v13:26.0.0-beta2"
- compile "com.android.support:cardview-v7:26.0.0-beta2"
- compile "com.android.support:appcompat-v7:26.0.0-beta2"
+ compile "com.android.support:support-v4:26.0.0-beta1"
+ compile "com.android.support:support-v13:26.0.0-beta1"
+ compile "com.android.support:cardview-v7:26.0.0-beta1"
+ compile "com.android.support:appcompat-v7:26.0.0-beta1"
+ compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.1'
}
@@ -16,7 +17,7 @@ List<String> dirs = [
android {
compileSdkVersion 26
- buildToolsVersion "26.0.0 rc2"
+ buildToolsVersion "26.0.0"
defaultConfig {
minSdkVersion 26
diff --git a/input/autofill/AutofillFramework/Application/src/main/AndroidManifest.xml b/input/autofill/AutofillFramework/Application/src/main/AndroidManifest.xml
index f7aef70b..21d33639 100644
--- a/input/autofill/AutofillFramework/Application/src/main/AndroidManifest.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/AndroidManifest.xml
@@ -28,7 +28,6 @@
android:theme="@style/Theme.AppCompat.Light">
<activity
android:name=".app.MainActivity"
- android:label="AF Main"
android:taskAffinity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -37,23 +36,19 @@
</activity>
<activity
android:name=".app.StandardSignInActivity"
- android:label="AF StandardLogin"
android:taskAffinity=".StandardSignInActivity">
</activity>
<activity
android:name=".app.StandardAutoCompleteSignInActivity"
- android:label="AF StandardLogin"
android:taskAffinity=".StandardAutoCompleteSignInActivity" />
<activity
android:name=".app.VirtualSignInActivity"
- android:label="AF VirtualLogin"
android:taskAffinity=".VirtualSignInActivity">
</activity>
<activity android:name=".app.WelcomeActivity" />
<activity
android:name=".app.CreditCardActivity"
- android:label="AF CreditCard"
android:taskAffinity=".CreditCardActivity">
</activity>
<!--
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CreditCardActivity.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CreditCardActivity.java
index 37dd7fed..2d336fbb 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CreditCardActivity.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CreditCardActivity.java
@@ -34,10 +34,10 @@ public class CreditCardActivity extends AppCompatActivity {
private final String[] years = new String[CC_EXP_YEARS_COUNT];
- private Spinner mCcExpirationDaySpinner = findViewById(R.id.expirationDay);
- private Spinner mCcExpirationMonthSpinner = findViewById(R.id.expirationMonth);
- private Spinner mCcExpirationYearSpinner = findViewById(R.id.expirationYear);
- private EditText mCcNumber = findViewById(R.id.creditCardNumberField);
+ private Spinner mCcExpirationDaySpinner;
+ private Spinner mCcExpirationMonthSpinner;
+ private Spinner mCcExpirationYearSpinner;
+ private EditText mCcCardNumber;
public static Intent getStartActivityIntent(Context context) {
Intent intent = new Intent(context, CreditCardActivity.class);
@@ -47,12 +47,11 @@ public class CreditCardActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
setContentView(R.layout.credit_card_activity);
-
- Spinner ccExpirationDaySpinner = findViewById(R.id.expirationDay);
- Spinner ccExpirationMonthSpinner = findViewById(R.id.expirationMonth);
- Spinner ccExpirationYearSpinner = findViewById(R.id.expirationYear);
+ mCcExpirationDaySpinner = findViewById(R.id.expirationDay);
+ mCcExpirationMonthSpinner = findViewById(R.id.expirationMonth);
+ mCcExpirationYearSpinner = findViewById(R.id.expirationYear);
+ mCcCardNumber = findViewById(R.id.creditCardNumberField);
// Create an ArrayAdapter using the string array and a default spinner layout
ArrayAdapter<CharSequence> dayAdapter = ArrayAdapter.createFromResource
@@ -60,18 +59,17 @@ public class CreditCardActivity extends AppCompatActivity {
// Specify the layout to use when the list of choices appears
dayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// Apply the adapter to the spinner
- ccExpirationDaySpinner.setAdapter(dayAdapter);
+ mCcExpirationDaySpinner.setAdapter(dayAdapter);
ArrayAdapter<CharSequence> monthAdapter = ArrayAdapter.createFromResource
(this, R.array.month_array, android.R.layout.simple_spinner_item);
monthAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- ccExpirationMonthSpinner.setAdapter(monthAdapter);
-
+ mCcExpirationMonthSpinner.setAdapter(monthAdapter);
int year = Calendar.getInstance().get(Calendar.YEAR);
for (int i = 0; i < years.length; i++) {
years[i] = Integer.toString(year + i);
}
- ccExpirationYearSpinner.setAdapter(
+ mCcExpirationYearSpinner.setAdapter(
new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, years) {
@Override
public CharSequence[] getAutofillOptions() {
@@ -96,7 +94,7 @@ public class CreditCardActivity extends AppCompatActivity {
mCcExpirationDaySpinner.setSelection(0);
mCcExpirationMonthSpinner.setSelection(0);
mCcExpirationYearSpinner.setSelection(0);
- mCcNumber.setText("");
+ mCcCardNumber.setText("");
}
/**
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/InfoButton.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/InfoButton.java
new file mode 100644
index 00000000..d5811e11
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/InfoButton.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+package com.example.android.autofillframework.app;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.support.v7.app.AlertDialog;
+import android.support.v7.widget.AppCompatImageButton;
+import android.util.AttributeSet;
+import android.view.View;
+
+import com.example.android.autofillframework.R;
+
+public class InfoButton extends AppCompatImageButton {
+ public InfoButton(Context context) {
+ this(context, null);
+ }
+
+ public InfoButton(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public InfoButton(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.InfoButton,
+ defStyleAttr, 0);
+ String infoText = typedArray.getString(R.styleable.InfoButton_dialogText);
+ typedArray.recycle();
+ setInfoText(infoText);
+ }
+
+ public void setInfoText(final String infoText) {
+ setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ new AlertDialog.Builder(InfoButton.this.getContext())
+ .setMessage(infoText).create().show();
+ }
+ });
+ }
+}
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/MainActivity.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/MainActivity.java
index cf76aee1..16f1bf7c 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/MainActivity.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/MainActivity.java
@@ -15,7 +15,6 @@
*/
package com.example.android.autofillframework.app;
-import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
@@ -26,37 +25,40 @@ import com.example.android.autofillframework.R;
/**
* This is used to launch sample activities that showcase autofill.
*/
-public class MainActivity extends AppCompatActivity implements View.OnClickListener {
+public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
- findViewById(R.id.standardViewSignInButton).setOnClickListener(this);
- findViewById(R.id.virtualViewSignInButton).setOnClickListener(this);
- findViewById(R.id.creditCardCheckoutButton).setOnClickListener(this);
- findViewById(R.id.standardLoginWithAutoCompleteButton).setOnClickListener(this);
- }
+ NavigationItem loginEditTexts = findViewById(R.id.standardViewSignInButton);
+ NavigationItem loginCustomVirtual = findViewById(R.id.virtualViewSignInButton);
+ NavigationItem creditCardSpinners = findViewById(R.id.creditCardCheckoutButton);
+ NavigationItem loginAutoComplete = findViewById(R.id.standardLoginWithAutoCompleteButton);
- @Override
- public void onClick(View view) {
- Intent intent = null;
- switch (view.getId()) {
- case R.id.standardViewSignInButton:
- intent = StandardSignInActivity.getStartActivityIntent(this);
- break;
- case R.id.virtualViewSignInButton:
- intent = VirtualSignInActivity.getStartActivityIntent(this);
- break;
- case R.id.creditCardCheckoutButton:
- intent = CreditCardActivity.getStartActivityIntent(this);
- break;
- case R.id.standardLoginWithAutoCompleteButton:
- intent = StandardAutoCompleteSignInActivity.getStartActivityIntent(this);
- break;
- }
- if (intent != null) {
- startActivity(intent);
- }
+ loginEditTexts.setNavigationButtonClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(StandardSignInActivity.getStartActivityIntent(MainActivity.this));
+ }
+ });
+ loginCustomVirtual.setNavigationButtonClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(VirtualSignInActivity.getStartActivityIntent(MainActivity.this));
+ }
+ });
+ creditCardSpinners.setNavigationButtonClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(CreditCardActivity.getStartActivityIntent(MainActivity.this));
+ }
+ });
+ loginAutoComplete.setNavigationButtonClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(StandardAutoCompleteSignInActivity.getStartActivityIntent(MainActivity.this));
+ }
+ });
}
} \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/NavigationItem.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/NavigationItem.java
new file mode 100644
index 00000000..baeef683
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/NavigationItem.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+package com.example.android.autofillframework.app;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.support.annotation.ColorRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.content.ContextCompat;
+import android.support.v7.widget.CardView;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.FrameLayout;
+import android.widget.TextView;
+
+import com.example.android.autofillframework.R;
+
+public class NavigationItem extends FrameLayout {
+ CardView mCardView;
+
+ public NavigationItem(Context context) {
+ this(context, null);
+ }
+
+ public NavigationItem(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public NavigationItem(Context context, AttributeSet attrs, int defStyleAttr) {
+ this(context, attrs, defStyleAttr, 0);
+ }
+
+ public NavigationItem(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr,
+ int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+ TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.NavigationItem,
+ defStyleAttr, defStyleRes);
+ String labelText = typedArray.getString(R.styleable.NavigationItem_labelText);
+ String infoText = typedArray.getString(R.styleable.NavigationItem_infoText);
+ Drawable logoDrawable = typedArray.getDrawable(R.styleable.NavigationItem_itemLogo);
+ @ColorRes int colorRes = typedArray.getResourceId(R.styleable.NavigationItem_imageColor, 0);
+ int imageColor = ContextCompat.getColor(getContext(), colorRes);
+ typedArray.recycle();
+ View rootView = LayoutInflater.from(context).inflate(R.layout.navigation_item, this);
+ if (logoDrawable != null) {
+ logoDrawable.setColorFilter(imageColor, PorterDuff.Mode.SRC_IN);
+ }
+ TextView buttonLabel = rootView.findViewById(R.id.buttonLabel);
+ buttonLabel.setText(labelText);
+ buttonLabel.setCompoundDrawablesRelativeWithIntrinsicBounds(logoDrawable, null,
+ null, null);
+ InfoButton infoButton = rootView.findViewById(R.id.infoButton);
+ infoButton.setInfoText(infoText);
+ infoButton.setColorFilter(imageColor);
+ mCardView = rootView.findViewById(R.id.cardView);
+ }
+
+ public void setNavigationButtonClickListener(@Nullable OnClickListener l) {
+ mCardView.setOnClickListener(l);
+ }
+}
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/StandardAutoCompleteSignInActivity.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/StandardAutoCompleteSignInActivity.java
index d5ed88f0..5fbdd346 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/StandardAutoCompleteSignInActivity.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/StandardAutoCompleteSignInActivity.java
@@ -24,7 +24,6 @@ import android.view.View;
import android.view.autofill.AutofillManager;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
-import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
@@ -35,8 +34,8 @@ import static com.example.android.autofillframework.CommonUtil.TAG;
public class StandardAutoCompleteSignInActivity extends AppCompatActivity {
private AutoCompleteTextView mUsernameAutoCompleteField;
private TextView mPasswordField;
- private Button mLoginButton;
- private Button mClearButton;
+ private TextView mLoginButton;
+ private TextView mClearButton;
private boolean mAutofillReceived = false;
private AutofillManager.AutofillCallback mAutofillCallback;
private AutofillManager mAutofillManager;
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/WelcomeActivity.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/WelcomeActivity.java
index fd3df2f6..13eb939b 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/WelcomeActivity.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/WelcomeActivity.java
@@ -15,14 +15,18 @@
*/
package com.example.android.autofillframework.app;
-import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
+import android.os.CountDownTimer;
+import android.support.v7.app.AppCompatActivity;
+import android.widget.TextView;
import com.example.android.autofillframework.R;
-public class WelcomeActivity extends Activity {
+import static java.lang.Math.toIntExact;
+
+public class WelcomeActivity extends AppCompatActivity {
public static Intent getStartActivityIntent(Context context) {
return new Intent(context, WelcomeActivity.class);
@@ -32,5 +36,21 @@ public class WelcomeActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.welcome_activity);
+ final TextView countdownText = findViewById(R.id.countdownText);
+ new CountDownTimer(5000, 1000) {
+ @Override
+ public void onTick(long millisUntilFinished) {
+ int secondsRemaining = toIntExact(millisUntilFinished / 1000);
+ countdownText.setText(getResources().getQuantityString
+ (R.plurals.welcome_page_countdown, secondsRemaining, secondsRemaining));
+ }
+
+ @Override
+ public void onFinish() {
+ if (!WelcomeActivity.this.isFinishing()) {
+ finish();
+ }
+ }
+ }.start();
}
}
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/MyAutofillService.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/MyAutofillService.java
index db63050f..19cf2ae0 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/MyAutofillService.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/MyAutofillService.java
@@ -35,6 +35,7 @@ import com.example.android.autofillframework.multidatasetservice.datasource.Shar
import com.example.android.autofillframework.multidatasetservice.model.FilledAutofillFieldCollection;
import com.example.android.autofillframework.multidatasetservice.settings.MyPreferences;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -65,7 +66,7 @@ public class MyAutofillService extends AutofillService {
// Check user's settings for authenticating Responses and Datasets.
boolean responseAuth = MyPreferences.getInstance(this).isResponseAuth();
AutofillId[] autofillIds = autofillFields.getAutofillIds();
- if (responseAuth) {
+ if (responseAuth && !Arrays.asList(autofillIds).isEmpty()) {
// If the entire Autofill Response is authenticated, AuthActivity is used
// to generate Response.
IntentSender sender = AuthActivity.getAuthIntentSenderForResponse(this);
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/datasource/SharedPrefsAutofillRepository.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/datasource/SharedPrefsAutofillRepository.java
index 7b7ade94..9d29fb3a 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/datasource/SharedPrefsAutofillRepository.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/datasource/SharedPrefsAutofillRepository.java
@@ -21,6 +21,7 @@ import android.util.ArraySet;
import com.example.android.autofillframework.multidatasetservice.model.FilledAutofillFieldCollection;
import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
import java.util.HashMap;
import java.util.List;
@@ -59,7 +60,8 @@ public class SharedPrefsAutofillRepository implements AutofillRepository {
HashMap<String, FilledAutofillFieldCollection> clientFormDataMap = new HashMap<>();
Set<String> clientFormDataStringSet = getAllAutofillDataStringSet();
for (String clientFormDataString : clientFormDataStringSet) {
- FilledAutofillFieldCollection filledAutofillFieldCollection = new Gson().fromJson(clientFormDataString, FilledAutofillFieldCollection.class);
+ Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
+ FilledAutofillFieldCollection filledAutofillFieldCollection = gson.fromJson(clientFormDataString, FilledAutofillFieldCollection.class);
if (filledAutofillFieldCollection != null) {
if (filledAutofillFieldCollection.helpsWithHints(focusedAutofillHints)) {
// Saved data has data relevant to at least 1 of the hints associated with the
@@ -85,7 +87,8 @@ public class SharedPrefsAutofillRepository implements AutofillRepository {
String datasetName = "dataset-" + getDatasetNumber();
filledAutofillFieldCollection.setDatasetName(datasetName);
Set<String> allAutofillData = getAllAutofillDataStringSet();
- allAutofillData.add(new Gson().toJson(filledAutofillFieldCollection));
+ Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
+ allAutofillData.add(gson.toJson(filledAutofillFieldCollection));
saveAllAutofillDataStringSet(allAutofillData);
incrementDatasetNumber();
}
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillField.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillField.java
index e7cda0ef..9ae92a3d 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillField.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillField.java
@@ -19,19 +19,23 @@ import android.app.assist.AssistStructure;
import android.view.autofill.AutofillValue;
import com.example.android.autofillframework.multidatasetservice.AutofillHelper;
+import com.google.gson.annotations.Expose;
/**
* JSON serializable data class containing the same data as an {@link AutofillValue}.
*/
public class FilledAutofillField {
+ @Expose
private String mTextValue = null;
+ @Expose
private Long mDateValue = null;
+ @Expose
private Boolean mToggleValue = null;
/**
- * Does not need to be serialized into persistent storage, so its marked {@code transient}.
+ * Does not need to be serialized into persistent storage, so it's not exposed.
*/
- private transient String[] mAutofillHints = null;
+ private String[] mAutofillHints = null;
public FilledAutofillField(AssistStructure.ViewNode viewNode) {
mAutofillHints = AutofillHelper.filterForSupportedHints(viewNode.getAutofillHints());
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillFieldCollection.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillFieldCollection.java
index 94991342..03e57838 100644
--- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillFieldCollection.java
+++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillFieldCollection.java
@@ -24,6 +24,7 @@ import android.view.autofill.AutofillValue;
import com.example.android.autofillframework.multidatasetservice.AutofillFieldMetadata;
import com.example.android.autofillframework.multidatasetservice.AutofillFieldMetadataCollection;
+import com.google.gson.annotations.Expose;
import java.util.HashMap;
import java.util.List;
@@ -35,7 +36,9 @@ import static com.example.android.autofillframework.CommonUtil.TAG;
* plus the dataset name associated with it.
*/
public final class FilledAutofillFieldCollection {
+ @Expose
private final HashMap<String, FilledAutofillField> mHintMap;
+ @Expose
private String mDatasetName;
public FilledAutofillFieldCollection() {
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/drawable-hdpi/ic_launcher.png b/input/autofill/AutofillFramework/Application/src/main/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 00000000..b1efaf4b
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/drawable-hdpi/tile.9.png b/input/autofill/AutofillFramework/Application/src/main/res/drawable-hdpi/tile.9.png
new file mode 100644
index 00000000..13586288
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/res/drawable-hdpi/tile.9.png
Binary files differ
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/drawable-mdpi/ic_launcher.png b/input/autofill/AutofillFramework/Application/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 00000000..f5f9244f
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/drawable-xhdpi/ic_launcher.png b/input/autofill/AutofillFramework/Application/src/main/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..5d07b3f0
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/drawable-xxhdpi/ic_launcher.png b/input/autofill/AutofillFramework/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 00000000..6ef21e1f
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_autocomplete_logo_24dp.xml b/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_autocomplete_logo_24dp.xml
new file mode 100644
index 00000000..80f30a2f
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_autocomplete_logo_24dp.xml
@@ -0,0 +1,24 @@
+<!--
+ * Copyright (C) 2017 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M20,2L4,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h14l4,4L22,4c0,-1.1 -0.9,-2 -2,-2zM18,14L6,14v-2h12v2zM18,11L6,11L6,9h12v2zM18,8L6,8L6,6h12v2z"/>
+</vector>
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_custom_virtual_logo_24dp.xml b/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_custom_virtual_logo_24dp.xml
new file mode 100644
index 00000000..3a8ee3b2
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_custom_virtual_logo_24dp.xml
@@ -0,0 +1,24 @@
+<!--
+ * Copyright (C) 2017 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M13,7h-2v2h2L13,7zM13,11h-2v2h2v-2zM17,11h-2v2h2v-2zM3,3v18h18L21,3L3,3zM19,19L5,19L5,5h14v14zM13,15h-2v2h2v-2zM9,11L7,11v2h2v-2z"/>
+</vector>
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_edittexts_logo_24dp.xml b/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_edittexts_logo_24dp.xml
new file mode 100644
index 00000000..17e403d9
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_edittexts_logo_24dp.xml
@@ -0,0 +1,24 @@
+<!--
+ * Copyright (C) 2017 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M4,9h16v2L4,11zM4,13h10v2L4,15z"/>
+</vector>
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_info_black_24dp.xml b/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_info_black_24dp.xml
new file mode 100644
index 00000000..c297121b
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_info_black_24dp.xml
@@ -0,0 +1,24 @@
+<!--
+ * Copyright (C) 2017 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
+</vector>
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_lock_black_24dp.xml b/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_lock_black_24dp.xml
index 67a7c73a..6b2f014d 100644
--- a/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_lock_black_24dp.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_lock_black_24dp.xml
@@ -1,3 +1,18 @@
+<!--
+ * Copyright (C) 2017 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.
+-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_spinners_logo_24dp.xml b/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_spinners_logo_24dp.xml
new file mode 100644
index 00000000..5fb27a24
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/res/drawable/ic_spinners_logo_24dp.xml
@@ -0,0 +1,24 @@
+<!--
+ * Copyright (C) 2017 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M9,11L7,11v2h2v-2zM13,11h-2v2h2v-2zM17,11h-2v2h2v-2zM19,4h-1L18,2h-2v2L8,4L8,2L6,2v2L5,4c-1.11,0 -1.99,0.9 -1.99,2L3,20c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,6c0,-1.1 -0.9,-2 -2,-2zM19,20L5,20L5,9h14v11z"/>
+</vector>
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/layout/activity_main.xml b/input/autofill/AutofillFramework/Application/src/main/res/layout/activity_main.xml
index b2510b07..2043dd1d 100644
--- a/input/autofill/AutofillFramework/Application/src/main/res/layout/activity_main.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/res/layout/activity_main.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,39 +13,55 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingStart="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin">
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
- <Button
- android:id="@+id/standardViewSignInButton"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/standard_view_sign_in" />
+ android:orientation="vertical"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingEnd="@dimen/activity_horizontal_margin"
+ android:paddingStart="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin">
- <Button
- android:id="@+id/standardLoginWithAutoCompleteButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/standard_view_autocomplete_sign_in"/>
+ <com.example.android.autofillframework.app.NavigationItem
+ android:id="@+id/standardViewSignInButton"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:infoText="@string/edittext_login_info"
+ app:labelText="@string/navigation_button_edittext_login_label"
+ app:itemLogo="@drawable/ic_edittexts_logo_24dp"
+ app:imageColor="@android:color/holo_red_dark" />
- <Button
- android:id="@+id/virtualViewSignInButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/activity_vertical_margin"
- android:text="@string/virtual_view_sign_in" />
+ <com.example.android.autofillframework.app.NavigationItem
+ android:id="@+id/standardLoginWithAutoCompleteButton"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:infoText="@string/autocomplete_login_info"
+ app:labelText="@string/navigation_button_autocomplete_login_label"
+ app:itemLogo="@drawable/ic_autocomplete_logo_24dp"
+ app:imageColor="@android:color/holo_blue_dark"/>
- <Button
- android:id="@+id/creditCardCheckoutButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/activity_vertical_margin"
- android:text="@string/credit_card_checkout" />
+ <com.example.android.autofillframework.app.NavigationItem
+ android:id="@+id/virtualViewSignInButton"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:infoText="@string/custom_virtual_login_info"
+ app:labelText="@string/navigation_button_custom_virtual_view_login_label"
+ app:itemLogo="@drawable/ic_custom_virtual_logo_24dp"
+ app:imageColor="@android:color/holo_green_dark"/>
+
+ <com.example.android.autofillframework.app.NavigationItem
+ android:id="@+id/creditCardCheckoutButton"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:infoText="@string/spinners_credit_card_info"
+ app:labelText="@string/navigation_button_spinners_credit_card_label"
+ app:itemLogo="@drawable/ic_spinners_logo_24dp"
+ app:imageColor="@android:color/holo_orange_dark"/>
-</LinearLayout> \ No newline at end of file
+ </LinearLayout>
+</ScrollView> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/layout/credit_card_activity.xml b/input/autofill/AutofillFramework/Application/src/main/res/layout/credit_card_activity.xml
index 7d8e099f..7f78c4e4 100644
--- a/input/autofill/AutofillFramework/Application/src/main/res/layout/credit_card_activity.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/res/layout/credit_card_activity.xml
@@ -14,95 +14,136 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/standardLoginLayout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:focusable="true"
- android:focusableInTouchMode="true"
- android:orientation="vertical"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin">
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin">
- <RelativeLayout
- android:layout_width="wrap_content"
+ <TextView
+ android:id="@+id/spinners_credit_card_header"
+ style="@style/TextAppearance.AppCompat.Large"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_gravity="center">
-
- <TextView
- android:id="@+id/creditCardNumberLabel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="20dp"
- android:importantForAutofill="no"
- android:text="@string/credit_card_number_label" />
-
- <EditText
- android:id="@+id/creditCardNumberField"
- android:layout_width="200sp"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/creditCardNumberLabel"
- android:layout_toEndOf="@id/creditCardNumberLabel"
- android:autofillHints="creditCardNumber" />
-
- <TextView
- android:id="@+id/creditCardExpirationLabel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignStart="@+id/creditCardNumberLabel"
- android:layout_below="@+id/creditCardNumberLabel"
- android:layout_marginTop="20dp"
- android:importantForAutofill="no"
- android:text="@string/credit_card_expiration_label" />
+ android:layout_marginTop="8dp"
+ android:gravity="center"
+ android:text="@string/navigation_button_spinners_credit_card_label"
+ app:layout_constraintEnd_toStartOf="@+id/imageButton"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="spread"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/creditCardExpirationLabel"
- android:layout_alignStart="@+id/creditCardNumberField"
- android:orientation="horizontal">
+ <com.example.android.autofillframework.app.InfoButton
+ android:id="@+id/imageButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ic_info_black_24dp"
+ app:layout_constraintBottom_toBottomOf="@+id/spinners_credit_card_header"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/spinners_credit_card_header"
+ app:layout_constraintTop_toTopOf="@+id/spinners_credit_card_header"
+ app:dialogText="@string/spinners_credit_card_info" />
- <Spinner
- android:id="@+id/expirationDay"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:autofillHints="creditCardExpirationDay" />
+ <TextView
+ android:id="@+id/creditCardNumberLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:importantForAutofill="no"
+ android:labelFor="@+id/creditCardNumberField"
+ android:text="@string/credit_card_number_label"
+ app:layout_constraintStart_toStartOf="@+id/creditCardExpirationLabel"
+ app:layout_constraintTop_toBottomOf="@+id/spinners_credit_card_header" />
- <Spinner
- android:id="@+id/expirationMonth"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:autofillHints="creditCardExpirationMonth" />
+ <EditText
+ android:id="@+id/creditCardNumberField"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/creditCardNumberLabel"
+ android:layout_marginEnd="8dp"
+ android:autofillHints="creditCardNumber"
+ android:focusedByDefault="true"
+ android:inputType="number"
+ app:layout_constraintBottom_toBottomOf="@+id/creditCardNumberLabel"
+ app:layout_constraintEnd_toEndOf="@+id/expirationYear"
+ app:layout_constraintStart_toStartOf="@+id/expirationDay"
+ app:layout_constraintTop_toTopOf="@+id/creditCardNumberLabel" />
- <Spinner
- android:id="@+id/expirationYear"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:autofillHints="creditCardExpirationYear" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/creditCardExpirationLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:importantForAutofill="no"
+ android:text="@string/credit_card_expiration_label"
+ app:layout_constraintEnd_toStartOf="@+id/expirationDay"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/creditCardNumberLabel" />
- </RelativeLayout>
+ <Spinner
+ android:id="@+id/expirationDay"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:autofillHints="creditCardExpirationDay"
+ app:layout_constraintBottom_toBottomOf="@+id/creditCardExpirationLabel"
+ app:layout_constraintEnd_toStartOf="@+id/expirationMonth"
+ app:layout_constraintStart_toEndOf="@+id/creditCardNumberLabel"
+ app:layout_constraintTop_toTopOf="@+id/creditCardExpirationLabel" />
- <LinearLayout
- android:layout_width="match_parent"
+ <Spinner
+ android:id="@+id/expirationMonth"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="20dp"
- android:gravity="center"
- android:orientation="horizontal">
+ android:autofillHints="creditCardExpirationMonth"
+ app:layout_constraintBottom_toBottomOf="@+id/expirationDay"
+ app:layout_constraintEnd_toStartOf="@+id/expirationYear"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/expirationDay"
+ app:layout_constraintTop_toTopOf="@+id/expirationDay" />
- <Button
- android:id="@+id/clear"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Clear" />
+ <Spinner
+ android:id="@+id/expirationYear"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:autofillHints="creditCardExpirationYear"
+ app:layout_constraintBottom_toBottomOf="@+id/expirationMonth"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/expirationMonth"
+ app:layout_constraintTop_toTopOf="@+id/expirationMonth" />
- <Button
- android:id="@+id/submit"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Submit" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/clear"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:text="@string/clear_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toStartOf="@+id/submit"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/creditCardExpirationLabel" />
-</LinearLayout> \ No newline at end of file
+ <TextView
+ android:id="@+id/submit"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:text="@string/submit_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/clear"
+ app:layout_constraintTop_toTopOf="@+id/clear" />
+</android.support.constraint.ConstraintLayout> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/layout/login_activity.xml b/input/autofill/AutofillFramework/Application/src/main/res/layout/login_activity.xml
index f9f5657d..1bbac855 100644
--- a/input/autofill/AutofillFramework/Application/src/main/res/layout/login_activity.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/res/layout/login_activity.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,78 +13,131 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/standardLoginLayout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:focusable="true"
- android:focusableInTouchMode="true"
- android:orientation="vertical"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin">
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/authLayout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin" >
- <RelativeLayout
- android:layout_width="wrap_content"
+ <TextView
+ android:id="@+id/standard_login_header"
+ style="@style/TextAppearance.AppCompat.Large"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_gravity="center">
+ android:layout_marginTop="8dp"
+ android:text="@string/navigation_button_edittext_login_label"
+ android:gravity="center"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/imageButton"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="spread"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
- <TextView
- android:id="@+id/usernameLabel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="20dp"
- android:importantForAutofill="no"
- android:text="@string/username_label" />
+ <com.example.android.autofillframework.app.InfoButton
+ android:id="@+id/imageButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:background="@drawable/ic_info_black_24dp"
+ app:layout_constraintBottom_toBottomOf="@+id/standard_login_header"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/standard_login_header"
+ app:layout_constraintTop_toTopOf="@+id/standard_login_header"
+ app:dialogText="@string/edittext_login_info"/>
- <EditText
- android:id="@+id/usernameField"
- android:layout_width="200sp"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/usernameLabel"
- android:layout_toEndOf="@id/usernameLabel"
- android:autofillHints="username"
- android:inputType="textPersonName" />
+ <TextView
+ android:id="@+id/usernameLabel"
+ style="@style/TextAppearance.AppCompat.Body1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:labelFor="@+id/usernameField"
+ android:text="@string/username_label"
+ app:layout_constraintEnd_toStartOf="@+id/usernameField"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/standard_login_header" />
- <TextView
- android:id="@+id/passwordLabel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignStart="@+id/usernameLabel"
- android:layout_below="@+id/usernameLabel"
- android:layout_marginTop="20dp"
- android:importantForAutofill="no"
- android:text="@string/password_label" />
+ <EditText
+ android:id="@+id/usernameField"
+ android:layout_width="@dimen/text_field_width"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:autofillHints="username"
+ android:inputType="text"
+ app:layout_constraintBottom_toBottomOf="@+id/usernameLabel"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/usernameLabel"
+ app:layout_constraintTop_toTopOf="@+id/usernameLabel" />
- <EditText
- android:id="@+id/passwordField"
- android:layout_width="200sp"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/passwordLabel"
- android:layout_alignStart="@+id/usernameField"
- android:autofillHints="password"
- android:inputType="textPassword" />
- </RelativeLayout>
+ <TextView
+ android:id="@+id/passwordLabel"
+ style="@style/TextAppearance.AppCompat.Body1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:labelFor="@+id/passwordField"
+ android:text="@string/password_label"
+ app:layout_constraintEnd_toStartOf="@+id/passwordField"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/usernameLabel" />
- <LinearLayout
- android:layout_width="match_parent"
+ <EditText
+ android:id="@+id/passwordField"
+ android:layout_width="@dimen/text_field_width"
android:layout_height="wrap_content"
- android:layout_marginTop="20dp"
- android:gravity="center"
- android:orientation="horizontal">
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:autofillHints="password"
+ android:inputType="textPassword"
+ app:layout_constraintBottom_toBottomOf="@+id/passwordLabel"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/passwordLabel"
+ app:layout_constraintTop_toTopOf="@+id/passwordLabel" />
- <Button
- android:id="@+id/clear"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/clear_label" />
+ <TextView
+ android:id="@+id/clear"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:text="@string/clear_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toStartOf="@+id/login"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/passwordField" />
- <Button
- android:id="@+id/login"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/login_label" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/login"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:text="@string/login_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/clear"
+ app:layout_constraintTop_toTopOf="@+id/clear" />
-</LinearLayout> \ No newline at end of file
+</android.support.constraint.ConstraintLayout> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/layout/login_with_autocomplete_activity.xml b/input/autofill/AutofillFramework/Application/src/main/res/layout/login_with_autocomplete_activity.xml
index 193387b8..a7efa42e 100644
--- a/input/autofill/AutofillFramework/Application/src/main/res/layout/login_with_autocomplete_activity.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/res/layout/login_with_autocomplete_activity.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,80 +13,128 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/standardLoginLayout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:focusable="true"
- android:focusableInTouchMode="true"
- android:orientation="vertical"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin">
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/authLayout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin" >
- <RelativeLayout
- android:layout_width="wrap_content"
+ <TextView
+ android:id="@+id/standard_login_header"
+ style="@style/TextAppearance.AppCompat.Large"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_gravity="center">
+ android:layout_marginTop="8dp"
+ android:gravity="center"
+ android:text="@string/navigation_button_autocomplete_login_label"
+ app:layout_constraintEnd_toStartOf="@+id/imageButton"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="spread"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
- <TextView
- android:id="@+id/usernameLabel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="20dp"
- android:importantForAutofill="no"
- android:labelFor="@+id/usernameField"
- android:text="@string/username_label" />
+ <com.example.android.autofillframework.app.InfoButton
+ android:id="@+id/imageButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ic_info_black_24dp"
+ app:layout_constraintBottom_toBottomOf="@+id/standard_login_header"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/standard_login_header"
+ app:layout_constraintTop_toTopOf="@+id/standard_login_header"
+ app:dialogText="@string/autocomplete_login_info"/>
- <AutoCompleteTextView
- android:id="@+id/usernameField"
- android:layout_width="200sp"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/usernameLabel"
- android:layout_toEndOf="@id/usernameLabel"
- android:autofillHints="username"
- android:inputType="textPersonName" />
+ <TextView
+ android:id="@+id/usernameLabel"
+ style="@style/TextAppearance.AppCompat.Body1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:labelFor="@+id/usernameField"
+ android:text="@string/username_label"
+ app:layout_constraintEnd_toStartOf="@+id/usernameField"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/standard_login_header" />
- <TextView
- android:id="@+id/passwordLabel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignStart="@+id/usernameLabel"
- android:layout_below="@+id/usernameLabel"
- android:layout_marginTop="20dp"
- android:importantForAutofill="no"
- android:text="@string/password_label"
- android:labelFor="@+id/passwordField"/>
+ <AutoCompleteTextView
+ android:id="@+id/usernameField"
+ android:layout_width="@dimen/text_field_width"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:autofillHints="username"
+ android:inputType="text"
+ app:layout_constraintBottom_toBottomOf="@+id/usernameLabel"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/usernameLabel"
+ app:layout_constraintTop_toTopOf="@+id/usernameLabel" />
- <EditText
- android:id="@+id/passwordField"
- android:layout_width="200sp"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/passwordLabel"
- android:layout_alignStart="@+id/usernameField"
- android:autofillHints="password"
- android:inputType="textPassword" />
- </RelativeLayout>
+ <TextView
+ android:id="@+id/passwordLabel"
+ style="@style/TextAppearance.AppCompat.Body1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:labelFor="@+id/passwordField"
+ android:text="@string/password_label"
+ app:layout_constraintEnd_toStartOf="@+id/passwordField"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/usernameLabel" />
- <LinearLayout
- android:layout_width="match_parent"
+ <AutoCompleteTextView
+ android:id="@+id/passwordField"
+ android:layout_width="@dimen/text_field_width"
android:layout_height="wrap_content"
- android:layout_marginTop="20dp"
- android:gravity="center"
- android:orientation="horizontal">
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:autofillHints="password"
+ android:inputType="textPassword"
+ app:layout_constraintBottom_toBottomOf="@+id/passwordLabel"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/passwordLabel"
+ app:layout_constraintTop_toTopOf="@+id/passwordLabel" />
- <Button
- android:id="@+id/clear"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Clear" />
+ <TextView
+ android:id="@+id/clear"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:text="@string/cancel"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toStartOf="@+id/login"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/passwordField" />
- <Button
- android:id="@+id/login"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Login" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/login"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:text="@string/login_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/clear"
+ app:layout_constraintTop_toTopOf="@+id/clear" />
-</LinearLayout> \ No newline at end of file
+</android.support.constraint.ConstraintLayout> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/layout/multidataset_service_auth_activity.xml b/input/autofill/AutofillFramework/Application/src/main/res/layout/multidataset_service_auth_activity.xml
index 28c0e7fd..981dd0d8 100644
--- a/input/autofill/AutofillFramework/Application/src/main/res/layout/multidataset_service_auth_activity.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/res/layout/multidataset_service_auth_activity.xml
@@ -13,7 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/authLayout"
android:layout_width="match_parent"
@@ -27,34 +28,72 @@
tools:context=".multidatasetservice.AuthActivity">
<TextView
+ android:id="@+id/master_login_header"
+ style="@style/TextAppearance.AppCompat.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:text="@string/master_password_label"/>
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:text="@string/autofill_master_login_label"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <TextView
+ android:id="@+id/password_label"
+ style="@style/TextAppearance.AppCompat.Body1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:labelFor="@+id/master_password"
+ android:text="@string/password_label"
+ app:layout_constraintEnd_toStartOf="@+id/master_password"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/master_login_header" />
<EditText
android:id="@+id/master_password"
- android:layout_width="match_parent"
+ android:layout_width="@dimen/text_field_width"
android:layout_height="wrap_content"
- android:inputType="textPassword"/>
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:inputType="textPassword"
+ app:layout_constraintBottom_toBottomOf="@+id/password_label"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/password_label"
+ app:layout_constraintTop_toTopOf="@+id/password_label" />
- <LinearLayout
- android:layout_width="match_parent"
+ <TextView
+ android:id="@+id/cancel"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="horizontal">
-
- <Button
- android:id="@+id/cancel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/cancel" />
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:text="@string/cancel"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toStartOf="@+id/login"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/master_password" />
- <Button
- android:id="@+id/login"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/login_label" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/login"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:text="@string/login_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/cancel"
+ app:layout_constraintTop_toTopOf="@+id/cancel" />
-</LinearLayout> \ No newline at end of file
+</android.support.constraint.ConstraintLayout> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/layout/multidataset_service_list_item.xml b/input/autofill/AutofillFramework/Application/src/main/res/layout/multidataset_service_list_item.xml
index fe51953e..442d54e7 100644
--- a/input/autofill/AutofillFramework/Application/src/main/res/layout/multidataset_service_list_item.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/res/layout/multidataset_service_list_item.xml
@@ -16,13 +16,13 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:background="@android:color/white"
android:orientation="horizontal">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:background="#ffffffff"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
@@ -34,5 +34,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
- android:src="@drawable/ic_person_black_24dp"/>
+ android:layout_marginEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:src="@drawable/ic_person_black_24dp" />
</LinearLayout> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/layout/navigation_button.xml b/input/autofill/AutofillFramework/Application/src/main/res/layout/navigation_button.xml
new file mode 100644
index 00000000..a0dba902
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/res/layout/navigation_button.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2017 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.
+-->
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools">
+ <LinearLayout
+ android:id="@+id/navigation_button_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <ImageButton
+ android:id="@+id/infoButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_marginHorizontal="@dimen/activity_horizontal_margin"
+ android:layout_marginVertical="@dimen/activity_vertical_margin"
+ android:background="@drawable/ic_info_black_24dp" />
+
+ <TextView
+ style="@style/TextAppearance.AppCompat.Medium"
+ android:id="@+id/buttonLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:minLines="2"
+ android:layout_marginHorizontal="@dimen/activity_horizontal_margin"
+ android:layout_marginVertical="@dimen/activity_vertical_margin"
+ tools:text="@string/navigation_button_edittext_login_label" />
+ </LinearLayout>
+</merge> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/layout/navigation_item.xml b/input/autofill/AutofillFramework/Application/src/main/res/layout/navigation_item.xml
new file mode 100644
index 00000000..581dbb26
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/res/layout/navigation_item.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2017 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.
+-->
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools">
+
+ <android.support.constraint.ConstraintLayout
+ android:id="@+id/navigation_item_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginVertical="@dimen/spacing_micro">
+
+ <android.support.v7.widget.CardView
+ android:id="@+id/cardView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="8dp"
+ android:layout_marginHorizontal="@dimen/activity_horizontal_margin"
+ android:layout_marginVertical="@dimen/spacing_micro"
+ android:clickable="true"
+ android:foreground="?android:attr/selectableItemBackground"
+ app:cardCornerRadius="@dimen/spacing_micro"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/infoButton"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent">
+
+ <TextView
+ android:id="@+id/buttonLabel"
+ style="@style/TextAppearance.AppCompat.Medium"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawablePadding="@dimen/spacing_normal"
+ android:minLines="2"
+ android:paddingHorizontal="@dimen/padding_normal"
+ android:paddingVertical="@dimen/padding_normal"
+ tools:text="@string/navigation_button_edittext_login_label" />
+ </android.support.v7.widget.CardView>
+
+ <com.example.android.autofillframework.app.InfoButton
+ android:id="@+id/infoButton"
+ android:layout_width="wrap_content"
+ android:layout_height="0dp"
+ android:layout_gravity="center"
+ android:layout_marginHorizontal="@dimen/spacing_normal"
+ android:background="@android:color/transparent"
+ android:src="@drawable/ic_info_black_24dp"
+ app:dialogText=""
+ app:layout_constraintBottom_toBottomOf="@+id/cardView"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintTop_toTopOf="@+id/cardView" />
+ </android.support.constraint.ConstraintLayout>
+</merge> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/layout/virtual_login_activity.xml b/input/autofill/AutofillFramework/Application/src/main/res/layout/virtual_login_activity.xml
index bf746ae5..9f49293d 100644
--- a/input/autofill/AutofillFramework/Application/src/main/res/layout/virtual_login_activity.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/res/layout/virtual_login_activity.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,35 +13,78 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:weightSum="100">
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin">
+
+ <TextView
+ android:id="@+id/custom_virtual_login_header"
+ style="@style/TextAppearance.AppCompat.Large"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp"
+ android:gravity="center"
+ android:text="@string/navigation_button_custom_virtual_view_login_label"
+ app:layout_constraintEnd_toStartOf="@+id/imageButton"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="spread"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <com.example.android.autofillframework.app.InfoButton
+ android:id="@+id/imageButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ic_info_black_24dp"
+ app:layout_constraintBottom_toBottomOf="@+id/custom_virtual_login_header"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/custom_virtual_login_header"
+ app:layout_constraintTop_toTopOf="@+id/custom_virtual_login_header"
+ app:dialogText="@string/custom_virtual_login_info"/>
<com.example.android.autofillframework.app.CustomVirtualView
android:id="@+id/custom_view"
android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="50" />
+ android:layout_height="@dimen/custom_view_height"
+ android:layout_marginEnd="8dp"
+ android:layout_marginStart="8dp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/custom_virtual_login_header" />
- <LinearLayout
- android:layout_width="match_parent"
+ <TextView
+ android:id="@+id/clear"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="20dp"
- android:gravity="center"
- android:orientation="horizontal">
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:text="@string/clear_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toStartOf="@+id/login"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/custom_view" />
- <Button
- android:id="@+id/clear"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/clear_label" />
-
- <Button
- android:id="@+id/login"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/login_label" />
- </LinearLayout>
-</LinearLayout>
+ <TextView
+ android:id="@+id/login"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:text="@string/login_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/clear"
+ app:layout_constraintTop_toTopOf="@+id/clear" />
+</android.support.constraint.ConstraintLayout>
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/layout/welcome_activity.xml b/input/autofill/AutofillFramework/Application/src/main/res/layout/welcome_activity.xml
index 4d746c53..4b9c3c99 100644
--- a/input/autofill/AutofillFramework/Application/src/main/res/layout/welcome_activity.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/res/layout/welcome_activity.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,17 +13,25 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin">
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingTop="@dimen/activity_vertical_margin"
+ android:orientation="vertical">
<TextView
- android:layout_width="match_parent"
+ style="@style/TextAppearance.AppCompat.Large"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/welcome_text" />
-</FrameLayout> \ No newline at end of file
+
+ <TextView
+ android:id="@+id/countdownText"
+ style="@style/TextAppearance.AppCompat.Body1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:layout_gravity="center_horizontal" />
+</LinearLayout> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/values/attrs.xml b/input/autofill/AutofillFramework/Application/src/main/res/values/attrs.xml
new file mode 100644
index 00000000..fbc1fb3f
--- /dev/null
+++ b/input/autofill/AutofillFramework/Application/src/main/res/values/attrs.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2017 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.
+-->
+<resources>
+ <declare-styleable name="NavigationItem">
+ <attr name="labelText" format="string" />
+ <attr name="infoText" format="string" />
+ <attr name="itemLogo" format="integer" />
+ <attr name="imageColor" format="reference" />
+ </declare-styleable>
+ <declare-styleable name="InfoButton">
+ <attr name="dialogText" format="string" />
+ </declare-styleable>
+</resources> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/values/dimens.xml b/input/autofill/AutofillFramework/Application/src/main/res/values/dimens.xml
index 961725d5..0827ef5e 100644
--- a/input/autofill/AutofillFramework/Application/src/main/res/values/dimens.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/res/values/dimens.xml
@@ -25,4 +25,6 @@
<dimen name="padding_normal_button">12dp</dimen>
<dimen name="spacing_large">32dp</dimen>
<dimen name="a11y_min_touch_target_dimen">48dp</dimen>
+ <dimen name="text_field_width">250sp</dimen>
+ <dimen name="custom_view_height">150dp</dimen>
</resources>
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/values/strings.xml b/input/autofill/AutofillFramework/Application/src/main/res/values/strings.xml
index 3bda7359..55d96c4c 100644
--- a/input/autofill/AutofillFramework/Application/src/main/res/values/strings.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/res/values/strings.xml
@@ -18,14 +18,16 @@
<resources>
<string name="app_name">Autofill Sample</string>
<string name="settings_name">Autofill Settings</string>
+ <string name="navigation_button_custom_virtual_view_login_label">Sample Login Using a Custom Virtual View</string>
+ <string name="navigation_button_spinners_credit_card_label">Sample Credit Card Check Out Using Spinners</string>
+ <string name="navigation_button_edittext_login_label">Sample Login Using EditTexts</string>
+ <string name="navigation_button_autocomplete_login_label">Sample Login Using AutoCompleteTextViews</string>
<string name="username_label">Username</string>
<string name="password_label">Password</string>
<string name="welcome_text">You have successfully signed in!</string>
<string name="standard_view_sign_in">Sign in using standard views</string>
<string name="standard_view_autocomplete_sign_in">Sign in using standard views that
trigger AutoComplete dialogs when focused</string>
- <string name="virtual_view_sign_in">Sign in using virtual views</string>
- <string name="credit_card_checkout">Credit Card check out</string>
<string name="autofill_sign_in_prompt">Tap to sign in.</string>
<string name="credit_card_number_label">CC Number</string>
<string name="credit_card_expiration_label">CC Exp</string>
@@ -49,7 +51,32 @@
<string name="settings_auth_change_credentials_title">Change credentials</string>
<string name="clear_label">Clear</string>
<string name="login_label">Login</string>
- <string name="master_password_label">Master Password</string>
+ <string name="autofill_master_login_label">Autofill Master Login</string>
+ <string name="submit_label">Submit</string>
+ <string name="edittext_login_info">This is a sample login page that uses standard EditTexts
+ from the UI toolkit. EditTexts are already optimized for autofill so extra autofill-specific
+ code is almost never needed.
+ </string>
+ <string name="autocomplete_login_info">This is a sample login page that uses
+ AutoCompleteTextViews instead of EditTexts. The AutoComplete dialogs can potentially
+ interfere with the Autofill dialogs, so it is necessary to implement the AutofillCallback to
+ disable AutoComplete when Autofill is working.
+ </string>
+ <string name="custom_virtual_login_info">This is a sample login page that uses a custom View with
+ virtual children. Since the Autofill framework does not know how to autofill the virtual
+ children out of the box, it is necessary implement certain Autofill-specific methods and
+ interface directly with AutofillManager.
+ </string>
+ <string name="spinners_credit_card_info">This is a sample credit card checkout page that uses
+ EditTexts and Spinners to input data into the form. While EditTexts are optimized out of the
+ box, Spinners can require a small amount of work when using a custom array adapter.
+ In that case, you need to tell the Autofill framework which values in the adapter map to
+ which indices.
+ </string>
+ <plurals name="welcome_page_countdown">
+ <item quantity="one">Automatically return to main page in %d second.</item>
+ <item quantity="other">Automatically return to main page in %d seconds.</item>
+ </plurals>
<string-array name="month_array">
<item>Jan</item>
<item>Feb</item>
diff --git a/input/autofill/AutofillFramework/Application/src/main/res/values/styles.xml b/input/autofill/AutofillFramework/Application/src/main/res/values/styles.xml
index 92aabaa6..8fe4718f 100644
--- a/input/autofill/AutofillFramework/Application/src/main/res/values/styles.xml
+++ b/input/autofill/AutofillFramework/Application/src/main/res/values/styles.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,12 +14,14 @@
* limitations under the License.
-->
<resources>
+
<style name="Settings.Label" parent="">
<item name="android:ellipsize">end</item>
<item name="android:lines">1</item>
<item name="android:paddingBottom">@dimen/spacing_normal</item>
<item name="android:paddingTop">@dimen/spacing_normal</item>
</style>
+
<style name="Settings.Container" parent="">
<item name="android:background">?android:selectableItemBackground</item>
<item name="android:gravity">center_vertical</item>
@@ -29,6 +30,7 @@
<item name="android:paddingEnd">?android:listPreferredItemPaddingEnd</item>
<item name="android:paddingStart">?android:listPreferredItemPaddingStart</item>
</style>
+
<style name="Settings.Switch" parent="">
<!-- We make the parent view clickable instead for better touch feedback -->
<item name="android:background">@null</item>
diff --git a/input/autofill/AutofillFramework/build.gradle b/input/autofill/AutofillFramework/build.gradle
index d047feac..ea207688 100644
--- a/input/autofill/AutofillFramework/build.gradle
+++ b/input/autofill/AutofillFramework/build.gradle
@@ -7,7 +7,7 @@ buildscript {
}
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.0.0-alpha3'
+ classpath 'com.android.tools.build:gradle:3.0.0-alpha4'
}
}
diff --git a/input/autofill/AutofillFramework/gradle/wrapper/gradle-wrapper.properties b/input/autofill/AutofillFramework/gradle/wrapper/gradle-wrapper.properties
index e54c9fe6..dd1cd8e8 100644
--- a/input/autofill/AutofillFramework/gradle/wrapper/gradle-wrapper.properties
+++ b/input/autofill/AutofillFramework/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Tue May 30 16:12:55 PDT 2017
+#Thu Jun 15 21:21:17 PDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-rc-1-all.zip
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/build.gradle b/input/autofill/AutofillFramework/kotlinApp/Application/build.gradle
index 8e0189d1..236b718a 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/build.gradle
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/build.gradle
@@ -3,9 +3,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
dependencies {
- compile "com.android.support:support-v4:26.0.0-beta2"
- compile "com.android.support:support-v13:26.0.0-beta2"
- compile 'com.android.support:appcompat-v7:26.0.0-beta2'
+ compile "com.android.support:support-v4:26.0.0-beta1"
+ compile "com.android.support:support-v13:26.0.0-beta1"
+ compile 'com.android.support:appcompat-v7:26.0.0-beta1'
+ compile 'com.android.support:cardview-v7:26.0.0-beta1'
+ compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.code.gson:gson:2.8.1'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
@@ -14,11 +16,11 @@ dependencies {
// keep boilerplate and common code separate from
// the main sample code.
List<String> dirs = [
- 'main'] // main sample code; look here for the interesting stuff.
+ 'main'] // main sample code; look here for the interesting stuff.
android {
compileSdkVersion 26
- buildToolsVersion "26.0.0 rc2"
+ buildToolsVersion "26.0.0"
defaultConfig {
minSdkVersion 26
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/AndroidManifest.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/AndroidManifest.xml
index f7aef70b..21d33639 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/AndroidManifest.xml
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/AndroidManifest.xml
@@ -28,7 +28,6 @@
android:theme="@style/Theme.AppCompat.Light">
<activity
android:name=".app.MainActivity"
- android:label="AF Main"
android:taskAffinity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -37,23 +36,19 @@
</activity>
<activity
android:name=".app.StandardSignInActivity"
- android:label="AF StandardLogin"
android:taskAffinity=".StandardSignInActivity">
</activity>
<activity
android:name=".app.StandardAutoCompleteSignInActivity"
- android:label="AF StandardLogin"
android:taskAffinity=".StandardAutoCompleteSignInActivity" />
<activity
android:name=".app.VirtualSignInActivity"
- android:label="AF VirtualLogin"
android:taskAffinity=".VirtualSignInActivity">
</activity>
<activity android:name=".app.WelcomeActivity" />
<activity
android:name=".app.CreditCardActivity"
- android:label="AF CreditCard"
android:taskAffinity=".CreditCardActivity">
</activity>
<!--
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/InfoButton.kt b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/InfoButton.kt
new file mode 100644
index 00000000..3a2c0e3d
--- /dev/null
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/InfoButton.kt
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+package com.example.android.autofillframework.app
+
+import android.content.Context
+import android.support.v7.app.AlertDialog
+import android.support.v7.widget.AppCompatImageButton
+import android.util.AttributeSet
+import com.example.android.autofillframework.R
+
+class InfoButton @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0) : AppCompatImageButton(context, attrs, defStyleAttr) {
+
+ init {
+ val typedArray = context.obtainStyledAttributes(attrs, R.styleable.InfoButton,
+ defStyleAttr, 0)
+ val infoText = typedArray.getString(R.styleable.InfoButton_dialogText)
+ typedArray.recycle()
+ setInfoText(infoText)
+ }
+
+ fun setInfoText(infoText: String) {
+ setOnClickListener {
+ AlertDialog.Builder(this@InfoButton.context)
+ .setMessage(infoText).create().show()
+ }
+ }
+} \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/MainActivity.kt b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/MainActivity.kt
index c7c458d4..3ab4f389 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/MainActivity.kt
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/MainActivity.kt
@@ -17,6 +17,7 @@ package com.example.android.autofillframework.app
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
+import android.view.View
import com.example.android.autofillframework.R
import kotlinx.android.synthetic.main.activity_main.creditCardCheckoutButton
import kotlinx.android.synthetic.main.activity_main.standardLoginWithAutoCompleteButton
@@ -31,10 +32,10 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
- standardViewSignInButton.setOnClickListener { standardViewSignIn() }
- virtualViewSignInButton.setOnClickListener { virtualViewSignIn() }
- creditCardCheckoutButton.setOnClickListener { creditCardCheckout() }
- standardLoginWithAutoCompleteButton.setOnClickListener { standardAutoCompleteSignIn() }
+ standardViewSignInButton.setNavigationButtonClickListener(View.OnClickListener { standardViewSignIn() })
+ virtualViewSignInButton.setNavigationButtonClickListener(View.OnClickListener { virtualViewSignIn() })
+ creditCardCheckoutButton.setNavigationButtonClickListener(View.OnClickListener { creditCardCheckout() })
+ standardLoginWithAutoCompleteButton.setNavigationButtonClickListener(View.OnClickListener { standardAutoCompleteSignIn() })
}
private fun creditCardCheckout() {
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/NavigationItem.kt b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/NavigationItem.kt
new file mode 100644
index 00000000..0701e146
--- /dev/null
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/NavigationItem.kt
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+package com.example.android.autofillframework.app
+
+import android.content.Context
+import android.graphics.PorterDuff
+import android.support.annotation.ColorRes
+import android.support.v4.content.ContextCompat
+import android.support.v7.app.AlertDialog
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.view.View
+import android.widget.FrameLayout
+import com.example.android.autofillframework.R
+import kotlinx.android.synthetic.main.navigation_item.view.buttonLabel
+import kotlinx.android.synthetic.main.navigation_item.view.cardView
+import kotlinx.android.synthetic.main.navigation_item.view.infoButton
+
+class NavigationItem @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0) : FrameLayout(context, attrs, defStyleAttr) {
+
+ init {
+ val typedArray = context.obtainStyledAttributes(attrs, R.styleable.NavigationItem,
+ defStyleAttr, 0)
+ val labelText = typedArray.getString(R.styleable.NavigationItem_labelText)
+ val infoText = typedArray.getString(R.styleable.NavigationItem_infoText)
+ val logoDrawable = typedArray.getDrawable(R.styleable.NavigationItem_itemLogo)
+ @ColorRes val colorRes = typedArray.getResourceId(R.styleable.NavigationItem_imageColor, 0)
+ val imageColor = ContextCompat.getColor(getContext(), colorRes)
+ typedArray.recycle()
+ LayoutInflater.from(context).inflate(R.layout.navigation_item, this)
+ logoDrawable?.setColorFilter(imageColor, PorterDuff.Mode.SRC_IN)
+ buttonLabel.text = labelText
+ buttonLabel.setCompoundDrawablesRelativeWithIntrinsicBounds(logoDrawable, null, null, null)
+ infoButton.setOnClickListener {
+ AlertDialog.Builder(this@NavigationItem.context)
+ .setMessage(infoText).create().show()
+ }
+ infoButton.setColorFilter(imageColor)
+ }
+
+ fun setNavigationButtonClickListener(l: View.OnClickListener?) {
+ cardView.setOnClickListener(l)
+ }
+}
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/WelcomeActivity.kt b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/WelcomeActivity.kt
index bdcfef2e..db8bf679 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/WelcomeActivity.kt
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/app/WelcomeActivity.kt
@@ -18,14 +18,34 @@ package com.example.android.autofillframework.app
import android.content.Context
import android.content.Intent
import android.os.Bundle
+import android.os.CountDownTimer
import android.support.v7.app.AppCompatActivity
import com.example.android.autofillframework.R
+import kotlinx.android.synthetic.main.welcome_activity.countdownText
+import java.lang.Math.toIntExact
+
class WelcomeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.welcome_activity)
+ object : CountDownTimer(5000, 1000) {
+
+ override fun onTick(millisUntilFinished: Long) {
+ val secondsRemaining = toIntExact(millisUntilFinished / 1000)
+ countdownText.text = getResources()
+ .getQuantityString(R.plurals.welcome_page_countdown, secondsRemaining,
+ secondsRemaining)
+ }
+
+ override fun onFinish() {
+ if (!this@WelcomeActivity.isFinishing) {
+ finish()
+ }
+ }
+
+ }.start()
}
companion object {
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/StructureParser.kt b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/StructureParser.kt
index d1bbc9c1..f185b8ea 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/StructureParser.kt
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/StructureParser.kt
@@ -19,8 +19,8 @@ import android.app.assist.AssistStructure
import android.app.assist.AssistStructure.ViewNode
import android.util.Log
import com.example.android.autofillframework.CommonUtil.TAG
-import com.example.android.autofillframework.multidatasetservice.model.FilledAutofillFieldCollection
import com.example.android.autofillframework.multidatasetservice.model.FilledAutofillField
+import com.example.android.autofillframework.multidatasetservice.model.FilledAutofillFieldCollection
/**
* Parser for an AssistStructure object. This is invoked when the Autofill Service receives an
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillFieldCollection.kt b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillFieldCollection.kt
index 032e1251..2de46809 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillFieldCollection.kt
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/model/FilledAutofillFieldCollection.kt
@@ -22,7 +22,6 @@ import android.view.autofill.AutofillId
import android.view.autofill.AutofillValue
import com.example.android.autofillframework.CommonUtil.TAG
import com.example.android.autofillframework.multidatasetservice.AutofillFieldMetadataCollection
-import com.example.android.autofillframework.multidatasetservice.AutofillHelper
import com.google.gson.annotations.Expose
import java.util.HashMap
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_autocomplete_logo_24dp.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_autocomplete_logo_24dp.xml
new file mode 100644
index 00000000..80f30a2f
--- /dev/null
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_autocomplete_logo_24dp.xml
@@ -0,0 +1,24 @@
+<!--
+ * Copyright (C) 2017 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M20,2L4,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h14l4,4L22,4c0,-1.1 -0.9,-2 -2,-2zM18,14L6,14v-2h12v2zM18,11L6,11L6,9h12v2zM18,8L6,8L6,6h12v2z"/>
+</vector>
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_custom_virtual_logo_24dp.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_custom_virtual_logo_24dp.xml
new file mode 100644
index 00000000..3a8ee3b2
--- /dev/null
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_custom_virtual_logo_24dp.xml
@@ -0,0 +1,24 @@
+<!--
+ * Copyright (C) 2017 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M13,7h-2v2h2L13,7zM13,11h-2v2h2v-2zM17,11h-2v2h2v-2zM3,3v18h18L21,3L3,3zM19,19L5,19L5,5h14v14zM13,15h-2v2h2v-2zM9,11L7,11v2h2v-2z"/>
+</vector>
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_edittexts_logo_24dp.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_edittexts_logo_24dp.xml
new file mode 100644
index 00000000..17e403d9
--- /dev/null
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_edittexts_logo_24dp.xml
@@ -0,0 +1,24 @@
+<!--
+ * Copyright (C) 2017 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M4,9h16v2L4,11zM4,13h10v2L4,15z"/>
+</vector>
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_info_black_24dp.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_info_black_24dp.xml
new file mode 100644
index 00000000..c297121b
--- /dev/null
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_info_black_24dp.xml
@@ -0,0 +1,24 @@
+<!--
+ * Copyright (C) 2017 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
+</vector>
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_lock_black_24dp.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_lock_black_24dp.xml
index 67a7c73a..6b2f014d 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_lock_black_24dp.xml
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_lock_black_24dp.xml
@@ -1,3 +1,18 @@
+<!--
+ * Copyright (C) 2017 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.
+-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_spinners_logo_24dp.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_spinners_logo_24dp.xml
new file mode 100644
index 00000000..5fb27a24
--- /dev/null
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/drawable/ic_spinners_logo_24dp.xml
@@ -0,0 +1,24 @@
+<!--
+ * Copyright (C) 2017 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M9,11L7,11v2h2v-2zM13,11h-2v2h2v-2zM17,11h-2v2h2v-2zM19,4h-1L18,2h-2v2L8,4L8,2L6,2v2L5,4c-1.11,0 -1.99,0.9 -1.99,2L3,20c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,6c0,-1.1 -0.9,-2 -2,-2zM19,20L5,20L5,9h14v11z"/>
+</vector>
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/activity_main.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/activity_main.xml
index b2510b07..2043dd1d 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/activity_main.xml
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/activity_main.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,39 +13,55 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingStart="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin">
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
- <Button
- android:id="@+id/standardViewSignInButton"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/standard_view_sign_in" />
+ android:orientation="vertical"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingEnd="@dimen/activity_horizontal_margin"
+ android:paddingStart="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin">
- <Button
- android:id="@+id/standardLoginWithAutoCompleteButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/standard_view_autocomplete_sign_in"/>
+ <com.example.android.autofillframework.app.NavigationItem
+ android:id="@+id/standardViewSignInButton"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:infoText="@string/edittext_login_info"
+ app:labelText="@string/navigation_button_edittext_login_label"
+ app:itemLogo="@drawable/ic_edittexts_logo_24dp"
+ app:imageColor="@android:color/holo_red_dark" />
- <Button
- android:id="@+id/virtualViewSignInButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/activity_vertical_margin"
- android:text="@string/virtual_view_sign_in" />
+ <com.example.android.autofillframework.app.NavigationItem
+ android:id="@+id/standardLoginWithAutoCompleteButton"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:infoText="@string/autocomplete_login_info"
+ app:labelText="@string/navigation_button_autocomplete_login_label"
+ app:itemLogo="@drawable/ic_autocomplete_logo_24dp"
+ app:imageColor="@android:color/holo_blue_dark"/>
- <Button
- android:id="@+id/creditCardCheckoutButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/activity_vertical_margin"
- android:text="@string/credit_card_checkout" />
+ <com.example.android.autofillframework.app.NavigationItem
+ android:id="@+id/virtualViewSignInButton"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:infoText="@string/custom_virtual_login_info"
+ app:labelText="@string/navigation_button_custom_virtual_view_login_label"
+ app:itemLogo="@drawable/ic_custom_virtual_logo_24dp"
+ app:imageColor="@android:color/holo_green_dark"/>
+
+ <com.example.android.autofillframework.app.NavigationItem
+ android:id="@+id/creditCardCheckoutButton"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:infoText="@string/spinners_credit_card_info"
+ app:labelText="@string/navigation_button_spinners_credit_card_label"
+ app:itemLogo="@drawable/ic_spinners_logo_24dp"
+ app:imageColor="@android:color/holo_orange_dark"/>
-</LinearLayout> \ No newline at end of file
+ </LinearLayout>
+</ScrollView> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/credit_card_activity.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/credit_card_activity.xml
index 7d8e099f..7f78c4e4 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/credit_card_activity.xml
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/credit_card_activity.xml
@@ -14,95 +14,136 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/standardLoginLayout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:focusable="true"
- android:focusableInTouchMode="true"
- android:orientation="vertical"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin">
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin">
- <RelativeLayout
- android:layout_width="wrap_content"
+ <TextView
+ android:id="@+id/spinners_credit_card_header"
+ style="@style/TextAppearance.AppCompat.Large"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_gravity="center">
-
- <TextView
- android:id="@+id/creditCardNumberLabel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="20dp"
- android:importantForAutofill="no"
- android:text="@string/credit_card_number_label" />
-
- <EditText
- android:id="@+id/creditCardNumberField"
- android:layout_width="200sp"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/creditCardNumberLabel"
- android:layout_toEndOf="@id/creditCardNumberLabel"
- android:autofillHints="creditCardNumber" />
-
- <TextView
- android:id="@+id/creditCardExpirationLabel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignStart="@+id/creditCardNumberLabel"
- android:layout_below="@+id/creditCardNumberLabel"
- android:layout_marginTop="20dp"
- android:importantForAutofill="no"
- android:text="@string/credit_card_expiration_label" />
+ android:layout_marginTop="8dp"
+ android:gravity="center"
+ android:text="@string/navigation_button_spinners_credit_card_label"
+ app:layout_constraintEnd_toStartOf="@+id/imageButton"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="spread"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/creditCardExpirationLabel"
- android:layout_alignStart="@+id/creditCardNumberField"
- android:orientation="horizontal">
+ <com.example.android.autofillframework.app.InfoButton
+ android:id="@+id/imageButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ic_info_black_24dp"
+ app:layout_constraintBottom_toBottomOf="@+id/spinners_credit_card_header"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/spinners_credit_card_header"
+ app:layout_constraintTop_toTopOf="@+id/spinners_credit_card_header"
+ app:dialogText="@string/spinners_credit_card_info" />
- <Spinner
- android:id="@+id/expirationDay"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:autofillHints="creditCardExpirationDay" />
+ <TextView
+ android:id="@+id/creditCardNumberLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:importantForAutofill="no"
+ android:labelFor="@+id/creditCardNumberField"
+ android:text="@string/credit_card_number_label"
+ app:layout_constraintStart_toStartOf="@+id/creditCardExpirationLabel"
+ app:layout_constraintTop_toBottomOf="@+id/spinners_credit_card_header" />
- <Spinner
- android:id="@+id/expirationMonth"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:autofillHints="creditCardExpirationMonth" />
+ <EditText
+ android:id="@+id/creditCardNumberField"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/creditCardNumberLabel"
+ android:layout_marginEnd="8dp"
+ android:autofillHints="creditCardNumber"
+ android:focusedByDefault="true"
+ android:inputType="number"
+ app:layout_constraintBottom_toBottomOf="@+id/creditCardNumberLabel"
+ app:layout_constraintEnd_toEndOf="@+id/expirationYear"
+ app:layout_constraintStart_toStartOf="@+id/expirationDay"
+ app:layout_constraintTop_toTopOf="@+id/creditCardNumberLabel" />
- <Spinner
- android:id="@+id/expirationYear"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:autofillHints="creditCardExpirationYear" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/creditCardExpirationLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:importantForAutofill="no"
+ android:text="@string/credit_card_expiration_label"
+ app:layout_constraintEnd_toStartOf="@+id/expirationDay"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/creditCardNumberLabel" />
- </RelativeLayout>
+ <Spinner
+ android:id="@+id/expirationDay"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:autofillHints="creditCardExpirationDay"
+ app:layout_constraintBottom_toBottomOf="@+id/creditCardExpirationLabel"
+ app:layout_constraintEnd_toStartOf="@+id/expirationMonth"
+ app:layout_constraintStart_toEndOf="@+id/creditCardNumberLabel"
+ app:layout_constraintTop_toTopOf="@+id/creditCardExpirationLabel" />
- <LinearLayout
- android:layout_width="match_parent"
+ <Spinner
+ android:id="@+id/expirationMonth"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="20dp"
- android:gravity="center"
- android:orientation="horizontal">
+ android:autofillHints="creditCardExpirationMonth"
+ app:layout_constraintBottom_toBottomOf="@+id/expirationDay"
+ app:layout_constraintEnd_toStartOf="@+id/expirationYear"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/expirationDay"
+ app:layout_constraintTop_toTopOf="@+id/expirationDay" />
- <Button
- android:id="@+id/clear"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Clear" />
+ <Spinner
+ android:id="@+id/expirationYear"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:autofillHints="creditCardExpirationYear"
+ app:layout_constraintBottom_toBottomOf="@+id/expirationMonth"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/expirationMonth"
+ app:layout_constraintTop_toTopOf="@+id/expirationMonth" />
- <Button
- android:id="@+id/submit"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Submit" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/clear"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:text="@string/clear_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toStartOf="@+id/submit"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/creditCardExpirationLabel" />
-</LinearLayout> \ No newline at end of file
+ <TextView
+ android:id="@+id/submit"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:text="@string/submit_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/clear"
+ app:layout_constraintTop_toTopOf="@+id/clear" />
+</android.support.constraint.ConstraintLayout> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/login_activity.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/login_activity.xml
index f9f5657d..1bbac855 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/login_activity.xml
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/login_activity.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,78 +13,131 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/standardLoginLayout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:focusable="true"
- android:focusableInTouchMode="true"
- android:orientation="vertical"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin">
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/authLayout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin" >
- <RelativeLayout
- android:layout_width="wrap_content"
+ <TextView
+ android:id="@+id/standard_login_header"
+ style="@style/TextAppearance.AppCompat.Large"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_gravity="center">
+ android:layout_marginTop="8dp"
+ android:text="@string/navigation_button_edittext_login_label"
+ android:gravity="center"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/imageButton"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="spread"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
- <TextView
- android:id="@+id/usernameLabel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="20dp"
- android:importantForAutofill="no"
- android:text="@string/username_label" />
+ <com.example.android.autofillframework.app.InfoButton
+ android:id="@+id/imageButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:background="@drawable/ic_info_black_24dp"
+ app:layout_constraintBottom_toBottomOf="@+id/standard_login_header"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/standard_login_header"
+ app:layout_constraintTop_toTopOf="@+id/standard_login_header"
+ app:dialogText="@string/edittext_login_info"/>
- <EditText
- android:id="@+id/usernameField"
- android:layout_width="200sp"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/usernameLabel"
- android:layout_toEndOf="@id/usernameLabel"
- android:autofillHints="username"
- android:inputType="textPersonName" />
+ <TextView
+ android:id="@+id/usernameLabel"
+ style="@style/TextAppearance.AppCompat.Body1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:labelFor="@+id/usernameField"
+ android:text="@string/username_label"
+ app:layout_constraintEnd_toStartOf="@+id/usernameField"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/standard_login_header" />
- <TextView
- android:id="@+id/passwordLabel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignStart="@+id/usernameLabel"
- android:layout_below="@+id/usernameLabel"
- android:layout_marginTop="20dp"
- android:importantForAutofill="no"
- android:text="@string/password_label" />
+ <EditText
+ android:id="@+id/usernameField"
+ android:layout_width="@dimen/text_field_width"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:autofillHints="username"
+ android:inputType="text"
+ app:layout_constraintBottom_toBottomOf="@+id/usernameLabel"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/usernameLabel"
+ app:layout_constraintTop_toTopOf="@+id/usernameLabel" />
- <EditText
- android:id="@+id/passwordField"
- android:layout_width="200sp"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/passwordLabel"
- android:layout_alignStart="@+id/usernameField"
- android:autofillHints="password"
- android:inputType="textPassword" />
- </RelativeLayout>
+ <TextView
+ android:id="@+id/passwordLabel"
+ style="@style/TextAppearance.AppCompat.Body1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:labelFor="@+id/passwordField"
+ android:text="@string/password_label"
+ app:layout_constraintEnd_toStartOf="@+id/passwordField"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/usernameLabel" />
- <LinearLayout
- android:layout_width="match_parent"
+ <EditText
+ android:id="@+id/passwordField"
+ android:layout_width="@dimen/text_field_width"
android:layout_height="wrap_content"
- android:layout_marginTop="20dp"
- android:gravity="center"
- android:orientation="horizontal">
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:autofillHints="password"
+ android:inputType="textPassword"
+ app:layout_constraintBottom_toBottomOf="@+id/passwordLabel"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/passwordLabel"
+ app:layout_constraintTop_toTopOf="@+id/passwordLabel" />
- <Button
- android:id="@+id/clear"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/clear_label" />
+ <TextView
+ android:id="@+id/clear"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:text="@string/clear_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toStartOf="@+id/login"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/passwordField" />
- <Button
- android:id="@+id/login"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/login_label" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/login"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:text="@string/login_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/clear"
+ app:layout_constraintTop_toTopOf="@+id/clear" />
-</LinearLayout> \ No newline at end of file
+</android.support.constraint.ConstraintLayout> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/login_with_autocomplete_activity.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/login_with_autocomplete_activity.xml
index 1906790a..a7efa42e 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/login_with_autocomplete_activity.xml
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/login_with_autocomplete_activity.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,80 +13,128 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/standardLoginLayout"
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/authLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:focusable="true"
- android:focusableInTouchMode="true"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin">
+ android:paddingTop="@dimen/activity_vertical_margin" >
- <RelativeLayout
- android:layout_width="wrap_content"
+ <TextView
+ android:id="@+id/standard_login_header"
+ style="@style/TextAppearance.AppCompat.Large"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_gravity="center">
+ android:layout_marginTop="8dp"
+ android:gravity="center"
+ android:text="@string/navigation_button_autocomplete_login_label"
+ app:layout_constraintEnd_toStartOf="@+id/imageButton"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="spread"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
- <TextView
- android:id="@+id/usernameLabel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="20dp"
- android:importantForAutofill="no"
- android:labelFor="@+id/usernameField"
- android:text="@string/username_label" />
+ <com.example.android.autofillframework.app.InfoButton
+ android:id="@+id/imageButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ic_info_black_24dp"
+ app:layout_constraintBottom_toBottomOf="@+id/standard_login_header"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/standard_login_header"
+ app:layout_constraintTop_toTopOf="@+id/standard_login_header"
+ app:dialogText="@string/autocomplete_login_info"/>
- <AutoCompleteTextView
- android:id="@+id/usernameField"
- android:layout_width="200sp"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/usernameLabel"
- android:layout_toEndOf="@id/usernameLabel"
- android:autofillHints="username"
- android:inputType="textPersonName" />
+ <TextView
+ android:id="@+id/usernameLabel"
+ style="@style/TextAppearance.AppCompat.Body1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:labelFor="@+id/usernameField"
+ android:text="@string/username_label"
+ app:layout_constraintEnd_toStartOf="@+id/usernameField"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/standard_login_header" />
- <TextView
- android:id="@+id/passwordLabel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignStart="@+id/usernameLabel"
- android:layout_below="@+id/usernameLabel"
- android:layout_marginTop="20dp"
- android:importantForAutofill="no"
- android:text="@string/password_label"
- android:labelFor="@+id/passwordField"/>
+ <AutoCompleteTextView
+ android:id="@+id/usernameField"
+ android:layout_width="@dimen/text_field_width"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:autofillHints="username"
+ android:inputType="text"
+ app:layout_constraintBottom_toBottomOf="@+id/usernameLabel"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/usernameLabel"
+ app:layout_constraintTop_toTopOf="@+id/usernameLabel" />
- <EditText
- android:id="@+id/passwordField"
- android:layout_width="200sp"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/passwordLabel"
- android:layout_alignStart="@+id/usernameField"
- android:autofillHints="password"
- android:inputType="textPassword" />
- </RelativeLayout>
+ <TextView
+ android:id="@+id/passwordLabel"
+ style="@style/TextAppearance.AppCompat.Body1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:labelFor="@+id/passwordField"
+ android:text="@string/password_label"
+ app:layout_constraintEnd_toStartOf="@+id/passwordField"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/usernameLabel" />
- <LinearLayout
- android:layout_width="match_parent"
+ <AutoCompleteTextView
+ android:id="@+id/passwordField"
+ android:layout_width="@dimen/text_field_width"
android:layout_height="wrap_content"
- android:layout_marginTop="20dp"
- android:gravity="center"
- android:orientation="horizontal">
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:autofillHints="password"
+ android:inputType="textPassword"
+ app:layout_constraintBottom_toBottomOf="@+id/passwordLabel"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/passwordLabel"
+ app:layout_constraintTop_toTopOf="@+id/passwordLabel" />
- <Button
- android:id="@+id/clear"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Clear" />
+ <TextView
+ android:id="@+id/clear"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:text="@string/cancel"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toStartOf="@+id/login"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/passwordField" />
- <Button
- android:id="@+id/login"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Login" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/login"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:text="@string/login_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/clear"
+ app:layout_constraintTop_toTopOf="@+id/clear" />
-</LinearLayout> \ No newline at end of file
+</android.support.constraint.ConstraintLayout> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/multidataset_service_auth_activity.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/multidataset_service_auth_activity.xml
index 029db191..981dd0d8 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/multidataset_service_auth_activity.xml
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/multidataset_service_auth_activity.xml
@@ -13,7 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/authLayout"
android:layout_width="match_parent"
@@ -27,34 +28,72 @@
tools:context=".multidatasetservice.AuthActivity">
<TextView
+ android:id="@+id/master_login_header"
+ style="@style/TextAppearance.AppCompat.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:text="@string/master_password_label" />
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:text="@string/autofill_master_login_label"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <TextView
+ android:id="@+id/password_label"
+ style="@style/TextAppearance.AppCompat.Body1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:labelFor="@+id/master_password"
+ android:text="@string/password_label"
+ app:layout_constraintEnd_toStartOf="@+id/master_password"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/master_login_header" />
<EditText
android:id="@+id/master_password"
- android:layout_width="match_parent"
+ android:layout_width="@dimen/text_field_width"
android:layout_height="wrap_content"
- android:inputType="textPassword" />
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:inputType="textPassword"
+ app:layout_constraintBottom_toBottomOf="@+id/password_label"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/password_label"
+ app:layout_constraintTop_toTopOf="@+id/password_label" />
- <LinearLayout
- android:layout_width="match_parent"
+ <TextView
+ android:id="@+id/cancel"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="horizontal">
-
- <Button
- android:id="@+id/cancel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/cancel" />
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:text="@string/cancel"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toStartOf="@+id/login"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/master_password" />
- <Button
- android:id="@+id/login"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/login_label" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/login"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:text="@string/login_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/cancel"
+ app:layout_constraintTop_toTopOf="@+id/cancel" />
-</LinearLayout> \ No newline at end of file
+</android.support.constraint.ConstraintLayout> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/multidataset_service_list_item.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/multidataset_service_list_item.xml
index fe51953e..442d54e7 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/multidataset_service_list_item.xml
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/multidataset_service_list_item.xml
@@ -16,13 +16,13 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:background="@android:color/white"
android:orientation="horizontal">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:background="#ffffffff"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
@@ -34,5 +34,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
- android:src="@drawable/ic_person_black_24dp"/>
+ android:layout_marginEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:src="@drawable/ic_person_black_24dp" />
</LinearLayout> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/navigation_button.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/navigation_button.xml
new file mode 100644
index 00000000..a0dba902
--- /dev/null
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/navigation_button.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2017 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.
+-->
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools">
+ <LinearLayout
+ android:id="@+id/navigation_button_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <ImageButton
+ android:id="@+id/infoButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_marginHorizontal="@dimen/activity_horizontal_margin"
+ android:layout_marginVertical="@dimen/activity_vertical_margin"
+ android:background="@drawable/ic_info_black_24dp" />
+
+ <TextView
+ style="@style/TextAppearance.AppCompat.Medium"
+ android:id="@+id/buttonLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:minLines="2"
+ android:layout_marginHorizontal="@dimen/activity_horizontal_margin"
+ android:layout_marginVertical="@dimen/activity_vertical_margin"
+ tools:text="@string/navigation_button_edittext_login_label" />
+ </LinearLayout>
+</merge> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/navigation_item.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/navigation_item.xml
new file mode 100644
index 00000000..581dbb26
--- /dev/null
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/navigation_item.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2017 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.
+-->
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools">
+
+ <android.support.constraint.ConstraintLayout
+ android:id="@+id/navigation_item_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginVertical="@dimen/spacing_micro">
+
+ <android.support.v7.widget.CardView
+ android:id="@+id/cardView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="8dp"
+ android:layout_marginHorizontal="@dimen/activity_horizontal_margin"
+ android:layout_marginVertical="@dimen/spacing_micro"
+ android:clickable="true"
+ android:foreground="?android:attr/selectableItemBackground"
+ app:cardCornerRadius="@dimen/spacing_micro"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/infoButton"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent">
+
+ <TextView
+ android:id="@+id/buttonLabel"
+ style="@style/TextAppearance.AppCompat.Medium"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawablePadding="@dimen/spacing_normal"
+ android:minLines="2"
+ android:paddingHorizontal="@dimen/padding_normal"
+ android:paddingVertical="@dimen/padding_normal"
+ tools:text="@string/navigation_button_edittext_login_label" />
+ </android.support.v7.widget.CardView>
+
+ <com.example.android.autofillframework.app.InfoButton
+ android:id="@+id/infoButton"
+ android:layout_width="wrap_content"
+ android:layout_height="0dp"
+ android:layout_gravity="center"
+ android:layout_marginHorizontal="@dimen/spacing_normal"
+ android:background="@android:color/transparent"
+ android:src="@drawable/ic_info_black_24dp"
+ app:dialogText=""
+ app:layout_constraintBottom_toBottomOf="@+id/cardView"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintTop_toTopOf="@+id/cardView" />
+ </android.support.constraint.ConstraintLayout>
+</merge> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/virtual_login_activity.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/virtual_login_activity.xml
index 28600084..9f49293d 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/virtual_login_activity.xml
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/virtual_login_activity.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,35 +13,78 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:orientation="vertical"
- android:weightSum="100">
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin">
+
+ <TextView
+ android:id="@+id/custom_virtual_login_header"
+ style="@style/TextAppearance.AppCompat.Large"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp"
+ android:gravity="center"
+ android:text="@string/navigation_button_custom_virtual_view_login_label"
+ app:layout_constraintEnd_toStartOf="@+id/imageButton"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="spread"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <com.example.android.autofillframework.app.InfoButton
+ android:id="@+id/imageButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ic_info_black_24dp"
+ app:layout_constraintBottom_toBottomOf="@+id/custom_virtual_login_header"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/custom_virtual_login_header"
+ app:layout_constraintTop_toTopOf="@+id/custom_virtual_login_header"
+ app:dialogText="@string/custom_virtual_login_info"/>
<com.example.android.autofillframework.app.CustomVirtualView
android:id="@+id/custom_view"
android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="50" />
+ android:layout_height="@dimen/custom_view_height"
+ android:layout_marginEnd="8dp"
+ android:layout_marginStart="8dp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/custom_virtual_login_header" />
- <LinearLayout
- android:layout_width="match_parent"
+ <TextView
+ android:id="@+id/clear"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="20dp"
- android:gravity="center"
- android:orientation="horizontal">
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:layout_marginTop="@dimen/spacing_normal"
+ android:text="@string/clear_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toStartOf="@+id/login"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/custom_view" />
- <Button
- android:id="@+id/clear"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/clear_label" />
-
- <Button
- android:id="@+id/login"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/login_label" />
- </LinearLayout>
-</LinearLayout> \ No newline at end of file
+ <TextView
+ android:id="@+id/login"
+ style="@style/Widget.AppCompat.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/spacing_normal"
+ android:layout_marginStart="@dimen/spacing_normal"
+ android:text="@string/login_label"
+ android:textColor="@android:color/holo_blue_dark"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/clear"
+ app:layout_constraintTop_toTopOf="@+id/clear" />
+</android.support.constraint.ConstraintLayout>
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/welcome_activity.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/welcome_activity.xml
index 4d746c53..4b9c3c99 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/welcome_activity.xml
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/layout/welcome_activity.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,17 +13,25 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin">
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingTop="@dimen/activity_vertical_margin"
+ android:orientation="vertical">
<TextView
- android:layout_width="match_parent"
+ style="@style/TextAppearance.AppCompat.Large"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/welcome_text" />
-</FrameLayout> \ No newline at end of file
+
+ <TextView
+ android:id="@+id/countdownText"
+ style="@style/TextAppearance.AppCompat.Body1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/spacing_large"
+ android:layout_gravity="center_horizontal" />
+</LinearLayout> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/attrs.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/attrs.xml
new file mode 100644
index 00000000..fbc1fb3f
--- /dev/null
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/attrs.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2017 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.
+-->
+<resources>
+ <declare-styleable name="NavigationItem">
+ <attr name="labelText" format="string" />
+ <attr name="infoText" format="string" />
+ <attr name="itemLogo" format="integer" />
+ <attr name="imageColor" format="reference" />
+ </declare-styleable>
+ <declare-styleable name="InfoButton">
+ <attr name="dialogText" format="string" />
+ </declare-styleable>
+</resources> \ No newline at end of file
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/dimens.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/dimens.xml
index 961725d5..0827ef5e 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/dimens.xml
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/dimens.xml
@@ -25,4 +25,6 @@
<dimen name="padding_normal_button">12dp</dimen>
<dimen name="spacing_large">32dp</dimen>
<dimen name="a11y_min_touch_target_dimen">48dp</dimen>
+ <dimen name="text_field_width">250sp</dimen>
+ <dimen name="custom_view_height">150dp</dimen>
</resources>
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/strings.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/strings.xml
index 445e435a..55d96c4c 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/strings.xml
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/strings.xml
@@ -18,14 +18,16 @@
<resources>
<string name="app_name">Autofill Sample</string>
<string name="settings_name">Autofill Settings</string>
+ <string name="navigation_button_custom_virtual_view_login_label">Sample Login Using a Custom Virtual View</string>
+ <string name="navigation_button_spinners_credit_card_label">Sample Credit Card Check Out Using Spinners</string>
+ <string name="navigation_button_edittext_login_label">Sample Login Using EditTexts</string>
+ <string name="navigation_button_autocomplete_login_label">Sample Login Using AutoCompleteTextViews</string>
<string name="username_label">Username</string>
<string name="password_label">Password</string>
<string name="welcome_text">You have successfully signed in!</string>
<string name="standard_view_sign_in">Sign in using standard views</string>
<string name="standard_view_autocomplete_sign_in">Sign in using standard views that
trigger AutoComplete dialogs when focused</string>
- <string name="virtual_view_sign_in">Sign in using virtual views</string>
- <string name="credit_card_checkout">Credit Card check out</string>
<string name="autofill_sign_in_prompt">Tap to sign in.</string>
<string name="credit_card_number_label">CC Number</string>
<string name="credit_card_expiration_label">CC Exp</string>
@@ -49,7 +51,32 @@
<string name="settings_auth_change_credentials_title">Change credentials</string>
<string name="clear_label">Clear</string>
<string name="login_label">Login</string>
- <string name="master_password_label">Master Password</string>
+ <string name="autofill_master_login_label">Autofill Master Login</string>
+ <string name="submit_label">Submit</string>
+ <string name="edittext_login_info">This is a sample login page that uses standard EditTexts
+ from the UI toolkit. EditTexts are already optimized for autofill so extra autofill-specific
+ code is almost never needed.
+ </string>
+ <string name="autocomplete_login_info">This is a sample login page that uses
+ AutoCompleteTextViews instead of EditTexts. The AutoComplete dialogs can potentially
+ interfere with the Autofill dialogs, so it is necessary to implement the AutofillCallback to
+ disable AutoComplete when Autofill is working.
+ </string>
+ <string name="custom_virtual_login_info">This is a sample login page that uses a custom View with
+ virtual children. Since the Autofill framework does not know how to autofill the virtual
+ children out of the box, it is necessary implement certain Autofill-specific methods and
+ interface directly with AutofillManager.
+ </string>
+ <string name="spinners_credit_card_info">This is a sample credit card checkout page that uses
+ EditTexts and Spinners to input data into the form. While EditTexts are optimized out of the
+ box, Spinners can require a small amount of work when using a custom array adapter.
+ In that case, you need to tell the Autofill framework which values in the adapter map to
+ which indices.
+ </string>
+ <plurals name="welcome_page_countdown">
+ <item quantity="one">Automatically return to main page in %d second.</item>
+ <item quantity="other">Automatically return to main page in %d seconds.</item>
+ </plurals>
<string-array name="month_array">
<item>Jan</item>
<item>Feb</item>
@@ -103,4 +130,4 @@
<item>user-2</item>
</string-array>
-</resources> \ No newline at end of file
+</resources>
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/styles.xml b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/styles.xml
index 92aabaa6..8fe4718f 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/styles.xml
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/res/values/styles.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,12 +14,14 @@
* limitations under the License.
-->
<resources>
+
<style name="Settings.Label" parent="">
<item name="android:ellipsize">end</item>
<item name="android:lines">1</item>
<item name="android:paddingBottom">@dimen/spacing_normal</item>
<item name="android:paddingTop">@dimen/spacing_normal</item>
</style>
+
<style name="Settings.Container" parent="">
<item name="android:background">?android:selectableItemBackground</item>
<item name="android:gravity">center_vertical</item>
@@ -29,6 +30,7 @@
<item name="android:paddingEnd">?android:listPreferredItemPaddingEnd</item>
<item name="android:paddingStart">?android:listPreferredItemPaddingStart</item>
</style>
+
<style name="Settings.Switch" parent="">
<!-- We make the parent view clickable instead for better touch feedback -->
<item name="android:background">@null</item>
diff --git a/input/autofill/AutofillFramework/kotlinApp/build.gradle b/input/autofill/AutofillFramework/kotlinApp/build.gradle
index de48679d..d3caf113 100644
--- a/input/autofill/AutofillFramework/kotlinApp/build.gradle
+++ b/input/autofill/AutofillFramework/kotlinApp/build.gradle
@@ -7,7 +7,7 @@ buildscript {
}
ext.kotlin_version = '1.1.2-4'
dependencies {
- classpath 'com.android.tools.build:gradle:3.0.0-alpha3'
+ classpath 'com.android.tools.build:gradle:3.0.0-alpha4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
diff --git a/input/autofill/AutofillFramework/kotlinApp/gradle/wrapper/gradle-wrapper.properties b/input/autofill/AutofillFramework/kotlinApp/gradle/wrapper/gradle-wrapper.properties
index a780f86e..97b77f9f 100644
--- a/input/autofill/AutofillFramework/kotlinApp/gradle/wrapper/gradle-wrapper.properties
+++ b/input/autofill/AutofillFramework/kotlinApp/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Tue May 30 14:00:16 PDT 2017
+#Thu Jun 15 21:15:38 PDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-rc-1-all.zip