本文整理汇总了Java中org.kymjs.kjframe.utils.StringUtils类的典型用法代码示例。如果您正苦于以下问题:Java StringUtils类的具体用法?Java StringUtils怎么用?Java StringUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringUtils类属于org.kymjs.kjframe.utils包,在下文中一共展示了StringUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initData
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
@Override
protected void initData() {
super.initData();
String folderPath = getArguments().getString(FACE_FOLDER_PATH);
if (StringUtils.isEmpty(folderPath)) {
folderPath = "";
Log.e("kymjs", getClass().getSimpleName() + " line 69, folder path is empty");
}
File folder = new File(folderPath);
if (folder.isDirectory()) {
File[] faceFiles = folder.listFiles();
datas = new ArrayList<>(faceFiles.length);
for (File faceFile : faceFiles) {
if (!faceFile.isHidden()) {
Faceicon data = new Faceicon();
data.setName("http://www.oschina.net/image/" + faceFile.getName());
data.setFileName(faceFile.getName());
data.setPath(faceFile.getAbsolutePath());
datas.add(data);
}
}
} else {
datas = new ArrayList<>(0);
}
}
开发者ID:woniukeji,项目名称:jianguo,代码行数:26,代码来源:FacePageFragment.java
示例2: updateUI
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
private void updateUI() {
LogUtil.log("GET => InfoLog :" + mInfo.toString());
ensureView();
if(isInfoOK) {
XmlCacheManager.saveDeviceUser(mInfo);
mTvAge.setText(getInfoStr(mInfo.getAge()));
mTvBirthday.setText(getInfoStr(mInfo.getBirthday()));
mTvGender.setText(mInfo.getGender() == 1 ? "男" : "女");
mTvHeight.setText(String.format("%s cm", getInfoStr(mInfo.getHeight())));
mTvWeight.setText(String.format("%s kg", getInfoStr(mInfo.getWeight())));
mTvWalk.setText(String.format("%s cm", Integer.toString(mInfo.getWalk_step_length())));
mTvRun.setText(String.format("%s cm", Integer.toString(mInfo.getRun_step_length())));
mIvGender.setImageResource(StringUtils.toInt(mInfo.getGender()) == 1 ?
R.mipmap.userinfo_icon_male : R.mipmap.userinfo_icon_female);
}
}
开发者ID:sczyh30,项目名称:yuedong-app,代码行数:17,代码来源:DeviceUserFragment.java
示例3: updateUI
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
private void updateUI() {
if (mInfo == null)
return;
mIvAvatar.setAvatarUrl(mInfo.getPortrait());
mTvUsername.setText(mInfo.getAccount());
mIvGender
.setImageResource(StringUtils.toInt(mInfo.getGender()) == 1 ? R.mipmap.userinfo_icon_male
: R.mipmap.userinfo_icon_female);
mTvScore.setText(String.valueOf(mInfo.getScore()));
mTvMotionActivities.setText(String.valueOf(mInfo.getActivitiesNumber()));
mTvFollowing.setText(String.valueOf(mInfo.getFollowers()));
mTvFans.setText(String.valueOf(mInfo.getFans()));
if(mInfo.getPortrait() != null) {
BitmapRequestClient.send(mIvAvatar, "portrait/" + mInfo.getPortrait(), 60, 60);
}
}
开发者ID:sczyh30,项目名称:yuedong-app,代码行数:17,代码来源:MySocialInfoFragment.java
示例4: bindData
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
public void bindData(final User data) {
mIvGender.setImageResource(StringUtils.toInt(data.getGender()) == 1 ?
R.mipmap.userinfo_icon_male : R.mipmap.userinfo_icon_female);
mTvTips.setText(data.getTips());
mTvUsername.setText(data.getUsername());
if(DeviceUtil.hasInternet()) {
if(data.getPortrait() != null)
BitmapRequestClient.send(mCircle, "portrait/" + data.getPortrait(), 50, 50);
else
mCircle.setImageResource(R.mipmap.widget_dface);
}
mCircle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(data.getId() != 0)
UIUtil.showUserProfile(AppContext.getContext(), data.getId());
}
});
}
开发者ID:sczyh30,项目名称:yuedong-app,代码行数:20,代码来源:BaseFriendHolder.java
示例5: addWebImageShow
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
/**
* 添加网页的点击图片展示支持
*/
@SuppressLint({ "JavascriptInterface", "SetJavaScriptEnabled" })
@JavascriptInterface
public static void addWebImageShow(final Context cxt, WebView wv) {
wv.getSettings().setJavaScriptEnabled(true);
wv.addJavascriptInterface(new OnWebViewImageListener() {
@Override
@JavascriptInterface
public void showImagePreview(String bigImageUrl) {
if (bigImageUrl != null && !StringUtils.isEmpty(bigImageUrl)) {
UIHelper.showImagePreview(cxt, new String[] { bigImageUrl });
}
}
}, "mWebViewImageListener");
}
开发者ID:KJFrame,项目名称:KJBlog,代码行数:19,代码来源:UIHelper.java
示例6: dateIsTody
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
public static boolean dateIsTody(String sdate) {
Date time = null;
if (StringUtils.isInEasternEightZones()) {
time = StringUtils.toDate(sdate);
} else {
time = StringUtils.transformTime(StringUtils.toDate(sdate),
TimeZone.getTimeZone("GMT+08"), TimeZone.getDefault());
}
if (time == null) {
return false;
}
String ftime = "";
Calendar cal = Calendar.getInstance();
// 判断是否是同一天
String curDate = dateFormater.get().format(cal.getTime());
String paramDate = dateFormater.get().format(time);
return curDate.equals(paramDate);
}
开发者ID:KJFrame,项目名称:KJBlog,代码行数:21,代码来源:TimeUtils.java
示例7: convert
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
@Override
public void convert(AdapterHolder helper, Blog item, boolean isScrolling) {
helper.getView(R.id.item_blog_tip_recommend).setVisibility(
item.getIsRecommend() == 0 ? View.GONE : View.VISIBLE);
helper.getView(R.id.item_blog_tip_tody).setVisibility(
item.getIsAuthor() == 0 ? View.GONE : View.VISIBLE);
ImageView image = helper.getView(R.id.item_blog_img);
String url = item.getImageUrl();
if (StringUtils.isEmpty(url)) {
image.setVisibility(View.GONE);
} else {
image.setVisibility(View.VISIBLE);
onPicClick(image, url);
if (isScrolling) {
kjb.displayCacheOrDefult(image, url, R.drawable.pic_bg);
} else {
kjb.display(image, url, 480, 420, R.drawable.pic_bg);
}
}
helper.setText(R.id.item_blog_tv_title, item.getTitle());
helper.setText(R.id.item_blog_tv_description, item.getDescription());
helper.setText(R.id.item_blog_tv_author, "张涛");
helper.setText(R.id.item_blog_tv_date,
StringUtils.friendlyTime(item.getDate()));
}
开发者ID:KJFrame,项目名称:KJBlog,代码行数:26,代码来源:BlogAdapter.java
示例8: initData
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
@Override
protected void initData() {
super.initData();
HttpConfig config = new HttpConfig();
int hour = StringUtils.toInt(StringUtils.getDataTime("HH"), 0);
if (hour > 7 && hour < 10) { // 如果是在早上7点到10点,就缓存的时间短一点
config.cacheTime = 10;
} else {
config.cacheTime = 300;
}
config.useDelayCache = true;
kjh = new KJHttp(config);
Bundle bundle = aty.getBundleData();
String name = null;
if (bundle != null) {
BLOGLIST_ID = bundle.getInt(BLOGLIST_KEY, 1428332);
name = bundle.getString(BlogAuthorFragment.AUTHOR_NAME_KEY);
}
if (StringUtils.isEmpty(name)) {
titleBarName = getString(R.string.osc_joke);
} else {
titleBarName = name + "的博客";
}
}
开发者ID:KJFrame,项目名称:KJBlog,代码行数:26,代码来源:OSCBlogListFragment.java
示例9: fillUI
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
private void fillUI() {
cache = kjh.getStringCache(OSCBLOG_HOST + BLOGLIST_ID);
if (!StringUtils.isEmpty(cache)) {
OSCBlogList dataRes = Parser.xmlToBean(OSCBlogList.class, cache);
mDatas.addAll(dataRes.getBloglist());
if (adapter == null) {
adapter = new OSCBlogAdapter(mListView, mDatas,
R.layout.item_list_blog);
mListView.setAdapter(adapter);
} else {
adapter.refresh(mDatas);
}
mEmptyLayout.dismiss();
}
refresh();
}
开发者ID:KJFrame,项目名称:KJBlog,代码行数:17,代码来源:OSCBlogListFragment.java
示例10: checkVersion
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
private void checkVersion(String json) {
final String url = Parser.checkVersion(outsideAty, json);
if (!StringUtils.isEmpty(url)) {
if (SystemTool.isWiFi(outsideAty)) {
download(url);
} else {
ViewInject.create().getExitDialog(outsideAty, "检测到新版本,是否更新",
new OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
dialog.dismiss();
download(url);
}
});
}
}
}
开发者ID:KJFrame,项目名称:KJBlog,代码行数:19,代码来源:AboutFragment.java
示例11: onMenuClick
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
@Override
public void onMenuClick() {
super.onMenuClick();
Object tag = outsideAty.mImgMenu.getTag();
// 如果有tag,且tag为真,则把tag改为false取消收藏
if (tag != null && tag instanceof Boolean) {
if ((Boolean) tag) {
outsideAty.mImgMenu.setTag(Boolean.valueOf(false));
setMenuImage(R.drawable.titlebar_unstar);
kjdb.deleteByWhere(CollectData.class, "url='" + blogUrl + "'");
return;
}
}
// 如果没有tag或tag为假,则把tag改为true收藏本链接
outsideAty.mImgMenu.setTag(Boolean.valueOf(true));
setMenuImage(R.drawable.titlebar_star);
if (StringUtils.isEmpty(data.getName())) {
data.setName(mWebView.getTitle());
}
data.setUrl(blogUrl);
kjdb.save(data);
}
开发者ID:KJFrame,项目名称:KJBlog,代码行数:23,代码来源:OSCBlogDetailFragment.java
示例12: fillUI
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
/**
* 填充UI
*
* @param data
*/
private void fillUI(OSCBlogEntity data) {
if (data.getBlog() != null) {
this.data.setName(data.getBlog().getTitle());
mTvAuthor.setText(data.getBlog().getAuthorname());
mTvBlogTitle.setText(data.getBlog().getTitle());
mTvTime.setText(StringUtils.friendlyTime(data.getBlog()
.getPubDate()));
StringBuffer body = new StringBuffer();
body.append(UIHelper.setHtmlCotentSupportImagePreview(data
.getBlog().getBody()));
body.append(UIHelper.WEB_STYLE).append(UIHelper.WEB_LOAD_IMAGES);
mWebView.loadDataWithBaseURL(null, body.toString(), "text/html",
"utf-8", null);
}
}
开发者ID:KJFrame,项目名称:KJBlog,代码行数:22,代码来源:OSCBlogDetailFragment.java
示例13: fillUI
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
/**
* 首次进入时填充数据
*/
private void fillUI() {
cache = kjh.getStringCache(ACTIVE_HOST);
if (!StringUtils.isEmpty(cache)) {
ActiveList dataRes = Parser.xmlToBean(ActiveList.class, cache);
if (adapter == null) {
adapter = new ActiveAdapter(mListView, dataRes.getEvents(),
R.layout.item_list_active);
mListView.setAdapter(adapter);
} else {
adapter.refresh(dataRes.getEvents());
}
mEmptyLayout.dismiss();
}
refresh();
}
开发者ID:KJFrame,项目名称:KJBlog,代码行数:19,代码来源:ActiveFragment.java
示例14: initWidget
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
@Override
protected void initWidget(View parentView) {
super.initWidget(parentView);
mListView.setStackFromBottom(true);
mListView.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
mListView.setDivider(new ColorDrawable(android.R.color.transparent));
cache = kjh.getStringCache(EVERYDAY_HOST);
if (!StringUtils.isEmpty(cache)) {
List<EverydayMessage> datas = Parser.getEveryDayMsg(cache);
if (adapter == null) {
adapter = new WeChatAdapter(outsideAty, datas);
mListView.setAdapter(adapter);
mListView.scrollTo(0, mListView.getBottom());
} else {
adapter.refresh(datas);
}
}
refresh();
}
开发者ID:KJFrame,项目名称:KJBlog,代码行数:20,代码来源:WeChatFragment.java
示例15: onMenuClick
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
@Override
public void onMenuClick() {
super.onMenuClick();
Intent intent = new Intent();
intent.putExtra(TweetFragment.CONTENT_KEY, mEtSpeech.getText()
.toString());
if (!StringUtils.isEmpty(filePath)) {
intent.putExtra(TweetFragment.IMAGEPATH_KEY, filePath);
outsideAty.setResult(TweetFragment.REQUEST_CODE_IMAGE, intent);
} else {
intent.putExtra(TweetFragment.AUDIOPATH_KEY,
mBtnRecort.getCurrentAudioPath());
outsideAty.setResult(TweetFragment.REQUEST_CODE_RECORD, intent);
}
outsideAty.finish();
}
开发者ID:KJFrame,项目名称:KJBlog,代码行数:17,代码来源:TweetRecordFragment.java
示例16: setActionBarTitle
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
/**
* Set the ActionBar title by string
* @param title title string
*/
public void setActionBarTitle(String title) {
if (StringUtils.isEmpty(title)) {
title = getString(R.string.app_name);
}
if (hasActionBar() && mActionBar != null) {
mActionBar.setTitle(title);
}
}
开发者ID:sczyh30,项目名称:yuedong-app,代码行数:13,代码来源:BaseActivity.java
示例17: updateUI
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
private void updateUI() {
//此逻辑还有些问题,可能会NullPointer
//fixed in 1.12
if(mUser != null && top_flag > 0) {
mTvUsername.setText(mUser.getUsername());
mTvTips.setText(mUser.getTips());
mTvActNum.setText(Integer.toString(mUser.getActivitiesNumber()));
mTvFollowers.setText(Integer.toString(mUser.getFans()));
mTvFollowing.setText(Integer.toString(mUser.getFollowers()));
mIvGender.setImageResource(StringUtils.toInt(mUser.getGender()) == 1 ?
R.mipmap.userinfo_icon_male : R.mipmap.userinfo_icon_female);
getImages();
}
}
开发者ID:sczyh30,项目名称:yuedong-app,代码行数:15,代码来源:UserProfileActivity.java
示例18: setAvatarUrl
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
public void setAvatarUrl(String url) {
if (StringUtils.isEmpty(url)) {
setImageResource(R.mipmap.widget_dface);
return;
}
// 由于头像地址默认加了一段参数需要去掉
int end = url.indexOf('?');
final String headUrl;
if (end > 0) {
headUrl = url.substring(0, end);
} else {
headUrl = url;
}
kjb.display(this, headUrl, R.mipmap.widget_dface, 0, 0,
new BitmapCallBack() {
@Override
public void onFailure(Exception e) {
super.onFailure(e);
aty.runOnUiThread(new Runnable() {
@Override
public void run() {
setImageResource(R.mipmap.widget_dface);
}
});
setImageResource(R.mipmap.widget_dface);
}
});
}
开发者ID:sczyh30,项目名称:yuedong-app,代码行数:30,代码来源:AvatarView.java
示例19: getFileNameNoFormat
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
/**
* 根据文件的绝对路径获取文件名但不包含扩展名
*
* @param filePath
* @return
*/
public static String getFileNameNoFormat(String filePath) {
if (StringUtils.isEmpty(filePath)) {
return "";
}
int point = filePath.lastIndexOf('.');
return filePath.substring(filePath.lastIndexOf(File.separator) + 1,
point);
}
开发者ID:haiyangxue,项目名称:blogplu,代码行数:15,代码来源:FileUtil.java
示例20: getFileFormat
import org.kymjs.kjframe.utils.StringUtils; //导入依赖的package包/类
/**
* 获取文件扩展名
*
* @param fileName
* @return
*/
public static String getFileFormat(String fileName) {
if (StringUtils.isEmpty(fileName))
return "";
int point = fileName.lastIndexOf('.');
return fileName.substring(point + 1);
}
开发者ID:haiyangxue,项目名称:blogplu,代码行数:14,代码来源:FileUtil.java
注:本文中的org.kymjs.kjframe.utils.StringUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论