本文整理汇总了Java中net.grandcentrix.thirtyinch.TiPresenter.State方法的典型用法代码示例。如果您正苦于以下问题:Java TiPresenter.State方法的具体用法?Java TiPresenter.State怎么用?Java TiPresenter.State使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.grandcentrix.thirtyinch.TiPresenter
的用法示例。
在下文中一共展示了TiPresenter.State方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: detachView
import net.grandcentrix.thirtyinch.TiPresenter; //导入方法依赖的package包/类
/**
* moves the presenter into state {@link net.grandcentrix.thirtyinch.TiPresenter.State#VIEW_DETACHED}
* from every state
*/
public void detachView() {
final TiPresenter.State state = mPresenter.getState();
switch (state) {
case INITIALIZED:
mPresenter.create();
break;
case VIEW_DETACHED:
// already there
break;
case VIEW_ATTACHED:
mPresenter.detachView();
mPresenter.setUiThreadExecutor(null);
break;
case DESTROYED:
throw new IllegalStateException(
"Presenter is already destroyed, further lifecycle changes aren't allowed");
}
}
示例2: detachView
import net.grandcentrix.thirtyinch.TiPresenter; //导入方法依赖的package包/类
/**
* moves the presenter into state {@link TiPresenter.State#VIEW_DETACHED}
* from every state
*
* @see TiPresenter#onDetachView()
*/
public void detachView() {
final TiPresenter.State state = mPresenter.getState();
switch (state) {
case INITIALIZED:
mPresenter.create();
break;
case VIEW_DETACHED:
// already there
break;
case VIEW_ATTACHED:
mPresenter.detachView();
mPresenter.setUiThreadExecutor(null);
break;
case DESTROYED:
throw new IllegalStateException(
"Presenter is already destroyed, further lifecycle changes aren't allowed");
}
}
示例3: onChange
import net.grandcentrix.thirtyinch.TiPresenter; //导入方法依赖的package包/类
@Override
public void onChange(final TiPresenter.State state,
final boolean hasLifecycleMethodBeenCalled) {
if (state == TiPresenter.State.VIEW_ATTACHED && !hasLifecycleMethodBeenCalled) {
// before super.onAttachView(view)
mPresenter.setUiThreadExecutor(mUiThreadExecutor);
}
if (state == TiPresenter.State.VIEW_DETACHED && hasLifecycleMethodBeenCalled) {
// after super.onDetachView()
mPresenter.setUiThreadExecutor(null);
}
}