use of org.thoughtcrime.securesms.preferences.widgets.StoragePreferenceCategory in project Signal-Android by WhisperSystems.
the class StoragePreferenceFragment method onCreate.
@Override
public void onCreate(@Nullable Bundle paramBundle) {
super.onCreate(paramBundle);
findPreference("pref_storage_clear_message_history").setOnPreferenceClickListener(new ClearMessageHistoryClickListener());
trimLength = findPreference(SettingsValues.THREAD_TRIM_LENGTH);
trimLength.setOnPreferenceClickListener(p -> {
updateToolbarTitle(R.string.preferences__conversation_length_limit);
pushFragment(BaseSettingsFragment.create(new ConversationLengthLimitConfiguration()));
return true;
});
keepMessages = findPreference(SettingsValues.KEEP_MESSAGES_DURATION);
keepMessages.setOnPreferenceClickListener(p -> {
updateToolbarTitle(R.string.preferences__keep_messages);
pushFragment(BaseSettingsFragment.create(new KeepMessagesConfiguration()));
return true;
});
StoragePreferenceCategory storageCategory = (StoragePreferenceCategory) findPreference("pref_storage_category");
FragmentActivity activity = requireActivity();
ApplicationPreferencesViewModel viewModel = ApplicationPreferencesViewModel.getApplicationPreferencesViewModel(activity);
storageCategory.setOnFreeUpSpace(() -> activity.startActivity(MediaOverviewActivity.forAll(activity)));
viewModel.getStorageBreakdown().observe(activity, storageCategory::setStorage);
}
use of org.thoughtcrime.securesms.preferences.widgets.StoragePreferenceCategory in project Signal-Android by signalapp.
the class StoragePreferenceFragment method onCreate.
@Override
public void onCreate(@Nullable Bundle paramBundle) {
super.onCreate(paramBundle);
findPreference("pref_storage_clear_message_history").setOnPreferenceClickListener(new ClearMessageHistoryClickListener());
trimLength = findPreference(SettingsValues.THREAD_TRIM_LENGTH);
trimLength.setOnPreferenceClickListener(p -> {
updateToolbarTitle(R.string.preferences__conversation_length_limit);
pushFragment(BaseSettingsFragment.create(new ConversationLengthLimitConfiguration()));
return true;
});
keepMessages = findPreference(SettingsValues.KEEP_MESSAGES_DURATION);
keepMessages.setOnPreferenceClickListener(p -> {
updateToolbarTitle(R.string.preferences__keep_messages);
pushFragment(BaseSettingsFragment.create(new KeepMessagesConfiguration()));
return true;
});
StoragePreferenceCategory storageCategory = (StoragePreferenceCategory) findPreference("pref_storage_category");
FragmentActivity activity = requireActivity();
ApplicationPreferencesViewModel viewModel = ApplicationPreferencesViewModel.getApplicationPreferencesViewModel(activity);
storageCategory.setOnFreeUpSpace(() -> activity.startActivity(MediaOverviewActivity.forAll(activity)));
viewModel.getStorageBreakdown().observe(activity, storageCategory::setStorage);
}
Aggregations