com.arellomobile.mvp.viewstate.strategy.SingleStateStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of moxy Show documentation
Show all versions of moxy Show documentation
MoxyX, we added X for make this library coolest
The newest version!
package com.arellomobile.mvp.viewstate.strategy;
import java.util.List;
import com.arellomobile.mvp.MvpView;
import com.arellomobile.mvp.viewstate.ViewCommand;
/**
* This strategy will clear current commands queue and then incoming command will be put in.
*
* Caution! Be sure that you fully set view to initial state inside this command.
*
* Date: 19-Dec-15
* Time: 14:34
*
* @author Alexander Blinov
*/
public class SingleStateStrategy implements StateStrategy {
@Override
public void beforeApply(List> currentState, ViewCommand incomingCommand) {
currentState.clear();
currentState.add(incomingCommand);
}
@Override
public void afterApply(List> currentState, ViewCommand incomingCommand) {
// pass
}
}