Read marker: refine JumpToReafMarkerView

This commit is contained in:
ganfra 2019-10-01 12:33:38 +02:00
parent e842bf13b2
commit 31397869b2
2 changed files with 7 additions and 9 deletions

View File

@ -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()

View File

@ -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"