本文整理汇总了Java中com.hyphenate.easeui.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
R类属于com.hyphenate.easeui包,在下文中一共展示了R类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addTab
import com.hyphenate.easeui.R; //导入依赖的package包/类
/**
* add tab
* @param icon
*/
public void addTab(int icon){
View tabView = View.inflate(context, R.layout.ease_scroll_tab_item, null);
ImageView imageView = (ImageView) tabView.findViewById(R.id.iv_icon);
imageView.setImageResource(icon);
int tabWidth = 60;
LinearLayout.LayoutParams imgParams = new LinearLayout.LayoutParams(DensityUtil.dip2px(context, tabWidth), LayoutParams.MATCH_PARENT);
imageView.setLayoutParams(imgParams);
tabContainer.addView(tabView);
tabList.add(imageView);
final int position = tabList.size() -1;
imageView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(itemClickListener != null){
itemClickListener.onItemClick(position);
}
}
});
}
开发者ID:Vicent9920,项目名称:FanChat,代码行数:25,代码来源:EaseEmojiconScrollTabBar.java
示例2: emptyHistory
import com.hyphenate.easeui.R; //导入依赖的package包/类
/**
* clear the conversation history
*
*/
protected void emptyHistory() {
String msg = getResources().getString(R.string.Whether_to_empty_all_chats);
new EaseAlertDialog(getActivity(),null, msg, null,new AlertDialogUser() {
@Override
public void onResult(boolean confirmed, Bundle bundle) {
if(confirmed){
if (conversation != null) {
conversation.clearAllMessages();
}
messageList.refresh();
}
}
}, true).show();
}
开发者ID:turoDog,项目名称:KTalk,代码行数:20,代码来源:EaseChatFragment.java
示例3: toGroupDetails
import com.hyphenate.easeui.R; //导入依赖的package包/类
/**
* open group detail
*
*/
protected void toGroupDetails() {
if (chatType == EaseConstant.CHATTYPE_GROUP) {
EMGroup group = EMClient.getInstance().groupManager().getGroup(toChatUsername);
if (group == null) {
Toast.makeText(getActivity(), R.string.gorup_not_found, Toast.LENGTH_SHORT).show();
return;
}
if(chatFragmentHelper != null){
chatFragmentHelper.onEnterToChatDetails();
}
}else if(chatType == EaseConstant.CHATTYPE_CHATROOM){
if(chatFragmentHelper != null){
chatFragmentHelper.onEnterToChatDetails();
}
}
}
开发者ID:turoDog,项目名称:KTalk,代码行数:21,代码来源:EaseChatFragment.java
示例4: startRecording
import com.hyphenate.easeui.R; //导入依赖的package包/类
public void startRecording() {
if (!EaseCommonUtils.isSdcardExist()) {
Toast.makeText(context, R.string.Send_voice_need_sdcard_support, Toast.LENGTH_SHORT).show();
return;
}
try {
wakeLock.acquire();
this.setVisibility(View.VISIBLE);
recordingHint.setText(context.getString(R.string.move_up_to_cancel));
recordingHint.setBackgroundColor(Color.TRANSPARENT);
voiceRecorder.startRecording(context);
} catch (Exception e) {
e.printStackTrace();
if (wakeLock.isHeld())
wakeLock.release();
if (voiceRecorder != null)
voiceRecorder.discardRecording();
this.setVisibility(View.INVISIBLE);
Toast.makeText(context, R.string.recoding_fail, Toast.LENGTH_SHORT).show();
return;
}
}
开发者ID:Vicent9920,项目名称:FanChat,代码行数:23,代码来源:EaseVoiceRecorderView.java
示例5: init
import com.hyphenate.easeui.R; //导入依赖的package包/类
private void init(Context context, AttributeSet attrs) {
this.context = context;
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.EaseContactList);
primaryColor = ta.getColor(R.styleable.EaseContactList_ctsListPrimaryTextColor, 0);
primarySize = ta.getDimensionPixelSize(R.styleable.EaseContactList_ctsListPrimaryTextSize, 0);
showSiderBar = ta.getBoolean(R.styleable.EaseContactList_ctsListShowSiderBar, true);
initialLetterBg = ta.getDrawable(R.styleable.EaseContactList_ctsListInitialLetterBg);
initialLetterColor = ta.getColor(R.styleable.EaseContactList_ctsListInitialLetterColor, 0);
ta.recycle();
LayoutInflater.from(context).inflate(R.layout.ease_widget_contact_list, this);
listView = (ListView)findViewById(R.id.list);
sidebar = (EaseSidebar) findViewById(R.id.sidebar);
if(!showSiderBar)
sidebar.setVisibility(View.GONE);
}
开发者ID:turoDog,项目名称:KTalk,代码行数:18,代码来源:EaseContactList.java
示例6: EaseSwitchButton
import com.hyphenate.easeui.R; //导入依赖的package包/类
public EaseSwitchButton(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.EaseSwitchButton);
Drawable openDrawable = ta.getDrawable(R.styleable.EaseSwitchButton_switchOpenImage);
Drawable closeDrawable = ta.getDrawable(R.styleable.EaseSwitchButton_switchCloseImage);
int switchStatus = ta.getInt(R.styleable.EaseSwitchButton_switchStatus, 0);
ta.recycle();
LayoutInflater.from(context).inflate(R.layout.ease_widget_switch_button, this);
openImage = (ImageView) findViewById(R.id.iv_switch_open);
closeImage = (ImageView) findViewById(R.id.iv_switch_close);
if(openDrawable != null){
openImage.setImageDrawable(openDrawable);
}
if(closeDrawable != null){
closeImage.setImageDrawable(closeDrawable);
}
if(switchStatus == 1){
closeSwitch();
}
}
开发者ID:turoDog,项目名称:KTalk,代码行数:24,代码来源:EaseSwitchButton.java
示例7: onCreate
import com.hyphenate.easeui.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.ease_showvideo_activity);
loadingLayout = (RelativeLayout) findViewById(R.id.loading_layout);
progressBar = (ProgressBar) findViewById(R.id.progressBar);
final EMMessage message = getIntent().getParcelableExtra("msg");
if (!(message.getBody() instanceof EMVideoMessageBody)) {
Toast.makeText(EaseShowVideoActivity.this, "Unsupported message body", Toast.LENGTH_SHORT).show();
finish();
return;
}
EMVideoMessageBody messageBody = (EMVideoMessageBody)message.getBody();
localFilePath = messageBody.getLocalUrl();
if (localFilePath != null && new File(localFilePath).exists()) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(localFilePath)),
"video/mp4");
startActivity(intent);
finish();
} else {
EMLog.d(TAG, "download remote video file");
downloadVideo(message);
}
}
开发者ID:funnyzhaov,项目名称:Tribe,代码行数:32,代码来源:EaseShowVideoActivity.java
示例8: onSetUpView
import com.hyphenate.easeui.R; //导入依赖的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
示例9: onSetUpView
import com.hyphenate.easeui.R; //导入依赖的package包/类
@Override
public void onSetUpView() {
String emojiconId = message.getStringAttribute(EaseConstant.MESSAGE_ATTR_EXPRESSION_ID, null);
EaseEmojicon emojicon = null;
if(EaseUI.getInstance().getEmojiconInfoProvider() != null){
emojicon = EaseUI.getInstance().getEmojiconInfoProvider().getEmojiconInfo(emojiconId);
}
if(emojicon != null){
if(emojicon.getBigIcon() != 0){
Glide.with(activity).load(emojicon.getBigIcon()).placeholder(R.drawable.ease_default_expression).into(imageView);
}else if(emojicon.getBigIconPath() != null){
Glide.with(activity).load(emojicon.getBigIconPath()).placeholder(R.drawable.ease_default_expression).into(imageView);
}else{
imageView.setImageResource(R.drawable.ease_default_expression);
}
}
handleTextMessage();
}
开发者ID:turoDog,项目名称:KTalk,代码行数:20,代码来源:EaseChatRowBigExpression.java
示例10: onSetUpView
import com.hyphenate.easeui.R; //导入依赖的package包/类
@Override
public void onSetUpView() {
String emojiconId = message.getStringAttribute(EaseConstant.MESSAGE_ATTR_EXPRESSION_ID, null);
EaseEmojicon emojicon = null;
if(EaseUI.getInstance().getEmojiconInfoProvider() != null){
emojicon = EaseUI.getInstance().getEmojiconInfoProvider().getEmojiconInfo(emojiconId);
}
if(emojicon != null){
if(emojicon.getBigIcon() != 0){
// Glide.with(activity).load(emojicon.getBigIcon()).placeholder(R.drawable.ease_default_expression).into(imageView);
}else if(emojicon.getBigIconPath() != null){
// Glide.with(activity).load(emojicon.getBigIconPath()).placeholder(R.drawable.ease_default_expression).into(imageView);
}else{
imageView.setImageResource(R.drawable.ease_default_expression);
}
}
handleTextMessage();
}
开发者ID:funnyzhaov,项目名称:Tribe,代码行数:20,代码来源:EaseChatRowBigExpression.java
示例11: onActivityResult
import com.hyphenate.easeui.R; //导入依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == Activity.RESULT_OK) {
if (requestCode == REQUEST_CODE_CAMERA) { // capture new image
if (cameraFile != null && cameraFile.exists())
sendImageMessage(cameraFile.getAbsolutePath());
} else if (requestCode == REQUEST_CODE_LOCAL) { // send local image
if (data != null) {
Uri selectedImage = data.getData();
if (selectedImage != null) {
sendPicByUri(selectedImage);
}
}
} else if (requestCode == REQUEST_CODE_MAP) { // location
double latitude = data.getDoubleExtra("latitude", 0);
double longitude = data.getDoubleExtra("longitude", 0);
String locationAddress = data.getStringExtra("address");
if (locationAddress != null && !locationAddress.equals("")) {
sendLocationMessage(latitude, longitude, locationAddress);
} else {
Toast.makeText(getActivity(), R.string.unable_to_get_loaction, Toast.LENGTH_SHORT).show();
}
}
}
}
开发者ID:Vicent9920,项目名称:FanChat,代码行数:28,代码来源:EaseChatFragment.java
示例12: loadMoreLocalMessage
import com.hyphenate.easeui.R; //导入依赖的package包/类
private void loadMoreLocalMessage() {
if (listView.getFirstVisiblePosition() == 0 && !isloading && haveMoreData) {
List<EMMessage> messages;
try {
messages = conversation.loadMoreMsgFromDB(conversation.getAllMessages().size() == 0 ? "" : conversation.getAllMessages().get(0).getMsgId(),
pagesize);
} catch (Exception e1) {
swipeRefreshLayout.setRefreshing(false);
return;
}
if (messages.size() > 0) {
messageList.refreshSeekTo(messages.size() - 1);
if (messages.size() != pagesize) {
haveMoreData = false;
}
} else {
haveMoreData = false;
}
isloading = false;
} else {
Toast.makeText(getActivity(), getResources().getString(R.string.no_more_messages),
Toast.LENGTH_SHORT).show();
}
swipeRefreshLayout.setRefreshing(false);
}
开发者ID:funnyzhaov,项目名称:Tribe,代码行数:27,代码来源:EaseChatFragment.java
示例13: sendFileByUri
import com.hyphenate.easeui.R; //导入依赖的package包/类
/**
* send file
* @param uri
*/
protected void sendFileByUri(Uri uri){
String filePath = null;
if ("content".equalsIgnoreCase(uri.getScheme())) {
String[] filePathColumn = { MediaStore.Images.Media.DATA };
Cursor cursor = null;
try {
cursor = getActivity().getContentResolver().query(uri, filePathColumn, null, null, null);
int column_index = cursor.getColumnIndexOrThrow("_data");
if (cursor.moveToFirst()) {
filePath = cursor.getString(column_index);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (cursor != null) {
cursor.close();
}
}
} else if ("file".equalsIgnoreCase(uri.getScheme())) {
filePath = uri.getPath();
}
if (filePath == null) {
return;
}
File file = new File(filePath);
if (!file.exists()) {
Toast.makeText(getActivity(), R.string.File_does_not_exist, Toast.LENGTH_SHORT).show();
return;
}
//limit the size < 10M
if (file.length() > 10 * 1024 * 1024) {
Toast.makeText(getActivity(), R.string.The_file_is_not_greater_than_10_m, Toast.LENGTH_SHORT).show();
return;
}
sendFileMessage(filePath);
}
开发者ID:Vicent9920,项目名称:FanChat,代码行数:42,代码来源:EaseChatFragment.java
示例14: containsAtAll
import com.hyphenate.easeui.R; //导入依赖的package包/类
public boolean containsAtAll(String content){
String atAll = "@" + EaseUI.getInstance().getContext().getString(R.string.all_members);
if(content.contains(atAll)){
return true;
}
return false;
}
开发者ID:turoDog,项目名称:KTalk,代码行数:8,代码来源:EaseAtMessageHelper.java
示例15: init
import com.hyphenate.easeui.R; //导入依赖的package包/类
private void init(Context context, AttributeSet attrs) {
this.context = context;
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.EaseConversationList);
primaryColor = ta.getColor(R.styleable.EaseConversationList_cvsListPrimaryTextColor, getResources().getColor(R.color.list_itease_primary_color));
secondaryColor = ta.getColor(R.styleable.EaseConversationList_cvsListSecondaryTextColor, getResources().getColor(R.color.list_itease_secondary_color));
timeColor = ta.getColor(R.styleable.EaseConversationList_cvsListTimeTextColor, getResources().getColor(R.color.list_itease_secondary_color));
primarySize = ta.getDimensionPixelSize(R.styleable.EaseConversationList_cvsListPrimaryTextSize, 0);
secondarySize = ta.getDimensionPixelSize(R.styleable.EaseConversationList_cvsListSecondaryTextSize, 0);
timeSize = ta.getDimension(R.styleable.EaseConversationList_cvsListTimeTextSize, 0);
ta.recycle();
}
开发者ID:funnyzhaov,项目名称:Tribe,代码行数:14,代码来源:EaseConversationList.java
示例16: onFindViewById
import com.hyphenate.easeui.R; //导入依赖的package包/类
@Override
protected void onFindViewById() {
fileNameView = (TextView) findViewById(R.id.tv_file_name);
fileSizeView = (TextView) findViewById(R.id.tv_file_size);
fileStateView = (TextView) findViewById(R.id.tv_file_state);
percentageView = (TextView) findViewById(R.id.percentage);
}
开发者ID:Vicent9920,项目名称:FanChat,代码行数:8,代码来源:EaseChatRowFile.java
示例17: init
import com.hyphenate.easeui.R; //导入依赖的package包/类
private void init(Context context, AttributeSet attrs) {
//init the value
borderWidth = 0;
borderColor = 0xddffffff;
pressAlpha = 0x42;
pressColor = 0x42000000;
radius = 16;
shapeType = 0;
// get attribute of EaseImageView
if (attrs != null) {
TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.EaseImageView);
borderColor = array.getColor(R.styleable.EaseImageView_ease_border_color, borderColor);
borderWidth = array.getDimensionPixelOffset(R.styleable.EaseImageView_ease_border_width, borderWidth);
pressAlpha = array.getInteger(R.styleable.EaseImageView_ease_press_alpha, pressAlpha);
pressColor = array.getColor(R.styleable.EaseImageView_ease_press_color, pressColor);
radius = array.getDimensionPixelOffset(R.styleable.EaseImageView_ease_radius, radius);
shapeType = array.getInteger(R.styleable.EaseImageView_ease_shape_type, shapeType);
array.recycle();
}
// set paint when pressed
pressPaint = new Paint();
pressPaint.setAntiAlias(true);
pressPaint.setStyle(Paint.Style.FILL);
pressPaint.setColor(pressColor);
pressPaint.setAlpha(0);
pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
setClickable(true);
setDrawingCacheEnabled(true);
setWillNotDraw(false);
}
开发者ID:Vicent9920,项目名称:FanChat,代码行数:34,代码来源:EaseImageView.java
示例18: selectPicFromCamera
import com.hyphenate.easeui.R; //导入依赖的package包/类
/**
* capture new image
*/
protected void selectPicFromCamera() {
if (!EaseCommonUtils.isSdcardExist()) {
Toast.makeText(getActivity(), R.string.sd_card_does_not_exist, Toast.LENGTH_SHORT).show();
return;
}
cameraFile = new File(PathUtil.getInstance().getImagePath(), EMClient.getInstance().getCurrentUser()
+ System.currentTimeMillis() + ".jpg");
//noinspection ResultOfMethodCallIgnored
cameraFile.getParentFile().mkdirs();
startActivityForResult(
new Intent(MediaStore.ACTION_IMAGE_CAPTURE).putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(cameraFile)),
REQUEST_CODE_CAMERA);
}
开发者ID:turoDog,项目名称:KTalk,代码行数:18,代码来源:EaseChatFragment.java
示例19: onUserRemoved
import com.hyphenate.easeui.R; //导入依赖的package包/类
@Override
public void onUserRemoved(final String groupId, String groupName) {
getActivity().runOnUiThread(new Runnable() {
public void run() {
if (toChatUsername.equals(groupId)) {
Toast.makeText(getActivity(), R.string.you_are_group, Toast.LENGTH_LONG).show();
Activity activity = getActivity();
if (activity != null && !activity.isFinishing()) {
activity.finish();
}
}
}
});
}
开发者ID:turoDog,项目名称:KTalk,代码行数:16,代码来源:EaseChatFragment.java
示例20: onActivityCreated
import com.hyphenate.easeui.R; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
inputMethodManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
//noinspection ConstantConditions
titleBar = (EaseTitleBar) getView().findViewById(R.id.title_bar);
initView();
setUpView();
}
开发者ID:Vicent9920,项目名称:FanChat,代码行数:11,代码来源:EaseBaseFragment.java
注:本文中的com.hyphenate.easeui.R类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论