slight modifications in quicksy onboard flow

This commit is contained in:
Daniel Gultsch 2024-02-08 11:06:07 +01:00
parent 3882ea669d
commit 5aff7d023c
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
3 changed files with 33 additions and 21 deletions

View file

@ -30,6 +30,10 @@ public abstract class AbstractQuickConversationsService {
return "playstore".equals(BuildConfig.FLAVOR_distribution); return "playstore".equals(BuildConfig.FLAVOR_distribution);
} }
public static boolean isQuicksyPlayStore() {
return isQuicksy() && isPlayStoreFlavor();
}
public abstract void signalAccountStateChange(); public abstract void signalAccountStateChange();
public abstract boolean isSynchronizing(); public abstract boolean isSynchronizing();

View file

@ -519,7 +519,7 @@
<string name="no_camera_permission">Grant %1$s access to the camera</string> <string name="no_camera_permission">Grant %1$s access to the camera</string>
<string name="sync_with_contacts">Synchronize with contacts</string> <string name="sync_with_contacts">Synchronize with contacts</string>
<string name="sync_with_contacts_long">%1$s wants permission to access your address book to match it with your XMPP contact list.\nThis will display your contacts full names and avatars.\n\n%1$s will only read your address book and match it locally without uploading anything to your server.</string> <string name="sync_with_contacts_long">%1$s wants permission to access your address book to match it with your XMPP contact list.\nThis will display your contacts full names and avatars.\n\n%1$s will only read your address book and match it locally without uploading anything to your server.</string>
<string name="sync_with_contacts_quicksy_static" translatable="false"><![CDATA[Quicksy stores your contacts phone numbers to make suggestions about possible contacts who are already on Quicksy.<br><br>By continuing you agree to our <a href="https://quicksy.im/privacy.htm">Privacy Policy</a> and our <a href="https://quicksy.im/tos.htm">Terms &amp; Conditions</a>.<br><br>You will now be asked to grant permission to access your contacts.]]></string> <string name="sync_with_contacts_quicksy_static" translatable="false"><![CDATA[Quicksy uploads and processes your contact list to make suggestions about possible contacts who are already on Quicksy.<br><br>By continuing you agree to our <a href="https://quicksy.im/privacy.htm">Privacy Policy</a> and our <a href="https://quicksy.im/tos.htm">Terms &amp; Conditions</a>.<br><br>You will now be asked to grant permission to access your contacts.]]></string>
<string name="notify_on_all_messages">Notify on all messages</string> <string name="notify_on_all_messages">Notify on all messages</string>
<string name="notify_only_when_highlighted">Notify only when mentioned</string> <string name="notify_only_when_highlighted">Notify only when mentioned</string>
<string name="notify_never">Notifications disabled</string> <string name="notify_never">Notifications disabled</string>
@ -545,7 +545,7 @@
<string name="share_uri_with">Share URI with…</string> <string name="share_uri_with">Share URI with…</string>
<string name="welcome_header" translatable="false">Join the Conversation</string> <string name="welcome_header" translatable="false">Join the Conversation</string>
<string name="welcome_header_quicksy" translatable="false">Have some Quick Conversations</string> <string name="welcome_header_quicksy" translatable="false">Have some Quick Conversations</string>
<string name="welcome_text_quicksy_static" translatable="false"><![CDATA[Quicksy is a spin off of the popular XMPP client Conversations with automatic contact discovery.<br><br>You sign up with your phone number and Quicksy will automatically—based on the phone numbers in your address book—suggest possible contacts to you.<br>Quicksy stores your contacts phone numbers to make suggestions about possible contacts who are already on Quicksy.<br>By signing up you agree to our <a href="https://quicksy.im/privacy.htm">Privacy Policy</a> and our <a href="https://quicksy.im/tos.htm">Terms &amp; Conditions</a>.]]></string> <string name="welcome_text_quicksy_static" translatable="false"><![CDATA[Quicksy is a spin off of the popular XMPP client Conversations with automatic contact discovery.<br><br>You sign up with your phone number and Quicksy will automatically—based on the phone numbers in your address book—suggest possible contacts to you.<br>Quicksy uploads and processes your contact list to make suggestions about possible contacts who are already on Quicksy.<br>By signing up you agree to our <a href="https://quicksy.im/privacy.htm">Privacy Policy</a> and our <a href="https://quicksy.im/tos.htm">Terms &amp; Conditions</a>.]]></string>
<string name="agree_and_continue">Agree and continue</string> <string name="agree_and_continue">Agree and continue</string>
<string name="magic_create_text">A guide is set up for account creation on conversations.im.\nWhen picking conversations.im as a provider you will be able to communicate with users of other providers by giving them your full XMPP address.</string> <string name="magic_create_text">A guide is set up for account creation on conversations.im.\nWhen picking conversations.im as a provider you will be able to communicate with users of other providers by giving them your full XMPP address.</string>
<string name="your_full_jid_will_be">Your full XMPP address will be: %s</string> <string name="your_full_jid_will_be">Your full XMPP address will be: %s</string>

View file

@ -1,20 +1,23 @@
package eu.siacs.conversations.ui; package eu.siacs.conversations.ui;
import android.content.Intent; import android.content.Intent;
import androidx.databinding.DataBindingUtil;
import android.os.Bundle; import android.os.Bundle;
import androidx.appcompat.widget.Toolbar;
import android.view.View; import android.view.View;
import java.util.concurrent.atomic.AtomicBoolean; import androidx.appcompat.widget.Toolbar;
import androidx.databinding.DataBindingUtil;
import eu.siacs.conversations.R; import eu.siacs.conversations.R;
import eu.siacs.conversations.databinding.ActivityEnterNameBinding; import eu.siacs.conversations.databinding.ActivityEnterNameBinding;
import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.services.AbstractQuickConversationsService;
import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.utils.AccountUtils; import eu.siacs.conversations.utils.AccountUtils;
public class EnterNameActivity extends XmppActivity implements XmppConnectionService.OnAccountUpdate { import java.util.concurrent.atomic.AtomicBoolean;
public class EnterNameActivity extends XmppActivity
implements XmppConnectionService.OnAccountUpdate {
private ActivityEnterNameBinding binding; private ActivityEnterNameBinding binding;
@ -28,23 +31,28 @@ public class EnterNameActivity extends XmppActivity implements XmppConnectionSer
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_enter_name); this.binding = DataBindingUtil.setContentView(this, R.layout.activity_enter_name);
setSupportActionBar((Toolbar) this.binding.toolbar); setSupportActionBar((Toolbar) this.binding.toolbar);
this.binding.next.setOnClickListener(this::next); this.binding.next.setOnClickListener(this::next);
this.setNick.set(savedInstanceState != null && savedInstanceState.getBoolean("set_nick",false)); this.setNick.set(
savedInstanceState != null && savedInstanceState.getBoolean("set_nick", false));
} }
private void next(View view) { private void next(final View view) {
if (account != null) { if (account == null) {
return;
String name = this.binding.name.getText().toString().trim();
account.setDisplayName(name);
xmppConnectionService.publishDisplayName(account);
Intent intent = new Intent(this, PublishProfilePictureActivity.class);
intent.putExtra(PublishProfilePictureActivity.EXTRA_ACCOUNT, account.getJid().asBareJid().toEscapedString());
intent.putExtra("setup", true);
startActivity(intent);
} }
final String name = this.binding.name.getText().toString().trim();
account.setDisplayName(name);
xmppConnectionService.publishDisplayName(account);
final Intent intent;
if (AbstractQuickConversationsService.isQuicksyPlayStore()) {
intent = new Intent(getApplicationContext(), StartConversationActivity.class);
intent.putExtra("init", true);
intent.putExtra(EXTRA_ACCOUNT, account.getJid().asBareJid().toEscapedString());
} else {
intent = new Intent(this, PublishProfilePictureActivity.class);
intent.putExtra("setup", true);
}
intent.putExtra(EXTRA_ACCOUNT, account.getJid().asBareJid().toEscapedString());
startActivity(intent);
finish(); finish();
} }
@ -66,7 +74,7 @@ public class EnterNameActivity extends XmppActivity implements XmppConnectionSer
} }
private void checkSuggestPreviousNick() { private void checkSuggestPreviousNick() {
String displayName = this.account == null ? null : this.account.getDisplayName(); final String displayName = this.account == null ? null : this.account.getDisplayName();
if (displayName != null) { if (displayName != null) {
if (setNick.compareAndSet(false, true) && this.binding.name.getText().length() == 0) { if (setNick.compareAndSet(false, true) && this.binding.name.getText().length() == 0) {
this.binding.name.getText().append(displayName); this.binding.name.getText().append(displayName);