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

Commit 89d7bca1 authored by Fan Zhang's avatar Fan Zhang
Browse files

When click conditional's title, expand/collapse content.

Bug: 30200101

It used to lead user to detailed setting for that conditional. This
leaves some confusion about which click target goes to where.

Change-Id: Ic9525ace65ca488f4e709576fb1ec96a1cb99938
(cherry picked from commit a2db2ca8)
parent a928b294
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingStart="16dp"
        android:background="?android:attr/colorAccent"
        android:elevation="2dp"
        android:clickable="true"
@@ -35,6 +34,7 @@
            android:id="@+id/collapsed_group"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            android:background="?android:attr/selectableItemBackground"
            android:orientation="horizontal"
            android:gravity="center">

@@ -42,6 +42,7 @@
                android:id="@android:id/icon"
                android:layout_width="24dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="16dp"
                android:layout_marginEnd="32dp"
                android:tint="?android:attr/textColorPrimaryInverse" />

@@ -58,10 +59,7 @@
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:padding="16dp"
                android:tint="?android:attr/textColorPrimaryInverse"
                android:clickable="true"
                android:focusable="true"
                android:background="?android:attr/selectableItemBackground" />
                android:tint="?android:attr/textColorPrimaryInverse"/>

        </LinearLayout>

@@ -69,7 +67,7 @@
            android:id="@+id/detail_group"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:paddingStart="56dp"
            android:paddingStart="72dp"
            android:visibility="gone"
            android:orientation="vertical">

+4 −3
Original line number Diff line number Diff line
@@ -68,12 +68,13 @@ public class ConditionAdapterUtils {
        card.setOnClickListener(onClickListener);
        view.icon.setImageIcon(condition.getIcon());
        view.title.setText(condition.getTitle());
        ImageView expand = (ImageView) view.itemView.findViewById(R.id.expand_indicator);
        expand.setTag(condition);
        final View collapsedGroup = view.itemView.findViewById(R.id.collapsed_group);
        collapsedGroup.setTag(condition);
        final ImageView expand = (ImageView) view.itemView.findViewById(R.id.expand_indicator);
        expand.setImageResource(isExpanded ? R.drawable.ic_expand_less : R.drawable.ic_expand_more);
        expand.setContentDescription(expand.getContext().getString(isExpanded
                ? R.string.condition_expand_hide : R.string.condition_expand_show));
        expand.setOnClickListener(onExpandListener);
        collapsedGroup.setOnClickListener(onExpandListener);

        View detailGroup = view.itemView.findViewById(R.id.detail_group);
        CharSequence[] actions = condition.getActions();