Add new auto-login UI.
When the WebView notifies us of an auto-login request, check if the account is
valid. If so, use it to log into the account manager. If that fails or the
account is not valid, display the login UI.
Bug: 3367381
Change-Id: I5a164ef676921eec03a89860fa5be722d3d987d4
diff --git a/res/anim/autologin_enter.xml b/res/anim/autologin_enter.xml
new file mode 100644
index 0000000..45e5204
--- /dev/null
+++ b/res/anim/autologin_enter.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<translate xmlns:android="http://schemas.android.com/apk/res/android"
+ android:fromYDelta="-100%" android:toYDelta="0"
+ android:duration="@android:integer/config_longAnimTime"/>
diff --git a/res/anim/autologin_exit.xml b/res/anim/autologin_exit.xml
new file mode 100644
index 0000000..6faa715
--- /dev/null
+++ b/res/anim/autologin_exit.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<translate xmlns:android="http://schemas.android.com/apk/res/android"
+ android:fromYDelta="0" android:toYDelta="-100%"
+ android:duration="@android:integer/config_longAnimTime"/>
diff --git a/res/layout/url_bar.xml b/res/layout/url_bar.xml
index f2b32c4..bf184a8 100644
--- a/res/layout/url_bar.xml
+++ b/res/layout/url_bar.xml
@@ -10,11 +10,68 @@
the specific language governing permissions and limitations under the
License.
-->
-<LinearLayout
+<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical">
+ >
+ <LinearLayout
+ android:id="@+id/autologin"
+ android:background="#FBF0A0"
+ android:gravity="center_vertical"
+ android:paddingTop="3dip"
+ android:visibility="gone"
+ android:layout_below="@+id/taburlbar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+ <TextView
+ android:text="@string/autologin_bar_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="@android:color/primary_text_light"
+ android:paddingLeft="15dip"
+ android:paddingRight="15dip"
+ android:textAppearance="?android:attr/textAppearanceMedium"/>
+ <Button
+ android:id="@+id/autologin_account"
+ android:background="@android:drawable/btn_dropdown"
+ android:textColor="@android:color/primary_text_light"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"/>
+ <Button
+ android:id="@+id/autologin_login"
+ android:text="@string/autologin_bar_login_text"
+ android:background="@android:drawable/btn_default"
+ android:textColor="@android:color/primary_text_light"
+ android:layout_marginRight="15dip"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content" />
+ <ProgressBar
+ android:id="@+id/autologin_progress"
+ android:indeterminateOnly="true"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:visibility="gone" />
+ <TextView
+ android:id="@+id/autologin_error"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:textColor="#dd6826"
+ android:text="@string/autologin_bar_error"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:visibility="gone" />
+ <View
+ android:layout_width="2dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"/>
+ <ImageButton
+ android:id="@+id/autologin_close"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingRight="15dip"
+ android:background="@null"
+ android:src="@*android:drawable/btn_close"/>
+ </LinearLayout>
<LinearLayout
android:id="@+id/taburlbar"
android:layout_width="match_parent"
@@ -128,7 +185,8 @@
android:layout_width="match_parent"
android:layout_height="22dip"
android:background="@null"
+ android:layout_below="@+id/taburlbar"
android:src="@drawable/progress"
android:layout_marginTop="-11dip"
android:visibility="gone" />
-</LinearLayout>
+</RelativeLayout>