本文整理汇总了Java中com.hyphenate.util.TextFormater类的典型用法代码示例。如果您正苦于以下问题:Java TextFormater类的具体用法?Java TextFormater怎么用?Java TextFormater使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextFormater类属于com.hyphenate.util包,在下文中一共展示了TextFormater类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onSetUpView
import com.hyphenate.util.TextFormater; //导入依赖的package包/类
@Override
protected void onSetUpView() {
fileMessageBody = (EMNormalFileMessageBody) message.getBody();
String filePath = fileMessageBody.getLocalUrl();
fileNameView.setText(fileMessageBody.getFileName());
fileSizeView.setText(TextFormater.getDataSize(fileMessageBody.getFileSize()));
if (message.direct() == EMMessage.Direct.RECEIVE) {
File file = new File(filePath);
if (file.exists()) {
fileStateView.setText(R.string.Have_downloaded);
} else {
fileStateView.setText(R.string.Did_not_download);
}
return;
}
// until here, to sending message
handleSendMessage();
}
开发者ID:turoDog,项目名称:KTalk,代码行数:20,代码来源:EaseChatRowFile.java
示例2: onSetUpView
import com.hyphenate.util.TextFormater; //导入依赖的package包/类
@Override
protected void onSetUpView() {
fileMessageBody = (EMNormalFileMessageBody) message.getBody();
String filePath = fileMessageBody.getLocalUrl();
fileNameView.setText(fileMessageBody.getFileName());
fileSizeView.setText(TextFormater.getDataSize(fileMessageBody.getFileSize()));
if (message.direct() == EMMessage.Direct.RECEIVE) { // 接收的消息
File file = new File(filePath);
if (file != null && file.exists()) {
fileStateView.setText(R.string.Have_downloaded);
} else {
fileStateView.setText(R.string.Did_not_download);
}
return;
}
// until here, deal with send voice msg
handleSendMessage();
}
开发者ID:Rabbit00,项目名称:MeifuGO,代码行数:20,代码来源:EaseChatRowFile.java
示例3: onSetUpView
import com.hyphenate.util.TextFormater; //导入依赖的package包/类
@Override
protected void onSetUpView() {
fileMessageBody = (EMNormalFileMessageBody) message.getBody();
String filePath = fileMessageBody.getLocalUrl();
fileNameView.setText(fileMessageBody.getFileName());
fileSizeView.setText(TextFormater.getDataSize(fileMessageBody.getFileSize()));
if (message.direct() == EMMessage.Direct.RECEIVE) {
File file = new File(filePath);
if (file != null && file.exists()) {
fileStateView.setText(R.string.Have_downloaded);
} else {
fileStateView.setText(R.string.Did_not_download);
}
return;
}
// until here, to sending message
handleSendMessage();
}
开发者ID:HyphenateInc,项目名称:Hyphenate-EaseUI-Android,代码行数:20,代码来源:EaseChatRowFile.java
示例4: getView
import com.hyphenate.util.TextFormater; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup container) {
ViewHolder holder=null;
if(convertView==null)
{
holder=new ViewHolder();
convertView=LayoutInflater.from(mContext).inflate(R.layout.em_choose_griditem, container,false);
holder.imageView=(RecyclingImageView) convertView.findViewById(R.id.imageView);
holder.icon=(ImageView) convertView.findViewById(R.id.video_icon);
holder.tvDur=(TextView)convertView.findViewById(R.id.chatting_length_iv);
holder.tvSize=(TextView)convertView.findViewById(R.id.chatting_size_iv);
holder.imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
holder.imageView.setLayoutParams(mImageViewLayoutParams);
convertView.setTag(holder);
}else{
holder=(ViewHolder) convertView.getTag();
}
// Check the height matches our calculated column width
if (holder.imageView.getLayoutParams().height != mItemHeight) {
holder.imageView.setLayoutParams(mImageViewLayoutParams);
}
// Finally load the image asynchronously into the ImageView, this
// also takes care of
// setting a placeholder image while the background thread runs
String st1 = getResources().getString(R.string.Video_footage);
if(position==0)
{
holder.icon.setVisibility(View.GONE);
holder.tvDur.setVisibility(View.GONE);
holder.tvSize.setText(st1);
holder.imageView.setImageResource(R.drawable.em_actionbar_camera_icon);
}else{
holder.icon.setVisibility(View.VISIBLE);
VideoEntity entty=mList.get(position-1);
holder.tvDur.setVisibility(View.VISIBLE);
holder.tvDur.setText(DateUtils.toTime(entty.duration));
holder.tvSize.setText(TextFormater.getDataSize(entty.size));
holder.imageView.setImageResource(R.drawable.em_empty_photo);
mImageResizer.loadImage(entty.filePath, holder.imageView);
}
return convertView;
// END_INCLUDE(load_gridview_item)
}
开发者ID:mangestudio,项目名称:GCSApp,代码行数:47,代码来源:ImageGridFragment.java
注:本文中的com.hyphenate.util.TextFormater类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论