Skip to content

Commit

Permalink
ANDROID-15197 fix headlineVisible (#385)
Browse files Browse the repository at this point in the history
* ANDROID-15197 fix headlineVisible

* ANDROID-15197 update README link as it was giving 403 Forbidden

* Apply suggestion

Co-authored-by: Fernando García Lidón <[email protected]>

* ANDROID-15197 fix error in the patch

* ANDROID-15197 fix comment

---------

Co-authored-by: Fernando García Lidón <[email protected]>
  • Loading branch information
jeprubio and haynlo authored Sep 18, 2024
1 parent 16231f8 commit 9a16035
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
![Mistica for Android](doc/images/mistica-android-dark.svg#gh-dark-mode-only)

[![Platform](https://img.shields.io/badge/Platform-Android-brightgreen)](https://github.com/Telefonica/mistica-android)
[![Version](https://maven-badges.herokuapp.com/maven-central/com.telefonica/mistica/badge.png)](https://search.maven.org/artifact/com.telefonica/mistica)
[![Version](https://maven-badges.herokuapp.com/maven-central/com.telefonica/mistica/badge.png)](https://central.sonatype.com/artifact/com.telefonica/mistica?smo=true)
[![Support](https://img.shields.io/badge/Support-%3E%3D%20Android%205.0-brightgreen)](https://github.com/Telefonica/mistica-android)
[![Kotlin version badge](https://img.shields.io/badge/kotlin-1.8.20-blue.svg)](https://kotlinlang.org/docs/whatsnew1820.html)

Expand Down
16 changes: 9 additions & 7 deletions library/src/main/java/com/telefonica/mistica/list/ListRowView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,17 @@ open class ListRowView @JvmOverloads constructor(
R.styleable.ListRowView_listRowHeadlineLayout,
TypedValue.TYPE_NULL
)
val headlineVisible: Boolean = styledAttrs.getBoolean(
R.styleable.ListRowView_listRowHeadlineVisible,
currentHeadlineLayoutRes != HEADLINE_NONE
)
setHeadlineLayout(
setHeadlineLayout(
layoutRes = headlineResId.takeIf { it != TypedValue.TYPE_NULL } ?: HEADLINE_NONE,
contentDescription = styledAttrs.getString(R.styleable.ListRowView_listRowHeadlineContentDescription)
)
setHeadlineVisible(headlineVisible)
).also {
// Visibility decision depends on the headline layout initialization
val headlineVisible: Boolean = styledAttrs.getBoolean(
R.styleable.ListRowView_listRowHeadlineVisible,
currentHeadlineLayoutRes != HEADLINE_NONE
)
setHeadlineVisible(headlineVisible)
}

// Subtitle
setSubtitleMaxLines(styledAttrs.getInteger(R.styleable.ListRowView_listRowSubtitleMaxLines, -1))
Expand Down

0 comments on commit 9a16035

Please sign in to comment.