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

Commit 4b19fecd authored by Mill Chen's avatar Mill Chen Committed by Fan Zhang
Browse files

Update new UI for conditional collapsibility

- Add a footer view with collapsing button and this view will be
appended to the last position of condition cards when condition
cards are expanded.
- Add a header view with expanding button when condition cards
are in collapsed state.

Bug: 119593268, 113451905
Test: rebuild, visual
Change-Id: I82c20641d1542e45383da48106f8fedea06a68ed
parent f611fe86
Loading
Loading
Loading
Loading
+40 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2018 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.
  -->

<androidx.cardview.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    style="@style/ContextualCardStyle">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/homepage_condition_footer_height"
        android:contentDescription="@string/homepage_condition_footer_content_description"
        android:gravity="end"
        android:orientation="horizontal"
        android:paddingTop="@dimen/homepage_condition_footer_padding_top"
        android:paddingEnd="@dimen/homepage_condition_footer_padding_end">

        <ImageView
            android:id="@+id/collapse_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/ic_expand_less" />

    </LinearLayout>
</androidx.cardview.widget.CardView>
 No newline at end of file
+52 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2018 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.
  -->

<androidx.cardview.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    style="@style/ContextualCardStyle">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="@dimen/homepage_condition_header_padding_top"
        android:paddingBottom="@dimen/homepage_condition_header_padding_bottom"
        android:orientation="horizontal"
        android:gravity="center_vertical">

        <LinearLayout
            android:id="@+id/header_icons_container"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:layout_marginStart="@dimen/homepage_condition_header_icons_margin_start"
            android:orientation="horizontal"
            android:gravity="center_vertical"/>

        <ImageView
            android:id="@+id/expand_indicator"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:paddingTop="@dimen/homepage_condition_header_indicator_padding_top"
            android:paddingStart="@dimen/homepage_condition_header_indicator_padding_start"
            android:paddingEnd="@dimen/homepage_condition_header_indicator_padding_end"
            android:src="@drawable/ic_expand_more"/>

    </LinearLayout>

</androidx.cardview.widget.CardView>
 No newline at end of file
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2018 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.
  -->

<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
           android:id="@android:id/icon"
           android:layout_width="@dimen/homepage_condition_header_icon_width_height"
           android:layout_height="@dimen/homepage_condition_header_icon_width_height"
           android:layout_marginEnd="@dimen/homepage_condition_header_icon_margin_end"
           android:tint="?android:attr/colorAccent"/>
 No newline at end of file
+11 −0
Original line number Diff line number Diff line
@@ -355,5 +355,16 @@
    <dimen name="homepage_condition_full_card_padding_end">24dp</dimen>
    <dimen name="homepage_condition_full_card_padding_top">12dp</dimen>
    <dimen name="homepage_condition_full_card_padding_bottom">12dp</dimen>
    <dimen name="homepage_condition_header_padding_top">10dp</dimen>
    <dimen name="homepage_condition_header_padding_bottom">10dp</dimen>
    <dimen name="homepage_condition_header_icons_margin_start">24dp</dimen>
    <dimen name="homepage_condition_header_indicator_padding_top">4dp</dimen>
    <dimen name="homepage_condition_header_indicator_padding_start">16dp</dimen>
    <dimen name="homepage_condition_header_indicator_padding_end">16dp</dimen>
    <dimen name="homepage_condition_footer_height">44dp</dimen>
    <dimen name="homepage_condition_footer_padding_top">10dp</dimen>
    <dimen name="homepage_condition_footer_padding_end">10dp</dimen>
    <dimen name="homepage_condition_header_icon_width_height">24dp</dimen>
    <dimen name="homepage_condition_header_icon_margin_end">24dp</dimen>

</resources>
+3 −0
Original line number Diff line number Diff line
@@ -9105,6 +9105,9 @@
    <!-- Summary for the condition section on the dashboard, representing number of conditions. [CHAR LIMIT=10] -->
    <string name="condition_summary" translatable="false"><xliff:g name="count" example="3">%1$d</xliff:g></string>
    <!-- Content description for condition footer button. In talkback mode, double tapping will cause condition list to collapse [CHAR LIMIT=NONE]-->
    <string name="homepage_condition_footer_content_description">Collapse</string>
    <!-- Title for the suggestions section on the dashboard [CHAR LIMIT=30] -->
    <string name="suggestions_title_v2">Suggested for You</string>