Extract compose subhint for SIM name to string resource

Fixes #5304
Closes #5305
// FREEBIE
This commit is contained in:
Geonu Kang 2016-03-01 11:15:03 +09:00 committed by Moxie Marlinspike
parent fa22fb7550
commit ba960a82e2
2 changed files with 6 additions and 1 deletions

View File

@ -664,6 +664,7 @@
<string name="conversation_activity__type_message_push">Send Signal message</string> <string name="conversation_activity__type_message_push">Send Signal message</string>
<string name="conversation_activity__type_message_sms_insecure">Send unsecured SMS</string> <string name="conversation_activity__type_message_sms_insecure">Send unsecured SMS</string>
<string name="conversation_activity__type_message_mms_insecure">Send unsecured MMS</string> <string name="conversation_activity__type_message_mms_insecure">Send unsecured MMS</string>
<string name="conversation_activity__from_sim_name">From %1$s</string>
<string name="conversation_activity__send">Send</string> <string name="conversation_activity__send">Send</string>
<string name="conversation_activity__remove">Remove</string> <string name="conversation_activity__remove">Remove</string>
<string name="conversation_activity__window_description">Conversation with %1$s</string> <string name="conversation_activity__window_description">Conversation with %1$s</string>

View File

@ -11,6 +11,7 @@ import android.text.TextUtils.TruncateAt;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.TransportOption; import org.thoughtcrime.securesms.TransportOption;
import org.thoughtcrime.securesms.components.emoji.EmojiEditText; import org.thoughtcrime.securesms.components.emoji.EmojiEditText;
import org.thoughtcrime.securesms.util.TextSecurePreferences; import org.thoughtcrime.securesms.util.TextSecurePreferences;
@ -104,6 +105,9 @@ public class ComposeText extends EmojiEditText {
setInputType(inputType); setInputType(inputType);
setImeOptions(imeOptions); setImeOptions(imeOptions);
setHint(transport.getComposeHint(), transport.getSimName().isPresent() ? "From " + transport.getSimName().get() : null); setHint(transport.getComposeHint(),
transport.getSimName().isPresent()
? getContext().getString(R.string.conversation_activity__from_sim_name, transport.getSimName().get())
: null);
} }
} }