-
-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fixes_issue_2806
- Loading branch information
Showing
12 changed files
with
110 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
app/src/main/java/org/jellyfin/androidtv/util/InfoLayoutHelper.java
This file was deleted.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
app/src/main/java/org/jellyfin/androidtv/util/InfoLayoutHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.jellyfin.androidtv.util | ||
|
||
import android.content.Context | ||
import android.widget.LinearLayout | ||
import org.jellyfin.androidtv.ui.browsing.composable.inforow.BaseItemInfoRowView | ||
import org.jellyfin.sdk.model.api.BaseItemDto | ||
import org.jellyfin.sdk.model.api.MediaSourceInfo | ||
|
||
object InfoLayoutHelper { | ||
@JvmStatic | ||
fun addInfoRow( | ||
context: Context, | ||
item: BaseItemDto?, | ||
mediaSource: MediaSourceInfo?, | ||
layout: LinearLayout, | ||
includeRuntime: Boolean | ||
) { | ||
// Find existing BaseItemInfoRowView or create a new one | ||
var baseItemInfoRowView: BaseItemInfoRowView? = null | ||
|
||
for (i in 0 until layout.childCount) { | ||
val child = layout.getChildAt(i) | ||
|
||
if (child is BaseItemInfoRowView) { | ||
baseItemInfoRowView = child | ||
break | ||
} | ||
} | ||
|
||
if (baseItemInfoRowView == null) { | ||
baseItemInfoRowView = BaseItemInfoRowView(context) | ||
layout.addView(baseItemInfoRowView) | ||
} | ||
|
||
// Update item info | ||
baseItemInfoRowView.item = item | ||
baseItemInfoRowView.mediaSource = mediaSource ?: item?.mediaSources?.firstOrNull() | ||
baseItemInfoRowView.includeRuntime = includeRuntime | ||
} | ||
|
||
@JvmStatic | ||
fun addInfoRow( | ||
context: Context, | ||
item: BaseItemDto?, | ||
layout: LinearLayout, | ||
includeRuntime: Boolean | ||
) = addInfoRow(context, item, null, layout, includeRuntime) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters