l
public class Example {
public static final boolean FIRST_VALUE_IS_ACCOUNT_TYPE = false;
public static final boolean FIRST_VALUE_IS_DEMO_USER = false;
public static void main(String[] args) {
Flowable<AccountType> accountTypeObs = Flowable.empty();
Flowable<Boolean> isDemoUserObs = Flowable.empty();
Flowable
.combineLatest(
accountTypeObs
.map(accountType -> accountType == AccountType.type1 || accountType == AccountType.type2)
.startWithItem(FIRST_VALUE_IS_ACCOUNT_TYPE),
isDemoUserObs.startWithItem(FIRST_VALUE_IS_DEMO_USER),
(isAccountType, isDemoUser) -> isAccountType || isDemoUser)
.doOnNext(Example::setFilterVisibility);
}
private static void setFilterVisibility(boolean val) {
//filterLayout.setFilterVisibility(val ? View.VISIBLE : View.DONE);
}
}
enum AccountType { type1, type2, type3, type4, type5 }


