Table Of Contents
RecycleView Layouts¶
バージョン 1.10.0 で追加.
The Layouts handle the presentation of views for the
RecycleView
.
警告
This module is highly experimental, its API may change in the future and the documentation is not complete at this time.
-
class
kivy.uix.recycleview.layout.
LayoutSelectionBehavior
(**kwargs)[ソース]¶ ベースクラス:
kivy.uix.behaviors.compoundselection.CompoundSelectionBehavior
The
LayoutSelectionBehavior
can be combined withRecycleLayoutManagerBehavior
to allow its derived classes selection behaviors similarly to howCompoundSelectionBehavior
can be used to add selection behaviors to normal layout.RecycleLayoutManagerBehavior
manages its children differently than normal layouts or widgets so this class adaptsCompoundSelectionBehavior
based selection to work withRecycleLayoutManagerBehavior
as well.Similarly to
CompoundSelectionBehavior
, one can select using the keyboard or touch, which callsselect_node()
ordeselect_node()
, or one can call these methods directly. When a item is selected or deselectedapply_selection()
is called. Seeapply_selection()
.-
apply_selection
(index, view, is_selected)[ソース]¶ Applies the selection to the view. This is called internally when a view is displayed and it needs to be shown as selected or as not selected.
It is called when
select_node()
ordeselect_node()
is called or when a view needs to be refreshed. Its function is purely to update the view to reflect the selection state. So the function may be called multiple times even if the selection state may not have changed.If the view is a instance of
RecycleDataViewBehavior
, itsapply_selection()
method will be called everything the view needs to refresh the selection state. Otherwise, the this method is responsible for applying the selection.Parameters: - index: int
The index of the data item that is associated with the view.
- view: widget
The widget that is the view of this data item.
- is_selected: bool
Whether the item is selected.
-
key_selection
¶ The key used to check whether a view of a data item can be selected with touch or the keyboard.
key_selection
is the key in data, which if present andTrue
will enable selection for this item from the keyboard or with a touch. When None, the default, not item will be selectable.key_selection
is aStringProperty
and defaults to None.注釈
All data items can be selected directly using
select_node()
ordeselect_node()
, even ifkey_selection
is False.
-
-
class
kivy.uix.recycleview.layout.
RecycleLayoutManagerBehavior
[ソース]¶ ベースクラス:
builtins.object
A RecycleLayoutManagerBehavior is responsible for positioning views into the
RecycleView.data
within aRecycleView
. It adds new views into the data when it becomes visible to the user, and removes them when they leave the visible area.-
get_view_index_at
(pos)[ソース]¶ Return the view index on which position, pos, falls.
pos is in coordinates of the layout manager.
-
key_viewclass
¶ See
RecyclerView.key_viewclass
.
-
refresh_view_layout
(index, layout, view, viewport)[ソース]¶ See :meth:`~kivy.uix.recycleview.views.RecycleDataAdapter.refresh_view_layout.
-
viewclass
¶ See
RecyclerView.viewclass
.
-