@@ -56,7 +56,7 @@ The open source code is available in the [Spren Vision Android SDK GitHub Reposi
5656
5757## Spren UI
5858
59- ### Finger Camera Example
59+ ### Implementation Example
6060
6161``` kotlin
6262// MainActivity.kt
@@ -121,73 +121,6 @@ class MainActivity : AppCompatActivity() {
121121}
122122```
123123
124- ### Body Composition Example
125-
126- ``` kotlin
127- // MainActivity.kt
128-
129- import com.spren.sprenui.SprenUI
130-
131- class MainActivity : AppCompatActivity () {
132-
133- private lateinit var binding: ActivityMainBinding
134- private lateinit var hardwareAlert: HardwareAlert
135-
136- override fun onCreate (savedInstanceState : Bundle ? ) {
137- super .onCreate(savedInstanceState)
138-
139- // optionally set custom theme
140- // theme inherits from "Theme.MaterialComponents.DayNight.NoActionBar"
141- // see themes.xml example below
142- setTheme(R .style.Theme_SprenUI )
143-
144- binding = ActivityMainBinding .inflate(layoutInflater)
145- setContentView(binding.root)
146-
147- // optionally check if hardware is compatible
148- hardwareAlert = HardwareAlert (this )
149- if (! HardwareCheck .isHighPerformingDevice(this )) {
150- hardwareAlert.show()
151- }
152-
153- // set user ID
154- SprenUI .Config .userId = .. .
155-
156- // optionally set user biological sex
157- SprenUI .Config .userGender = .. .
158-
159- // optionally set user birthdate
160- SprenUI .Config .userBirthdate = .. .
161-
162- // after dismissing results screen
163- SprenUI .Config .onFinish =
164- { _, results ->
165- // user completed a scan!
166- print (results)
167- // dismiss SprenUI
168- }
169-
170-
171- SprenUI .Config .onCancel = {
172- // handle user exit of UI flow without completing a scan
173- }
174-
175- // optionally override default intro screen graphics
176- // provide drawable ids for image sets in project
177- // *all are required for each project if overriding
178- SprenUI .Config .graphics = mapOf (
179- SprenUI .Graphic .GREETINGS to < image set drawable id> ,
180- SprenUI .Graphic .PRIVACY to < image set drawable id> ,
181- SprenUI .Graphic .CAMERA_ACCESS_DENIED < image set drawable id> ,
182- SprenUI .Graphic .PHOTOS_ACCESS_DENIED to < image set drawable id> ,
183- SprenUI .Graphic .SETUP_GUIDE to < image set drawable id> ,
184- SprenUI .Graphic .SERVER_ERROR to < image set drawable id> ,
185- SprenUI .Graphic .INCORRECT_BODY_POSITION to < image set drawable id>
186- )
187- }
188- }
189- ```
190-
191124### Layout and Theme
192125
193126``` xml
@@ -201,7 +134,7 @@ class MainActivity : AppCompatActivity() {
201134 android : layout_height =" match_parent"
202135 app : api_key =" @string/api_key"
203136 app : base_url =" @string/base_url"
204- app : project =" FINGER_CAMERA" or " BODY_COMPOSITION "
137+ app : project =" FINGER_CAMERA"
205138 tools : context =" .MainActivity" />
206139```
207140
0 commit comments