forked from github/wulkanowy-mirror
Show full subject name on expand (#193)
This commit is contained in:
parent
6fd70a0194
commit
247e81ba00
@ -31,11 +31,12 @@ class GradeDetailsHeader(
|
|||||||
|
|
||||||
override fun bindViewHolder(adapter: FlexibleAdapter<IFlexible<*>>?, holder: ViewHolder, position: Int, payloads: MutableList<Any>?) {
|
override fun bindViewHolder(adapter: FlexibleAdapter<IFlexible<*>>?, holder: ViewHolder, position: Int, payloads: MutableList<Any>?) {
|
||||||
holder.run {
|
holder.run {
|
||||||
gradeHeaderSubject.text = subject
|
gradeHeaderSubject.apply {
|
||||||
|
text = subject
|
||||||
|
maxLines = if (isExpanded) 2 else 1
|
||||||
|
}
|
||||||
gradeHeaderAverage.text = average
|
gradeHeaderAverage.text = average
|
||||||
gradeHeaderNumber.text = number
|
gradeHeaderNumber.text = number
|
||||||
gradeHeaderPredicted.visibility = GONE
|
|
||||||
gradeHeaderFinal.visibility = GONE
|
|
||||||
gradeHeaderNote.visibility = if (newGrades > 0) VISIBLE else GONE
|
gradeHeaderNote.visibility = if (newGrades > 0) VISIBLE else GONE
|
||||||
|
|
||||||
isViewExpandable = isExpandable
|
isViewExpandable = isExpandable
|
||||||
@ -71,11 +72,16 @@ class GradeDetailsHeader(
|
|||||||
contentView.setOnClickListener(this)
|
contentView.setOnClickListener(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override val containerView: View
|
||||||
|
get() = contentView
|
||||||
|
|
||||||
override fun isViewCollapsibleOnClick() = isViewExpandable
|
override fun isViewCollapsibleOnClick() = isViewExpandable
|
||||||
|
|
||||||
override fun isViewExpandableOnClick() = isViewExpandable
|
override fun isViewExpandableOnClick() = isViewExpandable
|
||||||
|
|
||||||
override val containerView: View
|
override fun onClick(view: View?) {
|
||||||
get() = contentView
|
super.onClick(view)
|
||||||
|
mAdapter.getItem(adapterPosition)?.let { mAdapter.updateItem(it) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_all_divider"
|
android:background="@drawable/ic_all_divider"
|
||||||
android:foreground="?attr/selectableItemBackgroundBorderless"
|
android:foreground="?attr/selectableItemBackgroundBorderless"
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingTop="10dp"
|
||||||
android:paddingRight="16dp"
|
android:paddingRight="16dp"
|
||||||
android:paddingTop="10dp">
|
android:paddingBottom="10dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/gradeHeaderSubject"
|
android:id="@+id/gradeHeaderSubject"
|
||||||
@ -16,8 +16,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
android:layout_marginRight="20dp"
|
android:layout_marginRight="20dp"
|
||||||
android:layout_toLeftOf="@id/gradeHeaderNote"
|
|
||||||
android:layout_toStartOf="@id/gradeHeaderNote"
|
android:layout_toStartOf="@id/gradeHeaderNote"
|
||||||
|
android:layout_toLeftOf="@id/gradeHeaderNote"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="@string/app_name"
|
android:text="@string/app_name"
|
||||||
@ -38,8 +38,8 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/gradeHeaderSubject"
|
android:layout_below="@id/gradeHeaderSubject"
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:layout_toEndOf="@+id/gradeHeaderAverage"
|
android:layout_toEndOf="@+id/gradeHeaderAverage"
|
||||||
android:layout_toRightOf="@+id/gradeHeaderAverage"
|
android:layout_toRightOf="@+id/gradeHeaderAverage"
|
||||||
@ -47,30 +47,6 @@
|
|||||||
android:textColor="?android:attr/android:textColorSecondary"
|
android:textColor="?android:attr/android:textColorSecondary"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/gradeHeaderPredicted"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/gradeHeaderAverage"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:text="@string/grade_predicted"
|
|
||||||
android:textColor="?android:attr/android:textColorSecondary"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/gradeHeaderFinal"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/gradeHeaderAverage"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_toEndOf="@+id/gradeHeaderPredicted"
|
|
||||||
android:layout_toRightOf="@+id/gradeHeaderPredicted"
|
|
||||||
android:text="@string/grade_final"
|
|
||||||
android:textColor="?android:attr/android:textColorSecondary"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/gradeHeaderNote"
|
android:id="@+id/gradeHeaderNote"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user