package Ġcom . example . map le leaves . ui . course Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroid . graphics . Color Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġandroidx . lifecycle . Observer Ċ import Ġandroidx . lifecycle . ViewModel Providers Ċ import Ġcom . example . map le leaves . databinding . Activity Teacher Course Binding Ċ import Ġcom . example . map le leaves . logic . model . response . Courses At tended Response Ċ import Ġcom . example . map le leaves . ui . sign ins heet . SignIn Sheet Activity Ċ import Ġcom . example . map le leaves . ui . start signin . Start SignIn Activity Ċ import Ġcom . example . map le leaves . utils . Log Util Ċ import Ġcom . example . map le leaves . utils . My Observer Ċ import Ġcom . google . gson . Gson Ċ Ċ class ĠTe acher Course Activity Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbinding : Activity Teacher Course Binding ĊĊĠĠĠ Ġprivate Ġval ĠTAG = this :: class . java . simple Name ĊĊĠĠĠ Ġprivate Ġval Ġte ach ViewModel Ġby Ġlazy Ġ{ ViewModel Providers . of ( this ). get ( Course ViewModel :: class . java )} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġ// set ContentView ( R . layout . activity _ teacher _ course ) ĊĠĠĠĠĠĠĠ Ġbinding = ĠActivity Teacher Course Binding . inflate ( layout Inflater ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( binding . root ) ĊĊĠĠĠĠĠĠĠ Ġ// Activity çļĦ å¸ĥå±Ģ ä¼ļ æĺ¾ç¤º åľ¨ çĬ¶æĢģ æłı ä¸Ĭ ĊĠĠĠĠĠĠĠ Ġval Ġdecor View = window . decor View ĊĠĠĠĠĠĠĠ Ġdecor View . system Ui Visibility = ĠView . SYSTEM _ UI _ FLAG _ LAYOUT _ FULL SCREEN Ġor ĠView . SYSTEM _ UI _ FLAG _ LAYOUT _ ST ABLE ĊĠĠĠĠĠĠĠ Ġ// Ġwindow . set Decor Fits System Windows ( false ) ĊĠĠĠĠĠĠĠ Ġ// å°Ĩ çĬ¶æĢģ æłı è®¾ç½® æĪĲ éĢı æĺİ èī² ĊĠĠĠĠĠĠĠ Ġwindow . status Bar Color = ĠColor . TRANSP ARENT Ċ Ċ // ĠĠĠĠĠĠĠ Ġval Ġjson Data = intent . getString Extra (" course Data ") Ċ // ĠĠĠĠĠĠĠ Ġval Ġcourse Data = Gson (). fromJson ( json Data , ĠCour ses At tended Response . Data :: class . java ) ĊĊĠĠĠĠĠĠĠ Ġval Ġcourse Data = intent . get Parcelable Extra < Courses At tended Response . Data >(" course Data ") !! ĊĊĠĠĠĠĠĠĠ Ġval Ġimage Id = intent . getInt Extra (" image Id ", 0 ) ĊĊĠĠĠĠĠĠĠ Ġbinding . cl Course Head . setBackground Resource ( image Id ) ĊĊĠĠĠĠĠĠĠ Ġte ach ViewModel . save Course Data ( course Data ) ĊĠĠĠĠĠĠĠ Ġte ach ViewModel . course LiveData . observe ( this , ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbinding . apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtv Course Name . text = it . name ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtv Course Code . text = it . id ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtv Add Course Code . text = it . addClass Code ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtv Course Member Count . text = Ġit . number . toString ()+" äºº " ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġbinding . iv Check Work . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠStart SignIn Activity . action Start ( this , course Data ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġbinding . iv SignIn List . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLog Util . d (" ä¼ł éĢģ çļĦ id "," ${ course Data . id }") ĊĠĠĠĠĠĠĠĠĠĠĠ ĠSign In Sheet Activity . action Start ( this , course Data . id ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġlifecycle . add Observer ( My Observer ( TAG )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġstart Teacher Course Activity ( context : ĠContext , Ġcourse Data : ĠCour ses At tended Response . Data , image Id : Int ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġintent = ĠIntent ( context , ĠTe acher Course Activity :: class . java ). apply Ġ{ Ċ // ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġput Extra (" course Data ", ĠGson (). toJson ( course Data )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġput Extra (" course Data ", Ġcourse Data ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġput Extra (" image Id ", Ġimage Id ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext . startActivity ( intent ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }