<?xml version="1.0" encoding="utf-8"?>
<!--
  Nextcloud Android client application

  Copyright (C) 2017 Andy Scherzinger
  Copyright (C) 2017 Nextcloud

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  License as published by the Free Software Foundation; either
  version 3 of the License, or 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 AFFERO GENERAL PUBLIC LICENSE for more details.

  You should have received a copy of the GNU Affero General Public
  License along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout
    android:id="@+id/root"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minWidth="300dp"
    android:orientation="vertical">

    <TextView
        android:id="@+id/header"
        style="@style/Base.DialogWindowTitle.AppCompat"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/standard_margin"
        android:text="@string/sort_by"/>

    <ScrollView
        android:id="@+id/scrollableSortings"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <ImageButton
                    android:id="@+id/sortByNameAscending"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:background="@color/white"
                    android:paddingBottom="@dimen/standard_half_padding"
                    android:paddingLeft="@dimen/standard_padding"
                    android:paddingRight="@dimen/standard_half_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:src="@drawable/ic_alphabetical_asc"/>

                <TextView
                    android:id="@+id/sortByNameAZText"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_weight="1"
                    android:ellipsize="middle"
                    android:singleLine="true"
                    android:paddingBottom="@dimen/standard_half_padding"
                    android:paddingRight="@dimen/standard_double_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:text="@string/menu_item_sort_by_name_a_z"
                    android:textColor="@color/standard_grey"
                    android:textSize="@dimen/two_line_primary_text_size"/>

            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <ImageButton
                    android:id="@+id/sortByNameDescending"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:background="@color/white"
                    android:paddingBottom="@dimen/standard_half_padding"
                    android:paddingLeft="@dimen/standard_padding"
                    android:paddingRight="@dimen/standard_half_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:src="@drawable/ic_alphabetical_desc"/>

                <TextView
                    android:id="@+id/sortByNameZAText"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_weight="1"
                    android:ellipsize="middle"
                    android:singleLine="true"
                    android:paddingBottom="@dimen/standard_half_padding"
                    android:paddingRight="@dimen/standard_double_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:text="@string/menu_item_sort_by_name_z_a"
                    android:textColor="@color/standard_grey"
                    android:textSize="@dimen/two_line_primary_text_size"/>

            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/standard_half_margin">

                <ImageButton
                    android:id="@+id/sortByModificationDateDescending"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:background="@color/white"
                    android:paddingBottom="@dimen/standard_half_padding"
                    android:paddingLeft="@dimen/standard_padding"
                    android:paddingRight="@dimen/standard_half_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:src="@drawable/ic_modification_desc"/>

                <TextView
                    android:id="@+id/sortByModificationDateNewestFirstText"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_weight="1"
                    android:ellipsize="middle"
                    android:singleLine="true"
                    android:paddingBottom="@dimen/standard_half_padding"
                    android:paddingRight="@dimen/standard_double_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:text="@string/menu_item_sort_by_date_newest_first"
                    android:textColor="@color/standard_grey"
                    android:textSize="@dimen/two_line_primary_text_size"/>

            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <ImageButton
                    android:id="@+id/sortByModificationDateAscending"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:background="@color/white"
                    android:paddingBottom="@dimen/standard_half_padding"
                    android:paddingLeft="@dimen/standard_padding"
                    android:paddingRight="@dimen/standard_half_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:src="@drawable/ic_modification_asc"/>

                <TextView
                    android:id="@+id/sortByModificationDateOldestFirstText"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_weight="1"
                    android:ellipsize="middle"
                    android:singleLine="true"
                    android:paddingBottom="@dimen/standard_half_padding"
                    android:paddingRight="@dimen/standard_double_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:text="@string/menu_item_sort_by_date_oldest_first"
                    android:textColor="@color/standard_grey"
                    android:textSize="@dimen/two_line_primary_text_size"/>

            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content"

                android:layout_marginTop="@dimen/standard_half_margin">

                <ImageButton
                    android:id="@+id/sortBySizeDescending"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:background="@color/white"
                    android:paddingBottom="@dimen/standard_half_padding"
                    android:paddingLeft="@dimen/standard_padding"
                    android:paddingRight="@dimen/standard_half_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:src="@drawable/ic_size_desc"/>

                <TextView
                    android:id="@+id/sortBySizeBiggestFirstText"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_weight="1"
                    android:ellipsize="middle"
                    android:singleLine="true"
                    android:paddingBottom="@dimen/standard_half_padding"
                    android:paddingRight="@dimen/standard_double_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:text="@string/menu_item_sort_by_size_biggest_first"
                    android:textColor="@color/standard_grey"
                    android:textSize="@dimen/two_line_primary_text_size"/>

            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <ImageButton
                    android:id="@+id/sortBySizeAscending"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:background="@color/white"
                    android:paddingBottom="@dimen/standard_half_padding"
                    android:paddingLeft="@dimen/standard_padding"
                    android:paddingRight="@dimen/standard_half_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:src="@drawable/ic_size_asc"/>

                <TextView
                    android:id="@+id/sortBySizeSmallestFirstText"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_weight="1"
                    android:ellipsize="middle"
                    android:singleLine="true"
                    android:paddingBottom="@dimen/standard_half_padding"
                    android:paddingRight="@dimen/standard_double_padding"
                    android:paddingTop="@dimen/standard_half_padding"
                    android:text="@string/menu_item_sort_by_size_smallest_first"
                    android:textColor="@color/standard_grey"
                    android:textSize="@dimen/two_line_primary_text_size"/>

            </TableRow>

        </TableLayout>

    </ScrollView>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="right">

        <android.support.v7.widget.AppCompatButton
            android:id="@+id/cancel"
            style="@style/Button.Borderless"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/common_cancel"/>

    </LinearLayout>

</LinearLayout>
