public class ViewBinderHelper
extends java.lang.Object
When you bind you data object to a view, use bind(SwipeRevealLayout, String) to
save and restore the open/close state of the view.
Optionally, if you also want to save and restore the open/close state when the device's
orientation is changed, call saveStates(Bundle) in android.app.Activity#onSaveInstanceState(Bundle)
and restoreStates(Bundle) in android.app.Activity#onRestoreInstanceState(Bundle)
| Constructor and Description |
|---|
ViewBinderHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(SwipeRevealLayout swipeLayout,
java.lang.String id)
Help to save and restore open/close state of the swipeLayout.
|
void |
closeLayout(java.lang.String id)
Close a specific layout.
|
void |
lockSwipe(java.lang.String... id)
Lock swipe for some layouts.
|
void |
openLayout(java.lang.String id)
Open a specific layout.
|
void |
restoreStates(android.os.Bundle inState)
Only if you need to restore open/close state when the orientation is changed.
|
void |
saveStates(android.os.Bundle outState)
Only if you need to restore open/close state when the orientation is changed.
|
void |
setOpenOnlyOne(boolean openOnlyOne) |
void |
unlockSwipe(java.lang.String... id)
Unlock swipe for some layouts.
|
public void bind(SwipeRevealLayout swipeLayout, java.lang.String id)
swipeLayout - swipeLayout of the current view.id - a string that uniquely defines the data object of the current view.public void saveStates(android.os.Bundle outState)
android.app.Activity#onSaveInstanceState(Bundle)public void restoreStates(android.os.Bundle inState)
android.app.Activity#onRestoreInstanceState(Bundle)public void lockSwipe(java.lang.String... id)
id - a string that uniquely defines the data object.public void unlockSwipe(java.lang.String... id)
id - a string that uniquely defines the data object.public void setOpenOnlyOne(boolean openOnlyOne)
openOnlyOne - If set to true, then only one row can be opened at a time.public void openLayout(java.lang.String id)
id - unique id which identifies the data object which is bind to the layout.public void closeLayout(java.lang.String id)
id - unique id which identifies the data object which is bind to the layout.