parent
76d0f45b9b
commit
d65a7f1a25
3 changed files with 12 additions and 8 deletions
|
@ -111,7 +111,7 @@
|
||||||
<string name="ConversationActivity_transport_insecure_mms">Insecure MMS</string>
|
<string name="ConversationActivity_transport_insecure_mms">Insecure MMS</string>
|
||||||
<string name="ConversationActivity_transport_textsecure">TextSecure</string>
|
<string name="ConversationActivity_transport_textsecure">TextSecure</string>
|
||||||
<string name="ConversationActivity_get_with_it">Get with it: %s</string>
|
<string name="ConversationActivity_get_with_it">Get with it: %s</string>
|
||||||
<string name="ConversationActivity_install_textsecure">Install TextSecure: %s</string>
|
<string name="ConversationActivity_lets_use_this_to_chat">Let's use this to chat: %s</string>
|
||||||
<string name="ConversationActivity_error_leaving_group">Error leaving group...</string>
|
<string name="ConversationActivity_error_leaving_group">Error leaving group...</string>
|
||||||
|
|
||||||
<!-- ConversationFragment -->
|
<!-- ConversationFragment -->
|
||||||
|
|
|
@ -343,14 +343,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||||
|
|
||||||
private void handleInviteLink() {
|
private void handleInviteLink() {
|
||||||
try {
|
try {
|
||||||
if (!TextUtils.isEmpty(composeText.getText()) &&
|
|
||||||
!composeText.getText().toString().endsWith(" "))
|
|
||||||
{
|
|
||||||
composeText.append(" ");
|
|
||||||
}
|
|
||||||
boolean a = SecureRandom.getInstance("SHA1PRNG").nextBoolean();
|
boolean a = SecureRandom.getInstance("SHA1PRNG").nextBoolean();
|
||||||
if (a) composeText.append(getString(R.string.ConversationActivity_get_with_it, "http://sgnl.link/zhrzvk6"));
|
if (a) composeText.appendInvite(getString(R.string.ConversationActivity_get_with_it, "http://sgnl.link/1IvurmD"));
|
||||||
else composeText.append(getString(R.string.ConversationActivity_install_textsecure, "http://sgnl.link/1yKYqoN"));
|
else composeText.appendInvite(getString(R.string.ConversationActivity_lets_use_this_to_chat, "sgnl.link/1CYCQQN"));
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException e) {
|
||||||
throw new AssertionError(e);
|
throw new AssertionError(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import android.os.Build;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.text.style.RelativeSizeSpan;
|
import android.text.style.RelativeSizeSpan;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
@ -33,4 +34,12 @@ public class ComposeText extends EditText {
|
||||||
span.setSpan(new RelativeSizeSpan(0.8f), 0, hint.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
span.setSpan(new RelativeSizeSpan(0.8f), 0, hint.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
||||||
super.setHint(span);
|
super.setHint(span);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void appendInvite(String invite) {
|
||||||
|
if (!TextUtils.isEmpty(getText()) && !getText().toString().equals(" ")) {
|
||||||
|
append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
append(invite);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue