From a6207e7b144733d67519d7539e1c33501258f64f Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 27 May 2018 00:36:38 +0200 Subject: show buttons to privacy policy and terms of use during account creation on our server pix-art.de --- .../pixart/messenger/ui/EditAccountActivity.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/main/java/de/pixart/messenger/ui/EditAccountActivity.java') diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index 28c0e1146..7a5210e8f 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -328,6 +328,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat @Override public void onTextChanged(final CharSequence s, final int start, final int before, final int count) { updateSaveButton(); + updateInfoButtons(); } @Override @@ -429,6 +430,18 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } } + protected void updateInfoButtons() { + if (this.binding.accountRegisterNew.isChecked()) { + if (!mUsernameMode && Jid.ofEscaped(this.binding.accountJid.getText()).getDomain().toLowerCase().equals("pix-art.de")) { + this.binding.showPrivacyPolicy.setVisibility(View.VISIBLE); + this.binding.showTermsOfUse.setVisibility(View.VISIBLE); + } + } else { + this.binding.showPrivacyPolicy.setVisibility(View.GONE); + this.binding.showTermsOfUse.setVisibility(View.GONE); + } + } + protected void updateSaveButton() { boolean accountInfoEdited = accountInfoEdited(); @@ -539,12 +552,23 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat @Override public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) { updateSaveButton(); + updateInfoButtons(); } }; this.binding.accountRegisterNew.setOnCheckedChangeListener(OnCheckedShowConfirmPassword); if (Config.DISALLOW_REGISTRATION_IN_UI) { this.binding.accountRegisterNew.setVisibility(View.GONE); } + this.binding.showPrivacyPolicy.setOnClickListener(view -> { + final Uri uri = Uri.parse("https://jabber.pix-art.de/privacy/"); + Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(browserIntent); + }); + this.binding.showTermsOfUse.setOnClickListener(view -> { + final Uri uri = Uri.parse("https://jabber.pix-art.de/termsofuse/"); + Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(browserIntent); + }); } @Override -- cgit v1.2.3