本文整理汇总了Java中com.fernandocejas.android10.sample.domain.interactor.DefaultSubscriber类的典型用法代码示例。如果您正苦于以下问题:Java DefaultSubscriber类的具体用法?Java DefaultSubscriber怎么用?Java DefaultSubscriber使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultSubscriber类属于com.fernandocejas.android10.sample.domain.interactor包,在下文中一共展示了DefaultSubscriber类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadUsersCommand
import com.fernandocejas.android10.sample.domain.interactor.DefaultSubscriber; //导入依赖的package包/类
@Command
public void loadUsersCommand() {
if (showLoading.get()) {
return;
}
showLoading();
useCase.getUsers(new DefaultSubscriber<List<UserModel>>() {
@Override
public void onNext(List<UserModel> users) {
UsersAdapter usersAdapter = new UsersAdapter(AndroidApplication.getContext(), users);
usersAdapter.setOnItemClickListener(onUserItemClick());
showContentList(usersAdapter);
}
@Override
public void onError(Throwable e) {
showRetry();
}
});
}
示例2: loadUserDetailsCommand
import com.fernandocejas.android10.sample.domain.interactor.DefaultSubscriber; //导入依赖的package包/类
@Command
public void loadUserDetailsCommand(int userId) {
showLoading();
getUserDetailsUseCase.setUserId(userId);
getUserDetailsUseCase.execute(new DefaultSubscriber<User>(){
@Override
public void onNext(User user) {
showUserDetails(userModelDataMapper.transformUser(user));
}
@Override
public void onError(Throwable e) {
showRetry();
}
});
}
示例3: loadUsersCommand
import com.fernandocejas.android10.sample.domain.interactor.DefaultSubscriber; //导入依赖的package包/类
@Command
public void loadUsersCommand() {
if (showLoading.get()) {
return;
}
showLoading();
getUserList.execute(new DefaultSubscriber<List<User>>() {
@Override
public void onNext(List<User> users) {
Collection<UserModel> userModelsCollection = userModelDataMapper.transformUsers(users);
UsersAdapter usersAdapter = new UsersAdapter(AndroidApplication.getContext(), userModelsCollection);
usersAdapter.setOnItemClickListener(onUserItemClick());
showContentList(usersAdapter);
}
@Override
public void onError(Throwable e) {
showRetry();
}
});
}
示例4: loadUserDetailsCommand
import com.fernandocejas.android10.sample.domain.interactor.DefaultSubscriber; //导入依赖的package包/类
@Command
public void loadUserDetailsCommand(int userId) {
showLoading();
getUserDetailsUseCase.createUser(new DefaultSubscriber<UserModel>() {
@Override
public void onNext(UserModel user) {
showUserDetails(user);
}
@Override
public void onError(Throwable e) {
showRetry();
}
}, userId);
}