package Ġcom . flip per devices . pair . impl . find stand art Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġandroidx . compose . runtime . Composable Ċ import Ġandroidx . core . content . edit Ċ import Ġandroidx . fragment . app . view Models Ċ import Ġcom . flip per devices . bridge . api . scanner . Dis covered Bluetooth Device Ċ import Ġcom . flip per devices . core . di . Component Holder Ċ import Ġcom . flip per devices . core . preference . Flip per SharedPreferences Ċ import Ġcom . flip per devices . core . preference . Flip per SharedPreferences Key Ċ import Ġcom . flip per devices . core . ui . Compose Fragment Ċ import Ġcom . flip per devices . pair . impl . di . Pair Component Ċ import Ġcom . flip per devices . pair . impl . find stand art . compose . Compose Find Device Ċ import Ġcom . flip per devices . pair . impl . find stand art . service . BLE Device ViewModel Ċ import Ġcom . flip per devices . pair . impl . navigation . machine . Pair Screen State Dispatcher Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠStand art Find Fragment Ġ: ĠCompose Fragment () Ġ{ ĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġstate Dispatcher : ĠPair Screen State Dispatcher ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġshared Preferences : ĠFlip per SharedPreferences ĊĊĠĠĠ Ġprivate Ġval Ġble Device ViewModel Ġby Ġview Models < BLE Device ViewModel >() ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠComponent Holder . component < Pair Component >(). inject ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Composable ĊĠĠĠ Ġoverride Ġfun ĠRender View () Ġ{ ĊĠĠĠĠĠĠĠ ĠCompose Find Device ( ble Device ViewModel ) Ġ{ Ġble Device Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġon Device Selected ( ble Device ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĠĠĠĠĠĠĠ Ġble Device ViewModel . start Scan IfNot Y et () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġon Device Selected ( dis covered Bluetooth Device : ĠDis covered Bluetooth Device ) Ġ{ ĊĠĠĠĠĠĠĠ Ġble Device ViewModel . stop Scan And Reset () ĊĠĠĠĠĠĠĠ Ġshared Preferences . edit Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġput String ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠFlip per SharedPreferences Key . DEVICE _ ID , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġdiscovered Bluetooth Device . address ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġstate Dispatcher . invalidate Current State Ġ{ Ġit . copy ( device Pa ired Ġ= Ġtrue ) Ġ} ĊĠĠĠ Ġ} Ċ } Ċ