- Material components with a Material3 theme
After initialisation of the core SDK, you can use
Snabble.setCheckedInShop to register a
shop with all UI components.
After that you should be able to either start an Activity like
or use the various Fragments or View's.
For a more seamless integration it's recommended to use Fragments and include those in your usual app flow.
Activities are less flexible, but work out of the box.
If you use a navigation framework that does not support Fragments, you can use the View's directly. But you need to make sure the Arguments in the provided Bundle are getting passed correctly. See the Fragments source code for more details
Most screens require that a you are checked in to a shop, or they will show an error.
Exceptions are View's for entering payment credentials.
Inject into Navigation Flow
The SDK does need to switch to different Screens at different times (For example, when starting a Checkout).
If you do not register any UI actions, activities will be launched. If you want to integrate the SDK more deeply into your App, you need to add Handlers to Events.
Todo that, call
SnabbleUI.setUiAction which will then be called instead of opening an Activity.
In some cases Activities will still be launched, which will then not invoke the UI action handler.
The SDK uses Material 3 theme styling where possible.
Activities can also use a MaterialToolbar, to enable using a Toolbar set the Theme attribute snabbleToolbarStyle.
The SDK supports Material 3 DayNight themes.
Checkout State Persistence
The CheckoutActivity may automatically started and be restored, if a Checkout is still in progress. If you dont want this behaviour add the following to your AndroidManifest.xml
You may then call
CheckoutActivity.restoreCheckoutIfNeeded(context) when you find it
acceptable to potentially restore pending checkouts after losing app state.
List of UI Actions
List of UI Components