package Ġcz . kot ox . template . ui . wizard Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroidx . databinding . ViewData Binding Ċ import Ġandroidx . fragment . app . Fragment Activity Ċ import Ġandroidx . lifecycle . Lifecycle Observer Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġandroidx . lifecycle . ViewModel Providers Ċ import Ġandroidx . navigation . Navigation Ċ import Ġcz . kot ox . core . arch . Base Activity ViewModel Ċ import Ġcz . kot ox . core . arch . Base Fragment ViewModel Ċ import Ġcz . kot ox . core . arch . Base ViewModel Ċ import Ġcz . kot ox . core . database . Preferences Common Ċ import Ġcz . kot ox . core . entity . App Version Ċ import Ġcz . kot ox . template . R Ċ import Ġcz . kot ox . template . databinding . Wizard Activity Binding Ċ import Ġcz . kot ox . template . model . Value Sample Ċ import Ġtim ber . log . Tim ber Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠWizard Activity Ġ: ĠBase Activity ViewModel < Wizard ViewModel , ĠWizard Activity Binding >() Ġ{ ĊĊ ĉ @ Inject Ċ ĉ late init Ġvar Ġpreferences Common : ĠPreferences Common ĊĊ ĉ override Ġfun Ġinf late Binding Layout ( in flater : ĠLayoutInflater ) Ġ= ĠWizard Activity Binding . inflate ( in flater ) ĊĊ ĉ override Ġfun Ġsetup ViewModel () Ġ= Ġfind ViewModel < Wizard ViewModel >() ĊĊ ĉ override Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ Ċĉ ĉ super . onCreate ( savedInstanceState ) ĊĊĉ ĉ Navigation . find Nav Controller ( this , ĠR . id . analyzer _ nav _ host _ fragment ) Ċĉĉ ĉ . set Graph ( R . navigation . analyzer _ navigation , Ġintent . extras ) ĊĊ ĉ } Ċ Ċ } Ċ Ċ class ĠWizard ViewModel Ġ@ Inject Ġconstructor ( app Version : ĠApp Version ) Ġ: ĠBase ViewModel (), ĠLifecycle Observer Ġ{ ĊĊ ĉ val Ġpitch List Ġ= Ġmutable ListOf < Value Sample >( Ċĉ ĉ Value Sample ( 1 0 0 f , Ġ 0 . 1 2 5 0 0 , Ġ 0 . 3 f , Ġ 1 0 0 f ), Ċĉ ĉ Value Sample ( 1 0 1 f , Ġ 0 . 1 4 0 0 0 , Ġ 0 . 3 f , Ġ 1 0 1 1 f ) Ċ ĉ ) ĊĊ ĉ init Ġ{ Ċĉ ĉ Tim ber . e ("> >> ĠAnalyzer ViewModel ĠINIT ") Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Cle ared () Ġ{ Ċĉ ĉ Tim ber . e ("> >> ĠAnalyzer ViewModel ĠC LE ARE D ") Ċĉ ĉ super . on Cle ared () Ċ ĉ } Ċ } Ċ Ċ abstract Ġclass ĠBase Wizard Fragment < V Ġ: ĠBase Wizard ViewModel , ĠB Ġ: ĠView Data Binding > Ġ: ĠBase Fragment ViewModel < V , ĠB >() Ġ{ Ċ ĉ comp anion Ġobject Ġ{ Ċĉ ĉ fun Ġget Create Consult ation ViewModel ( activity : ĠFragment Activity , ĠviewModel Factory : ĠViewModel Provider . Factory ) Ġ= Ċĉĉ ĉ ViewModel Providers . of ( activity , ĠviewModel Factory ). get ( Wizard ViewModel :: class . java ) Ċ ĉ } ĊĊ ĉ /** Ċĉ Ġ* ĠDifferent Ġabstract Ġclass , Ġso Ġthat Ġevery Ġwizard Ġfragment Ġhas Ġmain Ġview Ġmodel Ġset Ċĉ Ġ*/ Ċ ĉ abstract Ġfun Ġsetup Wizard ViewModel (): ĠV ĊĊ ĉ /** Ċĉ Ġ* ĠFor Ġwizard Ġscreens Ġthis Ġis Ġfinal , Ġso Ġthat Ġwe Ġcan Ġensure , Ġevery Ġscreen Ġhas Ġmain ViewModel Ġinitialized Ċĉ Ġ*/ Ċ ĉ final Ġoverride Ġfun Ġsetup ViewModel (): ĠV Ġ{ Ċĉ ĉ val Ġcurrent ViewModel Ġ= Ġsetup Wizard ViewModel () Ċĉ ĉ current ViewModel . main ViewModel Ġ= Ġget Create Consult ation ViewModel ( base Activity , ĠviewModel Factory ) Ċĉ ĉ return Ġcurrent ViewModel Ċ ĉ } Ċ } Ċ Ċ abstract Ġclass ĠBase Wizard ViewModel Ġ: ĠBase ViewModel (), ĠLifecycle Observer Ġ{ Ċ ĉ late init Ġvar Ġmain ViewModel : ĠWizard ViewModel Ġ// Ġis Ġinserted Ġafter Ġconstructor Ċĉ ĉ internal Ġset Ċ Ċ }