VoIP: clean code after benoit review

This commit is contained in:
ganfra 2020-12-10 16:58:22 +01:00
parent 8bb98d9ecc
commit e36059a427
7 changed files with 16 additions and 14 deletions

View file

@ -56,7 +56,7 @@ fun TextView.setTextOrHide(newText: CharSequence?, hideWhenBlank: Boolean = true
* @param coloredTextRes the resource id of the colored part of the text * @param coloredTextRes the resource id of the colored part of the text
* @param colorAttribute attribute of the color. Default to colorAccent * @param colorAttribute attribute of the color. Default to colorAccent
* @param underline true to also underline the text. Default to false * @param underline true to also underline the text. Default to false
* @param onClick attributes to handle click on the colored part if needed required * @param onClick attributes to handle click on the colored part if needed
*/ */
fun TextView.setTextWithColoredPart(@StringRes fullTextRes: Int, fun TextView.setTextWithColoredPart(@StringRes fullTextRes: Int,
@StringRes coloredTextRes: Int, @StringRes coloredTextRes: Int,
@ -83,8 +83,7 @@ fun TextView.setTextWithColoredPart(@StringRes fullTextRes: Int,
override fun updateDrawState(ds: TextPaint) { override fun updateDrawState(ds: TextPaint) {
ds.color = color ds.color = color
// underline will be handled separately if needed, see below ds.isUnderlineText = !underline
ds.isUnderlineText = false
} }
} }
setSpan(clickableSpan, index, index + coloredPart.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) setSpan(clickableSpan, index, index + coloredPart.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

View file

@ -1,5 +1,5 @@
/* /*
* Copyright 2019 New Vector Ltd * Copyright 2020 New Vector Ltd
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View file

@ -50,13 +50,15 @@
android:id="@+id/messageVerificationRequestStub" android:id="@+id/messageVerificationRequestStub"
style="@style/TimelineContentStubBaseParams" style="@style/TimelineContentStubBaseParams"
android:layout="@layout/item_timeline_event_verification_stub" android:layout="@layout/item_timeline_event_verification_stub"
tools:visibility="gone" /> tools:layout_marginTop= "250dp"
tools:visibility="visible" />
<ViewStub <ViewStub
android:id="@+id/messageVerificationDoneStub" android:id="@+id/messageVerificationDoneStub"
style="@style/TimelineContentStubBaseParams" style="@style/TimelineContentStubBaseParams"
tools:layout_marginTop= "450dp"
android:layout="@layout/item_timeline_event_status_tile_stub" android:layout="@layout/item_timeline_event_status_tile_stub"
tools:visibility="gone" /> tools:visibility="visible" />
</FrameLayout> </FrameLayout>

View file

@ -10,6 +10,7 @@
android:id="@+id/itemCallCreatorAvatar" android:id="@+id/itemCallCreatorAvatar"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
tools:src="@tools:sample/avatars"
android:layout_gravity="center_horizontal" /> android:layout_gravity="center_horizontal" />
<TextView <TextView