Tweak UI of profile tab layout

- Change color & shape of indicator.
- Add margin around tab layout.
- Remove divider below the tab layout.

Bug: 188589806
Bug: 188589053
Test: manual visual
Change-Id: I644a4aeb951daa6eb601229fa5f1096dcbdc86ca
This commit is contained in:
Arc Wang
2021-06-23 20:32:25 +08:00
parent b0e55afc95
commit 4f1d2ebfdf
2 changed files with 32 additions and 6 deletions

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 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.
-->
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?android:attr/textColorSecondaryInverse"/>
<corners android:radius="8dp"/>
<size android:height="4dp"/>
</shape>

View File

@@ -19,6 +19,7 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container_material" android:id="@+id/container_material"
android:orientation="vertical" android:orientation="vertical"
@@ -66,19 +67,20 @@
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:id="@+id/tabs" android:id="@+id/tabs"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="48dp"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layoutDirection="ltr" android:layoutDirection="ltr"
app:tabMaxWidth="0dp" app:tabMaxWidth="0dp"
app:tabGravity="fill" app:tabGravity="fill"
app:tabMode="fixed" app:tabMode="fixed"
app:tabIndicatorColor="@*android:color/accent_device_default" app:tabIndicator="@drawable/tabs_indicator_background"
app:tabIndicatorColor="?androidprv:attr/colorAccentPrimaryVariant"
app:tabSelectedTextColor="@*android:color/accent_device_default" app:tabSelectedTextColor="@*android:color/accent_device_default"
app:tabTextAppearance="@style/TextAppearance.Tab" app:tabTextAppearance="@style/TextAppearance.Tab"
app:tabTextColor="?android:attr/textColorSecondary"/> app:tabTextColor="?android:attr/textColorSecondary"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"/>
<androidx.viewpager.widget.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager" android:id="@+id/view_pager"