package Ġxyz . h ae h nel . bon j wa . ui . schedule Ċ Ċ import Ġandroidx . compose . runtime . Composable Ċ import Ġandroidx . compose . runtime . Mutable State Ċ import Ġandroidx . compose . runtime . mutable State Of Ċ import Ġandroidx . compose . runtime . remember Ċ import Ġandroidx . compose . ui . res . string Resource Ċ import Ġorg . th reet en . bp . DateTime Utils Ċ import Ġxyz . h ae h nel . bon j wa . R Ċ import Ġxyz . h ae h nel . bon j wa . model . Bon j wa Schedule Item Ċ import Ġxyz . h ae h nel . bon j wa . ui . common . Message Card Ċ import Ġjava . util .* Ċ Ċ @ Composable Ċ fun ĠSchedule ItemList ( ĊĠĠĠ Ġschedule : ĠList < Bon j wa Schedule Item >, ĊĠĠĠ Ġselected TabIndex : ĠMutable State < Int > Ċ ) Ġ{ ĊĠĠĠ Ġval Ġinitial Selection Done Ġ= Ġremember Ġ{ Ġmutable State Of ( false ) Ġ} ĊĊĠĠĠ Ġval Ġweek days As List Ġ= Ġweek days . toList () ĊĊĠĠĠ Ġ// ĠSelect Ġweek day ĊĠĠĠ Ġval Ġc Ġ= ĠCalendar . getInstance () ĊĠĠĠ Ġif Ġ(! initial Selection Done . value Ġ&& Ġschedule . isNotEmpty ()) Ġ{ ĊĠĠĠĠĠĠĠ Ġselected TabIndex . value Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġweek days As List . indexOf First Ġ{ Ġit . first Ġ== Ġc . get ( Calendar . DAY _ OF _ WEEK ) Ġ} ĊĠĠĠĠĠĠĠ Ġinitial Selection Done . value Ġ= Ġtrue ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġweek day From SelectedIndex Ġ= Ġweek days As List [ selected TabIndex . value ]. first ĊĊĠĠĠ Ġval Ġweek day Items Ġ= Ġschedule . filter Ġ{ ĊĠĠĠĠĠĠĠ Ġc . time Ġ= ĠDateTime Utils . toDate ( it . startDate ) ĊĠĠĠĠĠĠĠ Ġc . get ( Calendar . DAY _ OF _ WEEK ) Ġ== Ġweek day From SelectedIndex ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ( weekday Items . isNotEmpty ()) Ġ{ ĊĠĠĠĠĠĠĠ ĠWeek day Column ( weekday Items ) ĊĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( schedule . isNull OrEmpty () Ġ&& Ġc . get ( Calendar . DAY _ OF _ WEEK ) Ġ== Ġ 2 ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠMessage Card ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstring Resource ( R . string . schedule _ not _ published ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . drawable . ic _ no _ schedule _ published ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠMessage Card ( string Resource ( R . string . schedule _ not _ live ), ĠR . drawable . ic _ no _ schedule _ today ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ