本文整理汇总了Java中com.hyphenate.easeui.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
R类属于com.hyphenate.easeui包,在下文中一共展示了R类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
});
}
示例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();
}
示例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();
}
}
}
示例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;
}
}
示例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);
}
示例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();
}
}
示例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);
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
}
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}