Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 171e6f53 authored by Garfield, Tan's avatar Garfield, Tan Committed by Garfield Tan
Browse files

[multi-part] Enable bidirectional sorting in DocumentsUI

* Add a header to list mode
* Add a model for sort state
* Wire them together

Bug: 22823056
Change-Id: I6acd184b69e1564fccc92538d2b47792c6c9f45a
parent d97c8176
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 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.
-->

<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:propertyName="level"
    android:valueFrom="0"
    android:valueTo="10000"
    android:valueType="intType"
    android:duration="200" />
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 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.
-->

<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:propertyName="level"
    android:valueFrom="10000"
    android:valueTo="0"
    android:valueType="intType"
    android:duration="200" />
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 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.
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24"
        android:viewportHeight="24">

    <path
        android:fillColor="#000000"
        android:pathData="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"/>
</vector>
 No newline at end of file
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 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.
  -->

<rotate xmlns:android="http://schemas.android.com/apk/res/android"
        android:drawable="@drawable/ic_arrow_upward"
        android:fromDegrees="0"
        android:toDegrees="180"
        android:pivotX="50%"
        android:pivotY="50%"/>
+112 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 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.
-->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/table_header"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="@dimen/doc_header_height"
    android:background="@color/item_doc_background"
    android:visibility="gone">
    <!-- Placeholder for focus indicator -->
    <View
        android:layout_width="4dp"
        android:layout_height="match_parent"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:baselineAligned="false"
        android:gravity="center_vertical"
        android:minHeight="@dimen/list_item_height"
        android:paddingStart="@dimen/list_item_padding"
        android:paddingEnd="@dimen/list_item_padding"
        android:orientation="horizontal">
        <!-- Placeholder for icon -->
        <View
            android:layout_width="@dimen/list_item_thumbnail_size"
            android:layout_height="@dimen/list_item_thumbnail_size"
            android:layout_gravity="center_vertical"
            android:layout_marginEnd="16dp"
            android:layout_marginStart="0dp"/>

        <!-- Column headers -->
        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="horizontal">

            <com.android.documentsui.dirlist.header.HeaderCell
                android:id="@android:id/title"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="0.5"
                android:layout_marginEnd="12dp"
                android:focusable="true"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:animateLayoutChanges="true">

                <include layout="@layout/shared_cell_content" />
            </com.android.documentsui.dirlist.header.HeaderCell>

            <com.android.documentsui.dirlist.header.HeaderCell
                android:id="@android:id/summary"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="0.25"
                android:layout_marginEnd="12dp"
                android:focusable="true"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:animateLayoutChanges="true">

                <include layout="@layout/shared_cell_content" />
            </com.android.documentsui.dirlist.header.HeaderCell>

            <com.android.documentsui.dirlist.header.HeaderCell
                android:id="@+id/size"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="0.125"
                android:layout_marginEnd="12dp"
                android:focusable="true"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:animateLayoutChanges="true">

                <include layout="@layout/shared_cell_content" />
            </com.android.documentsui.dirlist.header.HeaderCell>

            <com.android.documentsui.dirlist.header.HeaderCell
                android:id="@+id/date"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="0.125"
                android:layout_marginEnd="12dp"
                android:focusable="true"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:animateLayoutChanges="true">

                <include layout="@layout/shared_cell_content" />
            </com.android.documentsui.dirlist.header.HeaderCell>
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
 No newline at end of file
Loading