mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-25 23:38:56 +00:00
committed by
Moxie Marlinspike
parent
49f60971bd
commit
08b61572e9
@@ -82,8 +82,7 @@ public class ConversationTitleView extends LinearLayout {
|
||||
int size = recipients.getRecipientsList().size();
|
||||
|
||||
title.setText(getContext().getString(R.string.ConversationActivity_group_conversation));
|
||||
subtitle.setText((size == 1) ? getContext().getString(R.string.ConversationActivity_d_recipients_in_group_singular) :
|
||||
String.format(getContext().getString(R.string.ConversationActivity_d_recipients_in_group), size));
|
||||
subtitle.setText(getContext().getResources().getQuantityString(R.plurals.ConversationActivity_d_recipients_in_group, size, size));
|
||||
subtitle.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public class AppProtectionPreferenceFragment extends PreferenceFragment {
|
||||
private void initializeTimeoutSummary() {
|
||||
int timeoutMinutes = TextSecurePreferences.getPassphraseTimeoutInterval(getActivity());
|
||||
this.findPreference(TextSecurePreferences.PASSPHRASE_TIMEOUT_INTERVAL_PREF)
|
||||
.setSummary(getString(R.string.AppProtectionPreferenceFragment_minutes, timeoutMinutes));
|
||||
.setSummary(getResources().getQuantityString(R.plurals.AppProtectionPreferenceFragment_minutes, timeoutMinutes, timeoutMinutes));
|
||||
}
|
||||
|
||||
private class BlockedContactsClickListener implements Preference.OnPreferenceClickListener {
|
||||
|
||||
@@ -77,8 +77,8 @@ public class ChatsPreferenceFragment extends PreferenceFragment {
|
||||
final int threadLengthLimit = TextSecurePreferences.getThreadTrimLength(getActivity());
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
builder.setTitle(R.string.ApplicationPreferencesActivity_delete_all_old_messages_now);
|
||||
builder.setMessage(getString(R.string.ApplicationPreferencesActivity_this_will_immediately_trim_all_conversations_to_the_s_most_recent_messages,
|
||||
threadLengthLimit));
|
||||
builder.setMessage(getResources().getQuantityString(R.plurals.ApplicationPreferencesActivity_this_will_immediately_trim_all_conversations_to_the_d_most_recent_messages,
|
||||
threadLengthLimit, threadLengthLimit));
|
||||
builder.setPositiveButton(R.string.ApplicationPreferencesActivity_delete,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
@@ -107,7 +107,7 @@ public class ChatsPreferenceFragment extends PreferenceFragment {
|
||||
|
||||
public TrimLengthValidationListener() {
|
||||
EditTextPreference preference = (EditTextPreference)findPreference(TextSecurePreferences.THREAD_TRIM_LENGTH);
|
||||
preference.setSummary(getString(R.string.ApplicationPreferencesActivity_messages_per_conversation, preference.getText()));
|
||||
onPreferenceChange(preference, preference.getText());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,18 +116,19 @@ public class ChatsPreferenceFragment extends PreferenceFragment {
|
||||
return false;
|
||||
}
|
||||
|
||||
int value;
|
||||
try {
|
||||
Integer.parseInt((String)newValue);
|
||||
value = Integer.parseInt((String)newValue);
|
||||
} catch (NumberFormatException nfe) {
|
||||
Log.w(TAG, nfe);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Integer.parseInt((String)newValue) < 1) {
|
||||
if (value < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
preference.setSummary(getString(R.string.ApplicationPreferencesActivity_messages_per_conversation, newValue));
|
||||
preference.setSummary(getResources().getQuantityString(R.plurals.ApplicationPreferencesActivity_messages_per_conversation, value, value));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user