Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

List container subcontroller

List container controller and subcontroller

Prior to Brew MP 1.0.4, the list container touch controller (ListContainerTC) provided all of the controller functionality for the list container widget.

Brew MP 1.0.4 provides a master controller (ListContainerTC) and a subcontroller (ListContainerSubTC), which splits the controller functionality into two groups: one that nearly every list will use and one that contains the functionality that is often customized by manufacturers. The ListContainerTC provides the following functionality:

  • Capture
  • Flick, livescroll, and item pressed notifications
  • Click and double-click notifications
  • The behavior of the touch controller in case livescroll is not set
  • Placeholder support

The ListContainerSubTC provides the following functionality:

  • Livescroll
  • Selection
  • Focus
  • Flick
  • Rubberband

Developers can implement their own ListContainerSubTC to provide additional or different functionality for touch control.

The ListContainerTC sends pointer events to the ListContainerSubTC. Based on the pointer information, the content can be scrolled or flicked, items can be moved from one location to another, etc.

The IController interface provides two functions are provided for setting and getting the subcontroller:

  • IController_SetSubController()
  • IController_GetSubController()

For more information on these function, see the http://developer.brewmp.com/reference/api-all.

The subcontroller is responsible for creating the effect transitions such as flick transition and rubberbanding because only it has information about the state (size) of the list items. In addition, it can be customized to provide support to features such as double-flick and hovering.

As soon as the transition is inserted into the transition manager, it is the responsibility of the subcontroller to notify the parent touch controller by calling IController_SetActiveTransition(). After all active transitions have completed, the ListContainerTC expects that the subcontroller will call IController_SetActiveTransition(me->piTC, NULL).