Start a Project

Slices UI template in android

Slice is the UI component that can display the contents from your application form within the Google Search app and later in other places like the Google Assistant or Google Assistant devices.

Rich and flexible layouts

Using templets. you can customize your Slices with color, text, imagery, video, and more to match your app’s design.

Slices Architecture

<!– To provide slices you must define a slice provider –>

Each Slice has an associated URI. When a surface wants to display a Slice, it sends a binding request to your app with this URI. Your app then handles
this request and dynamically builds the Slice via the onBindSlice method. The surface can then display the Slice when appropriate.

Interactive Slices

Similar to notifications, you can handle clicks within your Slice by attaching PendingIntent objects that are
triggered on user interaction. The example below starts an Activity that can receive and handle those intents:

Slices also support other input types, such as toggles, that include the state in the intent that is sent to the app.

The receiver can then check the state that it receives:

Templates:-
Slices support a variety of templates.
https://developer.android.com/guide/slices/templates

Exit mobile version