Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

詳細ページに開始・終了時刻を表示してほしい #6

Merged
merged 1 commit into from
Jan 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.daigorian.epcltvapp
import android.graphics.Paint
import android.text.TextUtils
import android.util.Log
import android.text.format.DateFormat
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand All @@ -13,6 +14,7 @@ import androidx.leanback.widget.Presenter
import com.daigorian.epcltvapp.epgstationcaller.*
import com.daigorian.epcltvapp.epgstationv2caller.*
import kotlin.math.floor
import java.util.*

class DetailsDescriptionPresenter : Presenter() {
/**
Expand Down Expand Up @@ -189,14 +191,18 @@ class DetailsDescriptionPresenter : Presenter() {
) {
if ( item is RecordedProgram) {

val startAt = DateFormat.format("MM/dd HH:mm",Date(item.startAt))
val endAt = DateFormat.format("HH:mm", Date(item.endAt))
viewHolder.title.text = item.name
viewHolder.subtitle.text = item.description
viewHolder.body.text = item.extended
viewHolder.subtitle.text = item.description.orEmpty()
viewHolder.body.text = "$startAt〜$endAt\n\n${item.extended.orEmpty()}"
}else if ( item is RecordedItem) {

val startAt = DateFormat.format("MM/dd HH:mm",Date(item.startAt))
val endAt = DateFormat.format("HH:mm", Date(item.endAt))
viewHolder.title.text = item.name
viewHolder.subtitle.text = item.description
viewHolder.body.text = item.extended
viewHolder.subtitle.text = item.description.orEmpty()
viewHolder.body.text = "$startAt〜$endAt\n\n${item.extended.orEmpty()}"
}
}

Expand Down