Skip to content

Attributes and Parameters Reference

Tonic Artos edited this page Feb 27, 2015 · 2 revisions

SuperSLiM uses layout parameters to load per view data about the views coming from the RecyclerView adapter. When you bind your data to your ViewBinders in your adapter your can programmatically use the SuperSLiM LayoutParams, or use XML views with the attributes appropriately set.

All item views

Required

slm_section_firstPosition

integer
Adapter position of the first view in the section. This is often a header view, and is the only valid location for a header view in a section.

A MissingFirstPositionException will be thrown if a view does not have this attribute or LayoutParameter set.

slm_section_sectionManager

integer|string Section layout manager for the section to which this view belongs. If a string value is set then the matching registered custom SLM will be used.

To use a built-in SLM the following values can be used.

  • LinearSLM.ID
  • GridSLM.ID

A MissingLayoutException will be thrown if the first view of a section does not have this attribute or LayoutParameter set.

An UnknownSectionLayoutException will be thrown if an unknown integer is passed, or if the string value does not match a registered custom SLM.


First item view in section

Optional

slm_isHeader

boolean
Indicate if the view is a header. If it is a header it must be the first view of its section.

default value = false

slm_headerDisplay

flag
Configuration for how to display headers.

default value = inline|sticky
flags
inline - Position header above the section.
start - Position the header to the start side of the section (for left to right languages this is the left side).
end - Position the header to the end side of the section.
overlay - Display the header over the top of the section contents.
sticky - Sticky the header to the top of the screen if any part of its section is displayed and its normal position would place it off the screen.

slm_section_headerMarginStart

enum | dimension
The header start margin is the area allotted only for headers on the start edge of the section. A start aligned header will align to the section edge of the start margin and overflow off the start side of the RecyclerView if it is too large.

default value = match_header
enums
match_header - Match the margin size to the header size.
dimension value
Some dimension value such as 32dips.

slm_section_headerMarginEnd

enum | dimension
The header end margin is the area allotted only for headers on the end edge of the section. An end aligned header will align to the section edge of the header margin and overflow off the end side of the RecyclerView if it is too large.

default value = match_header
enums
match_header - Match the margin size to the header size.
dimension value
Some dimension value such as 32dips.


Versioned Pages

0.4

[Getting Started](Getting started with version 0.4)
[User's Guide](User's guide for version 0.4)

version5 (WIP)

User documentation
[Basic usage](A simple tutorial)
[Advanced usage](All the cool things)
[SuperSLiM and RxJava](Using SuperSLiM with RxJava)

Developers documentation
Glossary
[The section graph](The section graph)
[Tracking data changes](Tracking data changes)
[Configuration transformations](Configuration transformations)
[Layout helpers](Layout helpers)
[Section configuration](Section configuration)
[Section state](Section state)
[Section layout managers](Section layout managers)
[Header layout managers](Header layout managers)

Clone this wiki locally