Documentation ¶
Overview ¶
Package chat implements chat components for [gio](https://gioui.org).
Index ¶
Constants ¶
const NoID = RowID("")
NoID is a special ID that can be used by Rows that do not require a unique identifier. Only stateless rows may go without a unique identifier.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Allocator ¶
type Allocator func(current Row) (state interface{})
Allocator is a function that can allocate the appropriate state type for a given Row.
type Presenter ¶
Presenter is a function that can transform the data for a Row into a widget to be laid out in the user interface.
type Row ¶
type Row interface { // ID returns a unique identifier for the Row, if it has one. // In order for a Row to be stateful, it _must_ return a unique // ID. Rows that are not stateful may return the special ID // NoID to indicate that they do not need any state allocated // for them. ID() RowID }
Row is a type that can be presented by a RowManager.
type RowManager ¶
type RowManager struct { // Rows is the list of data to present. Rows []Row // contains filtered or unexported fields }
RowManager presents heterogenous Row data. Each row could represent any element of an interface that occupies a horizontal slice of screen real-estate.
func NewManager ¶
func NewManager(allocator Allocator, presenter Presenter) *RowManager
NewManager constructs a manager with the given allocator and presenter.
func (*RowManager) Layout ¶
func (m *RowManager) Layout(gtx layout.Context, index int) layout.Dimensions
Layout the Row at position index within the manager's Row list.
func (*RowManager) Len ¶
func (m *RowManager) Len() int
Len returns the number of rows managed by this manager.
Directories ¶
Path | Synopsis |
---|---|
Loader adapted from Egon's https://github.com/egonelbre/expgio.
|
Loader adapted from Egon's https://github.com/egonelbre/expgio. |
Package debug provides tools for debugging Gio layout code.
|
Package debug provides tools for debugging Gio layout code. |
example
|
|
kitchen
Package kitchen demonstrates the various chat components and features.
|
Package kitchen demonstrates the various chat components and features. |
kitchen/appwidget
Package appwidget provides domain-specific stateful chat widgets.
|
Package appwidget provides domain-specific stateful chat widgets. |
kitchen/appwidget/apptheme
Package apptheme provides domain-specific material design chat widgets.
|
Package apptheme provides domain-specific material design chat widgets. |
kitchen/gen
Package gen implements data generators for the chat kitchen.
|
Package gen implements data generators for the chat kitchen. |
kitchen/model
Package model provides the domain-specific data models for this list.
|
Package model provides the domain-specific data models for this list. |
ninepatch
Package example is a playground for toying with and showcasing 9-Patch.
|
Package example is a playground for toying with and showcasing 9-Patch. |
Package ninepatch implements 9-Patch image rendering in Gio.
|
Package ninepatch implements 9-Patch image rendering in Gio. |
Package profile unifies the profiling api between Gio profiler and pkg/profile.
|
Package profile unifies the profiling api between Gio profiler and pkg/profile. |
Package widget provides stateful widget types for building chat interfaces.
|
Package widget provides stateful widget types for building chat interfaces. |
material
Package material provides material design building blocks for chat interfaces.
|
Package material provides material design building blocks for chat interfaces. |
plato
Package plato implements themed styles for Plato Team Inc.
|
Package plato implements themed styles for Plato Team Inc. |