X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Fprofiles%2FProfileDetailFragment.java;h=7cbfa0e7062c20abf3b7c2d6b75a6b128fccb7e7;hb=649f399014447df347d0fd5c76219b6549f53ee0;hp=7ef511d00656c2badc098dcedec3ba21a78b1a52;hpb=663f1b268de18b7d10a305e4f955d04e87d4a8a1;p=mobile-ledger-staging.git diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java index 7ef511d0..7cbfa0e7 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java @@ -61,6 +61,7 @@ public class ProfileDetailFragment extends Fragment { */ private MobileLedgerProfile mProfile; private TextView url; + private Switch postingPermitted; private TextInputLayout urlLayout; private LinearLayout authParams; private Switch useAuthentication; @@ -140,8 +141,9 @@ public class ProfileDetailFragment extends Fragment { } } else { - mProfile = new MobileLedgerProfile(profileName.getText(), url.getText(), - useAuthentication.isChecked(), userName.getText(), password.getText()); + mProfile = new MobileLedgerProfile(profileName.getText(), postingPermitted.isChecked(), + url.getText(), useAuthentication.isChecked(), userName.getText(), + password.getText()); mProfile.storeInDB(); Data.profiles.add(mProfile); MobileLedgerProfile.storeProfilesOrder(); @@ -165,6 +167,7 @@ public class ProfileDetailFragment extends Fragment { profileNameLayout = rootView.findViewById(R.id.profile_name_layout); url = rootView.findViewById(R.id.url); urlLayout = rootView.findViewById(R.id.url_layout); + postingPermitted = rootView.findViewById(R.id.profile_permit_posting); authParams = rootView.findViewById(R.id.auth_params); useAuthentication = rootView.findViewById(R.id.enable_http_auth); userName = rootView.findViewById(R.id.auth_user_name); @@ -185,6 +188,7 @@ public class ProfileDetailFragment extends Fragment { if (mProfile != null) { profileName.setText(mProfile.getName()); + postingPermitted.setChecked(mProfile.isPostingPermitted()); url.setText(mProfile.getUrl()); useAuthentication.setChecked(mProfile.isAuthEnabled()); authParams.setVisibility(mProfile.isAuthEnabled() ? View.VISIBLE : View.GONE); @@ -194,6 +198,7 @@ public class ProfileDetailFragment extends Fragment { else { profileName.setText(""); url.setText(""); + postingPermitted.setChecked(true); useAuthentication.setChecked(false); authParams.setVisibility(View.GONE); userName.setText("");