package Ġde . r ki . cor on aw arn app . ui . submission . test result . positive Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġandroid . view . accessibility . Accessibility Event Ċ import Ġandroidx . activity . On Back Pressed Callback Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . navigation . fragment . nav Args Ċ import Ġcom . google . android . material . dialog . Material AlertDialog Builder Ċ import Ġde . r ki . cor on aw arn app . R Ċ import Ġde . r ki . cor on aw arn app . databinding . Fragment Submission TestResult Positive No Consent Binding Ċ import Ġde . r ki . cor on aw arn app . family test . core . model . Family Cor ona Test Ċ import Ġde . r ki . cor on aw arn app . util . di . Auto Inject Ċ import Ġde . r ki . cor on aw arn app . util . shortcuts . App Shortcut s Helper Ċ import Ġde . r ki . cor on aw arn app . util . ui . do Navigate Ċ import Ġde . r ki . cor on aw arn app . util . ui . observe 2 Ċ import Ġde . r ki . cor on aw arn app . util . ui . view Binding Ċ import Ġde . r ki . cor on aw arn app . util . view model . C WA ViewModel Factory Provider Ċ import Ġde . r ki . cor on aw arn app . util . view model . c wa ViewModels Ass isted Ċ import Ġjavax . inject . Inject Ċ Ċ /** Ċ Ġ* Ġ[ Submission TestResult No Consent Fragment ], Ġthe Ġtest Ġresult Ġscreen Ġthat Ġis Ġshown Ġto Ġthe Ġuser Ġif Ġthey Ġhave Ġnot Ġprovided Ċ Ġ* Ġconsent Ċ Ġ*/ Ċ class ĠSubmission TestResult No Consent Fragment Ġ: ĊĠĠĠ ĠFragment ( R . layout . fragment _ submission _ test _ result _ positive _ no _ consent ), ĊĠĠĠ ĠAuto Inject Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġnav Args Ġby Ġnav Args < Submission TestResult No Consent Fragment Args >() ĊĊĠĠĠ Ġ@ Inject Ġlateinit Ġvar Ġapp Shortcut s Helper : ĠApp Shortcut s Helper ĊĠĠĠ Ġ@ Inject Ġlateinit Ġvar ĠviewModel Factory : ĠC WA ViewModel Factory Provider . Factory ĊĠĠĠ Ġprivate Ġval Ġbinding : ĠFragment Submission TestResult Positive No Consent Binding Ġby Ġview Binding () ĊĠĠĠ Ġprivate Ġval ĠviewModel : ĠSubmission TestResult No Consent ViewModel Ġby Ġc wa ViewModels Ass isted ( ĊĠĠĠĠĠĠĠ Ġfactory Producer Ġ= Ġ{ ĠviewModel Factory Ġ}, ĊĠĠĠĠĠĠĠ Ġconstructor Call Ġ= Ġ{ Ġfactory , Ġ_ Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfactory Ġas ĠSubmission TestResult No Consent ViewModel . Factory ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfactory . create ( nav Args . test Identifier ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĠĠĠĠĠĠĠ ĠviewModel . on Test Opened () ĊĊĠĠĠĠĠĠĠ Ġval Ġback Callback Ġ= Ġobject Ġ: ĠOn Back Pressed Callback ( true ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġhandle On Back Pressed () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġshow Cancel Dialog () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġrequire Activity (). on Back Pressed Dispatcher . add Callback ( view Lifecycle Owner , Ġback Callback ) ĊĊĠĠĠĠĠĠĠ ĠviewModel . ui State . observe 2 ( this ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbinding . submission TestResult Section . set TestResult Section ( it . cor ona Test ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( it . cor ona Test Ġis ĠFamily Cor ona Test ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġbinding . toolbar . title Ġ= ĠgetText ( R . string . submission _ test _ result _ headline ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġbinding . family Member Name . text Ġ= Ġit . cor ona Test . person Name ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġbinding . apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbinding . toolbar . set Navigation OnClickListener Ġ{ Ġshow Cancel Dialog () Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsubmission TestResult Positive No Consent Button Abort . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġshow Cancel Dialog () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsubmission TestResult Positive No Consent Button Warn Others . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġnavigate To Warn Others () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Resume () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Resume () ĊĠĠĠĠĠĠĠ Ġapp Shortcut s Helper . remove App Shortcut () ĊĠĠĠĠĠĠĠ Ġbinding . submission TestResult Container . send Accessibility Event ( Accessibility Event . TYPE _ AN NOUN CE MENT ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġshow Cancel Dialog () Ġ{ ĊĠĠĠĠĠĠĠ ĠMaterial AlertDialog Builder ( require Context ()). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠsetTitle ( R . string . submission _ test _ result _ positive _ no _ consent _ dialog _ title ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġset Message ( R . string . submission _ test _ result _ positive _ no _ consent _ dialog _ message ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġset Negative Button ( R . string . submission _ test _ result _ positive _ no _ consent _ dialog _ positive _ button ) Ġ{ Ġ_, Ġ_ Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġset Positive Button ( R . string . submission _ test _ result _ positive _ no _ consent _ dialog _ negative _ button ) Ġ{ Ġ_, Ġ_ Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġnavigate To Home () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ}. show () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġnavigate To Home () Ġ{ ĊĠĠĠĠĠĠĠ Ġdo Navigate ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠSubmission TestResult No Consent Fragment Directions . action Submission TestResult No Consent Fragment To Home Fragment () ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġnavigate To Warn Others () Ġ{ ĊĠĠĠĠĠĠĠ Ġdo Navigate ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠSubmission TestResult No Consent Fragment Directions ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. action Submission TestResult No Consent Fragment To Submission Result Positive Other Warning No Consent Fragment ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtest Identifier Ġ= Ġnav Args . test Identifier ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ } Ċ