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

Commit 5b3278f6 authored by Rakesh Iyer's avatar Rakesh Iyer
Browse files

Update fullscreen user switcher on the lock screen.

The older implementation didn't scale well with an
increasing number of users, it just kept making the
user pods smaller and smaller. Replace the custom
GridView with a custom ViewPager with a paging
indicator.

Also remove all the text from the screen since we
don't need it anymore.

More changes to follow.

Bug: 36454400
Test: Created more users than can fit on one screen,
      booted up and switched between the users.
Change-Id: I6de323fbaa6bc4cefc2bdb73a4c68c4f092a08a6
parent ec41ae65
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -15,16 +15,17 @@
     limitations under the License.
-->

<!--  LinearLayout -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:gravity="top|center_horizontal"
    android:layout_width="180dp"
    android:layout_height="wrap_content">
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="@dimen/car_fullscreen_user_pod_margin_side"
    android:layout_marginRight="@dimen/car_fullscreen_user_pod_margin_side"
    android:gravity="center"
    android:layout_weight="1" >

    <ImageView android:id="@+id/user_avatar"
               android:padding="10dp"
        android:layout_gravity="center"
        android:layout_width="@dimen/car_fullscreen_user_pod_image_avatar_width"
        android:layout_height="@dimen/car_fullscreen_user_pod_image_avatar_height" />
@@ -32,7 +33,8 @@
    <TextView android:id="@+id/user_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/car_fullscreen_user_pod_margin_above_text"
        android:textSize="@dimen/car_fullscreen_user_pod_text_size"
        android:textColor="@color/qs_user_detail_name"
              android:gravity="center_horizontal" />
        android:layout_gravity="center_horizontal" />
</LinearLayout>
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!--
     Copyright (C) 2017 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:layout_gravity="center">

    <!-- car_fullscreen_user_pods will be dynamically added here. -->
</LinearLayout>
+19 −33
Original line number Diff line number Diff line
@@ -14,38 +14,24 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:fitsSystemWindows="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/car_lockscreen_disclaimer_title"
            android:textSize="@dimen/car_lockscreen_disclaimer_title_size"
            android:paddingStart="@dimen/car_lockscreen_disclaimer_title_padding_start"
            android:paddingTop="@dimen/car_lockscreen_disclaimer_title_padding_top" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:text="@string/car_lockscreen_disclaimer_text"
            android:textSize="@dimen/car_lockscreen_disclaimer_text_size"
            android:paddingStart="@dimen/car_lockscreen_disclaimer_text_padding_start"
            android:paddingEnd="@dimen/car_lockscreen_disclaimer_text_padding_end"
            android:paddingTop="@dimen/car_lockscreen_disclaimer_text_padding_top" />

    <com.android.systemui.statusbar.car.UserGridView
        android:id="@+id/user_grid"
            android:layout_gravity="center"
            android:layout_width="wrap_content"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
            android:stretchMode="columnWidth">
        </com.android.systemui.statusbar.car.UserGridView>
    </LinearLayout>
</FrameLayout>
        android:layout_marginLeft="@dimen/car_margin"
        android:layout_marginRight="@dimen/car_margin"
        android:layout_centerInParent="true" />

    <com.android.systemui.statusbar.car.PageIndicator
        android:id="@+id/user_switcher_page_indicator"
        android:layout_width="match_parent"
        android:layout_height="@dimen/car_page_indicator_dot_diameter"
        android:layout_marginTop="@dimen/car_page_indicator_margin_top"
        android:layout_below="@+id/user_grid" />
</RelativeLayout>
+11 −12
Original line number Diff line number Diff line
@@ -16,18 +16,17 @@
*/
-->
<resources>
    <dimen name="car_lockscreen_disclaimer_title_size">48sp</dimen>
    <dimen name="car_lockscreen_disclaimer_title_padding_start">96dp</dimen>
    <dimen name="car_lockscreen_disclaimer_title_padding_top">82dp</dimen>
    <dimen name="car_lockscreen_disclaimer_text_size">28sp</dimen>
    <dimen name="car_lockscreen_disclaimer_text_padding_start">96dp</dimen>
    <dimen name="car_lockscreen_disclaimer_text_padding_end">96dp</dimen>
    <dimen name="car_lockscreen_disclaimer_text_padding_top">8dp</dimen>
    <dimen name="car_lockscreen_user_grid_view_padding_start">10dp</dimen>
    <dimen name="car_lockscreen_user_grid_view_padding_end">10dp</dimen>
    <dimen name="car_fullscreen_user_pod_image_avatar_width">128dp</dimen>
    <dimen name="car_fullscreen_user_pod_image_avatar_height">128dp</dimen>
    <dimen name="car_fullscreen_user_pod_text_size">24sp</dimen>
    <dimen name="car_margin">148dp</dimen>

    <dimen name="car_fullscreen_user_pod_margin_side">44dp</dimen>
    <dimen name="car_fullscreen_user_pod_margin_above_text">24dp</dimen>
    <dimen name="car_fullscreen_user_pod_image_avatar_width">192dp</dimen>
    <dimen name="car_fullscreen_user_pod_image_avatar_height">192dp</dimen>
    <dimen name="car_fullscreen_user_pod_text_size">40sp</dimen>

    <dimen name="car_navigation_button_width">64dp</dimen>
    <dimen name="car_navigation_bar_width">760dp</dimen>

    <dimen name="car_page_indicator_dot_diameter">12dp</dimen>
    <dimen name="car_page_indicator_margin_top">32dp</dimen>
</resources>
+1 −9
Original line number Diff line number Diff line
@@ -17,13 +17,5 @@
 */
-->
<resources>
    <string name="car_lockscreen_disclaimer_title">Drive safely</string>
    <string name="car_lockscreen_disclaimer_text">
        Stay fully aware of driving conditions and always obey applicable laws. Directions may be
        inaccurate, incomplete, dangerous, not suitable, prohibited, or involve crossing
        administrative areas. Business information may also be inaccurate or incomplete. Data is
        not real-time, and location accuracy cannot be guaranteed. Do not handle your mobile device
        or use apps not intended for Android Auto while driving.
    </string>

    <string name="unknown_user_label">Unknown</string>
</resources>
Loading