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/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>