本文整理匯總了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);
}