private MobileLedgerProfile mProfile;
private TextView url;
private TextView defaultCommodity;
- private View defaultCommodityLayout;
private boolean defaultCommoditySet;
private TextInputLayout urlLayout;
private LinearLayout authParams;
private TextView profileName;
private TextInputLayout profileNameLayout;
private TextView preferredAccountsFilter;
- private TextInputLayout preferredAccountsFilterLayout;
private View huePickerView;
private View insecureWarningText;
private TextView futureDatesText;
- private View futureDatesLayout;
private TextView apiVersionText;
private boolean syncingModelFromUI = false;
/**
urlLayout = context.findViewById(R.id.url_layout);
- defaultCommodityLayout = context.findViewById(R.id.default_commodity_layout);
- defaultCommodityLayout.setOnClickListener(v -> {
- CurrencySelectorFragment cpf = CurrencySelectorFragment.newInstance(
- CurrencySelectorFragment.DEFAULT_COLUMN_COUNT, false);
- cpf.setOnCurrencySelectedListener(model::setDefaultCommodity);
- final AppCompatActivity activity = (AppCompatActivity) v.getContext();
- cpf.show(activity.getSupportFragmentManager(), "currency-selector");
- });
+ context.findViewById(R.id.default_commodity_layout)
+ .setOnClickListener(v -> {
+ CurrencySelectorFragment cpf = CurrencySelectorFragment.newInstance(
+ CurrencySelectorFragment.DEFAULT_COLUMN_COUNT, false);
+ cpf.setOnCurrencySelectedListener(model::setDefaultCommodity);
+ final AppCompatActivity activity = (AppCompatActivity) v.getContext();
+ cpf.show(activity.getSupportFragmentManager(), "currency-selector");
+ });
Switch showCommodityByDefault = context.findViewById(R.id.profile_show_commodity);
showCommodityByDefault.setOnCheckedChangeListener(
((buttonView, isChecked) -> model.setPostingPermitted(isChecked)));
Switch showCommentsByDefault = context.findViewById(R.id.profile_show_comments);
- model.observeShowCommentsByDefault(viewLifecycleOwner, isChecked -> {
- showCommentsByDefault.setChecked(isChecked);
- });
+ model.observeShowCommentsByDefault(viewLifecycleOwner, showCommentsByDefault::setChecked);
showCommentsByDefault.setOnCheckedChangeListener(
((buttonView, isChecked) -> model.setShowCommentsByDefault(isChecked)));
defaultCommodity = context.findViewById(R.id.default_commodity_text);
- futureDatesLayout = context.findViewById(R.id.future_dates_layout);
futureDatesText = context.findViewById(R.id.future_dates_text);
context.findViewById(R.id.future_dates_layout)
.setOnClickListener(v -> {
v -> futureDatesText.setText(v.getText(getResources())));
apiVersionText = context.findViewById(R.id.api_version_text);
- model.observeApiVersion(viewLifecycleOwner, apiVer -> {
- apiVersionText.setText(apiVer.getDescription(getResources()));
- });
+ model.observeApiVersion(viewLifecycleOwner,
+ apiVer -> apiVersionText.setText(apiVer.getDescription(getResources())));
context.findViewById(R.id.api_version_layout)
.setOnClickListener(v -> {
MenuInflater mi = new MenuInflater(context);
preferredAccountsFilter.setText(text);
});
hookTextChangeSyncRoutine(preferredAccountsFilter, model::setPreferredAccountsFilter);
- preferredAccountsFilterLayout =
- context.findViewById(R.id.preferred_accounts_accounts_filter_layout);
insecureWarningText = context.findViewById(R.id.insecure_scheme_text);