use of org.thoughtcrime.securesms.payments.preferences.model.InProgress in project Signal-Android by WhisperSystems.
the class PaymentsHomeViewModel method createList.
@NonNull
private MappingModelList createList(@NonNull PaymentsHomeState state) {
MappingModelList list = new MappingModelList();
if (state.getPaymentsState() == PaymentsHomeState.PaymentsState.ACTIVATED) {
if (state.getTotalPayments() > 0) {
list.add(new SettingHeader.Item(R.string.PaymentsHomeFragment__recent_activity));
list.addAll(state.getPayments());
if (state.getTotalPayments() > MAX_PAYMENT_ITEMS) {
list.add(new SeeAll(PaymentType.PAYMENT));
}
}
if (!state.isRecentPaymentsLoaded()) {
list.add(new InProgress());
} else if (state.getRequests().isEmpty() && state.getPayments().isEmpty() && state.isRecentPaymentsLoaded()) {
list.add(new NoRecentActivity());
}
} else if (state.getPaymentsState() == PaymentsHomeState.PaymentsState.ACTIVATE_NOT_ALLOWED) {
Log.w(TAG, "Payments remotely disabled or not in region");
} else {
list.add(new IntroducingPayments(state.getPaymentsState()));
}
list.addAll(InfoCard.getInfoCards());
return list;
}
use of org.thoughtcrime.securesms.payments.preferences.model.InProgress in project Signal-Android by signalapp.
the class PaymentsHomeViewModel method createList.
@NonNull
private MappingModelList createList(@NonNull PaymentsHomeState state) {
MappingModelList list = new MappingModelList();
if (state.getPaymentsState() == PaymentsHomeState.PaymentsState.ACTIVATED) {
if (state.getTotalPayments() > 0) {
list.add(new SettingHeader.Item(R.string.PaymentsHomeFragment__recent_activity));
list.addAll(state.getPayments());
if (state.getTotalPayments() > MAX_PAYMENT_ITEMS) {
list.add(new SeeAll(PaymentType.PAYMENT));
}
}
if (!state.isRecentPaymentsLoaded()) {
list.add(new InProgress());
} else if (state.getRequests().isEmpty() && state.getPayments().isEmpty() && state.isRecentPaymentsLoaded()) {
list.add(new NoRecentActivity());
}
} else if (state.getPaymentsState() == PaymentsHomeState.PaymentsState.ACTIVATE_NOT_ALLOWED) {
Log.w(TAG, "Payments remotely disabled or not in region");
} else {
list.add(new IntroducingPayments(state.getPaymentsState()));
}
list.addAll(InfoCard.getInfoCards());
return list;
}
Aggregations