(buttonView, isChecked) -> model.setShowCommodityByDefault(isChecked));
model.observeShowCommodityByDefault(viewLifecycleOwner, showCommodityByDefault::setChecked);
+ View postingSubItems = context.findViewById(R.id.posting_sub_items);
+
Switch postingPermitted = context.findViewById(R.id.profile_permit_posting);
model.observePostingPermitted(viewLifecycleOwner, isChecked -> {
postingPermitted.setChecked(isChecked);
- defaultCommodityLayout.setVisibility(isChecked ? View.VISIBLE : View.GONE);
- showCommodityByDefault.setVisibility(isChecked ? View.VISIBLE : View.GONE);
- preferredAccountsFilterLayout.setVisibility(isChecked ? View.VISIBLE : View.GONE);
- futureDatesLayout.setVisibility(isChecked ? View.VISIBLE : View.GONE);
+ postingSubItems.setVisibility(isChecked ? View.VISIBLE : View.GONE);
});
postingPermitted.setOnCheckedChangeListener(
((buttonView, isChecked) -> model.setPostingPermitted(isChecked)));
+ Switch showCommentsByDefault = context.findViewById(R.id.profile_show_comments);
+ model.observeShowCommentsByDefault(viewLifecycleOwner, isChecked -> {
+ showCommentsByDefault.setChecked(isChecked);
+ });
+ showCommentsByDefault.setOnCheckedChangeListener(
+ ((buttonView, isChecked) -> model.setShowCommentsByDefault(isChecked)));
+
defaultCommodity = context.findViewById(R.id.default_commodity_text);
futureDatesLayout = context.findViewById(R.id.future_dates_layout);
useAuthentication = context.findViewById(R.id.enable_http_auth);
useAuthentication.setOnCheckedChangeListener((buttonView, isChecked) -> {
model.setUseAuthentication(isChecked);
- authParams.setVisibility(isChecked ? View.VISIBLE : View.GONE);
if (isChecked)
userName.requestFocus();
+ });
+ model.observeUseAuthentication(viewLifecycleOwner, isChecked -> {
+ useAuthentication.setChecked(isChecked);
+ authParams.setVisibility(isChecked ? View.VISIBLE : View.GONE);
checkInsecureSchemeWithAuth();
});
- model.observeUseAuthentication(viewLifecycleOwner, useAuthentication::setChecked);
userName = context.findViewById(R.id.auth_user_name);
model.observeUserName(viewLifecycleOwner, text -> {