- final int profileThemeId;
- if (mProfile != null) {
- profileName.setText(mProfile.getName());
- postingPermitted.setChecked(mProfile.isPostingPermitted());
- showCommodityByDefault.setChecked(mProfile.getShowCommodityByDefault());
- {
- String comm = mProfile.getDefaultCommodity();
- if (Misc.isEmptyOrNull(comm))
- resetDefaultCommodity();
- else
- setDefaultCommodity(comm);
- }
- futureDates = mProfile.getFutureDates();
- futureDatesText.setText(futureDates.getText(getResources()));
- apiVersion = mProfile.getApiVersion();
- apiVersionText.setText(apiVersion.getDescription(getResources()));
- url.setText(mProfile.getUrl());
- useAuthentication.setChecked(mProfile.isAuthEnabled());
- authParams.setVisibility(mProfile.isAuthEnabled() ? View.VISIBLE : View.GONE);
- userName.setText(mProfile.isAuthEnabled() ? mProfile.getAuthUserName() : "");
- password.setText(mProfile.isAuthEnabled() ? mProfile.getAuthPassword() : "");
- preferredAccountsFilter.setText(mProfile.getPreferredAccountsFilter());
- profileThemeId = mProfile.getThemeHue();
- }
- else {
- profileName.setText("");
- url.setText(HTTPS_URL_START);
- postingPermitted.setChecked(true);
- showCommodityByDefault.setChecked(false);
- resetDefaultCommodity();
- futureDates = MobileLedgerProfile.FutureDates.None;
- futureDatesText.setText(futureDates.getText(getResources()));
- apiVersion = SendTransactionTask.API.auto;
- apiVersionText.setText(apiVersion.getDescription(getResources()));
- useAuthentication.setChecked(false);
- authParams.setVisibility(View.GONE);
- userName.setText("");
- password.setText("");
- preferredAccountsFilter.setText(null);
- profileThemeId = getArguments().getInt(ARG_HUE, -1);