Fix chevron directions

pull/1732/head
Alex Baker 2 years ago
parent 898960a7dc
commit 6fa9901b18

@ -42,12 +42,12 @@ internal class SubheaderViewHolder(
} }
else -> errorIcon.visibility = View.GONE else -> errorIcon.visibility = View.GONE
} }
rotation = if (subheader.isCollapsed) 180f else 0f rotation = if (subheader.isCollapsed) -180f else 0f
chevron.rotation = rotation chevron.rotation = rotation
} }
private fun rotate() { private fun rotate() {
rotation = if (rotation == 0f) 180f else 0f rotation = if (rotation == 0f) -180f else 0f
chevron.animate().rotation(rotation).setDuration(250).start() chevron.animate().rotation(rotation).setDuration(250).start()
} }

@ -35,13 +35,13 @@ class HeaderViewHolder(
row.visibility = View.VISIBLE row.visibility = View.VISIBLE
this.title.text = header this.title.text = header
this.title.setTextColor(section.headerColor(context, sortMode)) this.title.setTextColor(section.headerColor(context, sortMode))
rotation = if (section.collapsed) 180f else 0f rotation = if (section.collapsed) -180f else 0f
chevron.rotation = rotation chevron.rotation = rotation
} }
} }
private fun rotate() { private fun rotate() {
rotation = if (rotation == 0f) 180f else 0f rotation = if (rotation == 0f) -180f else 0f
chevron.animate().rotation(rotation).setDuration(250).start() chevron.animate().rotation(rotation).setDuration(250).start()
} }

@ -22,7 +22,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="@dimen/half_keyline_first" android:padding="@dimen/half_keyline_first"
android:src="@drawable/ic_keyboard_arrow_down_black_24dp" android:src="@drawable/ic_keyboard_arrow_up_black_24dp"
app:tint="@color/icon_tint_with_alpha" app:tint="@color/icon_tint_with_alpha"
android:layout_toStartOf="@id/add_item" android:layout_toStartOf="@id/add_item"
android:layout_alignWithParentIfMissing="true" android:layout_alignWithParentIfMissing="true"

@ -25,7 +25,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="@dimen/keyline_first" android:padding="@dimen/keyline_first"
android:src="@drawable/ic_keyboard_arrow_down_black_24dp" android:src="@drawable/ic_keyboard_arrow_up_black_24dp"
app:tint="@color/text_tertiary" /> app:tint="@color/text_tertiary" />
</RelativeLayout> </RelativeLayout>

Loading…
Cancel
Save