mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-02 13:17:46 +00:00
another minor pref tweak for mms fallback
1) fix summary for outgoing sms/mms 2) disable mms option when TS-users is unselected, same as the fallback approval option. // FREEBIE
This commit is contained in:
parent
761049d6f8
commit
c448a833f5
@ -698,7 +698,8 @@
|
||||
<string name="preferences__sms_fallback">Outgoing SMS/MMS</string>
|
||||
<string name="preferences__submit_debug_log">Submit debug log</string>
|
||||
<string name="preferences__sms_outgoing_push_users">TextSecure users</string>
|
||||
<string name="preferences__sms_fallback_push_users_ask">(ask first)</string>
|
||||
<string name="preferences__sms_fallback_push_users_ask">ask first</string>
|
||||
<string name="preferences__sms_fallback_push_users_no_mms">no MMS</string>
|
||||
<string name="preferences__sms_outgoing_push_users_description">Send secure SMS if data connectivity is lost</string>
|
||||
<string name="preferences__sms_fallback_ask_before_sending_sms_mms">Ask before sending SMS/MMS</string>
|
||||
<string name="preferences__sms_fallback_never_send_mms">Never send MMS</string>
|
||||
|
@ -38,11 +38,16 @@ public class OutgoingSmsPreference extends DialogPreference {
|
||||
dataUsers.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
askForFallback.setEnabled(dataUsers.isChecked());
|
||||
updateEnabledViews();
|
||||
}
|
||||
});
|
||||
|
||||
updateEnabledViews();
|
||||
}
|
||||
|
||||
private void updateEnabledViews() {
|
||||
askForFallback.setEnabled(dataUsers.isChecked());
|
||||
neverFallbackMms.setEnabled(dataUsers.isChecked());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,6 +12,7 @@ import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v4.preference.PreferenceFragment;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import org.thoughtcrime.securesms.ApplicationPreferencesActivity;
|
||||
import org.thoughtcrime.securesms.MmsPreferencesFragment;
|
||||
@ -20,6 +21,9 @@ import org.thoughtcrime.securesms.components.OutgoingSmsPreference;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class SmsMmsPreferenceFragment extends PreferenceFragment {
|
||||
private static final String KITKAT_DEFAULT_PREF = "pref_set_default";
|
||||
private static final String OUTGOING_SMS_PREF = "pref_outgoing_sms";
|
||||
@ -92,11 +96,21 @@ public class SmsMmsPreferenceFragment extends PreferenceFragment {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
final boolean dataFallback = TextSecurePreferences.isFallbackSmsAllowed(getActivity());
|
||||
final boolean dataFallbackAsk = TextSecurePreferences.isFallbackSmsAskRequired(getActivity());
|
||||
final boolean mmsFallback = TextSecurePreferences.isFallbackMmsEnabled(getActivity());
|
||||
final boolean nonData = TextSecurePreferences.isDirectSmsAllowed(getActivity());
|
||||
|
||||
if (dataFallback) {
|
||||
builder.append(getString(R.string.preferences__sms_outgoing_push_users));
|
||||
if (dataFallbackAsk) builder.append(" ").append(getString(R.string.preferences__sms_fallback_push_users_ask));
|
||||
|
||||
List<String> fallbackOptions = new LinkedList<>();
|
||||
if (dataFallbackAsk) fallbackOptions.add(getString(R.string.preferences__sms_fallback_push_users_ask));
|
||||
if (!mmsFallback) fallbackOptions.add(getString(R.string.preferences__sms_fallback_push_users_no_mms));
|
||||
|
||||
if (fallbackOptions.size() > 0) {
|
||||
builder.append(" (")
|
||||
.append(TextUtils.join(", ", fallbackOptions))
|
||||
.append(")");
|
||||
}
|
||||
}
|
||||
if (nonData) {
|
||||
if (dataFallback) builder.append(", ");
|
||||
|
Loading…
x
Reference in New Issue
Block a user