package Ġcom . hyper track . android . ui . screens . permission _ request Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġandroidx . fragment . app . view Models Ċ import Ġandroidx . navigation . fragment . find Nav Controller Ċ import Ġcom . hyper track . android . ui . base . Progress Dialog Fragment Ċ import Ġcom . hyper track . android . ui . base . navigate Ċ import Ġcom . hyper track . android . ui . common . util . set G one State Ċ import Ġcom . hyper track . android . utils . My Application Ċ import Ġcom . hyper track . logistics . android . github . R Ċ import Ġkotlinx . android . synt hetic . main . fragment _ permission _ request .* Ċ Ċ class ĠPermission Request Fragment Ġ: ĠProgress Dialog Fragment ( R . layout . fragment _ permission _ request ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġvm : ĠPermission Request ViewModel Ġby Ġview Models Ġ{ ĊĠĠĠĠĠĠĠ ĠMy Application . injector . provide User Scope ViewModel Factory () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġvm . destination . observe ( view Lifecycle Owner , Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfind Nav Controller (). navigate ( it ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġvm . show Skip Button . observe ( view Lifecycle Owner ) Ġ{ Ġvisible Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbtn Skip . set G one State (! visible ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġvm . show Permissions Button . observe ( view Lifecycle Owner ) Ġ{ Ġshow Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbtn Allow . set G one State (! show ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġbtn Skip . setOnClickListener Ġ{ Ġvm . on Skip Clicked () Ġ} ĊĠĠĠĠĠĠĠ Ġbtn Allow . setOnClickListener Ġ{ Ġvm . request Permissions ( main Activity ()) Ġ} ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Resume () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Resume () ĊĠĠĠĠĠĠĠ Ġvm . on Resume ( main Activity ()) ĊĠĠĠ Ġ} Ċ }