aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-05-27 00:36:38 +0200
committerChristian Schneppe <christian@pix-art.de>2018-05-27 00:36:38 +0200
commita6207e7b144733d67519d7539e1c33501258f64f (patch)
tree117d5c2209a086711a23a9438cb62554be804643 /src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
parent0444ee9d4a90e9a2fc2c1c377438e93b6c0dfb97 (diff)
show buttons to privacy policy and terms of use during account creation on our server pix-art.de
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/EditAccountActivity.java')
-rw-r--r--src/main/java/de/pixart/messenger/ui/EditAccountActivity.java24
1 files changed, 24 insertions, 0 deletions
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