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


Java MvpView类代码示例

本文整理汇总了Java中com.arellomobile.mvp.MvpView的典型用法代码示例。如果您正苦于以下问题:Java MvpView类的具体用法?Java MvpView怎么用?Java MvpView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MvpView类属于com.arellomobile.mvp包,在下文中一共展示了MvpView类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: beforeApply

import com.arellomobile.mvp.MvpView; //导入依赖的package包/类
@Override
public <View extends MvpView> void beforeApply(List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand) {
	Iterator<ViewCommand<View>> iterator = currentState.iterator();

	while (iterator.hasNext()) {
		ViewCommand<View> entry = iterator.next();

		if (entry.getClass() == incomingCommand.getClass()) {
			iterator.remove();
			break;
		}
	}

	currentState.add(incomingCommand);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:AddToEndSingleStrategy.java

示例2: shouldExecuteCommandAndRemoveIt

import com.arellomobile.mvp.MvpView; //导入依赖的package包/类
@Test
public void shouldExecuteCommandAndRemoveIt() {
    final List<ViewCommand<MvpView>> currentState = new ArrayList<>();
    final ViewCommand<MvpView> incomingCommand = mock(ViewCommand.class);

    strategy.beforeApply(currentState, incomingCommand);

    assertEquals(1, currentState.size());
    assertEquals(incomingCommand, currentState.get(0));

    strategy.afterApply(currentState, incomingCommand);

    assertEquals(0, currentState.size());
}
 
开发者ID:dmitrikudrenko,项目名称:MDRXL,代码行数:15,代码来源:SingleExecutionStateStrategyTest.java

示例3: getViewClassFromGeneric

import com.arellomobile.mvp.MvpView; //导入依赖的package包/类
private String getViewClassFromGeneric(TypeElement typeElement, DeclaredType declaredType) {
	TypeMirror superclass = declaredType;
	Map<TypeParameterElement, TypeMirror> mTypedMap = Collections.emptyMap();

	if (!typeElement.getTypeParameters().isEmpty()) {
		mTypedMap = getChildInstanceOfClassFromGeneric(typeElement, MvpView.class);
	}


	Map<String, String> parentTypes = Collections.emptyMap();
	List<? extends TypeMirror> totalTypeArguments = new ArrayList<>(((DeclaredType) superclass).getTypeArguments());
	while (superclass.getKind() != TypeKind.NONE) {
		TypeElement superclassElement = (TypeElement) ((DeclaredType) superclass).asElement();
		List<? extends TypeMirror> typeArguments = ((DeclaredType) superclass).getTypeArguments();
		totalTypeArguments.retainAll(typeArguments);
		final List<? extends TypeParameterElement> typeParameters = superclassElement.getTypeParameters();

		Map<String, String> types = new HashMap<>();
		for (int i = 0; i < typeArguments.size(); i++) {
			types.put(typeParameters.get(i).toString(), fillGenerics(parentTypes, typeArguments.get(i)));
		}

		if (superclassElement.toString().equals(MvpPresenter.class.getCanonicalName())) {
			if (!typeArguments.isEmpty()) {
				TypeMirror typeMirror = typeArguments.get(0);
				if (typeMirror instanceof TypeVariable) {
					Element key = ((TypeVariable) typeMirror).asElement();

					for (Map.Entry<TypeParameterElement, TypeMirror> entry : mTypedMap.entrySet()) {
						if (entry.getKey().toString().equals(key.toString())) {
							return Util.getFullClassName(entry.getValue());
						}
					}
				}
			}

			if (typeArguments.isEmpty() && typeParameters.isEmpty()) {
				return ((DeclaredType) superclass).asElement().getSimpleName().toString();
			}
			// MvpPresenter is typed only on View class
			return fillGenerics(parentTypes, typeArguments);
		}

		parentTypes = types;

		superclass = superclassElement.getSuperclass();
	}

	return "";
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:51,代码来源:PresenterInjectorRules.java

示例4: afterApply

import com.arellomobile.mvp.MvpView; //导入依赖的package包/类
@Override
public <View extends MvpView> void afterApply(List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand) {
	// pass
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:AddToEndSingleStrategy.java

示例5: beforeApply

import com.arellomobile.mvp.MvpView; //导入依赖的package包/类
@Override
public <View extends MvpView> void beforeApply(List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand) {
	currentState.add(incomingCommand);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:AddToEndStrategy.java

示例6: beforeApply

import com.arellomobile.mvp.MvpView; //导入依赖的package包/类
@Override
public <View extends MvpView> void beforeApply(List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand) {
	//do nothing to skip
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:SkipStrategy.java

示例7: afterApply

import com.arellomobile.mvp.MvpView; //导入依赖的package包/类
@Override
public <View extends MvpView> void afterApply(List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand) {
	currentState.remove(incomingCommand);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:OneExecutionStateStrategy.java

示例8: beforeApply

import com.arellomobile.mvp.MvpView; //导入依赖的package包/类
@Override
public <View extends MvpView> void beforeApply(List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand) {
	currentState.clear();
	currentState.add(incomingCommand);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:SingleStateStrategy.java

示例9: beforeApply

import com.arellomobile.mvp.MvpView; //导入依赖的package包/类
@Override
public <View extends MvpView> void beforeApply(final List<ViewCommand<View>> currentState,
                                               final ViewCommand<View> incomingCommand) {
    currentState.clear();
    currentState.add(incomingCommand);
}
 
开发者ID:dmitrikudrenko,项目名称:MDRXL,代码行数:7,代码来源:SingleExecutionStateStrategy.java

示例10: afterApply

import com.arellomobile.mvp.MvpView; //导入依赖的package包/类
@Override
public <View extends MvpView> void afterApply(final List<ViewCommand<View>> currentState,
                                              final ViewCommand<View> incomingCommand) {
    currentState.remove(incomingCommand);
}
 
开发者ID:dmitrikudrenko,项目名称:MDRXL,代码行数:6,代码来源:SingleExecutionStateStrategy.java

示例11: beforeApply

import com.arellomobile.mvp.MvpView; //导入依赖的package包/类
/**
 * Called immediately after
 * {@link com.arellomobile.mvp.viewstate.MvpViewState} receive some
 * command. Will not be called before re-apply to some other
 * {@link MvpView}
 *
 * @param currentState    current state of
 *                        {@link com.arellomobile.mvp.viewstate.MvpViewState}. Each {@link ViewCommand}
 *                        contains self parameters.
 * @param incomingCommand command for apply to {@link MvpView} This
 *                        {@link ViewCommand} contains params of this command.
 * @param <View>          type of incoming view
 */
<View extends MvpView> void beforeApply(List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand);
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:StateStrategy.java

示例12: afterApply

import com.arellomobile.mvp.MvpView; //导入依赖的package包/类
/**
 * Called immediately after command applied to {@link MvpView}. Also called
 * after re-apply to other views.
 *
 * @param currentState    current state of
 *                        {@link com.arellomobile.mvp.viewstate.MvpViewState}. Each {@link ViewCommand}
 *                        contains self parameters.
 * @param incomingCommand applied command to {@link MvpView} This
 *                        {@link ViewCommand} contains params of this command.
 * @param <View>          type of incoming view
 */
<View extends MvpView> void afterApply(List<ViewCommand<View>> currentState, ViewCommand<View> incomingCommand);
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:StateStrategy.java


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