当前位置: 首页>>代码示例>>Java>>正文


Java Trimmer类代码示例

本文整理汇总了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;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:21,代码来源:ChatsPreferenceFragment.java

示例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;
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:21,代码来源:StoragePreferenceFragment.java


注:本文中的org.thoughtcrime.securesms.util.Trimmer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。