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

Commit 769630c8 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Settings new dashboard - part 2

Introduce the new Dashboard (a grid like presentation of
Settings top categories) per UX specification.

- the Dashboard is composed of "categories" and in each of them
you have "tiles"
- implement a new layout for showing top categories
(DashboardContainerView). This layout basically acts like a
grid
- depending on the device configuration make the grid with 1
column in portrait / 2 colums in landscape (phones) OR 2 columns
in portrait and 3 in landscape (tablets)
- take care of Accounts adding and removing (as it changes the
number of tiles to show)

Also remove all the old code related to Headers

Change-Id: Ie29944132c1b4c3f7b073d5a7d4453b8f5ec19a7
parent 1102f76e
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -14,21 +14,21 @@
     limitations under the License.
-->

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/dashboard"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout android:layout_width="match_parent"
    android:layout_height="match_parent"
                  android:layout_gravity="center"
                  android:orientation="vertical">
    android:paddingStart="12dp"
    android:paddingEnd="12dp"
    android:scrollbarStyle="outsideOverlay"
    android:background="@color/dashboard_background_color">

        <ListView android:id="@id/android:list"
        <LinearLayout
                android:id="@+id/dashboard_container"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                  android:background="@color/background_drawer" />

    </LinearLayout>
                android:layout_gravity="center_horizontal"
                android:orientation="vertical"
                />

</FrameLayout>
</ScrollView>
+38 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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/category"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

    <TextView android:id="@+id/category_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textAlignment="viewStart"
            />

    <com.android.settings.dashboard.DashboardContainerView
            android:id="@+id/category_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            />

</LinearLayout>
+58 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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:gravity="center_vertical"
        android:minHeight="72dp"
        android:background="@android:color/white">

    <ImageView
            android:id="@+id/icon"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:scaleType="centerInside"
            android:layout_marginStart="12dp"
            android:layout_marginEnd="16dp"
            />

    <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1" >

        <TextView android:id="@+id/title"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:singleLine="true"
                  android:textAppearance="?android:attr/textAppearanceMedium"
                  android:ellipsize="marquee"
                  android:fadingEdge="horizontal" />

        <TextView android:id="@+id/status"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_below="@android:id/title"
                  android:layout_alignStart="@android:id/title"
                  android:textAppearance="?android:attr/textAppearanceSmall"
                  android:textColor="?android:attr/textColorSecondary"
                  />

    </RelativeLayout>

</LinearLayout>
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -27,12 +27,13 @@
            android:layout_height="match_parent"
            android:layout_width="match_parent">

        <android.preference.PreferenceFrameLayout
        <FrameLayout
                android:id="@+id/prefs"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                />

    </LinearLayout>

    <RelativeLayout android:id="@+id/button_bar"
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

    <!-- Dashboard number of columns -->
    <integer name="dashboard_num_columns">2</integer>

</resources>
Loading