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

Commit 58f3edcd authored by Michael W's avatar Michael W
Browse files

DeskClock: Move navigation bar to bottom



* Wrap the desk_clock layout into a LinearLayout so the Snackbar
  appears above the BottomNavigationView
* Change the icon tint and text color to reflect the changes for the dark
  layout
* Use a BottomNavigationView instead of a TabLayout
* Reorder imports - looks like someone didn't care before

Co-authored-by: default avatarArian <arian.kulmer@web.de>
Co-authored-by: default avatarJesse Chan <jc@lineageos.org>
Signed-off-by: default avatarJesse Chan <jc@lineageos.org>
Change-Id: I780713dcbeb58256b2660a9631d48e5f7259fb11
parent 9026139e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_focused="true" android:color="@color/white" />
    <item android:state_selected="true" android:color="@color/white" />
    <item android:color="@color/white_63p" />
    <item android:state_focused="true" android:color="@color/accent_color" />
    <item android:state_selected="true" android:color="@color/accent_color" />
    <item android:color="@color/white_50p" />
</selector>
+81 −80
Original line number Diff line number Diff line
@@ -15,15 +15,21 @@
  limitations under the License.
  -->

<androidx.coordinatorlayout.widget.CoordinatorLayout
<LinearLayout
    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/content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    app:statusBarBackground="@null">
    android:orientation="vertical"
    app:statusBarBackground="@null"
    android:fitsSystemWindows="true">

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <com.google.android.material.appbar.AppBarLayout
            android:layout_width="match_parent"
@@ -36,46 +42,26 @@
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:contentInsetStart="0dp"
            tools:ignore="RtlSymmetry">
                tools:ignore="RtlSymmetry"
                android:gravity="center">

            <com.google.android.material.tabs.TabLayout
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:tabGravity="fill"
                app:tabIndicatorColor="@android:color/transparent"
                app:tabMaxWidth="0dp"
                app:tabMode="fixed"
                app:tabPaddingEnd="0dp"
                app:tabPaddingStart="0dp" />
            <TextView
                android:id="@+id/title_view"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title" />

            </androidx.appcompat.widget.Toolbar>

        <View
            android:id="@+id/tab_hairline"
            android:layout_width="match_parent"
            android:layout_height="@dimen/hairline_height"
            android:layout_gravity="bottom"
            android:background="@color/hairline"
            android:importantForAccessibility="no" />

        </com.google.android.material.appbar.AppBarLayout>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <androidx.viewpager.widget.ViewPager
            android:id="@+id/desk_clock_pager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:importantForAccessibility="no"
            android:saveEnabled="false" />

        <include layout="@layout/drop_shadow" />

    </FrameLayout>
            android:saveEnabled="false"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />

        <LinearLayout
            android:layout_width="match_parent"
@@ -129,3 +115,18 @@
        </LinearLayout>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottom_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/content"
        android:background="@color/secondary_color"
        app:menu="@menu/bottom_navigation_menu"
        app:itemIconTint="@color/tab_tint_color"
        app:itemTextColor="@color/tab_tint_color"
        app:itemTextAppearanceActive="@style/navText"
        app:itemTextAppearanceInactive="@style/navText"
        app:labelVisibilityMode="labeled" />

</LinearLayout>

res/layout/tab_item.xml

deleted100644 → 0
+0 −26
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.
-->

<TextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:drawablePadding="10dp"
    android:gravity="center"
    android:includeFontPadding="false"
    android:singleLine="true"
    android:textAppearance="@style/TextAppearance.Tab" />
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/page_alarm"
        android:enabled="true"
        android:icon="@drawable/ic_tab_alarm"
        android:title="@string/menu_alarm"/>
    <item
        android:id="@+id/page_clock"
        android:enabled="true"
        android:icon="@drawable/ic_tab_clock"
        android:title="@string/menu_clock"/>
    <item
        android:id="@+id/page_timer"
        android:enabled="true"
        android:icon="@drawable/ic_tab_timer"
        android:title="@string/menu_timer"/>
    <item
        android:id="@+id/page_stopwatch"
        android:enabled="true"
        android:icon="@drawable/ic_tab_stopwatch"
        android:title="@string/menu_stopwatch"/>
</menu>
+1 −0
Original line number Diff line number Diff line
@@ -18,4 +18,5 @@
<resources>
    <color name="default_background">#121212</color>
    <color name="accent_color">#FEF177</color>
    <color name="secondary_color">#212121</color>
</resources>
Loading