aboutsummaryrefslogtreecommitdiff
path: root/input/autofill/AutofillFramework/kotlinApp/Application/src
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/autofill/AutofillFramework/kotlinApp/Application/src
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/autofill/AutofillFramework/kotlinApp/Application/src')
-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
27 files changed, 978 insertions, 316 deletions
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>