Detail View Controller Guide
The Entrupy Android SDK's Detail View Controller provides a comprehensive interface for displaying authentication results and managing item-specific interactions. This full-screen activity presents detailed information about an authenticated item, including the final result, certificate access, support features, and catalog data.
Overview
The Detail View Controller is the primary interface for users to interact with completed authentication results. It serves as a central hub for:
- Result Display: Showing the final authentication outcome (Authentic, Unidentified, etc.).
- Certificate Access: Providing links to digital certificates of authenticity.
- Support Integration: Enabling item-specific support communications.
- Catalog Data: Displaying rich product information and condition details.
- Flag Management: Allowing users to flag results for review.
Launching the Detail View
You can launch the Detail View Controller using an Entrupy ID obtained from various sources:
From Capture Flow
After a successful capture, you can immediately show the Detail View:
// Kotlin
import com.entrupy.sdk.EntrupySDK
class YourActivity : AppCompatActivity(), EntrupyCaptureCallback {
override fun onCaptureCompleteSuccessfully(result: EntrupyCaptureResult, item: Map<String, Any>) {
val entrupyId = result.item.entrupyId
// Show Detail View immediately after capture
EntrupySDK.getInstance().showDetailView(this, entrupyId)
}
}
From Search Results
When displaying search results, allow users to tap on items to view details:
// Kotlin
class SearchResultsActivity : AppCompatActivity() {
fun onItemClicked(entrupyId: String) {
// Launch Detail View for the selected item
EntrupySDK.getInstance().showDetailView(this, entrupyId)
}
}
From Custom UI
Launch the Detail View from any part of your application:
// Kotlin
fun showItemDetails(entrupyId: String) {
if (EntrupySDK.getInstance().isAuthorizationValid()) {
EntrupySDK.getInstance().showDetailView(this, entrupyId)
} else {
// Handle re-authorization
println("User not authorized. Please log in again.")
}
}
Detail View Content
The Detail View Controller displays comprehensive information organized into several sections:
1. Authentication Result
- Primary Result: The final authentication outcome (Authentic, Unidentified, Not Supported, Invalid).
- Confidence Level: Indication of the system's confidence in the result.
- Processing Timeline: History of the authentication process.
2. Item Information
- Basic Details: Brand, style name, size, and other metadata provided during capture.
- Images: High-quality images captured during the authentication process.
- Serial Numbers: Any serial numbers or identifying marks found on the item.
3. Certificate Access
- Digital Certificate: For authentic items, a link to the digital certificate of authenticity.
- Sharing Options: Ability to share the certificate via various methods.
- Certificate Details: Certificate ID, issue date, and other relevant information.
4. Catalog Data
- Product Information: Detailed product attributes, materials, and specifications.
- Condition Assessment: Physical condition evaluation and scoring.
- Marketplace Context: Relevant market information and pricing data.
5. Support Features
- Flag Management: Options to flag results for review or clear existing flags.
- Support Chat: Item-specific support communication interface.
- Contact Information: Direct access to Entrupy support.
Detail View Callbacks
The Detail View Controller provides callback methods to handle user interactions:
// Kotlin
class YourActivity : AppCompatActivity(), EntrupyDetailViewCallback {
// Called when the user requests to share the certificate
override fun onShareCertificateRequested(entrupyId: String, certificateUrl: String) {
println("User requested to share certificate for item: $entrupyId")
// Handle certificate sharing, e.g., open share dialog
shareCertificate(certificateUrl)
}
// Called when the user flags or clears a flag on the result
override fun onFlagStatusChanged(entrupyId: String, isFlagged: Boolean) {
val action = if (isFlagged) "flagged" else "unflagged"
println("Item $entrupyId was $action")
// Update your UI or backend to reflect the flag status change
}
// Called when the user requests support for the item
override fun onSupportRequested(entrupyId: String) {
println("User requested support for item: $entrupyId")
// Handle support request, e.g., open support chat
}
// Called when the Detail View is dismissed
override fun onDetailViewDismissed(entrupyId: String) {
println("Detail View dismissed for item: $entrupyId")
// Handle dismissal, e.g., return to previous screen
finish()
}
// Called when the user requests a retake for the item
override fun onRetakeRequested(entrupyId: String) {
println("User requested retake for item: $entrupyId")
// Handle retake request, e.g., launch capture flow again
startCaptureForRetake(entrupyId)
}
}
Customizing the Detail View
1. Theming and Branding
The Detail View respects the same theming configuration as other SDK components. See UI Theme Customization for details on customizing colors, fonts, and other visual elements.
2. Content Configuration
You can configure which sections are displayed in the Detail View:
// Kotlin
// Configure Detail View content sections
val detailViewConfig = EntrupyDetailViewConfig.Builder()
.setShowCertificateSection(true) // or false
.setShowCatalogDataSection(true) // or false
.setShowSupportSection(true) // or false
.setShowFlagSection(true) // or false
.setShowRetakeOption(true) // or false
.build()
EntrupySDK.getInstance().setDetailViewConfig(detailViewConfig)
3. Custom Actions
Add custom actions to the Detail View:
// Kotlin
// Add custom action buttons to the Detail View
val customAction = EntrupyCustomAction.Builder()
.setTitle("Add to Wishlist")
.setIcon(R.drawable.ic_wishlist)
.setAction { entrupyId ->
// Handle custom action
addToWishlist(entrupyId)
}
.build()
val detailViewConfig = EntrupyDetailViewConfig.Builder()
.addCustomAction(customAction)
.build()
EntrupySDK.getInstance().setDetailViewConfig(detailViewConfig)
Integration with Other SDK Components
1. Flag Management
The Detail View integrates with the flagging system described in Handling Result Flags:
// Kotlin
// Handle flag status changes from Detail View
override fun onFlagStatusChanged(entrupyId: String, isFlagged: Boolean) {
// Update your backend or local storage
updateFlagStatus(entrupyId, isFlagged)
// Optionally refresh the Detail View to show updated status
EntrupySDK.getInstance().refreshDetailView(entrupyId)
}
2. Support Integration
The Detail View provides access to item-specific support features:
// Kotlin
// Handle support requests from Detail View
override fun onSupportRequested(entrupyId: String) {
// Launch support chat or contact form
launchSupportChat(entrupyId)
}
3. Catalog Data Display
The Detail View automatically displays Catalog Data when available. See Understanding Catalog Data in SDK for more information.
Best Practices
1. User Experience
- Consistent Navigation: Maintain consistent navigation patterns across your app.
- Loading States: Show appropriate loading indicators while the Detail View loads.
- Error Handling: Gracefully handle cases where the Detail View cannot be displayed.
2. Performance
- Efficient Loading: The Detail View should load quickly and display content progressively.
- Image Optimization: Handle image loading and caching appropriately.
- Memory Management: Ensure proper cleanup when the Detail View is dismissed.
3. Accessibility
- Screen Reader Support: Ensure all content is accessible to screen readers.
- Keyboard Navigation: Support keyboard navigation for all interactive elements.
- High Contrast: Respect user's accessibility settings.
Next Steps
- Learn about Programmatic Access to Session Data for custom UI implementations.
- Understand Programmatic Customer Support features.
- Explore UI Theme Customization for visual customization options.