本文整理汇总了Java中com.socks.jiandan.utils.AppInfoUtil类的典型用法代码示例。如果您正苦于以下问题:Java AppInfoUtil类的具体用法?Java AppInfoUtil怎么用?Java AppInfoUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AppInfoUtil类属于com.socks.jiandan.utils包,在下文中一共展示了AppInfoUtil类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreate
点赞 2
import com.socks.jiandan.utils.AppInfoUtil; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
clearCache = findPreference(CLEAR_CACHE);
aboutApp = findPreference(ABOUT_APP);
appVersion = findPreference(APP_VERSION);
enableSister = (CheckBoxPreference) findPreference(ENABLE_SISTER);
enableBig = (CheckBoxPreference) findPreference(ENABLE_FRESH_BIG);
appVersion.setTitle(AppInfoUtil.getVersionName(getActivity()));
File cacheFile = ImageLoader.getInstance().getDiskCache().getDirectory();
DecimalFormat decimalFormat = new DecimalFormat("#0.00");
clearCache.setSummary(getString(R.string.cache_size) + decimalFormat.format(FileUtil.getDirSize(cacheFile)) + "M");
enableSister.setOnPreferenceChangeListener((preference, newValue) -> {
ToastHelper.Short(((Boolean) newValue) ? getString(R.string.open_sister_mode) : getString(R.string.close_sister_mode));
return true;
});
enableBig.setOnPreferenceChangeListener((preference, newValue) -> {
ToastHelper.Short(((Boolean) newValue) ? getString(R.string.picture_mode_big) : getString(R.string.picture_mode_small));
return true;
});
clearCache.setOnPreferenceClickListener(this);
aboutApp.setOnPreferenceClickListener(this);
}
开发者ID:ZhaoKaiQiang,
项目名称:JianDanRxJava,
代码行数:31,
代码来源:SettingFragment.java