package Ġcom . ini . call endar . ui . dashboard Ċ Ċ import Ġandroid . content . res . Resources Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . util . Log Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroid . widget . TextView Ċ import Ġandroidx . core . text . parse As Html Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . lifecycle . Observer Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġcom . ini . call endar . R Ċ import Ġcom . ini . call endar . databinding . Fragment Dashboard Binding Ċ import Ġcom . ini . call endar . databinding . Week Calendar Binding Ċ import Ġjava . time . DayOfWeek Ċ import Ġjava . time . LocalDate Ċ import Ġjava . time . LocalDateTime Ċ import Ġjava . time . format . DateTime Formatter Ċ import Ġjava . time . temporal . Temporal Adj uster Ċ import Ġjava . time . temporal . Temporal Adjust ers Ċ Ċ class ĠDashboard Fragment Ġ: ĠFragment () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġdashboard ViewModel : ĠDashboard ViewModel ĊĠĠĠ Ġprivate Ġvar Ġ_ binding : ĠWeek Calendar Binding ? Ġ= Ġnull ĊĠĠĠ Ġprivate Ġval Ġbinding Ġget () Ġ= Ġ_ binding !! ĊĊĠĠĠ Ġprivate Ġvar Ġlocal Date : ĠLocalDateTime Ġ= ĠLocalDateTime . now () ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠĠĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġdashboard ViewModel Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠViewModel Provider ( this ). get ( Dashboard ViewModel :: class . java ) ĊĊĠĠĠĠĠĠĠ Ġ_ binding Ġ= Ġcom . ini . call endar . databinding . Week Calendar Binding . inflate ( in flater , Ġcontainer , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġval Ġroot : ĠView Ġ= Ġbinding . root ĊĊĠĠĠĠĠĠĠ Ġval Ġs unday : ĠTextView Ġ= Ġbinding . s unday Num ĊĠĠĠĠĠĠĠ Ġval Ġmon day : ĠTextView Ġ= Ġbinding . mon day Num ĊĠĠĠĠĠĠĠ Ġval Ġt uesday : ĠTextView Ġ= Ġbinding . t uesday Num ĊĠĠĠĠĠĠĠ Ġval Ġw ed nesday : ĠTextView Ġ= Ġbinding . wed nesday Num ĊĠĠĠĠĠĠĠ Ġval Ġth ursday : ĠTextView Ġ= Ġbinding . th ursday Num ĊĠĠĠĠĠĠĠ Ġval Ġf riday : ĠTextView Ġ= Ġbinding . f riday Num ĊĠĠĠĠĠĠĠ Ġval Ġs aturday : ĠTextView Ġ= Ġbinding . s aturday Num ĊĊĠĠĠĠĠĠĠ Ġval Ġpre S unday : ĠLocalDateTime Ġ= ĠLocalDateTime . now (). with ( Temporal Adjust ers . previous ( DayOfWeek . S UND AY )) ĊĠĠĠĠĠĠĠ Ġval Ġstart _ s unday Ġ= Ġpre S unday . format ( DateTime Formatter . of Pattern (" dd ")) ĊĠĠĠĠĠĠĠ ĠLog . d (" ìĿ´ ë²Ī Ġì£¼ ĠìĿ¼ ìļĶ ìĿ¼ ", Ġpre S unday . toString ()) ĊĠĠĠĠĠĠĠ ĠLog . d (" ìĿ´ ë²Ī Ġì£¼ ĠìĿ¼ ìļĶ ìĿ¼ Ġformat ", Ġstart _ s unday ) ĊĊĠĠĠĠĠĠĠ Ġval Ġpre Monday : ĠLocalDateTime Ġ= ĠLocalDateTime . now (). with ( Temporal Adjust ers . previous ( DayOfWeek . MON DAY )) ĊĠĠĠĠĠĠĠ Ġval Ġstart _ mon day Ġ= Ġpre Monday . format ( DateTime Formatter . of Pattern (" dd ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġpre Tuesday : ĠLocalDateTime Ġ= ĠLocalDateTime . now (). with ( Temporal Adjust ers . previous ( DayOfWeek . T UES DAY )) ĊĠĠĠĠĠĠĠ Ġval Ġstart _ t uesday Ġ= Ġpre Tuesday . format ( DateTime Formatter . of Pattern (" dd ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġpre Wednesday : ĠLocalDateTime Ġ= ĠLocalDateTime . now (). with ( Temporal Adjust ers . previous ( DayOfWeek . W ED N ES DAY )) ĊĠĠĠĠĠĠĠ Ġval Ġstart _ wed nesday Ġ= Ġpre Wednesday . format ( DateTime Formatter . of Pattern (" dd ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġpre Thursday : ĠLocalDateTime Ġ= ĠLocalDateTime . now (). with ( Temporal Adjust ers . previous ( DayOfWeek . TH UR SD AY )) ĊĠĠĠĠĠĠĠ Ġval Ġstart _ th ursday Ġ= Ġpre Thursday . format ( DateTime Formatter . of Pattern (" dd ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġpre Friday : ĠLocalDateTime Ġ= ĠLocalDateTime . now (). with ( Temporal Adjust ers . previous ( DayOfWeek . FR ID AY )) ĊĠĠĠĠĠĠĠ Ġval Ġstart _ f riday Ġ= Ġpre Friday . format ( DateTime Formatter . of Pattern (" dd ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġpre Saturday : ĠLocalDateTime Ġ= ĠLocalDateTime . now (). with ( Temporal Adjust ers . previous ( DayOfWeek . S ATUR DAY )) ĊĠĠĠĠĠĠĠ Ġval Ġstart _ s aturday Ġ= Ġpre Saturday . format ( DateTime Formatter . of Pattern (" dd ")) ĊĊĠĠĠĠĠĠĠ Ġs unday . setText ( start _ s unday ) ĊĠĠĠĠĠĠĠ Ġmon day . setText ( start _ mon day ) ĊĠĠĠĠĠĠĠ Ġt uesday . setText ( start _ t uesday ) ĊĠĠĠĠĠĠĠ Ġw ed nesday . setText ( start _ wed nesday ) ĊĠĠĠĠĠĠĠ Ġth ursday . setText ( start _ th ursday ) ĊĠĠĠĠĠĠĠ Ġf riday . setText ( start _ f riday ) ĊĠĠĠĠĠĠĠ Ġs aturday . setText ( start _ s aturday ) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġroot ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Destroy View () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Destroy View () ĊĠĠĠĠĠĠĠ Ġ_ binding Ġ= Ġnull ĊĠĠĠ Ġ} Ċ }