<?xml version="1.0" encoding="utf-8"?>
<!--
/**
 * Copyright (c) 2008, Google Inc.
 *
 * 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.
 */
-->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:divider="?android:attr/dividerHorizontal"
    android:showDividers="middle"
    android:dividerPadding="0dip" >

    <!-- The list of packages that correspond to the requesting UID
    and the account/authtokenType that is being requested -->
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fillViewport="true"
        android:layout_weight="1"
        android:gravity="top|center_horizontal">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:paddingTop="14dip"
            android:orientation="vertical">

            <TextView
                android:id="@+id/grant_credentials_permission_message_header"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/grant_credentials_permission_message_header"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:paddingStart="19dip"
                android:paddingBottom="12dip" />

            <LinearLayout
                android:id="@+id/packages_list"
                android:orientation="vertical"
                android:paddingStart="16dip"
                android:paddingEnd="12dip"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <RelativeLayout
                android:paddingStart="16dip"
                android:paddingEnd="12dip"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <ImageView
                    android:id="@+id/permission_icon"
                    android:layout_width="30dip"
                    android:layout_height="30dip"
                    android:src="@drawable/ic_bullet_key_permission"
                    android:layout_alignParentStart="true"
                    android:scaleType="fitCenter" />

                <TextView
                    android:id="@+id/account_type"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textColor="@color/perms_dangerous_perm_color"
                    android:textStyle="bold"
                    android:paddingStart="16dip"
                    android:layout_toEndOf="@id/permission_icon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />

                <TextView
                    android:id="@+id/account_name"
                    android:textAppearance="?android:attr/textAppearanceSmall"
                    android:textColor="@color/perms_dangerous_perm_color"
                    android:layout_marginTop="-4dip"
                    android:paddingBottom="8dip"
                    android:paddingStart="16dip"
                    android:layout_below="@id/account_type"
                    android:layout_toEndOf="@id/permission_icon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />

                <TextView
                    android:id="@+id/authtoken_type"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textColor="@color/perms_dangerous_perm_color"
                    android:textStyle="bold"
                    android:layout_marginTop="-4dip"
                    android:paddingBottom="8dip"
                    android:paddingStart="16dip"
                    android:layout_below="@id/account_name"
                    android:layout_toEndOf="@id/permission_icon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />
            </RelativeLayout>

            <TextView
                android:id="@+id/grant_credentials_permission_message_footer"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/grant_credentials_permission_message_footer"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:paddingStart="19dip"
                android:paddingBottom="12dip" />
        </LinearLayout>
    </ScrollView>

    <!-- The buttons to allow or deny -->
    <LinearLayout
        android:id="@+id/buttons"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="?android:attr/buttonBarStyle">

        <Button
            android:id="@+id/deny_button"
            android:text="@string/deny"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="2"
            style="?android:attr/buttonBarButtonStyle" />

        <Button
            android:id="@+id/allow_button"
            android:text="@string/allow"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="2"
            style="?android:attr/buttonBarButtonStyle" />

    </LinearLayout>
</LinearLayout>

