[UI] Update Iconics to remove the span workaround.

This commit is contained in:
Kuba Szczodrzyński 2021-10-13 19:23:17 +02:00
parent 63b74a9fda
commit fa318d4509
No known key found for this signature in database
GPG Key ID: 70CB8A85BA1633CB
3 changed files with 12 additions and 14 deletions

View File

@ -172,8 +172,8 @@ dependencies {
kapt "eu.szkolny.selective-dao:codegen:27f8f3f194"
// Iconics & related
implementation "com.mikepenz:iconics-core:5.3.1"
implementation "com.mikepenz:iconics-views:5.3.1"
implementation "com.mikepenz:iconics-core:5.3.2"
implementation "com.mikepenz:iconics-views:5.3.2"
implementation "com.mikepenz:community-material-typeface:5.8.55.0-kotlin@aar"
implementation "eu.szkolny:szkolny-font:77e33acc2a"

View File

@ -4,7 +4,6 @@
package pl.szczodrzynski.edziennik.ui.modules.event
import android.text.SpannableString
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
@ -53,13 +52,11 @@ class EventViewHolder(
b.simpleMode = adapter.simpleMode
manager.setEventTopic(b.topic, item, showType = false)
b.topic.text = SpannableString(
adapter.highlightSearchText(
item = item,
text = b.topic.text,
color = colorHighlight
)
).buildIconics()
b.topic.text = adapter.highlightSearchText(
item = item,
text = b.topic.text,
color = colorHighlight
)
b.topic.maxLines = if (adapter.simpleMode) 2 else 3
b.details.text = mutableListOf(
@ -107,9 +104,10 @@ class EventViewHolder(
text = addedBy,
color = colorHighlight
)
b.addedBy.text = SpannableString(
b.addedBy.text.replace(addedBy, addedBySpanned)
).buildIconics()
b.addedBy.text = b.addedBy.text.replace(addedBy, addedBySpanned)
// for now, as CharSequence.replace() converts the original sequence to string,
// so the Iconics span data is lost and the share icon set above does not display
b.addedBy.buildIconics()
b.attachmentIcon.isVisible = item.hasAttachments

View File

@ -71,7 +71,7 @@
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
<com.mikepenz.iconics.view.IconicsTextView
android:id="@+id/topic"
android:layout_width="0dp"
android:layout_height="wrap_content"