当前位置: 首页>>代码示例>>Java>>正文


Java TiPresenter.State方法代码示例

本文整理汇总了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");
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:TiPresenterInstructor.java

示例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");
    }
}
 
开发者ID:grandcentrix,项目名称:ThirtyInch,代码行数:25,代码来源:TiTestPresenter.java

示例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);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:UiThreadExecutorAutoBinder.java


注:本文中的net.grandcentrix.thirtyinch.TiPresenter.State方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。