<?xml version="1.0" encoding="utf-8"?><!--
  ~ Twidere - Twitter client for Android
  ~
  ~  Copyright (C) 2012-2014 Mariotaku Lee <mariotaku.lee@gmail.com>
  ~
  ~  This program is free software: you can redistribute it and/or modify
  ~  it under the terms of the GNU General Public License as published by
  ~  the Free Software Foundation, either version 3 of the License, or
  ~  (at your option) any later version.
  ~
  ~  This program is distributed in the hope that it will be useful,
  ~  but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~  GNU General Public License for more details.
  ~
  ~  You should have received a copy of the GNU General Public License
  ~  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->

<org.mariotaku.twidere.view.AccountDashboardHeaderView
    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/accountDashboardHeader"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:descendantFocusability="blocksDescendants"
    app:sizeMeasurementId="@+id/profileContainer"
    tools:layout_height="160dp"
    tools:layout_width="280dp">

    <ViewSwitcher
        android:id="@+id/accountProfileBanner"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignBottom="@+id/profileContainer"
        android:layout_alignTop="@+id/profileContainer"
        android:contentDescription="@string/profile_banner"
        android:focusable="false"
        android:foreground="@color/drawer_banner_foreground"
        tools:background="@drawable/nyan_stars_background"/>

    <FrameLayout
        android:id="@+id/profileContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:focusable="false"
        android:foreground="?selectableItemBackground">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:focusable="false"
            android:paddingBottom="@dimen/element_spacing_normal"
            android:paddingTop="@dimen/element_spacing_normal">

            <org.mariotaku.twidere.view.ProfileImageView
                android:id="@+id/profileImage"
                style="?profileImageStyle"
                android:layout_width="@dimen/icon_size_profile_image_dashboard_current"
                android:layout_height="@dimen/icon_size_profile_image_dashboard_current"
                android:layout_marginBottom="@dimen/element_spacing_mlarge"
                android:layout_marginLeft="@dimen/element_spacing_large"
                android:layout_marginStart="@dimen/element_spacing_large"
                android:layout_marginTop="@dimen/element_spacing_mlarge"
                android:focusable="false"
                app:sivBorder="true"
                app:sivBorderWidth="2dp"
                tools:src="@drawable/ic_profile_image_twidere"/>

            <org.mariotaku.twidere.view.ExtendedViewPager
                android:id="@+id/otherAccountsList"
                android:layout_width="wrap_content"
                android:layout_height="52dp"
                android:layout_alignBottom="@id/profileImage"
                android:layout_alignTop="@id/profileImage"
                android:layout_marginBottom="@dimen/element_spacing_large"
                android:layout_toEndOf="@+id/hasPrevAccountIndicator"
                android:layout_toLeftOf="@+id/hasNextAccountIndicator"
                android:layout_toRightOf="@+id/hasPrevAccountIndicator"
                android:layout_toStartOf="@+id/hasNextAccountIndicator"
                android:focusable="false"
                android:overScrollMode="never"
                tools:listitem="@layout/adapter_item_dashboard_account"
                tools:paddingStart="@dimen/element_spacing_large"
                tools:visibility="visible"/>

            <ImageButton
                android:id="@+id/hasNextAccountIndicator"
                android:layout_width="@dimen/element_spacing_large"
                android:layout_height="wrap_content"
                android:layout_alignBottom="@+id/otherAccountsList"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_alignTop="@+id/otherAccountsList"
                android:background="?selectableItemBackgroundBorderless"
                android:contentDescription="@string/next_item"
                android:scaleType="centerInside"
                android:src="@drawable/ic_indicator_arrow_next"/>

            <ImageButton
                android:id="@+id/hasPrevAccountIndicator"
                android:layout_width="@dimen/element_spacing_large"
                android:layout_height="wrap_content"
                android:layout_alignBottom="@+id/otherAccountsList"
                android:layout_alignTop="@+id/otherAccountsList"
                android:layout_toEndOf="@id/profileImage"
                android:layout_toRightOf="@id/profileImage"
                android:background="?selectableItemBackgroundBorderless"
                android:contentDescription="@string/previous_item"
                android:scaleType="centerInside"
                android:src="@drawable/ic_indicator_arrow_prev"/>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_alignParentBottom="true"
                android:layout_below="@id/profileImage"
                android:layout_marginEnd="@dimen/element_spacing_large"
                android:layout_marginLeft="@dimen/element_spacing_large"
                android:layout_marginRight="@dimen/element_spacing_large"
                android:layout_marginStart="@dimen/element_spacing_large"
                android:baselineAligned="false"
                android:focusable="false"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:focusable="false"
                    android:orientation="vertical">

                    <org.mariotaku.twidere.view.FixedTextView
                        android:id="@+id/name"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:ellipsize="end"
                        android:focusable="false"
                        android:maxLines="1"
                        android:textAppearance="?android:textAppearanceSmall"
                        android:textColor="@android:color/white"
                        android:textStyle="bold"
                        tools:text="Name"/>

                    <org.mariotaku.twidere.view.FixedTextView
                        android:id="@+id/screenName"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:ellipsize="end"
                        android:focusable="false"
                        android:maxLines="1"
                        android:textAppearance="?android:textAppearanceSmall"
                        android:textColor="@color/material_grey"
                        tools:text="\@username"/>

                </LinearLayout>

                <FrameLayout
                    android:layout_width="wrap_content"
                    android:layout_height="@dimen/element_size_normal"
                    android:focusable="false"
                    android:foregroundGravity="center"
                    tools:foreground="@drawable/ic_action_status_compose">

                    <android.support.v7.widget.ActionMenuView
                        android:id="@+id/accountDashboardMenu"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:focusable="true"/>
                </FrameLayout>

            </LinearLayout>
        </RelativeLayout>

        <org.mariotaku.twidere.view.ShapedImageView
            android:id="@+id/floatingProfileImageSnapshot"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:focusable="false"
            android:scaleType="fitCenter"
            android:visibility="invisible"
            tools:ignore="ContentDescription"/>
    </FrameLayout>

    <FrameLayout
        android:id="@+id/noAccountContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/profileContainer"
        android:layout_alignTop="@+id/profileContainer"
        android:clickable="true"
        android:focusable="true"
        tools:visibility="gone">

        <org.mariotaku.twidere.view.FixedTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="@string/message_toast_no_account"/>

    </FrameLayout>

</org.mariotaku.twidere.view.AccountDashboardHeaderView>