Merge branch 'dev_聊天' into dev_改版主分支

# Conflicts:
#	common/src/main/java/com/yunbao/common/http/PDLiveApi.java
#	common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java
This commit is contained in:
zlzw 2024-03-20 16:21:24 +08:00
commit bfa4a52dd4
74 changed files with 2574 additions and 992 deletions

View File

@ -7,7 +7,7 @@ import android.net.Uri;
import androidx.core.content.FileProvider;
import com.twitter.sdk.android.tweetcomposer.TweetUploadService;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.bean.ShareBean;
import com.yunbao.share.receiver.TwitterResultReceiver;
import java.io.File;
@ -23,7 +23,7 @@ public abstract class AbsShareInterface {
context.registerReceiver(new TwitterResultReceiver(), filter);
}
public abstract void share(ShareBuilder builder, ICallback callback);
public abstract void share(ShareBean builder, ICallback callback);
public Uri fileToUri(File file){
return FileProvider.getUriForFile(mContext,

View File

@ -3,6 +3,7 @@ package com.yunbao.share.adapters;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.RadioButton;
import android.widget.TextView;
@ -75,6 +76,10 @@ public class InternalShareAdapter extends RecyclerView.Adapter<InternalShareAdap
} else {
radioButton.setChecked(false);
}
radioButton.setOnClickListener(view -> {
selectPosition = position;
notifyDataSetChanged();
});
itemView.setOnClickListener(view -> {
selectPosition = position;
notifyDataSetChanged();

View File

@ -1,7 +1,6 @@
package com.yunbao.share.adapters;
import android.content.Context;
import android.os.Environment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -15,7 +14,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.pdlive.shayu.R;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.bean.ShareBean;
import com.yunbao.share.platform.FacebookShare;
import com.yunbao.share.platform.Instagram;
import com.yunbao.share.platform.Internal;
@ -24,13 +23,12 @@ import com.yunbao.share.platform.MessengerShare;
import com.yunbao.share.platform.TwitterShare;
import com.yunbao.share.platform.WhatsApp;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppViewHolder> {
private Context mContext;
private List<ShareBuilder> list;
private List<ShareBean> list;
ShareCallback shareCallback;
public ShareAppAdapter(Context mContext) {
@ -38,7 +36,7 @@ public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppVie
this.mContext = mContext;
}
public void setList(List<ShareBuilder> list) {
public void setList(List<ShareBean> list) {
this.list = list;
notifyDataSetChanged();
}
@ -51,27 +49,28 @@ public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppVie
@Override
public void onBindViewHolder(@NonNull AppViewHolder holder, int position) {
ShareBuilder builder = list.get(position);
ShareBean builder = list.get(position);
System.out.println("------type------>"+builder.getType());
switch (builder.getType()) {
case ShareBuilder.APP_FACEBOOK:
case ShareBean.APP_FACEBOOK:
holder.setData(builder, R.mipmap.icon_share_facebook, R.string.dialog_share_app_facebook);
break;
case ShareBuilder.APP_LINE:
case ShareBean.APP_LINE:
holder.setData(builder, R.mipmap.icon_share_line, R.string.dialog_share_app_line);
break;
case ShareBuilder.APP_TWITTER:
case ShareBean.APP_TWITTER:
holder.setData(builder, R.mipmap.icon_share_twitter, R.string.dialog_share_app_twitter);
break;
case ShareBuilder.APP_WHATSAPP:
case ShareBean.APP_WHATSAPP:
holder.setData(builder, R.mipmap.icon_share_whatsapp, R.string.dialog_share_app_whatsapp);
break;
case ShareBuilder.APP_MESSENGER:
case ShareBean.APP_MESSENGER:
holder.setData(builder, R.mipmap.icon_share_messenger, R.string.dialog_share_app_messenger);
break;
case ShareBuilder.APP_INSTAGRAM:
case ShareBean.APP_INSTAGRAM:
holder.setData(builder, R.mipmap.icon_share_instagram, R.string.dialog_share_app_instagram);
break;
case ShareBuilder.APP_INTERNAL:
case ShareBean.APP_INTERNAL:
holder.setData(builder, R.mipmap.ic_share_friend, R.string.dialog_share_app_internal);
break;
}
@ -99,30 +98,30 @@ public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppVie
title = itemView.findViewById(R.id.share_app_name);
}
public void setData(ShareBuilder bean, @DrawableRes int iconId, @StringRes int appName) {
public void setData(ShareBean bean, @DrawableRes int iconId, @StringRes int appName) {
icon.setImageResource(iconId);
title.setText(appName);
itemView.setOnClickListener(v -> {
switch (bean.getType()) {
case ShareBuilder.APP_FACEBOOK:
case ShareBean.APP_FACEBOOK:
new FacebookShare(itemView.getContext()).share(bean, new ShareCallback());
break;
case ShareBuilder.APP_LINE:
case ShareBean.APP_LINE:
new Line(itemView.getContext()).share(bean, new ShareCallback());
break;
case ShareBuilder.APP_TWITTER:
case ShareBean.APP_TWITTER:
new TwitterShare(itemView.getContext()).share(bean, new ShareCallback());
break;
case ShareBuilder.APP_WHATSAPP:
case ShareBean.APP_WHATSAPP:
new WhatsApp(itemView.getContext()).share(bean, new ShareCallback());
break;
case ShareBuilder.APP_MESSENGER:
case ShareBean.APP_MESSENGER:
new MessengerShare(itemView.getContext()).share(bean, new ShareCallback());
break;
case ShareBuilder.APP_INSTAGRAM:
case ShareBean.APP_INSTAGRAM:
new Instagram(itemView.getContext()).share(bean, new ShareCallback());
break;
case ShareBuilder.APP_INTERNAL:
case ShareBean.APP_INTERNAL:
new Internal(itemView.getContext()).share(bean, shareCallback);
break;
}

View File

@ -0,0 +1,260 @@
package com.yunbao.share.bean;
import androidx.annotation.NonNull;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.share.ui.SharePopDialog;
import java.io.File;
public class ShareBean {
public static final int APP_FACEBOOK = 0;
public static final int APP_LINE = 1;
public static final int APP_TWITTER = 2;
public static final int APP_WHATSAPP = 3;
public static final int APP_MESSENGER = 4;
public static final int APP_INSTAGRAM = 5;
public static final int APP_INTERNAL = 6;
private String text;
private String link;
private File file;
private int type;
private String uid;
private String anchorId;
private String anchorName;
private String anchorAvatar;
private int shareType;
private String cover;
private String title;
public static String createLiveShareLink(String shareUid, String anchorId, String anchorName, String anchorAvatar) {
return String.format(CommonAppConfig.HOST +
"/index.php?g=Appapi&m=home&a=share&uid=%s&user_id=%s&isGoogle=%s",
anchorId,
shareUid,
CommonAppConfig.IS_GOOGLE_PLAY
);
}
public static String createInviteLink(String shareUid) {
return String.format("https://www.pdlive.com/public/app/download/index.html?user_id=%s&isGoogle=%s",
shareUid,
CommonAppConfig.IS_GOOGLE_PLAY
);
}
public static ShareBean builder(int type) {
return new ShareBean(type);
}
private ShareBean(int type) {
this.type = type;
}
public int getShareType() {
return shareType;
}
public void setShareType(int shareType) {
this.shareType = shareType;
}
public void setType(int type) {
this.type = type;
}
public String getCover() {
return cover;
}
public void setCover(String cover) {
this.cover = cover;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getType() {
return type;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getAnchorId() {
return anchorId;
}
public void setAnchorId(String anchorId) {
this.anchorId = anchorId;
}
public String getAnchorName() {
return anchorName;
}
public void setAnchorName(String anchorName) {
this.anchorName = anchorName;
}
public String getAnchorAvatar() {
return anchorAvatar;
}
public void setAnchorAvatar(String anchorAvatar) {
this.anchorAvatar = anchorAvatar;
}
public ShareBean setText(String text) {
this.text = text;
return this;
}
public ShareBean setLink(String link) {
this.link = link;
return this;
}
public ShareBean setFile(File file) {
this.file = file;
return this;
}
public String getText() {
if (StringUtil.isEmpty(text)) {
return getLink();
}
return text + "\n" + getLink();
}
public String getLink() {
if (StringUtil.isEmpty(link)) {
link = createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
}
return link;
}
public File getFile() {
return file;
}
@NonNull
@Override
public String toString() {
return "ShareBuilder{" +
"text='" + text + '\'' +
", link='" + link + '\'' +
", file=" + file +
'}';
}
/**
* private String text;
* private String link;
* private File file;
* private int type;
* private String uid;
* private String anchorId;
* private String anchorName;
* private String anchorAvatar;
* private int shareType;
* private String cover;
* private String title;
*/
@NonNull
@Override
public ShareBean clone(){
ShareBean bean=new ShareBean(type);
bean.anchorId=anchorId;
bean.anchorName=anchorName;
bean.anchorAvatar=anchorAvatar;
bean.text=text;
bean.link=link;
bean.file=file;
bean.uid=uid;
bean.shareType=shareType;
bean.cover=cover;
bean.title=title;
return bean;
}
public static class ShareBuilder {
ShareBean bean;
public ShareBuilder() {
bean = new ShareBean(APP_FACEBOOK);
}
public ShareBuilder setShareType(int shareType) {
bean.setShareType(shareType);
return this;
}
public ShareBuilder setCover(String cover) {
bean.setCover(cover);
return this;
}
public ShareBuilder setTitle(String title) {
bean.setTitle(title);
return this;
}
public ShareBuilder setUid(String uid) {
bean.setUid(uid);
return this;
}
public ShareBuilder setAnchorId(String anchorId) {
bean.setAnchorId(anchorId);
return this;
}
public ShareBuilder setAnchorName(String anchorName) {
bean.setAnchorName(anchorName);
return this;
}
public ShareBuilder setAnchorAvatar(String anchorAvatar) {
bean.setAnchorAvatar(anchorAvatar);
return this;
}
public ShareBuilder setText(String text) {
bean.setText(text);
return this;
}
public ShareBuilder setLink(String link) {
bean.setLink(link);
return this;
}
public ShareBuilder setFile(File file) {
bean.setFile(file);
return this;
}
public ShareBean build() {
return bean;
}
public static ShareBuilder create() {
return new ShareBuilder();
}
}
}

View File

@ -1,135 +0,0 @@
package com.yunbao.share.bean;
import androidx.annotation.NonNull;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.StringUtil;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Locale;
public class ShareBuilder {
public static final int APP_FACEBOOK = 0;
public static final int APP_LINE = 1;
public static final int APP_TWITTER = 2;
public static final int APP_WHATSAPP = 3;
public static final int APP_MESSENGER = 4;
public static final int APP_INSTAGRAM = 5;
public static final int APP_INTERNAL = 6;
private String text;
private String link;
private File file;
private int type;
private String uid;
private String anchorId;
private String anchorName;
private String anchorAvatar;
public static String createLiveShareLink(String shareUid, String anchorId, String anchorName, String anchorAvatar) {
return String.format(CommonAppConfig.HOST +
"/index.php?g=Appapi&m=home&a=share&uid=%s&user_id=%s&isGoogle=%s",
anchorId,
shareUid,
CommonAppConfig.IS_GOOGLE_PLAY
);
}
public static String createInviteLink(String shareUid) {
return String.format("https://www.pdlive.com/public/app/download/index.html?user_id=%s&isGoogle=%s",
shareUid,
CommonAppConfig.IS_GOOGLE_PLAY
);
}
public static ShareBuilder builder(int type) {
return new ShareBuilder(type);
}
private ShareBuilder(int type) {
this.type = type;
}
public int getType() {
return type;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getAnchorId() {
return anchorId;
}
public void setAnchorId(String anchorId) {
this.anchorId = anchorId;
}
public String getAnchorName() {
return anchorName;
}
public void setAnchorName(String anchorName) {
this.anchorName = anchorName;
}
public String getAnchorAvatar() {
return anchorAvatar;
}
public void setAnchorAvatar(String anchorAvatar) {
this.anchorAvatar = anchorAvatar;
}
public ShareBuilder setText(String text) {
this.text = text;
return this;
}
public ShareBuilder setLink(String link) {
this.link = link;
return this;
}
public ShareBuilder setFile(File file) {
this.file = file;
return this;
}
public String getText() {
if (StringUtil.isEmpty(text)) {
return getLink();
}
return text + "\n" + getLink();
}
public String getLink() {
if (StringUtil.isEmpty(link)) {
link = createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
}
return link;
}
public File getFile() {
return file;
}
@NonNull
@Override
public String toString() {
return "ShareBuilder{" +
"text='" + text + '\'' +
", link='" + link + '\'' +
", file=" + file +
'}';
}
}

View File

@ -12,10 +12,9 @@ import com.facebook.FacebookException;
import com.facebook.share.Sharer;
import com.facebook.share.model.ShareLinkContent;
import com.facebook.share.widget.ShareDialog;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.share.AbsShareInterface;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.bean.ShareBean;
public class FacebookShare extends AbsShareInterface {
public static CallbackManager callbackManager;
@ -24,7 +23,7 @@ public class FacebookShare extends AbsShareInterface {
}
@Override
public void share(ShareBuilder builder, ICallback callback) {
public void share(ShareBean builder, ICallback callback) {
callbackManager= CallbackManager.Factory.create();
ShareLinkContent content = new ShareLinkContent.Builder()
.setContentUrl(Uri.parse(builder.getLink()))

View File

@ -6,7 +6,7 @@ import android.net.Uri;
import com.yunbao.share.AbsShareInterface;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.bean.ShareBean;
public class Instagram extends AbsShareInterface {
public Instagram(Context context) {
@ -14,7 +14,7 @@ public class Instagram extends AbsShareInterface {
}
@Override
public void share(ShareBuilder builder, ICallback callback) {
public void share(ShareBean builder, ICallback callback) {
String type = "image/*";
Intent share = new Intent(Intent.ACTION_SEND);
Uri uri = fileToUri(builder.getFile());

View File

@ -3,20 +3,23 @@ package com.yunbao.share.platform;
import android.content.Context;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.interfaces.OnSendMessageListener;
import com.yunbao.common.message.content.MessageChatCardContent;
import com.yunbao.share.AbsShareInterface;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.bean.ShareBean;
import com.yunbao.share.ui.AppInternalShareDialog;
import com.yunbao.share.ui.ShareSuccessNotifyDialog;
import io.rong.imlib.model.Conversation;
public class Internal extends AbsShareInterface {
public Internal(Context context) {
super(context);
}
@Override
public void share(ShareBuilder builder, ICallback callback) {
public void share(ShareBean builder, ICallback callback) {
new AppInternalShareDialog(mContext)
.setOnItemClickListener(new OnItemClickListener<String>() {
@Override
@ -26,10 +29,36 @@ public class Internal extends AbsShareInterface {
return;
}
builder.setUid(toUid);
sendMessage(builder);
new ShareSuccessNotifyDialog(mContext, builder)
.showDialog();
callback.onSuccess();
}
}).showDialog();
}
void sendMessage(ShareBean builder) {
MessageChatCardContent.sendMessage(Conversation.ConversationType.PRIVATE, builder.getUid(),
MessageChatCardContent.obtain(
builder.getCover(),
builder.getTitle(),
builder.getAnchorAvatar(),
builder.getAnchorName(),
builder.getAnchorId(),
builder.getShareType() + "",
builder.getAnchorId()
),
new OnSendMessageListener<Object>() {
@Override
public void onSuccess(String token, Object bean) {
super.onSuccess(token, bean);
}
@Override
public void onError(int status, String msg) {
super.onError(status, msg);
}
}
);
}
}

View File

@ -6,7 +6,7 @@ import android.net.Uri;
import com.yunbao.share.AbsShareInterface;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.bean.ShareBean;
import java.net.URLEncoder;
@ -17,7 +17,7 @@ public class Line extends AbsShareInterface {
}
@Override
public void share(ShareBuilder builder, ICallback callback) {
public void share(ShareBean builder, ICallback callback) {
try {
Intent share = new Intent(Intent.ACTION_VIEW, Uri.parse("https://line.me/R/share?text=" + URLEncoder.encode(builder.getText(), "UTF-8")));
mContext.startActivity(share);

View File

@ -13,10 +13,9 @@ import com.facebook.FacebookSdk;
import com.facebook.share.Sharer;
import com.facebook.share.model.ShareLinkContent;
import com.facebook.share.widget.MessageDialog;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.share.AbsShareInterface;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.bean.ShareBean;
public class MessengerShare extends AbsShareInterface {
public static CallbackManager callbackManager;
@ -27,7 +26,7 @@ public class MessengerShare extends AbsShareInterface {
}
@Override
public void share(ShareBuilder builder, ICallback callback) {
public void share(ShareBean builder, ICallback callback) {
callbackManager = CallbackManager.Factory.create();
ShareLinkContent content = new ShareLinkContent.Builder()
.setContentUrl(Uri.parse(builder.getLink()))

View File

@ -7,7 +7,7 @@ import android.net.Uri;
import com.twitter.sdk.android.core.Twitter;
import com.yunbao.share.AbsShareInterface;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.bean.ShareBean;
import java.net.URLEncoder;
@ -19,7 +19,7 @@ public class TwitterShare extends AbsShareInterface {
}
@Override
public void share(ShareBuilder date, ICallback callback) {
public void share(ShareBean date, ICallback callback) {
/*
new TwitterAuthClient().authorize((Activity) mContext, new Callback<TwitterSession>() {

View File

@ -5,7 +5,7 @@ import android.content.Intent;
import com.yunbao.share.AbsShareInterface;
import com.yunbao.share.ICallback;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.bean.ShareBean;
public class WhatsApp extends AbsShareInterface {
public WhatsApp(Context context) {
@ -13,7 +13,7 @@ public class WhatsApp extends AbsShareInterface {
}
@Override
public void share(ShareBuilder builder, ICallback callback) {
public void share(ShareBean builder, ICallback callback) {
try {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);

View File

@ -2,27 +2,21 @@ package com.yunbao.share.ui;
import android.content.Context;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.pdlive.shayu.R;
import com.yunbao.common.bean.MessageChatUserBean;
import com.yunbao.common.dialog.AbsDialogFullScreenPopupWindow;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.ViewUtils;
import com.yunbao.share.adapters.InternalShareAdapter;
import com.yunbao.share.bean.ShareBuilder;
import java.util.ArrayList;
import java.util.List;
import io.rong.imkit.conversationlist.model.SingleConversation;
import io.rong.imkit.userinfo.RongUserInfoManager;
import io.rong.imkit.widget.refresh.SmartRefreshLayout;
import io.rong.imkit.widget.refresh.api.RefreshLayout;
import io.rong.imkit.widget.refresh.listener.OnLoadMoreListener;
@ -31,7 +25,6 @@ import io.rong.imkit.widget.refresh.wrapper.RongRefreshHeader;
import io.rong.imlib.IRongCoreCallback;
import io.rong.imlib.IRongCoreEnum;
import io.rong.imlib.RongCoreClient;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation;
public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow {
@ -72,6 +65,10 @@ public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow {
dismiss();
});
findViewById(R.id.btn_share).setOnClickListener(view -> {
if(adapter.getSelectPosition()==-1){
ToastUtil.show(R.string.dialog_share_failure_not_select);
return;
}
if (onItemClickListener != null) {
onItemClickListener.onItemClick(listData.get(adapter.getSelectPosition()).mCore.getTargetId(), adapter.getSelectPosition());
}

View File

@ -2,14 +2,12 @@ package com.yunbao.share.ui;
import static android.content.Context.CLIPBOARD_SERVICE;
import android.app.Dialog;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Shader;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.TextView;
@ -22,10 +20,8 @@ import com.makeramen.roundedimageview.RoundedImageView;
import com.pdlive.shayu.R;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.bean.ShareBean;
import com.yunbao.share.adapters.ShareAppAdapter;
import java.util.ArrayList;
@ -38,7 +34,7 @@ public class InvitePopDialog extends AbsDialogPopupWindow {
private TextView info;
private TextView link;
private TextView title;
private List<ShareBuilder> data;
private List<ShareBean> data;
private String uid;
private String anchorId;
@ -123,18 +119,18 @@ public class InvitePopDialog extends AbsDialogPopupWindow {
private void initData() {
data = new ArrayList<>();
data.add(builder(ShareBuilder.APP_FACEBOOK));
data.add(builder(ShareBuilder.APP_LINE));
data.add(builder(ShareBuilder.APP_TWITTER));
data.add(builder(ShareBuilder.APP_WHATSAPP));
data.add(builder(ShareBuilder.APP_MESSENGER));
data.add(builder(ShareBean.APP_FACEBOOK));
data.add(builder(ShareBean.APP_LINE));
data.add(builder(ShareBean.APP_TWITTER));
data.add(builder(ShareBean.APP_WHATSAPP));
data.add(builder(ShareBean.APP_MESSENGER));
// data.add(builder(ShareBuilder.APP_INSTAGRAM));
adapter.setList(data);
}
private ShareBuilder builder(int type) {
ShareBuilder builder = ShareBuilder.builder(type);
private ShareBean builder(int type) {
ShareBean builder = ShareBean.builder(type);
builder.setText(getContext().getString(R.string.dialog_invite_info));
builder.setLink(url);
builder.setUid(uid);

View File

@ -12,58 +12,48 @@ import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.util.XPopupUtils;
import com.makeramen.roundedimageview.RoundedImageView;
import com.pdlive.shayu.R;
import com.yunbao.common.dialog.AbsDialogCenterPopupWindow;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.share.adapters.ShareAppAdapter;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.bean.ShareBean;
import java.util.ArrayList;
import java.util.List;
public class SharePopDialog extends AbsDialogPopupWindow {
public static final int TYPE_LIVE = 1;
public static final int TYPE_DYNAMIC = 0;
private ShareAppAdapter adapter;
private RecyclerView list;
private RoundedImageView avatar;
private TextView info;
private TextView link;
private List<ShareBuilder> data;
private List<ShareBean> data;
private String uid;
private String anchorId;
private String anchorName;
private String anchorAvatar;
private String shareLink;
private int type;
private ShareBean bean;
public SharePopDialog(@NonNull Context context) {
super(context);
}
public SharePopDialog setUid(String uid) {
this.uid = uid;
public SharePopDialog setShareType(int type) {
this.type = type;
return this;
}
public SharePopDialog setAnchorId(String anchorId) {
this.anchorId = anchorId;
public SharePopDialog setShareData(ShareBean build) {
this.bean=build;
return this;
}
public SharePopDialog setAnchorName(String anchorName) {
this.anchorName = anchorName;
return this;
}
public SharePopDialog setAnchorAvatar(String anchorAvatar) {
this.anchorAvatar = anchorAvatar;
return this;
}
public SharePopDialog setShareLink(String link) {
this.shareLink = link + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
return this;
@ -89,7 +79,7 @@ public class SharePopDialog extends AbsDialogPopupWindow {
info = findViewById(R.id.share_info);
link = findViewById(R.id.share_link);
adapter = new ShareAppAdapter(getContext());
adapter.setOnShareStatusListener(new ShareAppAdapter.ShareCallback(){
adapter.setOnShareStatusListener(new ShareAppAdapter.ShareCallback() {
@Override
public void onSuccess() {
super.onSuccess();
@ -103,16 +93,16 @@ public class SharePopDialog extends AbsDialogPopupWindow {
private void initData() {
data = new ArrayList<>();
data.add(builder(ShareBuilder.APP_FACEBOOK));
data.add(builder(ShareBuilder.APP_LINE));
data.add(builder(ShareBuilder.APP_TWITTER));
data.add(builder(ShareBuilder.APP_WHATSAPP));
data.add(builder(ShareBuilder.APP_MESSENGER));
data.add(builder(ShareBuilder.APP_INTERNAL));
data.add(builder(ShareBean.APP_FACEBOOK));
data.add(builder(ShareBean.APP_LINE));
data.add(builder(ShareBean.APP_TWITTER));
data.add(builder(ShareBean.APP_WHATSAPP));
data.add(builder(ShareBean.APP_MESSENGER));
data.add(builder(ShareBean.APP_INTERNAL));
adapter.setList(data);
String url;
if (shareLink == null) {
url = ShareBuilder.createLiveShareLink(uid, anchorId, anchorName, anchorAvatar).substring(0, 40) + "...";
url = ShareBean.createLiveShareLink(bean.getUid(), bean.getAnchorId(), bean.getAnchorName(), bean.getAnchorAvatar()).substring(0, 40) + "...";
} else {
if (shareLink.length() > 40) {
url = shareLink.substring(0, 40) + "...";
@ -122,20 +112,14 @@ public class SharePopDialog extends AbsDialogPopupWindow {
}
url = url + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
link.setText(url);
info.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName));
ImgLoader.display(getContext(), anchorAvatar, avatar);
info.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(bean.getAnchorName()) ? "" : bean.getAnchorName()));
ImgLoader.display(getContext(), bean.getAnchorAvatar(), avatar);
}
private ShareBuilder builder(int type) {
ShareBuilder builder = ShareBuilder.builder(type);
builder.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName));
builder.setUid(uid);
builder.setAnchorId(anchorId);
builder.setAnchorName(anchorName);
builder.setAnchorAvatar(anchorAvatar);
if (shareLink != null) {
builder.setLink(shareLink);
}
private ShareBean builder(int type) {
ShareBean builder = bean.clone();
builder.setType(type);
builder.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(bean.getAnchorName()) ? "" : bean.getAnchorName()));
return builder;
}
@ -144,11 +128,12 @@ public class SharePopDialog extends AbsDialogPopupWindow {
if (shareLink != null) {
url = shareLink;
} else {
url = ShareBuilder.createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
url = ShareBean.createLiveShareLink(bean.getUid(), bean.getAnchorId(), bean.getAnchorName(), bean.getAnchorAvatar());
}
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(CLIPBOARD_SERVICE);
ClipData clipData = ClipData.newPlainText("text", info.getText().toString() + "\n" + url + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0));
cm.setPrimaryClip(clipData);
ToastUtil.show(getContext().getString(com.yunbao.common.R.string.copy_success));
}
}

View File

@ -11,19 +11,16 @@ import androidx.annotation.NonNull;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.enums.PopupAnimation;
import com.pdlive.shayu.R;
import com.yunbao.common.bean.MessageUserInfoBean;
import com.yunbao.common.custom.RatioRoundImageView;
import com.yunbao.common.dialog.AbsDialogPositionPopupWindow;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.share.bean.ShareBuilder;
import com.yunbao.share.bean.ShareBean;
import io.rong.imkit.utils.RouteUtils;
import io.rong.imlib.model.Conversation;
public class ShareSuccessNotifyDialog extends AbsDialogPositionPopupWindow {
private ShareBuilder bean;
private ShareBean bean;
private DialogInterface.OnDismissListener onDismissListener;
private TextView anchorName;
@ -34,7 +31,7 @@ public class ShareSuccessNotifyDialog extends AbsDialogPositionPopupWindow {
super(context);
}
public ShareSuccessNotifyDialog(@NonNull Context context, ShareBuilder bean) {
public ShareSuccessNotifyDialog(@NonNull Context context, ShareBean bean) {
super(context);
this.bean = bean;
}

View File

@ -12,4 +12,5 @@
<string name="dialog_share_internal_list_btn">Share</string>
<string name="dialog_share_success">Success</string>
<string name="dialog_share_success_btn">Chat</string>
<string name="dialog_share_failure_not_select">Please select friends</string>
</resources>

View File

@ -21,4 +21,5 @@
<string name="dialog_share_internal_list_btn">發送</string>
<string name="dialog_share_success">分享成功</string>
<string name="dialog_share_success_btn">去聊聊</string>
<string name="dialog_share_failure_not_select">请选择好友</string>
</resources>

View File

@ -44,7 +44,9 @@ import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.common.manager.imrongcloud.RecommendLiveRoom;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.message.content.MessageChatCardContent;
import com.yunbao.common.message.content.MessageChatTipsContent;
import com.yunbao.common.provider.MessageChatCardItemProvider;
import com.yunbao.common.provider.MessageChatTipsItemProvider;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.Bus;
@ -60,6 +62,7 @@ import com.yunbao.live.socket.SocketRyClient;
import com.yunbao.live.utils.LiveImDeletUtil;
import com.yunbao.live.views.PortraitLiveManager;
import com.yunbao.live.views.RecommendLiveRoomProvider;
import com.yunbao.main.activity.CompleteUserInfoActivity;
import com.yunbao.main.activity.MainActivity;
import com.yunbao.main.activity.MainHomeCommunityActivity;
import com.yunbao.main.activity.MsgSettActivity;
@ -108,17 +111,21 @@ public class AppContext extends CommonAppContext {
MessageSayHiNotifyManager.getInstance().stop();
return;
}
if(activity instanceof MainHomeCommunityActivity){
if (activity instanceof MainHomeCommunityActivity) {
MessageSayHiNotifyManager.getInstance().stop();
return;
}
if(activity instanceof SudGameActivity){
if (activity instanceof SudGameActivity) {
MessageSayHiNotifyManager.getInstance().stop();
return;
}
if (activity instanceof MainActivity && !MessageSayHiNotifyManager.getInstance().isInit()) {
return;
}
if (activity instanceof CompleteUserInfoActivity) {
MessageSayHiNotifyManager.getInstance().stop();
return;
}
MessageSayHiNotifyManager.getInstance().reload();
}
@ -220,12 +227,14 @@ public class AppContext extends CommonAppContext {
myMessages.add(RecommendLiveRoom.class);
myMessages.add(InstructorSendReward.class);
myMessages.add(MessageChatTipsContent.class);
myMessages.add(MessageChatCardContent.class);
RongIMClient.registerMessageType(myMessages);
// 注册自定义消息模板
RongConfigCenter.conversationConfig().addMessageProvider(new InstructorSendRewardProvider(getApplicationContext()));
RongConfigCenter.conversationConfig().addMessageProvider(new RecommendLiveRoomProvider(getApplicationContext()));
RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatTipsItemProvider(getApplicationContext()));
RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatCardItemProvider(getApplicationContext()));
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
@Override
@ -260,6 +269,10 @@ public class AppContext extends CommonAppContext {
} else if (message.getConversationType() == Conversation.ConversationType.PRIVATE) {//私聊信息
EventBus.getDefault().post(message);
if (AppManager.getInstance().getLastActivity() instanceof CompleteUserInfoActivity) {
return false;
}
MessageChatNotifyManager.getInstance().setShieldClass(CompleteUserInfoActivity.class);
MessageChatNotifyManager.getInstance().push(AppManager.getInstance().getLastActivity()
, message.getTargetId(),
content.getContent()
@ -358,9 +371,9 @@ public class AppContext extends CommonAppContext {
activity.get().finish();
}
}
setFirebaseCrashData();
Process.killProcess(Process.myPid());
System.exit(0);
setFirebaseCrashData();
new Handler(Looper.getMainLooper()).postDelayed(() -> {
throw new RuntimeException(e);
}, 100);

View File

@ -0,0 +1,76 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class CareerBean extends BaseModel {
int id;
int pid;
@SerializedName("cn_title")
String titleCn;
@SerializedName("en_title")
String titleEn;
@SerializedName("create_time")
long createTime;
@SerializedName("uplong_time")
long uplongTime;
@SerializedName("children")
List<CareerBean> children;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getPid() {
return pid;
}
public void setPid(int pid) {
this.pid = pid;
}
public String getTitleCn() {
return titleCn;
}
public void setTitleCn(String titleCn) {
this.titleCn = titleCn;
}
public String getTitleEn() {
return titleEn;
}
public void setTitleEn(String titleEn) {
this.titleEn = titleEn;
}
public long getCreateTime() {
return createTime;
}
public void setCreateTime(long createTime) {
this.createTime = createTime;
}
public long getUplongTime() {
return uplongTime;
}
public void setUplongTime(long uplongTime) {
this.uplongTime = uplongTime;
}
public List<CareerBean> getChildren() {
return children;
}
public void setChildren(List<CareerBean> children) {
this.children = children;
}
}

View File

@ -0,0 +1,16 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class FirstLoginBean extends BaseModel{
@SerializedName("status")
int status;//0是第一次登陸1是已經登錄過的
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}

View File

@ -8,7 +8,7 @@ import java.util.List;
public class MessageUserInfoBean extends BaseModel{
IMLoginModel user;
UserInfo info;
UserLevel level;
//UserLevel level;
@SerializedName("gift_num")
int giftNum;
@SerializedName("msg")
@ -60,13 +60,13 @@ public class MessageUserInfoBean extends BaseModel{
this.info = info;
}
public UserLevel getLevel() {
/*public UserLevel getLevel() {
return level;
}
public void setLevel(UserLevel level) {
this.level = level;
}
}*/
public int getGiftNum() {
return giftNum;
@ -107,6 +107,20 @@ public class MessageUserInfoBean extends BaseModel{
private String age;
@SerializedName("open_off")
private int openOff;//接单设置 1开启 2关闭
@SerializedName("rong_online")
private int rongOnline;
public void setOpenOff(int openOff) {
this.openOff = openOff;
}
public int getRongOnline() {
return rongOnline;
}
public void setRongOnline(int rongOnline) {
this.rongOnline = rongOnline;
}
public int getOpenOff() {
return openOff;

View File

@ -11,6 +11,7 @@ import com.yunbao.common.bean.BattlePassPoints;
import com.yunbao.common.bean.BattlePassTask;
import com.yunbao.common.bean.BattlePassUserInfoBean;
import com.yunbao.common.bean.BlindBoxInfoModel;
import com.yunbao.common.bean.CareerBean;
import com.yunbao.common.bean.CheckLiveModel;
import com.yunbao.common.bean.CheckRemainingBalance;
import com.yunbao.common.bean.ContributeModel;
@ -23,6 +24,7 @@ import com.yunbao.common.bean.FaceBookUpModel;
import com.yunbao.common.bean.FansCheckRed;
import com.yunbao.common.bean.FansGroupGiftPack;
import com.yunbao.common.bean.FansGroupGiftPackInfo;
import com.yunbao.common.bean.FirstLoginBean;
import com.yunbao.common.bean.GiftAlreadyWallModel;
import com.yunbao.common.bean.GiftGuideModel;
import com.yunbao.common.bean.GiftNamingInfoModel;
@ -1196,7 +1198,6 @@ public interface PDLiveApi {
@GET("/api/public/?service=Userhome.getUserHomeBanner")
Observable<ResponseModel<List<String>>> getUserHomeBanner(@Query("select_uid") String tuid);
@GET("/api/public/?service=Pdlinfos.getIsAnchor")
Observable<ResponseModel<MessageChatIsAnchor>> getIsAnchor();
@ -1273,4 +1274,27 @@ public interface PDLiveApi {
@GET("/api/public/?service=Pdlcommunity.getDynamicInfo")
Observable<ResponseModel<ActiveBean>> getDynamicInfo(@Query("dynamic_id") String dynamic_id);
@GET("/api/public/?service=Pdlinfos.getCareer")
Observable<ResponseModel<List<CareerBean>>> getCareer();
@GET("/api/public/?service=Pdlinfos.setCareer")
Observable<ResponseModel<List<BaseModel>>> setCareer(
@Query("career") String career,
@Query("en_career") String en
);
@GET("/api/public/?service=Pdlinfos.setHeight")
Observable<ResponseModel<List<BaseModel>>> setUserHeight(
@Query("height") String height
);
@GET("/api/public/?service=Pdllable.get")
Observable<ResponseModel<List<CareerBean>>> getHobby();
@GET("/api/public/?service=Pdlinfos.setLabel")
Observable<ResponseModel<List<BaseModel>>> setHobby(
@Query("labels") String labelsId
);
@GET("/api/public/?service=Pdlinfos.getIsSet")
Observable<ResponseModel<FirstLoginBean>> isFirstLogin(
);
}

View File

@ -16,6 +16,7 @@ import com.yunbao.common.bean.BattlePassPoints;
import com.yunbao.common.bean.BattlePassTask;
import com.yunbao.common.bean.BattlePassUserInfoBean;
import com.yunbao.common.bean.BlindBoxInfoModel;
import com.yunbao.common.bean.CareerBean;
import com.yunbao.common.bean.CheckLiveModel;
import com.yunbao.common.bean.CheckRemainingBalance;
import com.yunbao.common.bean.CoolConfig;
@ -26,6 +27,7 @@ import com.yunbao.common.bean.EnterRoomNewModel;
import com.yunbao.common.bean.FansCheckRed;
import com.yunbao.common.bean.FansGroupGiftPack;
import com.yunbao.common.bean.FansGroupGiftPackInfo;
import com.yunbao.common.bean.FirstLoginBean;
import com.yunbao.common.bean.GiftAlreadyWallModel;
import com.yunbao.common.bean.GiftGuideModel;
import com.yunbao.common.bean.GiftNamingInfoModel;
@ -3406,6 +3408,120 @@ public class LiveNetManager {
}).isDisposed();
}
public void getCareer(HttpCallback<List<CareerBean>> callback) {
API.get().pdLiveApi(mContext)
.getCareer()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(roomMicStatusModelResponseModel -> {
if (callback != null) {
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void setCareer(String career,String careerEn, HttpCallback<HttpCallbackModel> callback) {
API.get().pdLiveApi(mContext)
.setCareer(career,careerEn)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.getData().getMsg()));
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void setUserHeight(String height, HttpCallback<HttpCallbackModel> callback) {
API.get().pdLiveApi(mContext)
.setUserHeight(height)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.getData().getMsg()));
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void getHobby(HttpCallback<List<CareerBean>> callback) {
API.get().pdLiveApi(mContext)
.getHobby()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(roomMicStatusModelResponseModel -> {
if (callback != null) {
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void setHobby(String ids, HttpCallback<HttpCallbackModel> callback) {
API.get().pdLiveApi(mContext)
.setHobby(ids)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.getData().getMsg()));
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void isFirstLogin(HttpCallback<FirstLoginBean> callback) {
API.get().pdLiveApi(mContext)
.isFirstLogin()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(roomMicStatusModelResponseModel -> {
if (callback != null) {
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
private MultipartBody.Part createUploadFile(File file) {
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);

View File

@ -6,6 +6,7 @@ import android.os.Parcelable;
import androidx.annotation.NonNull;
import com.yunbao.common.interfaces.OnSendMessageListener;
import com.yunbao.common.utils.ToastUtil;
import org.json.JSONException;
import org.json.JSONObject;
@ -14,6 +15,7 @@ import java.io.UnsupportedEncodingException;
import io.rong.common.ParcelUtils;
import io.rong.imkit.IMCenter;
import io.rong.imlib.IRongCallback;
import io.rong.imlib.MessageTag;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation;
@ -31,20 +33,29 @@ public class MessageChatCardContent extends MessageContent implements Parcelable
private String extraData;
public static <T> void sendMessage(Conversation.ConversationType type, String targetId, MessageChatCardContent tipsContent, OnSendMessageListener<T> listener) {
IMCenter.getInstance().insertOutgoingMessage(type, targetId, Message.SentStatus.SENT, tipsContent, System.currentTimeMillis(), new RongIMClient.ResultCallback<Message>() {
ToastUtil.show("发送给:"+targetId);
Message message=Message.obtain(targetId, type,tipsContent);
IMCenter.getInstance().sendMessage(message,null,null,new IRongCallback.ISendMessageCallback(){
@Override
public void onAttached(Message message) {
}
@Override
public void onSuccess(Message message) {
ToastUtil.show("发送成功");
if (listener != null) {
listener.onSuccess(null, null);
}
}
@Override
public void onError(RongIMClient.ErrorCode e) {
public void onError(Message message, RongIMClient.ErrorCode e) {
ToastUtil.show("发送失败:"+e.getMessage());
if (listener != null) {
listener.onError(e.code, e.msg);
}
}
});
}

View File

@ -4,9 +4,19 @@ import android.content.Context;
import android.text.Spannable;
import android.view.ViewGroup;
import com.alibaba.fastjson.JSON;
import com.yunbao.common.R;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.message.content.MessageChatCardContent;
import com.yunbao.common.message.content.MessageChatTipsContent;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.MicStatusManager;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.StringUtil;
import org.greenrobot.eventbus.EventBus;
import java.util.List;
@ -21,34 +31,74 @@ public class MessageChatCardItemProvider extends BaseMessageItemProvider<Message
public MessageChatCardItemProvider(Context mContext) {
this.mContext = mContext;
mConfig.showPortrait = false;
mConfig.showSummaryWithName = false;
mConfig.showPortrait = true;
mConfig.showSummaryWithName = true;
mConfig.showContentBubble = false;
mConfig.centerInHorizontal = true;
mConfig.centerInHorizontal = false;
}
@Override
protected ViewHolder onCreateMessageContentViewHolder(ViewGroup parent, int viewType) {
return ViewHolder.createViewHolder(mContext, parent, R.layout.view_message_chat_tip);
return ViewHolder.createViewHolder(mContext, parent, R.layout.view_message_chat_card);
}
@Override
protected void bindMessageContentViewHolder(ViewHolder holder, ViewHolder parentHolder, MessageChatCardContent content, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
holder.setText(R.id.tips, content.getAvatar());
holder.setText(R.id.user_name, content.getUserName());
holder.setText(R.id.titleView, content.getTitle());
ImgLoader.display(mContext, content.getAvatar(), holder.getView(R.id.avatar));
if (!StringUtil.isEmpty()) {
ImgLoader.display(mContext, content.getCover(), holder.getView(R.id.cover));
}
}
@Override
protected boolean onItemClick(ViewHolder holder, MessageChatCardContent messageChatTipsContent, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
protected boolean onItemClick(ViewHolder holder, MessageChatCardContent content, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
if ("1".equals(content.getType())) {
gotoLive(content.getExtraData());
}
return false;
}
@Override
protected boolean isMessageViewType(MessageContent messageContent) {
return messageContent instanceof MessageChatTipsContent;
return messageContent instanceof MessageChatCardContent;
}
@Override
public Spannable getSummarySpannable(Context context, MessageChatCardContent content) {
return null;
}
private void gotoLive(final String live_id) {
LiveHttpUtil.getLiveInfo(live_id + "", new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
if (liveBean == null) {
return;
}
if (MicStatusManager.getInstance().isMic(liveUid)) {
MicStatusManager.getInstance().showDownMicDialog(mContext);
return;
}
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
}
@Override
public void onCheckError(String contextError) {
}
});
} else {
RouteUtil.forwardUserHome(mContext, String.valueOf(live_id), 0);
}
}
});
}
}

View File

@ -13,6 +13,7 @@ import java.util.List;
public class MessageChatNotifyManager {
private static MessageChatNotifyManager instance;
private List<MessageUserInfoBean> startListNotifyList = new ArrayList<>();
Class<?> clazz;
public static MessageChatNotifyManager getInstance() {
if (instance == null) {
@ -21,6 +22,10 @@ public class MessageChatNotifyManager {
return instance;
}
public void setShieldClass(Class<?> clazz) {
this.clazz = clazz;
}
public void push(Context mContext, MessageUserInfoBean userInfo) {
if (startListNotifyList.isEmpty()) {
startListNotifyList.add(userInfo);
@ -31,6 +36,10 @@ public class MessageChatNotifyManager {
}
private void notifyLiveFlot(Context mContext) {
if (AppManager.getInstance().getLastActivity().getClass().getSimpleName().equals(clazz.getSimpleName())) {
ToastUtil.showDebug("屏蔽类,不展示");
return;
}
if (startListNotifyList.iterator().hasNext()) {
MessageUserInfoBean bean = startListNotifyList.iterator().next();
new MessageChatNotifyDialog(AppManager.getInstance().getLastActivity(), bean).setOnDismissListener(dialog -> {

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="192dp"
android:layout_height="299dp"
android:background="@drawable/bg_msg_list_search">
<com.yunbao.common.custom.RatioRoundImageView
android:id="@+id/cover"
android:layout_width="0dp"
android:layout_height="206dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:riv_corner_radius="15dp"
app:ri_ratio="1.2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@mipmap/screen" />
<TextView
android:id="@+id/titleView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="15dp"
android:textColor="#333333"
android:textSize="13sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cover"
tools:text="TextView" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:scaleType="centerCrop"
android:src="@mipmap/chat_head_mo"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleView"
app:riv_oval="true" />
<TextView
android:id="@+id/user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:text="TextView"
android:textColor="#333333"
android:textSize="11sp"
app:layout_constraintBottom_toBottomOf="@+id/avatar"
app:layout_constraintStart_toEndOf="@+id/avatar"
app:layout_constraintTop_toTopOf="@+id/avatar" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="72dp"
android:paddingTop="24dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/titleView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center"
android:textColor="@color/textColor"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/btn_back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:onClick="backClick"
android:padding="9dp"
android:src="@mipmap/icon_back"
android:tint="@color/textColor" />
<ImageView
android:id="@+id/img_more"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:padding="9dp"
android:src="@mipmap/btn_more_black"
android:tint="@color/textColor"
android:visibility="gone" />
<TextView
android:id="@+id/rView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toLeftOf="@+id/redPacketMain"
android:layout_marginRight="10dp"
android:gravity="center"
android:textColor="@color/textColor"
android:textSize="13sp"
android:textStyle="bold"
android:text="@string/not_received"
android:visibility="gone"
tools:visibility="visible" />
<ImageView
android:id="@+id/redPacketMain"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:visibility="invisible"
app:srcCompat="@mipmap/ic_red_packet_record"
tools:visibility="visible" />
</RelativeLayout>
</FrameLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -26,6 +26,7 @@
<string name="black">Pull black</string>
<string name="black_ing">Relieving blackout</string>
<string name="chat_remarks">Remarks</string>
<string name="chat_report">Report</string>
<string name="bonus_sign">Sign in immediately</string>
<string name="bonus_sign_1">Continuously signed in</string>
<string name="bonus_day">day</string>

View File

@ -16,7 +16,8 @@
<string name="refresh_footer_nothing">沒有更多數據了</string>
<string name="black">拉黑</string>
<string name="black_ing">解除拉黑</string>
<string name="chat_remarks">備註</string>
<string name="chat_remarks">修改備註</string>
<string name="chat_report">舉報</string>
<string name="bonus_sign">立即簽到</string>
<string name="bonus_sign_1">已連續簽到</string>
<string name="bonus_day"></string>

View File

@ -16,7 +16,8 @@
<string name="refresh_footer_nothing">沒有更多數據了</string>
<string name="black">拉黑</string>
<string name="black_ing">解除拉黑</string>
<string name="chat_remarks">備註</string>
<string name="chat_remarks">修改備註</string>
<string name="chat_report">舉報</string>
<string name="bonus_sign">立即簽到</string>
<string name="bonus_sign_1">已連續簽到</string>
<string name="bonus_day"></string>

View File

@ -16,7 +16,8 @@
<string name="refresh_footer_nothing">沒有更多數據了</string>
<string name="black">拉黑</string>
<string name="black_ing">解除拉黑</string>
<string name="chat_remarks">備註</string>
<string name="chat_remarks">修改備註</string>
<string name="chat_report">舉報</string>
<string name="bonus_sign">立即簽到</string>
<string name="bonus_sign_1">已連續簽到</string>
<string name="bonus_day"></string>

View File

@ -26,6 +26,7 @@
<string name="black">Pull black</string>
<string name="black_ing">Relieving blackout</string>
<string name="chat_remarks">Remarks</string>
<string name="chat_report">Report</string>
<string name="bonus_sign">Sign in immediately</string>
<string name="bonus_sign_1">Continuously signed in</string>
<string name="bonus_day">day</string>

View File

@ -98,6 +98,13 @@
<item name="android:paddingRight">15dp</item>
<item name="android:background">@color/white</item>
</style>
<style name="edit_profile_group_not_color" parent="AppTheme">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">45dp</item>
<item name="android:paddingLeft">15dp</item>
<item name="android:paddingRight">15dp</item>
</style>
<style name="Theme.PayssionTrans" parent="Theme.AppCompat.Light">
<item name="android:windowIsTranslucent">true</item>

View File

@ -123,6 +123,7 @@ import com.yunbao.live.http.ImHttpUtil;
import com.yunbao.live.views.LiveRoomPlayViewHolder;
import com.yunbao.live.views.LiveRoomViewHolder;
import com.yunbao.live.views.PortraitLiveManager;
import com.yunbao.share.bean.ShareBean;
import com.yunbao.share.ui.SharePopDialog;
import org.greenrobot.eventbus.EventBus;
@ -865,7 +866,7 @@ public class LiveAudienceActivity extends LiveActivity {
if (!TextUtils.isEmpty(event.getMethod())) {
if (TextUtils.equals(event.getMethod(), "closeLiveRoom")) {
onBackPressed();
}else if (TextUtils.equals(event.getMethod(), "androidtoCommunityVideo")) {
} else if (TextUtils.equals(event.getMethod(), "androidtoCommunityVideo")) {
RouteUtil.forwardCommunityActivity();
}
}
@ -1460,10 +1461,17 @@ public class LiveAudienceActivity extends LiveActivity {
break;
case LIVE_SHARE:
new SharePopDialog(mContext)
.setUid(CommonAppConfig.getInstance().getUid())
.setAnchorId(event.getBean().getUid())
.setAnchorName(event.getBean().getUserNiceName())
.setAnchorAvatar(event.getBean().getAvatar())
.setShareType(SharePopDialog.TYPE_LIVE)
.setShareData(ShareBean.ShareBuilder.create()
.setShareType(SharePopDialog.TYPE_LIVE)
.setUid(CommonAppConfig.getInstance().getUid())
.setCover(StringUtil.isEmpty(event.getBean().getImg()) ? event.getBean().getAvatar() : event.getBean().getImg())
.setTitle(StringUtil.isEmpty(event.getBean().getTitle()) ? event.getBean().getUserNiceName() : event.getBean().getTitle())
.setAnchorId(event.getBean().getUid())
.setAnchorName(event.getBean().getUserNiceName())
.setAnchorAvatar(event.getBean().getAvatar())
.build()
)
.showDialog();
break;
case WISH_LIST_PROGRESS:

View File

@ -13,6 +13,8 @@ import android.widget.PopupWindow;
import android.widget.TextView;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.EditNameRemarksActivity;
@ -26,15 +28,15 @@ import io.rong.imlib.RongIMClient;
public class MenuPopuwWindow implements View.OnClickListener {
private Activity mContext;
private String userId;
private View popupView;
private TextView tvBlack, tvBlackMove;
private View popupView, ltBlack, ltReport;
private TextView tvBlack;
private LinearLayout ltRemarks;
private PopupWindow popupWindow;
private Handler netHandler = new Handler();
public MenuPopuwWindow(Activity context) {
this.mContext = context;
popupView = LayoutInflater.from(mContext).inflate(R.layout.popwindow_chat_more, null);
popupView = LayoutInflater.from(mContext).inflate(R.layout.popwindow_chat_more_v2, null);
initView();
}
@ -43,19 +45,18 @@ public class MenuPopuwWindow implements View.OnClickListener {
if (TextUtils.equals(isAdmin, "1")) {
tvBlack.setVisibility(View.GONE);
tvBlackMove.setVisibility(View.GONE);
ltRemarks.setVisibility(View.VISIBLE);
} else {
ltRemarks.setVisibility(View.GONE);
ltRemarks.setVisibility(View.VISIBLE);
RongIMClient.getInstance().getBlacklistStatus(userId, new RongIMClient.ResultCallback<RongIMClient.BlacklistStatus>() {
@Override
public void onSuccess(RongIMClient.BlacklistStatus blacklistStatus) {
if (blacklistStatus == RongIMClient.BlacklistStatus.IN_BLACK_LIST) {
tvBlackMove.setVisibility(View.VISIBLE);
tvBlack.setVisibility(View.GONE);
tvBlack.setTag("1");
tvBlack.setText(R.string.black_ing);
} else {
tvBlack.setVisibility(View.VISIBLE);
tvBlackMove.setVisibility(View.GONE);
tvBlack.setTag(null);
tvBlack.setText(R.string.black);
}
}
@ -73,10 +74,11 @@ public class MenuPopuwWindow implements View.OnClickListener {
*/
private void initView() {
tvBlack = popupView.findViewById(R.id.tv_black);
tvBlackMove = popupView.findViewById(R.id.tv_black_move);
ltBlack = popupView.findViewById(R.id.lt_black);
ltReport = popupView.findViewById(R.id.lt_report);
ltRemarks = popupView.findViewById(R.id.lt_remarks);
tvBlack.setOnClickListener(this);
tvBlackMove.setOnClickListener(this);
ltBlack.setOnClickListener(this);
ltReport.setOnClickListener(this);
ltRemarks.setOnClickListener(this);
}
@ -87,7 +89,7 @@ public class MenuPopuwWindow implements View.OnClickListener {
* @return
*/
public void show(View view) {
popupWindow = new PopupWindow(popupView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
popupWindow = new PopupWindow(popupView, DpUtil.dp2px(97), ViewGroup.LayoutParams.WRAP_CONTENT, true);
popupWindow.showAsDropDown(view);
WindowManager.LayoutParams lp = mContext.getWindow().getAttributes();
lp.alpha = 0.8f;
@ -105,40 +107,14 @@ public class MenuPopuwWindow implements View.OnClickListener {
public void onClick(View v) {
int id = v.getId();
//拉黑
if (id == R.id.tv_black) {
RongIMClient.getInstance().addToBlacklist(userId, new RongIMClient.OperationCallback() {
@Override
public void onSuccess() {
ToastUtil.show(mContext.getResources().getString(R.string.black_succer));
popupWindow.dismiss();
tvBlack.setVisibility(View.VISIBLE);
tvBlackMove.setVisibility(View.GONE);
netHandler.post(setBlackRunnable);
}
@Override
public void onError(RongIMClient.ErrorCode errorCode) {
ToastUtil.show(errorCode.msg);
popupWindow.dismiss();
}
});
} else if (id == R.id.tv_black_move) {//移出黑名单
RongIMClient.getInstance().removeFromBlacklist(userId, new RongIMClient.OperationCallback() {
@Override
public void onSuccess() {
ToastUtil.show(mContext.getResources().getString(R.string.black_succer_more));
popupWindow.dismiss();
tvBlackMove.setVisibility(View.VISIBLE);
tvBlack.setVisibility(View.GONE);
netHandler.post(setBlackRunnable);
}
@Override
public void onError(RongIMClient.ErrorCode errorCode) {
ToastUtil.show(errorCode.msg);
popupWindow.dismiss();
}
});
if (id == R.id.lt_black) {
if (tvBlack.getTag() == null) {
black();
} else {
unblack();
}
} else if (id == R.id.lt_report) {//移出黑名单
RouteUtil.forwardLiveReportActivity(userId);
} else if (id == R.id.lt_remarks) {//添加备注
Intent intent = new Intent(mContext, EditNameRemarksActivity.class);
intent.putExtra(EditNameRemarksActivity.NAMEREMARK, userId);
@ -147,6 +123,40 @@ public class MenuPopuwWindow implements View.OnClickListener {
}
}
private void black() {
RongIMClient.getInstance().addToBlacklist(userId, new RongIMClient.OperationCallback() {
@Override
public void onSuccess() {
ToastUtil.show(mContext.getResources().getString(R.string.black_succer));
popupWindow.dismiss();
netHandler.post(setBlackRunnable);
}
@Override
public void onError(RongIMClient.ErrorCode errorCode) {
ToastUtil.show(errorCode.msg);
popupWindow.dismiss();
}
});
}
private void unblack() {
RongIMClient.getInstance().removeFromBlacklist(userId, new RongIMClient.OperationCallback() {
@Override
public void onSuccess() {
ToastUtil.show(mContext.getResources().getString(R.string.black_succer_more));
popupWindow.dismiss();
netHandler.post(setBlackRunnable);
}
@Override
public void onError(RongIMClient.ErrorCode errorCode) {
ToastUtil.show(errorCode.msg);
popupWindow.dismiss();
}
});
}
//将对方拉黑或者解除拉黑(自己后台
private Runnable setBlackRunnable = new Runnable() {
@Override

View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="97dp"
android:layout_height="wrap_content"
android:background="@drawable/background_d5_white"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:id="@+id/lt_remarks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:gravity="start|center"
android:orientation="horizontal">
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginEnd="7dp"
android:src="@mipmap/ic_chat_remarks" />
<TextView
android:id="@+id/tv_remarks"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:gravity="center"
android:text="@string/chat_remarks"
android:textColor="@color/black1"
android:textSize="13sp"
android:textStyle="bold"
android:visibility="visible" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:background="@color/gray_dcdcdc" />
<LinearLayout
android:id="@+id/lt_report"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:gravity="start|center"
android:orientation="horizontal">
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginEnd="7dp"
android:src="@mipmap/ic_chat_report" />
<TextView
android:id="@+id/tv_report"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:gravity="center"
android:text="@string/chat_report"
android:textColor="@color/black1"
android:textSize="13sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:background="@color/gray_dcdcdc" />
<LinearLayout
android:id="@+id/lt_black"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:gravity="start|center"
android:orientation="horizontal">
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginEnd="7dp"
android:src="@mipmap/ic_chat_black" />
<TextView
android:id="@+id/tv_black"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:gravity="center"
android:text="@string/black"
android:textColor="@color/black1"
android:textSize="13sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>

View File

@ -170,6 +170,7 @@
android:screenOrientation="portrait" />
<activity android:name=".activity.CompleteUserInfoActivity"
android:screenOrientation="portrait" />
<activity android:name=".activity.EditUserHobbyActivity" android:screenOrientation="portrait" />
</application>
</manifest>

View File

@ -1,29 +1,39 @@
package com.yunbao.main.activity;
import android.app.Dialog;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.bigkoo.pickerview.builder.TimePickerBuilder;
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
import com.bigkoo.pickerview.view.TimePickerView;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.ImageResultCallback;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.NoviceInstructorManager;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.ProcessImageUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.ViewUtils;
@ -63,6 +73,20 @@ public class CompleteUserInfoActivity extends AbsActivity {
initView();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_ESCAPE || keyCode == KeyEvent.KEYCODE_BACK) {
//onBackPressed();
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
public void onBackPressed() {
// super.onBackPressed();
}
int year;
int month;
int day;
@ -76,6 +100,9 @@ public class CompleteUserInfoActivity extends AbsActivity {
birthday = findViewById(R.id.birthday);
submit = findViewById(R.id.submit);
userName.setHint(R.string.complete_user_info_username_hint);
userName.setText(IMLoginManager.get(this).getUserInfo().getUserNicename());
initSexView();
initBirthdayView();
initAvatarView();
@ -102,8 +129,15 @@ public class CompleteUserInfoActivity extends AbsActivity {
new HttpCallback<List<BaseModel>>() {
@Override
public void onSuccess(List<BaseModel> data) {
ToastUtil.show("註冊成功");
finish();
String anchorId = getIntent().getStringExtra("anchor_id");
if (StringUtil.isEmpty(anchorId)) {
Intent intent = new Intent(CompleteUserInfoActivity.this, MainActivity.class);
intent.putExtra(Constants.SHOW_INVITE, false);
startActivity(intent);
finish();
} else {
gotoLive(anchorId);
}
}
@Override
@ -192,6 +226,7 @@ public class CompleteUserInfoActivity extends AbsActivity {
@Override
public void onItemClick(String bean, int position) {
avatar.setTag(bean);
ImgLoader.display(mContext,bean,avatar);
loading.dismiss();
}
});
@ -200,8 +235,9 @@ public class CompleteUserInfoActivity extends AbsActivity {
}
void initSexView() {
ViewUtils.findViewById(man, R.id.sex_bg).setBackgroundResource(R.drawable.dialog_bg_chat_status_config_select);
ViewUtils.findViewById(man, R.id.sex_bg).setBackgroundResource(R.drawable.complete_user_info_sex_man);
ViewUtils.findViewById(man, R.id.sex_icon, ImageView.class).setImageTintList(ColorStateList.valueOf(Color.parseColor("#00A3FF")));
ViewUtils.findViewById(man, R.id.sex_top_icon, ImageView.class).setImageTintList(ColorStateList.valueOf(Color.parseColor("#00A3FF")));
ViewUtils.findViewById(woman, R.id.sex_bg).setBackgroundResource(R.drawable.dialog_bg_chat_status_config_unselect);
@ -213,7 +249,7 @@ public class CompleteUserInfoActivity extends AbsActivity {
man.setTag("man");
woman.setTag(null);
man.setOnClickListener(view -> {
ViewUtils.findViewById(man, R.id.sex_bg).setBackgroundResource(R.drawable.dialog_bg_chat_status_config_select);
ViewUtils.findViewById(man, R.id.sex_bg).setBackgroundResource(R.drawable.complete_user_info_sex_man);
ViewUtils.findViewById(woman, R.id.sex_bg).setBackgroundResource(R.drawable.dialog_bg_chat_status_config_unselect);
ViewUtils.findViewById(man, R.id.sex_icon, ImageView.class).setImageTintList(ColorStateList.valueOf(Color.parseColor("#00A3FF")));
ViewUtils.findViewById(man, R.id.sex_top_icon, ImageView.class).setImageTintList(ColorStateList.valueOf(Color.parseColor("#00A3FF")));
@ -225,7 +261,7 @@ public class CompleteUserInfoActivity extends AbsActivity {
woman.setTag(null);
});
woman.setOnClickListener(view -> {
ViewUtils.findViewById(woman, R.id.sex_bg).setBackgroundResource(R.drawable.dialog_bg_chat_status_config_select);
ViewUtils.findViewById(woman, R.id.sex_bg).setBackgroundResource(R.drawable.complete_user_info_sex_woman);
ViewUtils.findViewById(man, R.id.sex_bg).setBackgroundResource(R.drawable.dialog_bg_chat_status_config_unselect);
ViewUtils.findViewById(woman, R.id.sex_icon, ImageView.class).setImageTintList(ColorStateList.valueOf(Color.parseColor("#FF4874")));
ViewUtils.findViewById(woman, R.id.sex_top_icon, ImageView.class).setImageTintList(ColorStateList.valueOf(Color.parseColor("#FF4874")));
@ -237,4 +273,34 @@ public class CompleteUserInfoActivity extends AbsActivity {
woman.setTag("man");
});
}
private void gotoLive(final String live_id) {
LiveHttpUtil.getLiveInfo(live_id, new com.yunbao.common.http.HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
if (liveBean == null) {
return;
}
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
NoviceInstructorManager.get(mContext).setFrist(false);
}
@Override
public void onCheckError(String contextError) {
}
});
} else {
MainActivity.forward(CompleteUserInfoActivity.this, false);
}
}
});
}
}

View File

@ -13,6 +13,10 @@ import android.widget.TextView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
import com.bigkoo.pickerview.configure.PickerOptions;
import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
import com.bigkoo.pickerview.view.OptionsPickerView;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.BasePopupView;
import com.lxj.xpopup.interfaces.XPopupCallback;
@ -27,6 +31,9 @@ import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.bean.CareerBean;
import com.yunbao.common.bean.HttpCallbackModel;
import com.yunbao.common.bean.MessageUserInfoBean;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.event.UpdateFieldEvent;
import com.yunbao.common.glide.ImgLoader;
@ -59,6 +66,8 @@ import org.greenrobot.eventbus.ThreadMode;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import cn.qqtheme.framework.entity.City;
import cn.qqtheme.framework.entity.County;
@ -90,6 +99,7 @@ public class EditProfileActivity extends AbsActivity {
private View viewProgress1, viewProgress2, viewProgress3;
private FrameLayout completeInformation, completeInformation1, completeInformation2, completeInformation3;
private TextView information, information1, information2, information3, submit;
private MessageUserInfoBean userInfoBean;
@Override
protected int getLayoutId() {
@ -130,10 +140,10 @@ public class EditProfileActivity extends AbsActivity {
public void onSuccess(File file) {
if (file != null) {
System.err.println("头像---->收到头像文件 file = "+file.getAbsolutePath()+" | length = "+file.length());
if (file.getName().contains(".gif")){
ToastUtil.show(WordUtil.isNewZh()?"暫不支持該文件":"This file is not supported");
}else {
System.err.println("头像---->收到头像文件 file = " + file.getAbsolutePath() + " | length = " + file.length());
if (file.getName().contains(".gif")) {
ToastUtil.show(WordUtil.isNewZh() ? "暫不支持該文件" : "This file is not supported");
} else {
ImgLoader.display(mContext, file, mAvatar);
MainHttpUtil.updateAvatar(file, new HttpCallback() {
@Override
@ -185,12 +195,14 @@ public class EditProfileActivity extends AbsActivity {
mUserBean = CommonAppConfig.getInstance().getUserBean();
if (mUserBean != null) {
showData(mUserBean);
initUserInfoData();
} else {
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
@Override
public void callback(UserBean u) {
mUserBean = u;
showData(u);
initUserInfoData();
}
});
}
@ -399,9 +411,102 @@ public class EditProfileActivity extends AbsActivity {
.putExtra("token", CommonAppConfig.getInstance().getToken())
.putExtra("isBind", isBind)
.putExtra("mobile", mobile));
} else if (i == R.id.btn_occupation) {
showOccupationDialog();
} else if (i == R.id.btn_height) {
showUserHeightDialog();
} else if (i == R.id.btn_hobby) {
startActivity(new Intent(this, EditUserHobbyActivity.class));
}
}
List<CareerBean> careerBeans;
private void showOccupationDialog() {
LiveNetManager.get(mContext)
.getCareer(new com.yunbao.common.http.base.HttpCallback<List<CareerBean>>() {
@Override
public void onSuccess(List<CareerBean> data) {
careerBeans = new ArrayList<>(data);
List<String> items1 = new ArrayList<>();
List<List<String>> items2 = new ArrayList<>();
for (CareerBean bean : data) {
items1.add(WordUtil.isNewZh() ? bean.getTitleCn() : bean.getTitleEn());
List<String> tmp = new ArrayList<>();
for (CareerBean child : bean.getChildren()) {
tmp.add(WordUtil.isNewZh() ? child.getTitleCn() : child.getTitleEn());
}
items2.add(tmp);
}
OptionsPickerView<String> pickerView = new OptionsPickerBuilder(mContext, new OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int i, int i1, int i2, View view) {
CareerBean val = careerBeans.get(i).getChildren().get(i1);
setOccupation(val.getTitleCn(), val.getTitleEn());
}
private void setOccupation(String cn, String en) {
LiveNetManager.get(mContext)
.setCareer(cn, en, new com.yunbao.common.http.base.HttpCallback<HttpCallbackModel>() {
@Override
public void onSuccess(HttpCallbackModel data) {
ToastUtil.show(data.getMsg());
((TextView) findViewById(R.id.occupation)).setText(WordUtil.isNewZh() ? cn : en);
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
}
}).build();
pickerView.setPicker(items1, items2);
pickerView.show();
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
}
private void showUserHeightDialog() {
List<String> height = new ArrayList<>();
for (int i = 50; i <= 250; i++) {
height.add(i + "cm");
}
OptionsPickerView<String> pickerView = new OptionsPickerBuilder(mContext, new OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int i, int i1, int i2, View view) {
String height = (i + 50) + "";
setUserHeight(height);
}
private void setUserHeight(String height) {
LiveNetManager.get(mContext)
.setUserHeight(height, new com.yunbao.common.http.base.HttpCallback<HttpCallbackModel>() {
@Override
public void onSuccess(HttpCallbackModel data) {
ToastUtil.show(data.getMsg());
((TextView) findViewById(R.id.height)).setText(height + "cm");
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
}
}).setSelectOptions(120)
.build();
pickerView.setPicker(height);
pickerView.show();
}
private void showTaskDialog() {
final Dialog dialog = new Dialog(EditProfileActivity.this, com.yunbao.live.R.style.dialog);
dialog.setContentView(R.layout.dialog_task);
@ -418,7 +523,7 @@ public class EditProfileActivity extends AbsActivity {
@Override
public void onClick(View v) {
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1";
WebViewActivity.forward(mContext, url,false);
WebViewActivity.forward(mContext, url, false);
dialog.dismiss();
}
});
@ -453,7 +558,7 @@ public class EditProfileActivity extends AbsActivity {
}
Constants.myIntoIndex = 2;
Intent intent = new Intent(mContext, MyWebViewActivity2.class);
intent.putExtra(Constants.URL, CommonAppConfig.HOST + "/h5/table/Modify-information.html" + "?token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0));
intent.putExtra(Constants.URL, CommonAppConfig.HOST + "/h5/table/Modify-information.html" + "?token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0));
startActivity(intent);
}
@ -767,12 +872,37 @@ public class EditProfileActivity extends AbsActivity {
});
}
private void initUserInfoData() {
LiveNetManager.get(mContext)
.getOtherInfo(userModel.getId() + "", new com.yunbao.common.http.base.HttpCallback<MessageUserInfoBean>() {
@Override
public void onSuccess(MessageUserInfoBean data) {
userInfoBean = data;
((TextView) findViewById(R.id.occupation)).setText(data.getInfo().getCareer());
((TextView) findViewById(R.id.height)).setText(data.getInfo().getHeight() + "cm");
List<String> tags = WordUtil.isNewZh() ? data.getInfo().getCn_label() : data.getInfo().getEn_label();
if (tags == null || tags.isEmpty()) return;
StringBuilder sb = new StringBuilder();
for (String tag : tags) {
sb.append(tag).append(",");
}
((TextView) findViewById(R.id.hobby)).setText(sb.substring(0, sb.length() - 1));
}
@Override
public void onError(String error) {
}
});
}
@Override
protected void onResume() {
super.onResume();
if (Constants.isShowPage != -1) {
finish();
}
initUserInfoData();
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
@Override
public void callback(UserBean u) {

View File

@ -0,0 +1,126 @@
package com.yunbao.main.activity;
import android.widget.Button;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSONArray;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.CareerBean;
import com.yunbao.common.bean.HttpCallbackModel;
import com.yunbao.common.bean.MessageUserInfoBean;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.main.R;
import com.yunbao.main.adapter.EditUserHobbyAdapter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class EditUserHobbyActivity extends AbsActivity {
TextView mNumber;
RecyclerView recyclerView;
EditUserHobbyAdapter adapter;
Button mSave, mCancel;
@Override
protected int getLayoutId() {
return R.layout.activity_edit_user_hobby;
}
@Override
protected void main() {
super.main();
mNumber = findViewById(R.id.number);
recyclerView = findViewById(R.id.recyclerView);
mSave = findViewById(R.id.btn_save);
mCancel = findViewById(R.id.btn_cancel);
adapter = new EditUserHobbyAdapter();
recyclerView.setAdapter(adapter);
adapter.setOnItemClickListener(new OnItemClickListener<List<String>>() {
@Override
public void onItemClick(List<String> bean, int position) {
mNumber.setText(String.format("(%s/%s)", position, "5"));
System.out.println(JSONArray.toJSONString(bean));
}
});
initData();
mCancel.setOnClickListener(view -> {
finish();
});
mSave.setOnClickListener(view -> {
List<String> strings = adapter.getmSelectedList();
uploadSelectData(strings);
});
}
private void uploadSelectData(List<String> strings) {
StringBuilder sb = new StringBuilder();
String hobby = "";
for (String tag : strings) {
if (!StringUtil.isEmpty(tag)) {
sb.append(tag).append(",");
}
}
if (sb.length() != 0) {
hobby = sb.substring(0, sb.length() - 1);
}
LiveNetManager.get(mContext)
.setHobby(hobby, new HttpCallback<HttpCallbackModel>() {
@Override
public void onSuccess(HttpCallbackModel data) {
ToastUtil.show(data.getMsg());
finish();
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
}
private void initData() {
LiveNetManager.get(mContext)
.getHobby(new HttpCallback<List<CareerBean>>() {
@Override
public void onSuccess(List<CareerBean> data) {
adapter.setHobbyData(data);
adapter.notifyDataSetChanged();
}
@Override
public void onError(String error) {
}
});
LiveNetManager.get(mContext)
.getOtherInfo(CommonAppConfig.getInstance().getUid(), new HttpCallback<MessageUserInfoBean>() {
@Override
public void onSuccess(MessageUserInfoBean data) {
String labelIds = data.getInfo().getLabel_id();
if (StringUtil.isEmpty(labelIds)) {
adapter.setSelectData(new ArrayList<>());
return;
}
List<String> list = new ArrayList<>(Arrays.asList(labelIds.split(",")));
mNumber.setText(String.format("(%s/%s)", list.size(), "5"));
adapter.setSelectData(list);
adapter.notifyDataSetChanged();
}
@Override
public void onError(String error) {
}
});
}
}

View File

@ -59,6 +59,7 @@ import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.AnchorStartLiveBean;
import com.yunbao.common.bean.ChatRemarksBean;
import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.bean.FirstLoginBean;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.LiveSvgGiftBean;
@ -82,6 +83,7 @@ import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpConsts;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.http.main.MainNetManager;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.APKManager;
@ -536,6 +538,23 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
ConversationIMListManager.get(this).getUserInstructor(this);
checkVersion();
MessageSayHiNotifyManager.getInstance().start();
showFirstLogin();
}
private void showFirstLogin(){
LiveNetManager.get(mContext)
.isFirstLogin(new com.yunbao.common.http.base.HttpCallback<FirstLoginBean>() {
@Override
public void onSuccess(FirstLoginBean data) {
if(data.getStatus()==0){
mContext.startActivity(new Intent(mContext, CompleteUserInfoActivity.class));
}
}
@Override
public void onError(String error) {
}
});
}
/**

View File

@ -61,6 +61,7 @@ import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.views.LiveRoomViewHolder;
import com.yunbao.main.dialog.EncourageDialog;
import com.yunbao.main.http.MainHttpUtil;
import com.yunbao.share.bean.ShareBean;
import com.yunbao.share.ui.SharePopDialog;
import com.yunbao.video.activity.VideoPlayActivity;
import com.yunbao.video.utils.VideoStorge;
@ -592,8 +593,13 @@ public class MyWebViewActivity extends AbsActivity {
} else if (TextUtils.equals(event.getMethod(), "androidCommunityShare")) {
JSONObject json = JSONObject.parseObject(event.getData());
new SharePopDialog(mContext)
.setShareType(SharePopDialog.TYPE_DYNAMIC)
.setShareData(ShareBean.ShareBuilder
.create()
.setAnchorAvatar(json.getString("avatar"))
.build()
)
.setShareLink(CommonAppConfig.HOST + json.getString("link"))
.setAnchorAvatar(json.getString("avatar"))
.showDialog();
} else if (TextUtils.equals(event.getMethod(), "androidCancelAnchorAttention")) {
if (!StringUtil.isEmpty(LiveAudienceActivity.is_fans)) {

View File

@ -1,21 +1,16 @@
package com.yunbao.main.activity;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
@ -27,12 +22,13 @@ import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.activity.SelectImageActivity;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.ImageEntity;
import com.yunbao.common.bean.MessageChatUserBean;
import com.yunbao.common.bean.MessageUserInfoBean;
import com.yunbao.common.bean.NoviceInstructorModel;
import com.yunbao.common.bean.SetAttentsModel;
@ -40,11 +36,9 @@ import com.yunbao.common.event.PDChatInputModeEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnSendMessageListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.NoviceInstructorManager;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.common.message.content.MessageChatTipsContent;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
@ -59,13 +53,14 @@ import com.yunbao.live.views.PDLiveConversationFragment;
import com.yunbao.main.R;
import com.yunbao.main.adapter.MessageChatTopImageListAdapter;
import com.yunbao.main.adapter.MessageChatTopTopListAdapter;
import com.yunbao.main.fragment.MyAddressBookFragment;
import com.yunbao.main.http.MainHttpUtil;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import io.rong.imkit.IMCenter;
@ -113,6 +108,12 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
MessageIMManager.get(this).addConversationClickListener();
}
@Override
protected void onResume() {
super.onResume();
setUserCard();
}
private void hideUserCard() {
if (card.getTag() != null) return;
card.setTag("fold");
@ -185,7 +186,6 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
//绑定聊天用户id
inputPanel.setTargetId(targetId);
ToastUtil.show("id:" + targetId);
//获取用户信息
UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(targetId);
setUserCard();
@ -262,29 +262,37 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
@Override
public void onSuccess(MessageUserInfoBean data) {
userInfoBean = data;
titleView.setText(data.getUser().getUserNicename() + "_");
titleView.setText(data.getUser().getUserNicename());
ImgLoader.display(mContext, data.getUser().getAvatar(), ViewUtils.findViewById(card, R.id.rc_conversation_portrait, ImageView.class));
ViewUtils.findViewById(card, R.id.userName, TextView.class).setText(data.getUser().getUserNicename());
ViewUtils.findViewById(card, R.id.sign, TextView.class).setText(data.getUser().getSignature());
if (data.getInfo().getRongOnline() == 1) {
ViewUtils.findViewById(card, R.id.user_status, TextView.class).setText(R.string.activity_msg_chat_top_status_online);
ViewUtils.findViewById(card, R.id.userStatusIcon, ImageView.class).setImageResource(R.mipmap.icon_green);
} else {
ViewUtils.findViewById(card, R.id.user_status, TextView.class).setText(R.string.activity_msg_chat_top_status_offline);
ViewUtils.findViewById(card, R.id.userStatusIcon, ImageView.class).setImageResource(R.mipmap.icon_green);
}
showBanner();
showTag();
if(data.getUser().getAttention()==0){
ViewUtils.findViewById(card,R.id.follow, Button.class).setOnClickListener(new View.OnClickListener() {
if (data.getUser().getAttention() == 0) {
ViewUtils.findViewById(card, R.id.follow, Button.class).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
follow((Button) view,userInfoBean.getUser().getId()+"");
follow((Button) view, userInfoBean.getUser().getId() + "");
}
});
}else{
ViewUtils.findViewById(card,R.id.follow, Button.class).setVisibility(View.INVISIBLE);
} else {
ViewUtils.findViewById(card, R.id.follow, Button.class).setVisibility(View.INVISIBLE);
}
getRemarkName();
}
@Override
public void onError(String error) {
}
private void showBanner() {
LiveNetManager.get(mContext)
.getUserHomeBanner(targetId, new HttpCallback<List<String>>() {
@ -305,30 +313,31 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
}
});
}
private void showTag(){
List<String> tags=new ArrayList<>();
private void showTag() {
List<String> tags = new ArrayList<>();
tags.add(userInfoBean.getInfo().getAge());
if(!StringUtil.isEmpty(userInfoBean.getInfo().getCareer())){
if (!StringUtil.isEmpty(userInfoBean.getInfo().getCareer())) {
tags.add(userInfoBean.getInfo().getCareer());
}
if(!StringUtil.isEmpty(userInfoBean.getInfo().getHeight())&&!userInfoBean.getInfo().getHeight().equals("0")) {
if (!StringUtil.isEmpty(userInfoBean.getInfo().getHeight()) && !userInfoBean.getInfo().getHeight().equals("0")) {
tags.add(userInfoBean.getInfo().getHeight());
}
List<String> t;
if(WordUtil.isNewZh()) {
t=userInfoBean.getInfo().getCn_label();
}else{
t=userInfoBean.getInfo().getEn_label();
if (WordUtil.isNewZh()) {
t = userInfoBean.getInfo().getCn_label();
} else {
t = userInfoBean.getInfo().getEn_label();
}
if(t!=null){
if (t != null) {
for (String tag : t) {
if(!StringUtil.isEmpty(tag)){
if (!StringUtil.isEmpty(tag)) {
tags.add(tag);
}
}
}
MessageChatTopTopListAdapter adapter=new MessageChatTopTopListAdapter();
MessageChatTopTopListAdapter adapter = new MessageChatTopTopListAdapter();
RecyclerView avatarList = ViewUtils.findViewById(card, R.id.tag_list, RecyclerView.class);
avatarList.setAdapter(adapter);
adapter.setUrls(tags);
@ -337,6 +346,23 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
}
private void getRemarkName() {
MainHttpUtil.getInstructorRemark(new com.yunbao.common.http.HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
JSONArray array = JSONArray.parseArray(Arrays.toString(info));
for (int i = 0; i < array.size(); i++) {
JSONObject json = array.getJSONObject(0);
if (json.containsKey(targetId)) {
titleView.setText(json.getString(targetId));
ViewUtils.findViewById(card, R.id.userName, TextView.class).setText(json.getString(targetId));
return;
}
}
}
});
}
@Override
public void onClick(View v) {
int id = v.getId();
@ -418,12 +444,13 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
}
}
}
private void follow(Button btn, String id) {
LiveNetManager.get(btn.getContext())
.setAttents(id, new HttpCallback<SetAttentsModel>() {
@Override
public void onSuccess(SetAttentsModel data) {
btn.setVisibility(View.INVISIBLE);
btn.setVisibility(View.INVISIBLE);
}
@Override
@ -432,6 +459,7 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
}
});
}
@Override
protected void onDestroy() {
super.onDestroy();
@ -448,7 +476,7 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMessageIMEvent(String event) {
if (!TextUtils.isEmpty(event)) {
titleView.setText(event);
//titleView.setText(event);
}
}

View File

@ -404,7 +404,7 @@ public class RegisterActivity extends AbsActivity {
//获取自定义数据
if (appData.getData() != null && !appData.getData().equals("")) {
JSONObject data = JSON.parseObject(appData.getData());
if (CommonAppConfig.IS_GOOGLE_PLAY == 1 || CommonAppConfig.IS_GOOGLE_PLAY == 2|| CommonAppConfig.IS_GOOGLE_PLAY == 3) {
if (CommonAppConfig.IS_GOOGLE_PLAY == 1 || CommonAppConfig.IS_GOOGLE_PLAY == 2 || CommonAppConfig.IS_GOOGLE_PLAY == 3) {
yqm_view.setVisibility(View.VISIBLE);
MainHttpUtil.getDeviceLoginType(new HttpCallback() {
@Override
@ -496,13 +496,13 @@ public class RegisterActivity extends AbsActivity {
home_zdy_img_us = obj.getString("home_zdy_img_us");
home_zdy_img_cn = obj.getString("home_zdy_img_cn");
}
gotoLive(obj.getString("anchor_id"));
// gotoLive(obj.getString("anchor_id"));
if (obj.containsKey("home_zdy_pop")) {
NoviceInstructorManager.get(mContext).setHomeZdyPop(obj.getString("home_zdy_pop"));
}
jumpMain(false);
jumpMain(false, obj.getString("anchor_id"));
} else {
jumpMain(false);
jumpMain(false, null);
}
EventBus.getDefault().post(new RegSuccessEvent());
}
@ -510,9 +510,10 @@ public class RegisterActivity extends AbsActivity {
}
};
private void jumpMain(boolean showInvite) {
Intent intent = new Intent(activity, MainActivity.class);
private void jumpMain(boolean showInvite, String anchorId) {
Intent intent = new Intent(activity, CompleteUserInfoActivity.class);
intent.putExtra(Constants.SHOW_INVITE, showInvite);
intent.putExtra("anchor_id", anchorId);
startActivity(intent);
}

View File

@ -0,0 +1,86 @@
package com.yunbao.main.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.bean.CareerBean;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.main.R;
import java.util.ArrayList;
import java.util.List;
public class EditUserHobbyAdapter extends RecyclerView.Adapter<EditUserHobbyAdapter.ViewHolder> {
List<CareerBean> mList = new ArrayList<>();
List<String> mSelectedList = new ArrayList<>();
OnItemClickListener<List<String>> onItemClickListener;
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_edit_user_hobby, parent, false));
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
holder.setData(mList.get(position), position);
}
public void setOnItemClickListener(OnItemClickListener<List<String>> onItemClickListener) {
this.onItemClickListener = onItemClickListener;
}
@Override
public int getItemCount() {
return mList.size();
}
public void setSelectData(List<String> list) {
mSelectedList = list;
}
public List<String> getmSelectedList() {
return mSelectedList;
}
public void setHobbyData(List<CareerBean> data) {
mList = data;
}
public class ViewHolder extends RecyclerView.ViewHolder {
Button button;
public ViewHolder(@NonNull View itemView) {
super(itemView);
button = itemView.findViewById(R.id.btn);
}
public void setData(CareerBean careerBean, int position) {
button.setBackgroundResource(R.drawable.dialog_bg_chat_status_config);
String tag = careerBean.getId() + "";
for (String select : mSelectedList) {
if (select.equals(tag)) {
button.setBackgroundResource(R.drawable.dialog_bg_chat_status_config_select);
}
}
button.setOnClickListener(view -> {
if (mSelectedList.contains(tag)) {
mSelectedList.remove(tag);
} else if (mSelectedList.size() < 5) {
mSelectedList.add(tag);
}
if (onItemClickListener != null) {
onItemClickListener.onItemClick(mSelectedList, mSelectedList.size());
}
notifyDataSetChanged();
});
button.setText(WordUtil.isNewZh() ? careerBean.getTitleCn() : careerBean.getTitleEn());
}
}
}

View File

@ -2,6 +2,7 @@ package com.yunbao.main.adapter;
import android.content.Context;
import android.text.Html;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextUtils;
import android.util.Log;
@ -14,6 +15,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.message.content.MessageChatCardContent;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.ListUtils;
import com.yunbao.common.utils.StringUtil;
@ -30,6 +32,7 @@ import io.rong.imkit.conversationlist.model.BaseUiConversation;
import io.rong.imkit.conversationlist.model.SingleConversation;
import io.rong.imkit.utils.RouteUtils;
import io.rong.imkit.widget.adapter.ViewHolder;
import io.rong.imlib.model.Conversation;
public class MainConversationListAdapter extends ConversationListAdapter {
public static final int TYPE_SEARCH_TITLE = 500;
@ -125,7 +128,14 @@ public class MainConversationListAdapter extends ConversationListAdapter {
for (BaseUiConversation item : data) {
BaseUiConversation cn = new SingleConversation(mContext, item.mCore);
srcList.add(cn);
if (item.mCore.getConversationType() == Conversation.ConversationType.PRIVATE) {
if (item.mCore.getLatestMessage() instanceof MessageChatCardContent) {
item.mConversationContent = new SpannableString(WordUtil.getNewString(R.string.activity_msg_chat_list_card));
}
}
}
super.setDataCollection(data);
}

View File

@ -96,11 +96,16 @@ public class MainHomeComAdapter extends RefreshAdapter<ActiveBean> {
isVideo.setVisibility(View.VISIBLE);
}
name.setText(bean.getUser_name());
JSONObject json = JSONObject.parseObject(bean.getContent());
if (json != null) {
String content = (String) json.get("msg");
title.setText(content);
try {
JSONObject json = JSONObject.parseObject(bean.getContent());
if (json != null) {
String content = (String) json.get("msg");
title.setText(content);
}
}catch (Exception e){
e.printStackTrace();
}
likeCount.setText(bean.getLove_num());
ImgLoader.display(mContext, bean.getUser_avatar(), author);

View File

@ -65,6 +65,7 @@ import com.yunbao.main.activity.MainActivity;
import com.yunbao.main.activity.MyWalletActivity;
import com.yunbao.main.dialog.EncourageDialog;
import com.yunbao.main.utils.BottomBarUtil;
import com.yunbao.share.bean.ShareBean;
import com.yunbao.share.ui.SharePopDialog;
import com.yunbao.video.activity.VideoPlayActivity;
import com.yunbao.video.utils.VideoStorge;
@ -376,8 +377,10 @@ public class MainHomeCommunityFragment extends BaseFragment {
} else if (TextUtils.equals(event.getMethod(), "androidCommunityShare")) {
JSONObject json = JSONObject.parseObject(event.getData());
new SharePopDialog(mContext)
.setShareData(ShareBean.ShareBuilder.create()
.setAnchorAvatar(json.getString("avatar"))
.build())
.setShareLink(CommonAppConfig.HOST + json.getString("link"))
.setAnchorAvatar(json.getString("avatar"))
.showDialog();
}
}

View File

@ -1,8 +1,6 @@
package com.yunbao.main.fragment;
import android.graphics.Color;
import android.os.Bundle;
import android.text.SpannableString;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -10,7 +8,6 @@ import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.yunbao.common.custom.ItemDecoration;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
@ -24,9 +21,6 @@ import io.rong.imkit.conversationlist.ConversationListAdapter;
import io.rong.imkit.conversationlist.ConversationListFragment;
import io.rong.imkit.conversationlist.model.BaseUiConversation;
import io.rong.imkit.conversationlist.model.SingleConversation;
import io.rong.imlib.IRongCoreCallback;
import io.rong.imlib.IRongCoreEnum;
import io.rong.imlib.RongCoreClient;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation;
import io.rong.imlib.model.SearchConversationResult;
@ -63,7 +57,7 @@ public class MainMessageChatFragment extends ConversationListFragment {
System.err.println(" ----------------------->" + mAdapter.getData().size());
for (BaseUiConversation cn : ((MainConversationListAdapter) mAdapter).getSrcList()) {
System.err.println(" ----------------------->" + cn.mCore.getConversationTitle() + "|" + cn.mCore.getSenderUserName());
if(StringUtil.isEmpty(cn.mCore.getConversationTitle()))continue;
if (StringUtil.isEmpty(cn.mCore.getConversationTitle())) continue;
if (cn.mCore.getConversationTitle().contains(search)) {
conversation = new SingleConversation(getContext(), new Conversation());
conversation.mCore.setObjectName("SEARCH_USER" + search);
@ -74,7 +68,6 @@ public class MainMessageChatFragment extends ConversationListFragment {
conversation.mCore.setSenderUserId(cn.mCore.getSenderUserId());
data.add(conversation);
}
}
if (data.size() == 1) {
data.get(0).mCore.setMentionedCount(3);

View File

@ -57,6 +57,7 @@ import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation;
import io.rong.imlib.model.UserInfo;
import io.rong.sight.SightExtensionModule;
import com.yunbao.main.R;
import com.yunbao.main.views.MessageChatExtensionConfig;
@ -68,6 +69,7 @@ public class ConversationIMListManager {
private Context mContext;
//指导员ID
private String targetId;
private String topContent;
private Handler conversationIMListHandler = new Handler();
private ConversationIMListManager(Context context) {
@ -246,11 +248,30 @@ public class ConversationIMListManager {
}
};
private void setConversationToTop(String targetId) {
setConversationToTop(null, targetId);
}
/**
* 消息置顶
*/
private void setConversationToTop(String targetId) {
IMCenter.getInstance().setConversationToTop(Conversation.ConversationType.PRIVATE, targetId, true, false, null
private void setConversationToTop(BaseUiConversation conversation, String targetId) {
boolean top = true;
Conversation.ConversationType type = Conversation.ConversationType.PRIVATE;
if (conversation != null) {
top = !conversation.mCore.isTop();
targetId = conversation.mCore.getTargetId();
type = conversation.mCore.getConversationType();
}
IMCenter.getInstance().setConversationToTop(type, targetId, top, false, new RongIMClient.ResultCallback<Boolean>() {
@Override
public void onSuccess(Boolean aBoolean) {
}
@Override
public void onError(RongIMClient.ErrorCode e) {
}
}
);
}
@ -283,7 +304,12 @@ public class ConversationIMListManager {
//非指导员都可以点击
UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(baseUiConversation.mCore.getTargetId());
String[] list;
list = new String[]{WordUtil.getNewString(R.string.top),WordUtil.getNewString(R.string.delete)};
if (baseUiConversation.mCore.isTop()) {
topContent = WordUtil.getNewString(R.string.untop);
} else {
topContent = WordUtil.getNewString(R.string.top);
}
list = new String[]{topContent, WordUtil.getNewString(R.string.delete)};
if (userInfo != null && !TextUtils.isEmpty(userInfo.getExtra())) {
IMLoginModel model = new Gson().fromJson(userInfo.getExtra(), IMLoginModel.class);
if (!TextUtils.equals(model.getIsAdmin(), "1")) {
@ -300,10 +326,10 @@ public class ConversationIMListManager {
.setOnItemClickListener(new OnItemClickListener<String>() {
@Override
public void onItemClick(String bean, int position) {
if (bean.equals(WordUtil.getNewString(R.string.top))) {
// copyText(baseUiConversation,context);
setConversationToTop(targetId);
} else if(bean.equals(WordUtil.getNewString(R.string.delete))){
if (bean.equals(topContent)) {
// copyText(baseUiConversation,context);
setConversationToTop(baseUiConversation, targetId);
} else if (bean.equals(WordUtil.getNewString(R.string.delete))) {
delete(baseUiConversation.mCore.getTargetId());
}
}
@ -402,7 +428,8 @@ public class ConversationIMListManager {
public String getTargetId() {
return targetId;
}
private void copyText(UiMessage uiMessage,Context context) {
private void copyText(UiMessage uiMessage, Context context) {
ClipboardManager cm = (ClipboardManager) context.getSystemService(CLIPBOARD_SERVICE);
ClipData clipData = ClipData.newPlainText("text", uiMessage.getContentSpannable());
cm.setPrimaryClip(clipData);

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="153dp" android:height="72dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#ff00a3ff" />
<solid android:color="#fff4fcff" />
<corners android:topLeftRadius="15dp" android:topRightRadius="15dp" android:bottomLeftRadius="15dp" android:bottomRightRadius="15dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="153dp" android:height="72dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#ffff4874" />
<solid android:color="#fffff4f8" />
<corners android:topLeftRadius="15dp" android:topRightRadius="15dp" android:bottomLeftRadius="15dp" android:bottomRightRadius="15dp" />
</shape>
</item>
</selector>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/include5"
layout="@layout/view_title_not_color"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/titleView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:text="@string/edit_profile_hobby"
android:textColor="#333333"
android:textSize="30sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include5" />
<TextView
android:id="@+id/number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="(0/5)"
android:textColor="#777777"
android:textSize="11sp"
app:layout_constraintStart_toStartOf="@+id/titleView"
app:layout_constraintTop_toBottomOf="@+id/titleView" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="15dp"
android:layout_marginTop="20dp"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/number"
app:spanCount="4"
tools:listitem="@layout/item_edit_user_hobby" />
<Button
android:id="@+id/btn_save"
android:layout_width="186dp"
android:layout_height="54dp"
android:textColor="#FFFFFF"
android:layout_marginEnd="21dp"
android:layout_marginBottom="112dp"
android:background="@drawable/bg_msg_address_book_user_btn_fan"
android:text="@string/edit_profile_hobby_save"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<Button
android:id="@+id/btn_cancel"
android:layout_width="122dp"
android:layout_height="54dp"
android:layout_marginStart="21dp"
android:layout_marginBottom="112dp"
android:background="@drawable/dialog_bg_chat_status_config"
android:text="@string/edit_profile_hobby_cancel"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/btn_save"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -38,7 +38,7 @@
android:src="@mipmap/ic_message_hi_config_image_add"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title"
app:riv_corner_radius="10dp" />
app:riv_corner_radius="25dp" />
<Button
android:id="@+id/btn_change"
@ -46,8 +46,13 @@
android:layout_height="34dp"
android:layout_marginTop="-34dp"
android:background="@drawable/bg_btn_activity_user_info_avatar_change"
android:text="更换"
android:text="@string/activity_reg_user_info_avatar_change"
android:textSize="13sp"
android:maxLines="2"
app:autoSizeMaxTextSize="13sp"
app:autoSizeMinTextSize="5sp"
app:autoSizeStepGranularity="1sp"
app:autoSizeTextType="uniform"
app:layout_constraintEnd_toEndOf="@+id/avatar"
app:layout_constraintTop_toBottomOf="@+id/avatar" />
@ -58,7 +63,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="27dp"
android:layout_marginTop="20dp"
android:text="@string/activity_reg_user_info_sex_title"
android:text="@string/activity_reg_user_info_sex_sex"
android:textColor="#333333"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="parent"
@ -82,7 +87,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="27dp"
android:layout_marginTop="25dp"
android:text="昵称"
android:text="@string/activity_reg_user_info_sex_title"
android:textColor="#333333"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="parent"
@ -140,10 +145,23 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
android:text="@string/aristocrat_determine"
android:text="@string/activity_reg_user_info_submit"
android:textAllCaps="false"
android:background="@drawable/bg_msg_address_book_user_btn_fan"
android:textColor="#FFFFFF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/textView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:textColor="#FF4874"
android:textSize="11sp"
android:text="@string/activity_reg_user_info_sex_sex_tips"
app:layout_constraintBottom_toBottomOf="@+id/title2"
app:layout_constraintStart_toEndOf="@+id/title2"
app:layout_constraintTop_toTopOf="@+id/title2" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginEnd="15dp"
android:layout_height="wrap_content">
<Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:background="@drawable/dialog_bg_chat_status_config"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>

View File

@ -3,16 +3,15 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
android:layout_height="wrap_content">
<RelativeLayout
android:layout_marginTop="20dp"
android:id="@+id/relativeLayout"
android:layout_width="match_parent"
android:paddingTop="24dp"
android:layout_height="52dp"
android:layout_marginTop="20dp"
android:paddingTop="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
@ -49,10 +48,10 @@
<ImageView
android:id="@+id/img_more"
android:layout_width="40dp"
android:scaleType="center"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:padding="9dp"
android:scaleType="center"
android:src="@mipmap/btn_more_black"
android:visibility="visible" />
</RelativeLayout>
@ -109,17 +108,31 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/user_status"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:text="在线"
android:textColor="#AAAAAA"
android:textSize="8sp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@+id/userName"
app:layout_constraintStart_toEndOf="@+id/userName"
app:layout_constraintTop_toTopOf="@+id/userName" />
app:layout_constraintTop_toTopOf="@+id/userName">
<TextView
android:id="@+id/user_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="在线"
android:textColor="#AAAAAA"
android:textSize="8sp" />
<ImageView
android:id="@+id/userStatusIcon"
android:layout_width="5dp"
android:layout_height="5dp"
android:layout_gravity="top"
android:layout_marginStart="5dp"
android:src="@mipmap/icon_green" />
</LinearLayout>
<TextView
android:id="@+id/info"
@ -184,13 +197,13 @@
android:layout_marginStart="50dp"
android:layout_marginEnd="50dp"
android:layout_marginBottom="60dp"
tools:listitem="@layout/view_msg_chat_top_image"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="9"
android:orientation="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/imageView"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"
tools:itemCount="9"
tools:listitem="@layout/view_msg_chat_top_image" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/tag_list"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -19,24 +19,25 @@
<string name="battlepass_reward_item_lock">暫未達到等級</string>
<string name="battlepass_reward_item_get">領取成功</string>
<string name="top">置頂</string>
<string name="untop">取消置頂</string>
<string name="delete">刪除</string>
<string name="activity_msg_title">消息</string>
<string name="activity_msg_news_notice">官方通知</string>
<string name="activity_msg_system_message">通知</string>
<string name="activity_msg_system_message">通知</string>
<string name="activity_msg_newts_interaction">互動消息</string>
<string name="activity_msg_news_online">在線客服</string>
<string name="activity_msg_search_hint">搜索昵稱或聊天記錄</string>
<string name="activity_msg_list_include">包含:</string>
<string name="activity_msg_list_title_contacts">聯繫人</string>
<string name="activity_msg_list_title_chat_records">聊天記錄</string>
<string name="activity_msg_addressbook_layout_title">讯录</string>
<string name="activity_msg_addressbook_layout_title">訊錄</string>
<string name="activity_msg_addressbook_search_hint">搜索昵稱</string>
<string name="activity_msg_addressbook_tab_follow">已關注</string>
<string name="activity_msg_addressbook_tab_follow2">關注</string>
<string name="activity_msg_addressbook_tab_fan">粉絲</string>
<string name="activity_msg_addressbook_tab_fan2">回關</string>
<string name="activity_msg_addressbook_tab_mutual">互相關注</string>
<string name="activity_msg_chat_top_tip1">赠送礼物陪伴TA</string>
<string name="activity_msg_chat_top_tip1">贈送禮物陪伴TA</string>
<string name="dialog_msg_m_config">消息設置</string>
<string name="dialog_msg_status_config">接單設置</string>
<string name="dialog_msg_status_online_config">在線</string>
@ -56,18 +57,31 @@
<string name="dialog_msg_hi_config_audio_btn_play">點擊播放</string>
<string name="dialog_msg_hi_config_audio_btn_reset">重錄</string>
<string name="dialog_msg_hi_config_audio_btn_save">保存</string>
<string name="dialog_msg_hi_config_audio_refuse_save_image">至少传一张图</string>
<string name="dialog_msg_hi_config_audio_refuse_save_text">至少传一条文字消息</string>
<string name="dialog_msg_hi_config_audio_refuse_save_audio">至少传一条语音消息</string>
<string name="dialog_msg_hi_config_audio_refuse_save_image">至少傳一張圖</string>
<string name="dialog_msg_hi_config_audio_refuse_save_text">至少傳一條文字消息</string>
<string name="dialog_msg_hi_config_audio_refuse_save_audio">至少傳一條語音消息</string>
<string name="activity_reg_user_info_title">完善個人信息</string>
<string name="activity_reg_user_info_sex_title">性别</string>
<string name="activity_reg_user_info_sex_title">暱稱</string>
<string name="activity_reg_user_info_sex_sex">性別</string>
<string name="activity_reg_user_info_sex_sex_tips">*只有一次選擇性別的機會,請謹慎選擇</string>
<string name="activity_reg_user_info_avatar_change">更換</string>
<string name="activity_reg_user_info_sex_man">男生</string>
<string name="activity_reg_user_info_sex_woman">女生</string>
<string name="activity_reg_user_info_birthday_title">生日</string>
<string name="activity_reg_user_info_birthday_text">选择你的生日</string>
<string name="activity_reg_user_info_birthday_text">選擇你的生日</string>
<string name="activity_reg_user_info_submit">完成</string>
<string name="dialog_user_info_album">圖庫</string>
<string name="dialog_user_info_camera">相機</string>
<string name="year"></string>
<string name="month"></string>
<string name="day"></string>
<string name="activity_msg_chat_top_status_online">在線</string>
<string name="activity_msg_chat_top_status_offline">離線</string>
<string name="activity_msg_chat_list_card">[名片]</string>
<string name="edit_profile_occupation">職業</string>
<string name="edit_profile_height">身高</string>
<string name="edit_profile_hobby">愛好</string>
<string name="edit_profile_hobby_save">完成</string>
<string name="edit_profile_hobby_cancel">退出</string>
<string name="complete_user_info_username_hint">請輸入暱稱</string>
</resources>

View File

@ -19,6 +19,7 @@
<string name="battlepass_reward_item_lock">Not yet reached level</string>
<string name="battlepass_reward_item_get">Successfully claimed</string>
<string name="top">置頂</string>
<string name="untop">取消置頂</string>
<string name="delete">刪除</string>
<string name="activity_msg_title">Information</string>
<string name="activity_msg_news_notice">Activities</string>
@ -59,15 +60,28 @@
<string name="dialog_msg_hi_config_audio_refuse_save_image">至少传一张图片</string>
<string name="dialog_msg_hi_config_audio_refuse_save_text">至少传一条文字消息</string>
<string name="dialog_msg_hi_config_audio_refuse_save_audio">至少传一条语音消息</string>
<string name="activity_reg_user_info_title">完善個人信息</string>
<string name="activity_reg_user_info_sex_title">Sex</string>
<string name="activity_reg_user_info_sex_man">Man</string>
<string name="activity_reg_user_info_sex_woman">Woman</string>
<string name="activity_reg_user_info_title">Personal information</string>
<string name="activity_reg_user_info_sex_title">Nickname</string>
<string name="activity_reg_user_info_sex_sex">Sex</string>
<string name="activity_reg_user_info_sex_sex_tips">*Only one chance to choose gender, choose wisely.</string>
<string name="activity_reg_user_info_sex_man">Boys</string>
<string name="activity_reg_user_info_sex_woman">Girl</string>
<string name="activity_reg_user_info_avatar_change">Replace</string>
<string name="activity_reg_user_info_birthday_title">Birthday</string>
<string name="activity_reg_user_info_birthday_text">Select your Birthday</string>
<string name="activity_reg_user_info_birthday_text">Choose your birthday</string>
<string name="activity_reg_user_info_submit">Finish</string>
<string name="dialog_user_info_album">Album</string>
<string name="dialog_user_info_camera">Camera</string>
<string name="year"></string>
<string name="month"></string>
<string name="day"></string>
<string name="year">Year</string>
<string name="month">Month</string>
<string name="day">Day</string>
<string name="activity_msg_chat_top_status_online">Online</string>
<string name="activity_msg_chat_top_status_offline">Offline</string>
<string name="activity_msg_chat_list_card">[Card]</string>
<string name="edit_profile_occupation">Profession</string>
<string name="edit_profile_height">Height</string>
<string name="edit_profile_hobby">Hobby</string>
<string name="edit_profile_hobby_save">Save</string>
<string name="edit_profile_hobby_cancel">Cancel</string>
<string name="complete_user_info_username_hint">Please enter a nickname</string>
</resources>