Skip to content

Commit c0939b4

Browse files
committed
update docs
1 parent 842515d commit c0939b4

File tree

2 files changed

+3
-122
lines changed

2 files changed

+3
-122
lines changed

docs/Spren-Vision/Spren-Vision-Android-SDK.md

Lines changed: 2 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -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

docs/Spren-Vision/Spren-Vision-iOS-SDK.md

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
## Spren UI
1010

11-
### Finger Camera Example
11+
### Implementation Example
1212

1313
```swift
1414
import SwiftUI
@@ -58,58 +58,6 @@ SprenUI(config: config)
5858

5959
```
6060

61-
### Body Composition Example
62-
63-
```swift
64-
import SwiftUI
65-
import SprenUI
66-
67-
// create SprenUI configuration
68-
let config = SprenUI.Config(
69-
// API
70-
baseURL: "https://test.api.spren.com",
71-
apiKey: "<API key>",
72-
73-
// user
74-
userID: "<user ID>",
75-
userGender: <optional, male, female, or other>,
76-
userBirthdate: <optional, Date>,
77-
78-
// UI
79-
primaryColor: <optional, Color>, // used for buttons
80-
secondaryColor: <optional, Color>, // used for graphics
81-
82-
project: .bodyComp,
83-
84-
// optionally override graphics
85-
// provide names for image sets in main bundle xcassets
86-
// *all are required for each project if overriding
87-
graphics: [
88-
.setupGuide: "<image set name>",
89-
.serverError: "<image set name>",
90-
.privacy: "<image set name>",
91-
.cameraAccessDenied: "<image set name>",
92-
.incorrectBodyPosition: "<image set name>",
93-
.greetings: "<image set name>",
94-
.bodyPosition: "<image set name>"
95-
],
96-
97-
onCancel: {
98-
// user exited UI before completing a scan
99-
// dismiss SprenUI
100-
},
101-
onFinish: { results in
102-
// user completed a scan!
103-
print(results)
104-
// dismiss SprenUI
105-
}
106-
)
107-
108-
// init SprenUI view
109-
SprenUI(config: config)
110-
111-
```
112-
11361
## SprenCapture and SprenCore
11462

11563
### Implementation Example

0 commit comments

Comments
 (0)