Package-level declarations

Types

Link copied to clipboard
fun interface LayoutProvider<VM>

Provides a layout resource ID for a given view model. This allows for individual items within the same priority layout to have different layouts.

Link copied to clipboard
fun interface OverflowChangedListener<T>

Listener for overflowing items of a TtPriorityLayout.

Link copied to clipboard
interface Prioritizable

Offers a priority which is used for determining whether a view will be visible if there is not enough space in a TtPriorityLayout container.

Link copied to clipboard
open class TtPriorityLayout<T : Prioritizable> @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = ID_NULL) : LinearLayout

A LinearLayout that adjust its child views visibility according to the available space. The child views' priorities determine which views will be shown. The view with the lowest priority will be hidden first if the available space is not enough. When views share the same priority, the one that appears in ttContents first, will be prioritized to show.

Link copied to clipboard
open class TtSharedPriorityLayout @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : LinearLayout

Takes priorities of all views in its own child TtPriorityLayouts into account to determine which views are visible when there is not enough space. Views with lower priorities among all TtPriorityLayouts will be hidden first when there is not enough space. This is useful in situations where multiple priority layouts compete for space in the same orientation. And when there is not enough space sometimes an item from one priority layout should disappear and sometimes from another.