Read marker: refine JumpToReafMarkerView
This commit is contained in:
parent
e842bf13b2
commit
31397869b2
|
@ -60,16 +60,11 @@ class JumpToReadMarkerView @JvmOverloads constructor(
|
||||||
private fun setupView() {
|
private fun setupView() {
|
||||||
inflate(context, R.layout.view_jump_to_read_marker, this)
|
inflate(context, R.layout.view_jump_to_read_marker, this)
|
||||||
setBackgroundColor(ContextCompat.getColor(context, R.color.notification_accent_color))
|
setBackgroundColor(ContextCompat.getColor(context, R.color.notification_accent_color))
|
||||||
jumpToReadMarkerLabelView.movementMethod = BetterLinkMovementMethod.getInstance()
|
jumpToReadMarkerLabelView.setOnClickListener {
|
||||||
isClickable = true
|
|
||||||
jumpToReadMarkerLabelView.text = span(resources.getString(R.string.room_jump_to_first_unread)) {
|
|
||||||
textDecorationLine = "underline"
|
|
||||||
onClick = {
|
|
||||||
readMarkerId?.also {
|
readMarkerId?.also {
|
||||||
callback?.onJumpToReadMarkerClicked(it)
|
callback?.onJumpToReadMarkerClicked(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
closeJumpToReadMarkerView.setOnClickListener {
|
closeJumpToReadMarkerView.setOnClickListener {
|
||||||
visibility = View.INVISIBLE
|
visibility = View.INVISIBLE
|
||||||
callback?.onClearReadMarkerClicked()
|
callback?.onClearReadMarkerClicked()
|
||||||
|
|
|
@ -10,11 +10,13 @@
|
||||||
android:id="@+id/jumpToReadMarkerLabelView"
|
android:id="@+id/jumpToReadMarkerLabelView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_toStartOf="@+id/closeJumpToReadMarkerView"
|
android:layout_toStartOf="@+id/closeJumpToReadMarkerView"
|
||||||
android:drawableStart="@drawable/arrow_up_circle"
|
android:drawableStart="@drawable/arrow_up_circle"
|
||||||
android:drawablePadding="10dp"
|
android:drawablePadding="10dp"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
android:paddingTop="12dp"
|
android:paddingTop="12dp"
|
||||||
android:paddingBottom="12dp"
|
android:paddingBottom="12dp"
|
||||||
android:text="@string/room_jump_to_first_unread"
|
android:text="@string/room_jump_to_first_unread"
|
||||||
|
@ -23,6 +25,7 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/closeJumpToReadMarkerView"
|
android:id="@+id/closeJumpToReadMarkerView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignTop="@+id/jumpToReadMarkerLabelView"
|
android:layout_alignTop="@+id/jumpToReadMarkerLabelView"
|
||||||
android:layout_alignBottom="@+id/jumpToReadMarkerLabelView"
|
android:layout_alignBottom="@+id/jumpToReadMarkerLabelView"
|
||||||
|
|
Loading…
Reference in New Issue