mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Display registered number in advanced preferences
Fixes #4504 // FREEBIE
This commit is contained in:
parent
8914c79613
commit
54b30c47f5
@ -55,7 +55,6 @@ public class AdvancedPreferenceFragment extends PreferenceFragment {
|
|||||||
masterSecret = getArguments().getParcelable("master_secret");
|
masterSecret = getArguments().getParcelable("master_secret");
|
||||||
addPreferencesFromResource(R.xml.preferences_advanced);
|
addPreferencesFromResource(R.xml.preferences_advanced);
|
||||||
|
|
||||||
initializePushMessagingToggle();
|
|
||||||
initializeIdentitySelection();
|
initializeIdentitySelection();
|
||||||
|
|
||||||
Preference submitDebugLog = this.findPreference(SUBMIT_DEBUG_LOG_PREF);
|
Preference submitDebugLog = this.findPreference(SUBMIT_DEBUG_LOG_PREF);
|
||||||
@ -67,6 +66,8 @@ public class AdvancedPreferenceFragment extends PreferenceFragment {
|
|||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
((ApplicationPreferencesActivity) getActivity()).getSupportActionBar().setTitle(R.string.preferences__advanced);
|
((ApplicationPreferencesActivity) getActivity()).getSupportActionBar().setTitle(R.string.preferences__advanced);
|
||||||
|
|
||||||
|
initializePushMessagingToggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -81,7 +82,15 @@ public class AdvancedPreferenceFragment extends PreferenceFragment {
|
|||||||
|
|
||||||
private void initializePushMessagingToggle() {
|
private void initializePushMessagingToggle() {
|
||||||
CheckBoxPreference preference = (CheckBoxPreference)this.findPreference(PUSH_MESSAGING_PREF);
|
CheckBoxPreference preference = (CheckBoxPreference)this.findPreference(PUSH_MESSAGING_PREF);
|
||||||
preference.setChecked(TextSecurePreferences.isPushRegistered(getActivity()));
|
|
||||||
|
if (TextSecurePreferences.isPushRegistered(getActivity())) {
|
||||||
|
preference.setChecked(true);
|
||||||
|
preference.setSummary(TextSecurePreferences.getLocalNumber(getActivity()));
|
||||||
|
} else {
|
||||||
|
preference.setChecked(false);
|
||||||
|
preference.setSummary(R.string.preferences__free_private_messages_and_calls);
|
||||||
|
}
|
||||||
|
|
||||||
preference.setOnPreferenceChangeListener(new PushMessagingClickListener());
|
preference.setOnPreferenceChangeListener(new PushMessagingClickListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,8 +178,8 @@ public class AdvancedPreferenceFragment extends PreferenceFragment {
|
|||||||
Toast.LENGTH_LONG).show();
|
Toast.LENGTH_LONG).show();
|
||||||
break;
|
break;
|
||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
checkBoxPreference.setChecked(false);
|
|
||||||
TextSecurePreferences.setPushRegistered(getActivity(), false);
|
TextSecurePreferences.setPushRegistered(getActivity(), false);
|
||||||
|
initializePushMessagingToggle();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user