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

Commit 88f322c3 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

DocumentsUI tablet support.

Shows as a faux dialog on larger tablets, since the normal dialog
themes from framework don't support action bars.  Instead, this hacks
itself to look like a dialog with an InsetDrawable.  Detects touches
in dim area to dismiss dialog.

Show all action bar icons on tablets, and roots panel is always
visible with a different shadow. Show settings in dialog. Allow mode
switches in recents.

Bug: 10329832
Change-Id: Id02982ce7b0d4694962d32f8d5286fdfcc207208
parent 16dae599
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
        <!-- TODO: allow rotation when state saving is in better shape -->
        <activity
            android:name=".DocumentsActivity"
            android:theme="@android:style/Theme.Holo.Light">
            android:theme="@style/Theme">
            <intent-filter android:priority="100">
                <action android:name="android.intent.action.OPEN_DOCUMENT" />
                <category android:name="android.intent.category.DEFAULT" />
@@ -39,8 +39,8 @@

        <activity
            android:name=".SettingsActivity"
            android:title="@string/menu_settings"
            android:theme="@android:style/Theme.Holo.Light"
            android:label="@string/menu_settings"
            android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge"
            android:exported="false" />

        <provider
+1 −1
Original line number Diff line number Diff line
@@ -18,5 +18,5 @@
    <item android:state_pressed="true" android:drawable="@color/item_root_activated" />
    <item android:state_activated="true" android:drawable="@color/item_root_activated" />
    <item android:state_focused="true" android:drawable="@color/item_root_activated" />
    <item android:drawable="@android:color/white" />
    <item android:drawable="@android:color/transparent" />
</selector>
+115 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 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:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/item_background"
    android:minHeight="?android:attr/listPreferredItemHeight"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:paddingTop="8dip"
    android:paddingBottom="8dip"
    android:orientation="horizontal">

    <FrameLayout
        android:id="@android:id/icon"
        android:layout_width="@dimen/icon_size"
        android:layout_height="@dimen/icon_size"
        android:layout_marginStart="12dp"
        android:layout_marginEnd="20dp"
        android:layout_gravity="center_vertical">

        <ImageView
            android:id="@+id/icon_mime"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerInside"
            android:contentDescription="@null" />

        <ImageView
            android:id="@+id/icon_thumb"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop"
            android:contentDescription="@null" />

    </FrameLayout>

    <LinearLayout
        android:layout_width="0dip"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_gravity="center_vertical"
        android:orientation="horizontal">

        <TextView
            android:id="@android:id/title"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:layout_marginEnd="12dp"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAlignment="viewStart"
            style="@style/TextAppearance.Medium" />

        <ImageView
            android:id="@android:id/icon1"
            android:layout_width="@dimen/root_icon_size"
            android:layout_height="@dimen/root_icon_size"
            android:layout_marginEnd="8dp"
            android:scaleType="centerInside"
            android:contentDescription="@null" />

        <TextView
            android:id="@android:id/summary"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.25"
            android:layout_marginEnd="12dp"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAlignment="viewStart"
            style="@style/TextAppearance.Small" />

        <TextView
            android:id="@+id/size"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.125"
            android:layout_marginEnd="12dp"
            android:minWidth="70dp"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAlignment="viewEnd"
            style="@style/TextAppearance.Small" />

        <TextView
            android:id="@+id/date"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.125"
            android:layout_marginEnd="12dp"
            android:minWidth="70dp"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAlignment="viewEnd"
            style="@style/TextAppearance.Small" />

    </LinearLayout>

</LinearLayout>
+60 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">

    <FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:id="@+id/dialog_roots">

        <FrameLayout
            android:id="@+id/container_roots"
            android:layout_width="250dp"
            android:layout_height="match_parent" />

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="end"
            android:scaleType="fitXY"
            android:src="@drawable/ic_drawer_shadow_tablet" />

    </FrameLayout>

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="vertical">

        <FrameLayout
            android:id="@+id/container_directory"
            android:layout_width="match_parent"
            android:layout_height="0dip"
            android:layout_weight="1" />

        <FrameLayout
            android:id="@+id/container_save"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </LinearLayout>

</LinearLayout>
+0 −12
Original line number Diff line number Diff line
@@ -121,18 +121,6 @@
                android:textAlignment="viewStart"
                style="@style/TextAppearance.Small" />

            <TextView
                android:id="@android:id/summary"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_gravity="center_vertical"
                android:layout_marginStart="8dp"
                android:singleLine="true"
                android:ellipsize="marquee"
                android:textAlignment="viewStart"
                style="@style/TextAppearance.Small" />

        </LinearLayout>

    </LinearLayout>
Loading