本文整理汇总了Java中org.thoughtcrime.securesms.util.Trimmer类的典型用法代码示例。如果您正苦于以下问题:Java Trimmer类的具体用法?Java Trimmer怎么用?Java Trimmer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Trimmer类属于org.thoughtcrime.securesms.util包,在下文中一共展示了Trimmer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPreferenceClick
import org.thoughtcrime.securesms.util.Trimmer; //导入依赖的package包/类
@Override
public boolean onPreferenceClick(Preference preference) {
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(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
public void onClick(DialogInterface dialog, int which) {
Trimmer.trimAllThreads(getActivity(), threadLengthLimit);
}
});
builder.setNegativeButton(android.R.string.cancel, null);
builder.show();
return true;
}
示例2: onPreferenceClick
import org.thoughtcrime.securesms.util.Trimmer; //导入依赖的package包/类
@Override
public boolean onPreferenceClick(Preference preference) {
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_are_you_sure_you_would_like_to_immediately_trim_all_conversation_threads_to_the_s_most_recent_messages,
threadLengthLimit));
builder.setPositiveButton(R.string.ApplicationPreferencesActivity_delete,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Trimmer.trimAllThreads(getActivity(), threadLengthLimit);
}
});
builder.setNegativeButton(android.R.string.cancel, null);
builder.show();
return true;
}