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

Commit 469c69b5 authored by Anna Zappone's avatar Anna Zappone
Browse files

Add new templates & show Statuses in People Tiles

Backup strings provided in the case of missing status text when icons
are provided. Implements three layouts to handle our different states.

Change-Id: I1cb81c42e4cdd75b000f52c402a7396897c0f027
Test: PeopleSpaceUtilsTest
Bug: 178792356
parent e3ca0e42
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 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="oval">
    <size android:height="10dp"
          android:width="10dp" />
    <solid android:color="#34A853" />
</shape>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -16,5 +16,5 @@
  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <solid android:color="?android:attr/colorControlHighlight" />
    <corners android:radius="@dimen/people_space_widget_radius" />
    <corners android:radius="@dimen/people_space_image_radius" />
</shape>
+3 −2
Original line number Diff line number Diff line
@@ -13,7 +13,8 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="oval">
    <solid android:color="?android:attr/colorBackground" />
    <corners android:radius="@dimen/people_space_widget_round_radius" />
    <stroke android:width="2dp" android:color="?android:attr/colorAccent" />
</shape>
 No newline at end of file
+39 −31
Original line number Diff line number Diff line
@@ -19,65 +19,73 @@
    android:layout_height="match_parent"
    android:orientation="vertical">
    <LinearLayout
        android:background="@drawable/people_space_round_tile_view_card"
        android:background="@drawable/people_space_tile_view_card"
        android:id="@+id/item"
        android:paddingVertical="6dp"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:orientation="horizontal"
            android:gravity="center_vertical"
            android:paddingStart="12dp"
            android:gravity="center"
            android:paddingVertical="2dp"
            android:paddingHorizontal="8dp"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <LinearLayout
                android:background="@drawable/people_space_new_story_outline"
                android:id="@+id/person_icon_with_story"
                android:gravity="center_horizontal"
                android:layout_width="60dp"
                android:layout_height="60dp">
                <ImageView
                    android:id="@+id/person_icon_inside_ring"
                    android:layout_marginEnd="4dp"
                    android:layout_marginStart="4dp"
                    android:layout_marginBottom="4dp"
                    android:layout_marginTop="4dp"
                    android:layout_width="52dp"
                    android:layout_height="52dp"/>
            </LinearLayout>
            <ImageView
                    android:id="@+id/person_icon"
                android:id="@+id/person_icon_only"
                android:layout_width="60dp"
                android:layout_height="60dp"/>

                <LinearLayout
                    android:background="@drawable/people_space_rounded_border"
                    android:layout_marginStart="-12dp"
                    android:layout_marginTop="28dp"
                    android:layout_marginBottom="14dp"
                    android:layout_width="16dp"
                    android:layout_height="16dp">

            <ImageView
                android:id="@+id/package_icon"
                        android:layout_width="12dp"
                        android:layout_marginStart="2dp"
                        android:layout_marginEnd="2dp"
                        android:layout_marginBottom="2dp"
                        android:layout_marginTop="2dp"
                        android:layout_height="12dp" />
                </LinearLayout>
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_marginStart="-20dp"
                android:layout_marginTop="22dp"/>

            <LinearLayout
                android:orientation="vertical"
                android:paddingStart="8dp"
                android:paddingEnd="12dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <ImageView
                    android:id="@+id/availability"
                    android:layout_width="10dp"
                    android:layout_height="10dp"
                    android:background="@drawable/circle_green_10dp"/>
                <TextView
                    android:id="@+id/name"
                    android:text="@string/empty_user_name"
                    android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
                    android:textColor="?android:attr/textColorPrimary"
                    android:textSize="16sp"
                    android:textSize="14sp"
                    android:maxLines="1"
                    android:ellipsize="end"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>

                <TextView
                    android:id="@+id/status"
                    android:id="@+id/last_interaction"
                    android:text="@string/empty_status"
                    android:textColor="?android:attr/textColorSecondary"
                    android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
                    android:paddingVertical="3dp"
                    android:textSize="12sp"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
+154 −0
Original line number Diff line number Diff line
<?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.
  -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <RelativeLayout
        android:background="@drawable/people_space_tile_view_card"
        android:id="@+id/people_tile"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <include layout="@layout/punctuation_layout"/>
        <RelativeLayout
            android:gravity="start"
            android:id="@+id/column_one"
            android:paddingVertical="10dp"
            android:paddingStart="8dp"
            android:layout_width="wrap_content"
            android:layout_height="match_parent">
            <TextView
                android:id="@+id/subtext"
                android:layout_toStartOf="@+id/content_layout"
                android:layout_alignParentStart="true"
                android:layout_alignParentTop="true"
                android:gravity="top|start"
                android:textColor="?android:attr/textColorSecondary"
                android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
                android:textSize="12sp"
                android:maxWidth="60dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:maxLines="1"
                android:ellipsize="end"/>
            <LinearLayout
                android:orientation="horizontal"
                android:id="@+id/avatar_and_app_icon"
                android:layout_alignParentBottom="true"
                android:layout_alignParentStart="true"
                android:gravity="center"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">
                <LinearLayout
                    android:id="@+id/person_icon_with_story"
                    android:background="@drawable/people_space_new_story_outline"
                    android:gravity="center_horizontal"
                    android:layout_width="48dp"
                    android:layout_height="48dp">
                    <ImageView
                        android:id="@+id/person_icon_inside_ring"
                        android:layout_marginEnd="4dp"
                        android:layout_marginStart="4dp"
                        android:layout_marginBottom="4dp"
                        android:layout_marginTop="4dp"
                        android:layout_width="40dp"
                        android:layout_height="40dp"/>
                </LinearLayout>
                <ImageView
                    android:id="@+id/person_icon_only"
                    android:layout_width="48dp"
                    android:layout_height="48dp"/>
                <ImageView
                    android:id="@id/package_icon"
                    android:layout_marginStart="-16dp"
                    android:layout_marginTop="18dp"
                    android:paddingBottom="10dp"
                    android:paddingEnd="8dp"
                    android:layout_width="28dp"
                    android:layout_height="32dp"/>
            </LinearLayout>
        </RelativeLayout>
        <LinearLayout
            android:id="@+id/content_layout"
            android:paddingBottom="4dp"
            android:paddingStart="4dp"
            android:paddingTop="8dp"
            android:paddingEnd="8dp"
            android:layout_alignParentEnd="true"
            android:layout_alignParentTop="true"
            android:layout_toEndOf="@id/column_one"
            android:gravity="top|end"
            android:orientation="vertical"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
            <TextView
                android:id="@+id/content"
                android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
                android:textColor="?android:attr/textColorPrimary"
                android:gravity="top|end"
                android:textSize="12sp"
                android:paddingTop="2dp"
                android:paddingEnd="4dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:maxLines="2"
                android:ellipsize="end"/>
            <LinearLayout
                android:id="@+id/content_background"
                android:background="@drawable/people_space_content_background"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <ImageView
                    android:id="@+id/image"
                    android:adjustViewBounds="true"
                    android:maxHeight="44dp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:scaleType="centerCrop"/>
            </LinearLayout>
        </LinearLayout>
        <LinearLayout
            android:id="@+id/person_label"
            android:paddingBottom="10dp"
            android:paddingEnd="8dp"
            android:gravity="start|bottom"
            android:layout_toEndOf="@id/column_one"
            android:layout_alignParentBottom="true"
            android:layout_alignParentEnd="true"
            android:layout_below="@id/content_layout"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <ImageView
                android:id="@+id/availability"
                android:layout_width="10dp"
                android:layout_height="10dp"
                android:paddingVertical="2dp"
                android:background="@drawable/circle_green_10dp"/>
            <TextView
                android:id="@+id/name"
                android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
                android:textColor="?android:attr/textColorPrimary"
                android:textSize="14sp"
                android:maxLines="1"
                android:ellipsize="end"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>
        </LinearLayout>
    </RelativeLayout>
</LinearLayout>
 No newline at end of file
Loading