Compare commits
54 Commits
pandorapan
...
dev_改版主分支
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b90d86d90f | ||
|
|
0324b638fa | ||
|
|
28f00f1c8a | ||
| dd582c10c7 | |||
| bd6ddf7153 | |||
| c20708d633 | |||
| d08861a082 | |||
| 12989e12ce | |||
| 77530340d0 | |||
| a387b30893 | |||
| 889f8dcfe8 | |||
| 88e822004f | |||
| b954e9d451 | |||
| 578de1f101 | |||
| 62419c86cf | |||
| 434486387d | |||
| 7cf7c1e993 | |||
|
|
9427fb8aaa | ||
|
|
4d4d3d1bae | ||
| 2cc58b920f | |||
| 3b4ffe8c51 | |||
| cd3a86c6b7 | |||
| 82c4edf7e4 | |||
| bd598176c1 | |||
|
|
02bc604685 | ||
|
|
5ebb97cd3c | ||
|
|
e9a3e8aa2f | ||
| 61dcf0916d | |||
| 7167ad8e97 | |||
| 9992dec28e | |||
| 04980cbb2f | |||
|
|
f2b2c39168 | ||
| d39facbcc7 | |||
|
|
c3ca76df07 | ||
| 34dae7d981 | |||
| ce568c6d87 | |||
| c7ba98acb4 | |||
|
|
f8cb1d0a4b | ||
|
|
94d05a3929 | ||
| 1c74689e90 | |||
| a5acbb0146 | |||
| 457e47e885 | |||
| 1442d05262 | |||
| 9e80e77297 | |||
| ab6d871b38 | |||
|
|
0e83f4fbaf | ||
|
|
434474bd98 | ||
| f3d19e37bb | |||
| bfa4a52dd4 | |||
| d17f89b5c1 | |||
| 938bee4fdb | |||
| 3127a5faaf | |||
| d130c1565c | |||
| b3b46ccff3 |
1
.gitignore
vendored
@@ -14,3 +14,4 @@ local.properties
|
||||
/live/build/
|
||||
/main/build/
|
||||
/video/build/
|
||||
/tmp/full-r8-config.txt
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
276
Share/src/main/java/com/yunbao/share/bean/ShareBean.java
Normal file
@@ -0,0 +1,276 @@
|
||||
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;
|
||||
private String extraData;
|
||||
|
||||
|
||||
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 String getExtraData() {
|
||||
return extraData;
|
||||
}
|
||||
|
||||
public void setExtraData(String extraData) {
|
||||
this.extraData = extraData;
|
||||
}
|
||||
|
||||
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;
|
||||
bean.extraData = extraData;
|
||||
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 ShareBuilder setExtraData(String extraData) {
|
||||
bean.setExtraData(extraData);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ShareBean build() {
|
||||
return bean;
|
||||
}
|
||||
|
||||
|
||||
public static ShareBuilder create() {
|
||||
return new ShareBuilder();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -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()))
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -3,20 +3,24 @@ 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.SharePopDialog;
|
||||
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 +30,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.getExtraData()
|
||||
),
|
||||
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);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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()))
|
||||
|
||||
@@ -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>() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,28 +1,25 @@
|
||||
package com.yunbao.share.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
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.StringUtil;
|
||||
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 +28,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 +68,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());
|
||||
}
|
||||
@@ -85,6 +85,37 @@ public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow {
|
||||
initRefreshView();
|
||||
|
||||
refreshData();
|
||||
search.addTextChangedListener(new TextWatcher() {
|
||||
List<SingleConversation> searchList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
String key = editable.toString();
|
||||
searchList.clear();
|
||||
if (StringUtil.isEmpty(key)) {
|
||||
adapter.setList(listData);
|
||||
return;
|
||||
}
|
||||
for (SingleConversation datum : listData) {
|
||||
if (datum.mCore.getConversationTitle().contains(key)) {
|
||||
searchList.add(datum);
|
||||
}
|
||||
}
|
||||
adapter.setList(searchList);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -12,58 +12,49 @@ 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;
|
||||
public static final int TYPE_VIDEO = 2;
|
||||
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 +80,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 +94,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 +113,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 +129,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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,19 +11,17 @@ 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.AbsDialogCenterPopupWindow;
|
||||
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;
|
||||
public class ShareSuccessNotifyDialog extends AbsDialogCenterPopupWindow {
|
||||
private ShareBean bean;
|
||||
private DialogInterface.OnDismissListener onDismissListener;
|
||||
|
||||
private TextView anchorName;
|
||||
@@ -34,7 +32,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;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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,10 +62,12 @@ 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;
|
||||
import com.yunbao.main.activity.PDLiveConversationActivity;
|
||||
import com.yunbao.video.activity.VideoPlayActivity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@@ -108,17 +112,25 @@ 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;
|
||||
}
|
||||
if(activity instanceof VideoPlayActivity){
|
||||
MessageSayHiNotifyManager.getInstance().stop();
|
||||
return;
|
||||
}
|
||||
MessageSayHiNotifyManager.getInstance().reload();
|
||||
}
|
||||
|
||||
@@ -220,12 +232,18 @@ 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()));
|
||||
|
||||
//注册屏蔽push弹窗的类
|
||||
MessageChatNotifyManager.getInstance().addShieldClass(CompleteUserInfoActivity.class);
|
||||
MessageChatNotifyManager.getInstance().addShieldClass(PDLiveConversationActivity.class);
|
||||
|
||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||
@Override
|
||||
@@ -260,6 +278,9 @@ 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().push(AppManager.getInstance().getLastActivity()
|
||||
, message.getTargetId(),
|
||||
content.getContent()
|
||||
@@ -358,9 +379,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);
|
||||
|
||||
@@ -65,18 +65,6 @@
|
||||
android:name="com.yunbao.common.activity.PreviewVideoActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.CommunitySendActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.CommunityDetailsActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.UserHomeActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yunbao.common;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
@@ -12,6 +13,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.FansMedalBean;
|
||||
import com.yunbao.common.bean.NewCommunityType;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.bean.UserItemBean;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
@@ -117,10 +119,46 @@ public class CommonAppConfig {
|
||||
private String mAppName;
|
||||
private Boolean mTiBeautyEnable;//是否使用萌颜 true使用萌颜 false 使用基础美颜
|
||||
|
||||
public static List<NewCommunityType> getCommunityTypeList(boolean isHome, Context mContext) {
|
||||
List<NewCommunityType> newCommunityTypeList = new ArrayList<>();
|
||||
if (isHome) {
|
||||
NewCommunityType type0 = new NewCommunityType();
|
||||
type0.setId(0);
|
||||
type0.setTalk_name(mContext.getString(R.string.recomment));
|
||||
newCommunityTypeList.add(type0);
|
||||
}
|
||||
NewCommunityType type17 = new NewCommunityType();
|
||||
type17.setId(17);
|
||||
type17.setTalk_name(mContext.getResources().getString(R.string.main_active_type_01));
|
||||
|
||||
NewCommunityType type16 = new NewCommunityType();
|
||||
type16.setId(16);
|
||||
type16.setTalk_name(mContext.getResources().getString(R.string.main_active_type_02));
|
||||
|
||||
NewCommunityType type15 = new NewCommunityType();
|
||||
type15.setId(15);
|
||||
type15.setTalk_name(mContext.getResources().getString(R.string.main_active_type_03));
|
||||
|
||||
NewCommunityType type14 = new NewCommunityType();
|
||||
type14.setId(14);
|
||||
type14.setTalk_name(mContext.getResources().getString(R.string.main_active_type_04));
|
||||
|
||||
NewCommunityType type13 = new NewCommunityType();
|
||||
type13.setId(13);
|
||||
type13.setTalk_name(mContext.getResources().getString(R.string.main_active_type_05));
|
||||
|
||||
newCommunityTypeList.add(type17);
|
||||
newCommunityTypeList.add(type16);
|
||||
newCommunityTypeList.add(type15);
|
||||
newCommunityTypeList.add(type14);
|
||||
newCommunityTypeList.add(type13);
|
||||
return newCommunityTypeList;
|
||||
}
|
||||
|
||||
|
||||
public String getUid() {
|
||||
if (TextUtils.isEmpty(mUid)) {
|
||||
String[] uidAndToken = SpUtil.getInstance()
|
||||
.getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
|
||||
String[] uidAndToken = SpUtil.getInstance().getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
|
||||
if (uidAndToken != null) {
|
||||
if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) {
|
||||
mUid = uidAndToken[0];
|
||||
@@ -311,9 +349,7 @@ public class CommonAppConfig {
|
||||
mUid = null;
|
||||
mToken = null;
|
||||
mLoginIM = false;
|
||||
SpUtil.getInstance().removeValue(
|
||||
SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN
|
||||
);
|
||||
SpUtil.getInstance().removeValue(SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN);
|
||||
}
|
||||
|
||||
|
||||
@@ -349,12 +385,7 @@ public class CommonAppConfig {
|
||||
mProvince = null;
|
||||
mCity = null;
|
||||
mDistrict = null;
|
||||
SpUtil.getInstance().removeValue(
|
||||
SpUtil.LOCATION_LNG,
|
||||
SpUtil.LOCATION_LAT,
|
||||
SpUtil.LOCATION_PROVINCE,
|
||||
SpUtil.LOCATION_CITY,
|
||||
SpUtil.LOCATION_DISTRICT);
|
||||
SpUtil.getInstance().removeValue(SpUtil.LOCATION_LNG, SpUtil.LOCATION_LAT, SpUtil.LOCATION_PROVINCE, SpUtil.LOCATION_CITY, SpUtil.LOCATION_DISTRICT);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,759 +0,0 @@
|
||||
package com.yunbao.common.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Outline;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.SparseArray;
|
||||
import android.view.View;
|
||||
import android.view.ViewOutlineProvider;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.google.gson.Gson;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.ms.banner.Banner;
|
||||
import com.xuexiang.xui.widget.flowlayout.FlowTagLayout;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.LabelTagAdapter;
|
||||
import com.yunbao.common.adapter.UserCommunityAdapter;
|
||||
import com.yunbao.common.adapter.UserHomeImgAdapter;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.ActiveOtherBean;
|
||||
import com.yunbao.common.bean.HomeUserExhibitInfoBean;
|
||||
import com.yunbao.common.bean.HomeUserInfoBean;
|
||||
import com.yunbao.common.bean.LabelBean;
|
||||
import com.yunbao.common.bean.UserHomeImgBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.upload.UploadBean;
|
||||
import com.yunbao.common.upload.UploadCallback;
|
||||
import com.yunbao.common.upload.UploadQnImpl;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.FilesUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.UserHomeImgsViewHolder;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
@Route(path = RouteUtil.PATH_USER_HOME)
|
||||
public class UserHomeActivity extends AbsActivity {
|
||||
private final int CHOOSE_IMG = 100;//Android 5.0以下的
|
||||
public static final int PERMISSION_REQUEST_CODE_IMG = 0;
|
||||
private String uid;
|
||||
private Banner mBanner;
|
||||
private RecyclerView imgsRecyclerView;
|
||||
private UserHomeImgAdapter userHomeImgAdapter;
|
||||
private List<String> bannerImgList = new ArrayList<>();
|
||||
private List<UserHomeImgBean> tempList;
|
||||
private RoundedImageView avatar;
|
||||
private TextView userName;
|
||||
private TextView fansCount;
|
||||
private TextView likeCount;
|
||||
private LinearLayout followLayout;
|
||||
private ImageView followIcon;
|
||||
private TextView followName;
|
||||
private TextView userId;
|
||||
private TextView userStatus;
|
||||
private ImageView userStatusIcon;
|
||||
private ImageView user_sex;
|
||||
private ImageView authorIcon;
|
||||
private ImageView levelIcon;
|
||||
private LinearLayout authenticationLayout;
|
||||
private TextView signature;
|
||||
private LinearLayout moreLayout;
|
||||
private TextView moreText;
|
||||
private ImageView moreIcon;
|
||||
private HomeUserInfoBean userInfo;
|
||||
private RecyclerView communityRecyclerView;
|
||||
private LinearLayout itemLayout01;
|
||||
private LinearLayout itemLayout02;
|
||||
private LinearLayout itemLayout03;
|
||||
private LinearLayout itemLayout04;
|
||||
private FlowTagLayout myFlowTag; //我的标签
|
||||
private LabelTagAdapter myAdapter;
|
||||
private boolean isShowcase;
|
||||
private boolean isAnchor;
|
||||
private boolean isMe;
|
||||
private RelativeLayout userPresidentLayout;
|
||||
private TextView userPresidentName;
|
||||
private RoundedImageView fansImg1;
|
||||
private RoundedImageView fansImg2;
|
||||
private RoundedImageView fansImg3;
|
||||
private List<RoundedImageView> fansImgViewList = new ArrayList<>();
|
||||
private RoundedImageView guardImg1;
|
||||
private RoundedImageView guardImg2;
|
||||
private RoundedImageView guardImg3;
|
||||
private List<RoundedImageView> guardImgViewList = new ArrayList<>();
|
||||
private RoundedImageView giftImg1;
|
||||
private RoundedImageView giftImg2;
|
||||
private RoundedImageView giftImg3;
|
||||
private List<RoundedImageView> giftImgViewList = new ArrayList<>();
|
||||
private RoundedImageView honorImg1;
|
||||
private RoundedImageView honorImg2;
|
||||
private RoundedImageView honorImg3;
|
||||
private List<RoundedImageView> honorImgViewList = new ArrayList<>();
|
||||
private TextView giftCount;
|
||||
private List<String> tagList;
|
||||
private GifImageView liveStatus;
|
||||
private TextView topName;
|
||||
private LinearLayout topLayout;
|
||||
private ScrollView scrollView;
|
||||
private RelativeLayout topImgLayout;
|
||||
private ImageView imgUp;
|
||||
private ImageView imgLabel;
|
||||
private LinearLayout bottomEditLayout;
|
||||
private UploadQnImpl mUploadStrategy;
|
||||
private List<ActiveBean> videoList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_user_home;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void create() {
|
||||
super.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
uid = getIntent().getStringExtra(Constants.TO_UID);
|
||||
if (StringUtil.isEmpty(uid)) {
|
||||
ToastUtil.show("用户不存在");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
initView();
|
||||
getUseData();
|
||||
getCommunityList();
|
||||
}
|
||||
|
||||
private void getCommunityList() {
|
||||
CommonHttpUtil.getOtherDynamicList(uid, new com.yunbao.common.http.HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
List<ActiveOtherBean> beanList = JSONArray.parseArray(Arrays.toString(info), ActiveOtherBean.class);
|
||||
UserCommunityAdapter userCommunityAdapter = new UserCommunityAdapter(mContext, beanList);
|
||||
userCommunityAdapter.setOnItemClickListener(new UserCommunityAdapter.onItemClickListener() {
|
||||
@Override
|
||||
public void onImgItem(ActiveOtherBean bean, int position) {
|
||||
if (bean.getImg_or_video().equals("1")) {
|
||||
RouteUtil.forwardCommunity(bean.getId());
|
||||
} else {
|
||||
int playPosition = 0;
|
||||
for (int i = 0; i < videoList.size(); i++) {
|
||||
if (videoList.get(i).getId().equals(bean.getId())) {
|
||||
playPosition = i;
|
||||
}
|
||||
}
|
||||
RouteUtil.forwardVideoActivity();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoItem(String activeBean, int position) {
|
||||
|
||||
}
|
||||
});
|
||||
communityRecyclerView.setAdapter(userCommunityAdapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint({"SetTextI18n", "UseCompatLoadingForDrawables"})
|
||||
private void initData(HomeUserInfoBean userInfoBean) {
|
||||
userInfo = userInfoBean;
|
||||
if (!userInfo.getCheckBlack().get(0).getU2t().equals("0")) {
|
||||
ToastUtil.show("已拉黑,无法查看");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getUser_president_name())) {
|
||||
userPresidentLayout.setVisibility(View.VISIBLE);
|
||||
userPresidentName.setText(userInfo.getUserHomeTopInfo().getUser_president_name());
|
||||
}
|
||||
isAnchor = userInfo.getUserHomeTopInfo().getIs_anchor() == 1;
|
||||
isMe = CommonAppConfig.getInstance().getUserBean().getId().equals(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()));
|
||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_avatar(), avatar);
|
||||
topName.setText(userInfo.getUserHomeTopInfo().getUser_name()); //用户名称-顶部
|
||||
userName.setText(userInfo.getUserHomeTopInfo().getUser_name());//用户名称
|
||||
fansCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_fans_num()));//粉丝数量
|
||||
likeCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_love_num()));//关注数量
|
||||
|
||||
if (isMe) {
|
||||
bottomEditLayout.setVisibility(View.VISIBLE);
|
||||
imgUp.setVisibility(View.VISIBLE);
|
||||
imgLabel.setVisibility(View.VISIBLE);
|
||||
followLayout.setVisibility(View.GONE);
|
||||
}
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getUser_goodnum())) {
|
||||
userId.setText("靓号:" + userInfo.getUserHomeTopInfo().getUser_goodnum());//用户靓号
|
||||
} else {
|
||||
userId.setText("ID:" + userInfo.getUserHomeTopInfo().getUser_id());//用户ID
|
||||
}
|
||||
|
||||
if (userInfo.getUserHomeTopInfo().getRong_online().equals("0")) {
|
||||
userStatus.setText("在线");
|
||||
userStatusIcon.setImageDrawable(getResources().getDrawable(R.mipmap.icon_green));
|
||||
} else {
|
||||
userStatus.setText("离线");
|
||||
userStatusIcon.setImageDrawable(getResources().getDrawable(R.mipmap.icon_gray));
|
||||
}
|
||||
if (userInfo.getUserHomeTopInfo().getIs_live() == 1) {
|
||||
liveStatus.setVisibility(View.VISIBLE);
|
||||
avatar.setBackground(getResources().getDrawable(R.drawable.bg_live_1));
|
||||
}
|
||||
ImgLoader.display(UserHomeActivity.this, Integer.parseInt(String.valueOf(userInfo.getUserHomeTopInfo().getUser_sex())) == 0 ? R.mipmap.icon_man_new : R.mipmap.icon_wumen, user_sex);
|
||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_anchor_img(), authorIcon);
|
||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_img(), levelIcon);
|
||||
|
||||
if (isAnchor) {//是否是主播
|
||||
authorIcon.setVisibility(View.VISIBLE);
|
||||
authenticationLayout.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
authorIcon.setVisibility(View.GONE);
|
||||
authenticationLayout.setVisibility(View.GONE);
|
||||
}
|
||||
signature.setText(userInfo.getUserHomeTopInfo().getUser_signature());//个性签名
|
||||
//标签
|
||||
myAdapter = new LabelTagAdapter(mContext, new LabelTagAdapter.OnSureOnClickListener() {
|
||||
@Override
|
||||
public void sure(LabelBean.Children labelBean) {
|
||||
|
||||
}
|
||||
});
|
||||
tagList = new ArrayList<>();
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getAge())) {
|
||||
tagList.add(userInfo.getUserHomeTopInfo().getAge() + "岁");
|
||||
}
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getHeight())) {
|
||||
tagList.add(userInfo.getUserHomeTopInfo().getHeight());
|
||||
}
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getCareer())) {
|
||||
tagList.add(userInfo.getUserHomeTopInfo().getCareer());
|
||||
}
|
||||
if (userInfo.getUserHomeTopInfo().getCn_label() != null) {
|
||||
if (userInfo.getUserHomeTopInfo().getCn_label().size() > 0) {
|
||||
for (int i = 0; i < userInfo.getUserHomeTopInfo().getCn_label().size(); i++) {
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getCn_label().get(i))) {
|
||||
tagList.add(userInfo.getUserHomeTopInfo().getCn_label().get(i));
|
||||
}
|
||||
}
|
||||
myFlowTag.setAdapter(myAdapter);
|
||||
myFlowTag.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
||||
myAdapter.setData(tagList);
|
||||
}
|
||||
}
|
||||
mBanner.setOutlineProvider(new ViewOutlineProvider() {
|
||||
@Override
|
||||
public void getOutline(View view, Outline outline) {
|
||||
outline.setRoundRect(0, 0, 0, 0, 0);
|
||||
}
|
||||
});
|
||||
mBanner.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
bannerImgList = userInfo.getUserHomeTopInfo().getUser_home_banner();
|
||||
tempList = new ArrayList<>();
|
||||
for (int i = 0; i < bannerImgList.size(); i++) {
|
||||
tempList.add(new UserHomeImgBean(bannerImgList.get(i)));
|
||||
}
|
||||
if (tempList.size() > 0) {
|
||||
tempList.get(0).setShow(true);
|
||||
}
|
||||
userHomeImgAdapter = new UserHomeImgAdapter(UserHomeActivity.this, tempList, isMe);
|
||||
imgsRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||
imgsRecyclerView.setAdapter(userHomeImgAdapter);
|
||||
|
||||
userHomeImgAdapter.setOnItemClickListener(new UserHomeImgAdapter.onItemClickListener() {
|
||||
@Override
|
||||
public void onImgItem(UserHomeImgBean activeBean, int position) {
|
||||
L.e("onImgItem:" + position);
|
||||
mBanner.setCurrentPage(position).start();
|
||||
for (int i = 0; i < tempList.size(); i++) {
|
||||
if (i == position) {
|
||||
tempList.get(i).setShow(true);
|
||||
} else {
|
||||
tempList.get(i).setShow(false);
|
||||
}
|
||||
}
|
||||
userHomeImgAdapter.setCommentBeanList(tempList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onImgDel(UserHomeImgBean activeBean, int position) {
|
||||
bannerImgList.remove(position);
|
||||
uploadImg(false);
|
||||
}
|
||||
});
|
||||
mBanner.setAutoPlay(false).setPages(bannerImgList, new UserHomeImgsViewHolder()).setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
L.e("onPageSelected:" + position);
|
||||
for (int i = 0; i < tempList.size(); i++) {
|
||||
if (i == position) {
|
||||
tempList.get(i).setShow(true);
|
||||
} else {
|
||||
tempList.get(i).setShow(false);
|
||||
}
|
||||
}
|
||||
userHomeImgAdapter.setCommentBeanList(tempList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
mBanner.start();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
bottomEditLayout = findViewById(R.id.bottomEditLayout);
|
||||
imgUp = findViewById(R.id.imgUp);
|
||||
imgLabel = findViewById(R.id.imgLabel);
|
||||
topImgLayout = findViewById(R.id.topImgLayout);
|
||||
|
||||
topLayout = findViewById(R.id.topLayout);
|
||||
scrollView = findViewById(R.id.scrollView);
|
||||
|
||||
topName = findViewById(R.id.topName);
|
||||
liveStatus = findViewById(R.id.liveStatus);
|
||||
giftCount = findViewById(R.id.giftCount);
|
||||
|
||||
fansImg1 = findViewById(R.id.fansImg1);
|
||||
fansImg2 = findViewById(R.id.fansImg2);
|
||||
fansImg3 = findViewById(R.id.fansImg3);
|
||||
fansImgViewList = new ArrayList<>();
|
||||
fansImgViewList.add(fansImg1);
|
||||
fansImgViewList.add(fansImg2);
|
||||
fansImgViewList.add(fansImg3);
|
||||
|
||||
guardImg1 = findViewById(R.id.guardImg1);
|
||||
guardImg2 = findViewById(R.id.guardImg2);
|
||||
guardImg3 = findViewById(R.id.guardImg3);
|
||||
guardImgViewList = new ArrayList<>();
|
||||
guardImgViewList.add(guardImg1);
|
||||
guardImgViewList.add(guardImg2);
|
||||
guardImgViewList.add(guardImg3);
|
||||
|
||||
giftImg1 = findViewById(R.id.giftImg1);
|
||||
giftImg2 = findViewById(R.id.giftImg2);
|
||||
giftImg3 = findViewById(R.id.giftImg3);
|
||||
giftImgViewList = new ArrayList<>();
|
||||
giftImgViewList.add(giftImg1);
|
||||
giftImgViewList.add(giftImg2);
|
||||
giftImgViewList.add(giftImg3);
|
||||
|
||||
honorImg1 = findViewById(R.id.honorImg1);
|
||||
honorImg2 = findViewById(R.id.honorImg2);
|
||||
honorImg3 = findViewById(R.id.honorImg3);
|
||||
honorImgViewList = new ArrayList<>();
|
||||
honorImgViewList.add(honorImg1);
|
||||
honorImgViewList.add(honorImg2);
|
||||
honorImgViewList.add(honorImg3);
|
||||
|
||||
userPresidentLayout = findViewById(R.id.userPresidentLayout);
|
||||
userPresidentName = findViewById(R.id.userPresidentName);
|
||||
itemLayout01 = findViewById(R.id.itemLayout01);
|
||||
itemLayout02 = findViewById(R.id.itemLayout02);
|
||||
itemLayout03 = findViewById(R.id.itemLayout03);
|
||||
itemLayout04 = findViewById(R.id.itemLayout04);
|
||||
communityRecyclerView = findViewById(R.id.communityRecyclerView);
|
||||
myFlowTag = findViewById(R.id.myFlowTag);
|
||||
avatar = findViewById(R.id.avatar);
|
||||
userName = findViewById(R.id.name);
|
||||
fansCount = findViewById(R.id.fansCount);
|
||||
likeCount = findViewById(R.id.likeCount);
|
||||
followLayout = findViewById(R.id.followLayout);
|
||||
followName = findViewById(R.id.followName);
|
||||
followIcon = findViewById(R.id.followIcon);
|
||||
userId = findViewById(R.id.userId);
|
||||
userStatus = findViewById(R.id.userStatus);
|
||||
userStatusIcon = findViewById(R.id.userStatusIcon);
|
||||
user_sex = findViewById(R.id.user_sex);
|
||||
|
||||
levelIcon = findViewById(R.id.levelIcon);
|
||||
authorIcon = findViewById(R.id.authorlIcon);
|
||||
|
||||
authenticationLayout = findViewById(R.id.authenticationLayout);
|
||||
signature = findViewById(R.id.signature);
|
||||
moreLayout = findViewById(R.id.moreLayout);
|
||||
moreText = findViewById(R.id.moreText);
|
||||
moreIcon = findViewById(R.id.moreIcon);
|
||||
|
||||
mBanner = findViewById(R.id.banner);
|
||||
imgsRecyclerView = findViewById(R.id.imgsRecyclerView);
|
||||
|
||||
communityRecyclerView = findViewById(R.id.communityRecyclerView);
|
||||
communityRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
communityRecyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
|
||||
findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
followLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
CommonHttpUtil.setAttention(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()), new CommonCallback<Integer>() {
|
||||
@Override
|
||||
public void callback(Integer isAttention) {
|
||||
if (isAttention == 1) {
|
||||
ImgLoader.display(UserHomeActivity.this, R.mipmap.icon_like_followed, followIcon);
|
||||
followName.setText("已关注");
|
||||
followName.setTextColor(Color.parseColor("#777777"));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type_1));
|
||||
} else {
|
||||
ImgLoader.display(UserHomeActivity.this, R.mipmap.icon_like_follow, followIcon);
|
||||
followName.setText("关注");
|
||||
followName.setTextColor(getResources().getColor(R.color.white));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
moreLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (isShowcase) {
|
||||
if (isAnchor) {
|
||||
itemLayout01.setVisibility(View.GONE);
|
||||
itemLayout02.setVisibility(View.GONE);
|
||||
itemLayout03.setVisibility(View.GONE);
|
||||
itemLayout04.setVisibility(View.GONE);
|
||||
} else {
|
||||
itemLayout03.setVisibility(View.GONE);
|
||||
itemLayout04.setVisibility(View.GONE);
|
||||
}
|
||||
moreText.setText("查看更多");
|
||||
ImgLoader.display(mContext, R.mipmap.icon_down, moreIcon);
|
||||
} else {
|
||||
if (isAnchor) {
|
||||
itemLayout01.setVisibility(View.VISIBLE);
|
||||
itemLayout02.setVisibility(View.VISIBLE);
|
||||
itemLayout03.setVisibility(View.VISIBLE);
|
||||
itemLayout04.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
itemLayout01.setVisibility(View.GONE);
|
||||
itemLayout02.setVisibility(View.GONE);
|
||||
}
|
||||
moreText.setText("收起");
|
||||
ImgLoader.display(mContext, R.mipmap.icon_up, moreIcon);
|
||||
}
|
||||
isShowcase = !isShowcase;
|
||||
}
|
||||
});
|
||||
findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
scrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
|
||||
@Override
|
||||
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
|
||||
int height = (int) (topImgLayout.getMeasuredHeight() * 1.2);
|
||||
if (scrollY <= 0) {
|
||||
//滑动之前,标题栏布局背景颜色为完全透明,标题文字完全透明
|
||||
topLayout.setBackgroundColor(Color.argb(0, 0, 0, 0));
|
||||
topName.setTextColor(Color.argb(0, 255, 255, 255));
|
||||
//让mScrollView滑动的距离在0~height之间时颜色发生渐变
|
||||
} else if (scrollY > 0 && scrollY <= height) {
|
||||
//获取渐变率
|
||||
float scale = (float) scrollY / height;
|
||||
//获取渐变数值
|
||||
float alpha = (255 * scale);
|
||||
//布局文本颜色逐渐发生变化
|
||||
topLayout.setBackgroundColor(Color.argb((int) alpha, 0, 0, 0));
|
||||
topName.setTextColor(Color.argb((int) alpha, 255, 255, 255));
|
||||
} else {
|
||||
//当滑动距离超过height,布局文本颜色完全不透明
|
||||
topLayout.setBackgroundColor(Color.argb(255, 0, 0, 0));
|
||||
topName.setTextColor(Color.argb(255, 255, 255, 255));
|
||||
}
|
||||
}
|
||||
});
|
||||
topLayout.setBackgroundColor(Color.argb(0, 0, 0, 0));
|
||||
topName.setTextColor(Color.argb(0, 255, 255, 255));
|
||||
}
|
||||
imgUp.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (bannerImgList.size() < 9) {
|
||||
selectImg();
|
||||
}
|
||||
}
|
||||
});
|
||||
bottomEditLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
RouteUtil.forwardEditProfileActivity();
|
||||
}
|
||||
});
|
||||
findViewById(R.id.setting).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
SparseArray<String> array = new SparseArray<>();
|
||||
array.append(1, "不感兴趣");
|
||||
array.append(0, "举报");
|
||||
array.append(2, "加入黑名单");
|
||||
DialogUitl.showStringArrayDialog(UserHomeActivity.this, array, new DialogUitl.StringArrayDialogCallback() {
|
||||
@Override
|
||||
public void onItemClick(String text, int tag) {
|
||||
if (tag == 0) {
|
||||
CommonHttpUtil.noInterest(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()), new com.yunbao.common.http.HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
});
|
||||
} else if (tag == 1) {
|
||||
RouteUtil.forwardLiveReportActivity(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()));
|
||||
} else {
|
||||
RouteUtil.forwardLiveReportActivity(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void selectImg() {
|
||||
String permission1 = Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||
String permission2 = Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
permission1 = Manifest.permission.READ_MEDIA_IMAGES;
|
||||
permission2 = Manifest.permission.READ_MEDIA_VIDEO;
|
||||
}
|
||||
int isPermission1 = ContextCompat.checkSelfPermission(mContext, permission1);
|
||||
int isPermission2 = ContextCompat.checkSelfPermission(mContext, permission2);
|
||||
if (isPermission1 == PackageManager.PERMISSION_GRANTED && isPermission2 == PackageManager.PERMISSION_GRANTED) {
|
||||
openImageChooserActivity();
|
||||
} else {
|
||||
//申请权限
|
||||
ActivityCompat.requestPermissions(UserHomeActivity.this, new String[]{permission1, permission2}, PERMISSION_REQUEST_CODE_IMG);
|
||||
}
|
||||
}
|
||||
|
||||
private void openImageChooserActivity() {
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.setType("image/*");
|
||||
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, false);
|
||||
startActivityForResult(intent, CHOOSE_IMG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
if (requestCode == PERMISSION_REQUEST_CODE_IMG) {
|
||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
openImageChooserActivity();
|
||||
} else {
|
||||
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE_IMG);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getUseData() {
|
||||
LiveNetManager.get(mContext).getUserHomeInfo(uid, new HttpCallback<HomeUserInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(HomeUserInfoBean data) {
|
||||
initData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
LiveNetManager.get(mContext).getUserExhibitInfoInfo(uid, new HttpCallback<HomeUserExhibitInfoBean>() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void onSuccess(HomeUserExhibitInfoBean data) {
|
||||
//主播粉丝团
|
||||
if (data.getUserHomeTopInfo().getFans().getList() != null) {
|
||||
if (data.getUserHomeTopInfo().getFans().getList().size() >= 3) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getFans().getList().get(i).getAvatar(), fansImgViewList.get(i));
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < data.getUserHomeTopInfo().getFans().getList().size(); i++) {
|
||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getFans().getList().get(i).getAvatar(), fansImgViewList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
//主播守护团
|
||||
if (data.getUserHomeTopInfo().getGuard() != null) {
|
||||
if (data.getUserHomeTopInfo().getGuard().size() >= 3) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getGuard().get(i).getAvatar(), guardImgViewList.get(i));
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < data.getUserHomeTopInfo().getGuard().size(); i++) {
|
||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getGuard().get(i).getAvatar(), guardImgViewList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
//礼物墙
|
||||
if (data.getGiftAlreadyWall().getGift_wall() != null) {
|
||||
if (data.getGiftAlreadyWall().getGift_wall().size() >= 3) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ImgLoader.display(mContext, data.getGiftAlreadyWall().getGift_wall().get(i).getGifticon(), giftImgViewList.get(i));
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < data.getGiftAlreadyWall().getGift_wall().size(); i++) {
|
||||
ImgLoader.display(mContext, data.getGiftAlreadyWall().getGift_wall().get(i).getGifticon(), giftImgViewList.get(i));
|
||||
}
|
||||
}
|
||||
giftCount.setText(data.getGiftAlreadyWall().getGift_wall().size() + "/36");
|
||||
}
|
||||
//荣誉墙
|
||||
if (data.getUserHomeTopInfo().getDress() != null) {
|
||||
if (data.getUserHomeTopInfo().getDress().size() >= 3) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getDress().get(i).getDisplay_src(), honorImgViewList.get(i));
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < data.getUserHomeTopInfo().getDress().size(); i++) {
|
||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getDress().get(i).getDisplay_src(), honorImgViewList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK && requestCode == CHOOSE_IMG) {
|
||||
// 获取用户选择的图片 URI
|
||||
Uri[] imageUris = null;
|
||||
if (data != null) {
|
||||
imageUris = new Uri[]{data.getData()};
|
||||
File file = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, imageUris[0])));
|
||||
uploadFile(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void uploadFile(File file) {
|
||||
if (mUploadStrategy == null) {
|
||||
mUploadStrategy = new UploadQnImpl(mContext);
|
||||
}
|
||||
List<UploadBean> uploadBeans = new ArrayList<>();
|
||||
UploadBean upVideoBean = new UploadBean(file, UploadBean.IMG);
|
||||
uploadBeans.add(upVideoBean);
|
||||
mUploadStrategy.upload(uploadBeans, true, new UploadCallback() {
|
||||
@Override
|
||||
public void onFinish(List<UploadBean> list, boolean success) {
|
||||
if (!success) {
|
||||
return;
|
||||
}
|
||||
bannerImgList.add("https://downs.yaoulive.com/" + list.get(0).getRemoteAccessUrl());
|
||||
uploadImg(true);
|
||||
L.e(new Gson().toJson(list));
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
private void uploadImg(boolean isUp) {
|
||||
CommonHttpUtil.uploadUserInfoImg(new Gson().toJson(bannerImgList), new com.yunbao.common.http.HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info != null) {
|
||||
if (isUp) {
|
||||
ToastUtil.show("上传成功");
|
||||
} else {
|
||||
ToastUtil.show("删除成功");
|
||||
}
|
||||
mBanner.setPages(bannerImgList, new UserHomeImgsViewHolder()).start();
|
||||
tempList = new ArrayList<>();
|
||||
for (int i = 0; i < bannerImgList.size(); i++) {
|
||||
tempList.add(new UserHomeImgBean(bannerImgList.get(i)));
|
||||
}
|
||||
if (tempList.size() > 0) {
|
||||
tempList.get(0).setShow(true);
|
||||
}
|
||||
userHomeImgAdapter.setCommentBeanList(tempList);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private File uri2File(Uri uri) {
|
||||
String img_path;
|
||||
String[] proj = {MediaStore.Images.Media.DATA};
|
||||
Cursor actualimagecursor = this.managedQuery(uri, proj, null, null, null);
|
||||
if (actualimagecursor == null) {
|
||||
img_path = uri.getPath();
|
||||
} else {
|
||||
int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||
actualimagecursor.moveToFirst();
|
||||
img_path = actualimagecursor.getString(actual_image_column_index);
|
||||
}
|
||||
File file = new File(img_path);
|
||||
return file;
|
||||
}
|
||||
}
|
||||
@@ -103,6 +103,15 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
}
|
||||
});
|
||||
report1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (onItemClickListener != null) {
|
||||
CommentBean.ReplyComment bean = (CommentBean.ReplyComment) v.getTag();
|
||||
onItemClickListener.onReport(bean);
|
||||
}
|
||||
}
|
||||
});
|
||||
replyTextView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -135,6 +144,7 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void setData(CommentBean bean) {
|
||||
del.setTag(bean);
|
||||
del1.setTag(bean);
|
||||
report.setTag(bean);
|
||||
replyTextView.setTag(bean);
|
||||
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
||||
@@ -153,6 +163,7 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
||||
if (bean.getReplyCommentList() != null) {
|
||||
replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>");
|
||||
if (bean.getReplyCommentList().size() > 0) {
|
||||
report1.setTag(bean.getReplyCommentList().get(0));
|
||||
del1.setTag(bean.getReplyCommentList().get(0));
|
||||
replyContent.setText(bean.getReplyCommentList().get(0).getContent());
|
||||
ImgLoader.display(itemView.getContext(), bean.getReplyCommentList().get(0).getUser_avatar(), mAvatar01);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class CommentVideoAdapter extends RefreshAdapter<CommentBean> {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
public CommentVideoAdapter(Context content, String authorId,CommentVideoAdapter.onItemClickListener onItemClickListener ) {
|
||||
public CommentVideoAdapter(Context content, String authorId, CommentVideoAdapter.onItemClickListener onItemClickListener) {
|
||||
super(content);
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
this.mContext = content;
|
||||
@@ -94,6 +94,15 @@ public class CommentVideoAdapter extends RefreshAdapter<CommentBean> {
|
||||
author = itemView.findViewById(R.id.author);
|
||||
del1 = itemView.findViewById(R.id.del1);
|
||||
report1 = itemView.findViewById(R.id.report1);
|
||||
report1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (onItemClickListener != null) {
|
||||
CommentBean.ReplyComment bean = (CommentBean.ReplyComment) v.getTag();
|
||||
onItemClickListener.onReport(bean);
|
||||
}
|
||||
}
|
||||
});
|
||||
report.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -135,8 +144,10 @@ public class CommentVideoAdapter extends RefreshAdapter<CommentBean> {
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void setData(CommentBean bean) {
|
||||
del.setTag(bean);
|
||||
report1.setTag(bean);
|
||||
report.setTag(bean);
|
||||
replyTextView.setTag(bean);
|
||||
del1.setTag(bean);
|
||||
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
||||
name.setText(bean.getUser_name());
|
||||
content.setText(bean.getContent());
|
||||
|
||||
@@ -36,7 +36,7 @@ public class LabelTagAdapter extends BaseTagAdapter<String, TextView> {
|
||||
|
||||
@Override
|
||||
protected void convert(TextView textView, String item, int position) {
|
||||
textView.setText(item);
|
||||
textView.setText("#"+item);
|
||||
}
|
||||
|
||||
public interface OnSureOnClickListener {
|
||||
|
||||
76
common/src/main/java/com/yunbao/common/bean/CareerBean.java
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class FirstLoginBean extends BaseModel{
|
||||
@SerializedName("status")
|
||||
int status=-1;//0是第一次登陸,1是已經登錄過的
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
@@ -256,7 +256,9 @@ public class IMLoginModel extends BaseModel {
|
||||
@SerializedName("guard_type")
|
||||
private String guardType = "";
|
||||
@SerializedName("isAttention")
|
||||
private int attention;
|
||||
private int attention;//1被关注 2已关注 3互关 0没关系
|
||||
@SerializedName("type")
|
||||
private String type;
|
||||
|
||||
public int getAttention() {
|
||||
return attention;
|
||||
@@ -270,6 +272,14 @@ public class IMLoginModel extends BaseModel {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public IMLoginModel setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
return this;
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
public class MessageSayHiStartBean extends BaseModel{
|
||||
@SerializedName("time")
|
||||
private int nextTime;
|
||||
|
||||
private int status;
|
||||
public int getNextTime() {
|
||||
return nextTime;
|
||||
}
|
||||
@@ -13,4 +13,20 @@ public class MessageSayHiStartBean extends BaseModel{
|
||||
public void setNextTime(int nextTime) {
|
||||
this.nextTime = nextTime;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MessageSayHiStartBean{" +
|
||||
"nextTime=" + nextTime +
|
||||
", status=" + status +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;//0 在线 非0 其他
|
||||
|
||||
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;
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.yunbao.common.bean;
|
||||
public class NewCommunityType extends BaseModel {
|
||||
private int id;
|
||||
private String talk_name;
|
||||
private String talk_name_en;
|
||||
private String img;
|
||||
private String is_hot;
|
||||
private String hot_time;
|
||||
@@ -11,13 +12,12 @@ public class NewCommunityType extends BaseModel {
|
||||
public NewCommunityType() {
|
||||
}
|
||||
|
||||
public NewCommunityType(int id, String talk_name, String img, String is_hot, String hot_time, String sort) {
|
||||
this.id = id;
|
||||
this.talk_name = talk_name;
|
||||
this.img = img;
|
||||
this.is_hot = is_hot;
|
||||
this.hot_time = hot_time;
|
||||
this.sort = sort;
|
||||
public String getTalk_name_en() {
|
||||
return talk_name_en;
|
||||
}
|
||||
|
||||
public void setTalk_name_en(String talk_name_en) {
|
||||
this.talk_name_en = talk_name_en;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
|
||||
@@ -94,8 +94,8 @@ public class InstructorOperationDialog extends AbsDialogFragment {
|
||||
mRootView.findViewById(R.id.to_msg).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
EventBus.getDefault().post(new InstructorOperationEvent());
|
||||
dismiss();
|
||||
EventBus.getDefault().post(new InstructorOperationEvent());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,14 +52,14 @@ public class MessageLongClickPopuwindow implements View.OnClickListener {
|
||||
Log.e("MessageLongClick ", "currentTimeMillis:" + System.currentTimeMillis());
|
||||
Log.e("MessageLongClick ", "秒:" + ((System.currentTimeMillis() - sentTime) / 1000));
|
||||
//超过俩分钟无法撤回
|
||||
if (((System.currentTimeMillis() - sentTime) / 1000) > 120) {
|
||||
/* if (((System.currentTimeMillis() - sentTime) / 1000) > 120) {
|
||||
withdrawLinear.setVisibility(View.GONE);
|
||||
}
|
||||
//只可以撤回自己的消息
|
||||
IMLoginModel model = IMLoginManager.get(mContext).getUserInfo();
|
||||
if (!message.getSenderUserId().equals(String.valueOf(model.getId()))) {
|
||||
withdrawLinear.setVisibility(View.GONE);
|
||||
}
|
||||
}*/
|
||||
//非文字信息无法复制
|
||||
if (!message.getObjectName().equals("RC:TxtMsg")) {
|
||||
copyLinear.setVisibility(View.GONE);
|
||||
@@ -106,7 +106,8 @@ public class MessageLongClickPopuwindow implements View.OnClickListener {
|
||||
copyMethod();
|
||||
popupWindow.dismiss();
|
||||
} else if (id == R.id.withdraw_linear) {//撤回
|
||||
withdrawMethod();
|
||||
// withdrawMethod();
|
||||
delete();
|
||||
popupWindow.dismiss();
|
||||
} else if (id == R.id.quote_linear) {//引用
|
||||
List<MessageItemLongClickAction> messageItemLongClickActionList = MessageItemLongClickActionManager.getInstance().getMessageItemLongClickActions();
|
||||
@@ -115,6 +116,20 @@ public class MessageLongClickPopuwindow implements View.OnClickListener {
|
||||
|
||||
}
|
||||
|
||||
private void delete() {
|
||||
IMCenter.getInstance().deleteMessages(message.getConversationType(), message.getTargetId(), new int[]{message.getMessageId()}, new RongIMClient.ResultCallback<Boolean>() {
|
||||
@Override
|
||||
public void onSuccess(Boolean aBoolean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void copyMethod() {
|
||||
//文字消息支持复制
|
||||
if (message.getContent() instanceof TextMessage) {
|
||||
|
||||
@@ -76,9 +76,9 @@ public class MessageSayHiNotifyDialog extends AbsDialogCenterPopupWindow {
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
super.onDismiss();
|
||||
if (onDismissListener != null) {
|
||||
/*if (onDismissListener != null) {
|
||||
onDismissListener.onItemClick(userInfoBean.getUser().getId() + "", isSayHi ? 2 : 1);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
boolean isSayHi = false;
|
||||
@@ -93,15 +93,19 @@ public class MessageSayHiNotifyDialog extends AbsDialogCenterPopupWindow {
|
||||
sendMsg(userInfoBean.getSayHiMsg());
|
||||
dismiss();
|
||||
});
|
||||
avatar = findViewById(R.id.avatar);
|
||||
/* avatar = findViewById(R.id.avatar);
|
||||
anchorName = findViewById(R.id.anchorName);
|
||||
ImgLoader.display(mContext, userInfoBean.getUser().getAvatar(), avatar);
|
||||
anchorName.setText(userInfoBean.getUser().getUserNicename());
|
||||
((TextView) findViewById(R.id.description)).setText(userInfoBean.getUser().getSignature());
|
||||
ViewUtils.findViewById(findViewById(R.id.age), R.id.tag, TextView.class).setText(String.format("%s%s",
|
||||
// ((TextView) findViewById(R.id.description)).setText(userInfoBean.getUser().getSignature());
|
||||
((TextView) findViewById(R.id.description)).setText(WordUtil.isNewZh()?"他就在你附近,來看看~":"He is near you, come and see~");
|
||||
ViewUtils.findViewById(findViewById(R.id.age), R.id.tag, TextView.class).setText(String.format("%s%s%s",
|
||||
WordUtil.getNewString(R.string.dialog_message_say_hi_age)
|
||||
, userInfoBean.getInfo().getAge()));
|
||||
showTag();
|
||||
, userInfoBean.getInfo().getAge()
|
||||
,WordUtil.isNewZh()?"歲":"years old"
|
||||
)
|
||||
);
|
||||
showTag();*/
|
||||
}
|
||||
|
||||
private void showTag() {
|
||||
|
||||
@@ -618,7 +618,7 @@ public class CommonHttpUtil {
|
||||
* 动态-不感兴趣
|
||||
*/
|
||||
public static void noInterest(String uid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.setBlack", "User.setBlack")
|
||||
HttpClient.getInstance().get("Pdluser.setBlack", "User.setBlack")
|
||||
.params("touid", uid)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -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,31 @@ 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(
|
||||
);
|
||||
@GET("/api/public/?service=Pdlinfos.getIsLive")
|
||||
Observable<ResponseModel<List<Integer>>> getUserLiveStatus(
|
||||
@Query("ids")String ids
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -3231,14 +3233,14 @@ public class LiveNetManager {
|
||||
String user_nicename,
|
||||
String avatar,
|
||||
String birthday,
|
||||
HttpCallback<List<BaseModel>> callback) {
|
||||
HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.initUserInfo(sex, user_nicename, avatar, birthday)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(roomMicStatusModelResponseModel -> {
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
|
||||
callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.getData().getMsg()));
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
@@ -3406,6 +3408,139 @@ 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();
|
||||
}
|
||||
public void getUserLiveStatus(String ids,HttpCallback<List<Integer>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getUserLiveStatus(ids)
|
||||
.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);
|
||||
|
||||
@@ -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,7 +33,14 @@ 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>() {
|
||||
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) {
|
||||
if (listener != null) {
|
||||
@@ -40,11 +49,10 @@ public class MessageChatCardContent extends MessageContent implements Parcelable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
public void onError(Message message, RongIMClient.ErrorCode e) {
|
||||
if (listener != null) {
|
||||
listener.onError(e.code, e.msg);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,13 +1,28 @@
|
||||
package com.yunbao.common.provider;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.Spannable;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
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.http.live.LiveNetManager;
|
||||
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.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.conversation.messgelist.provider.BaseMessageItemProvider;
|
||||
@@ -21,34 +36,88 @@ 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());
|
||||
}else if("0".equals(content.getType())){
|
||||
RouteUtil.forwardCommunity(content.getExtraData());
|
||||
}else if("2".equals(content.getType())){
|
||||
LiveNetManager.get(mContext).getDynamicInfo(content.getExtraData(), new com.yunbao.common.http.base.HttpCallback<ActiveBean>() {
|
||||
@Override
|
||||
public void onSuccess(ActiveBean data) {
|
||||
RouteUtil.forwardVideoPlayActivity(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,6 +188,7 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
||||
|
||||
void setData(ActiveImageBean bean, int position) {
|
||||
itemView.setTag(position);
|
||||
del.setTag(position);
|
||||
if (bean.getImageFile() == null) {
|
||||
mImg.setImageDrawable(null);
|
||||
if (mIconAdd.getVisibility() != View.VISIBLE) {
|
||||
|
||||
@@ -13,6 +13,7 @@ import java.util.List;
|
||||
public class MessageChatNotifyManager {
|
||||
private static MessageChatNotifyManager instance;
|
||||
private List<MessageUserInfoBean> startListNotifyList = new ArrayList<>();
|
||||
List<String> clazzList = new ArrayList<>();
|
||||
|
||||
public static MessageChatNotifyManager getInstance() {
|
||||
if (instance == null) {
|
||||
@@ -21,6 +22,12 @@ public class MessageChatNotifyManager {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void addShieldClass(Class<?> clazz) {
|
||||
if (!clazzList.contains(clazz.getSimpleName())) {
|
||||
clazzList.add(clazz.getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
public void push(Context mContext, MessageUserInfoBean userInfo) {
|
||||
if (startListNotifyList.isEmpty()) {
|
||||
startListNotifyList.add(userInfo);
|
||||
@@ -31,6 +38,11 @@ public class MessageChatNotifyManager {
|
||||
}
|
||||
|
||||
private void notifyLiveFlot(Context mContext) {
|
||||
String simpleName = AppManager.getInstance().getLastActivity().getClass().getSimpleName();
|
||||
if (clazzList.contains(simpleName)) {
|
||||
ToastUtil.showDebug("屏蔽类,不展示");
|
||||
return;
|
||||
}
|
||||
if (startListNotifyList.iterator().hasNext()) {
|
||||
MessageUserInfoBean bean = startListNotifyList.iterator().next();
|
||||
new MessageChatNotifyDialog(AppManager.getInstance().getLastActivity(), bean).setOnDismissListener(dialog -> {
|
||||
|
||||
@@ -47,6 +47,10 @@ public class MessageSayHiNotifyManager {
|
||||
.getMessageSayHiStartTimer(new HttpCallback<MessageSayHiStartBean>() {
|
||||
@Override
|
||||
public void onSuccess(MessageSayHiStartBean data) {
|
||||
if(data.getStatus()==0){
|
||||
Log.i(TAG, "onSuccess: 初始化定时器,定时器关:" + data.toString());
|
||||
return;
|
||||
}
|
||||
timer = new Timer();
|
||||
timer.schedule(createTask(), data.getNextTime() * 1000L);
|
||||
hiBean = new MessageSayHiBean();
|
||||
@@ -72,11 +76,15 @@ public class MessageSayHiNotifyManager {
|
||||
.getMessageSayHiTimer(new HttpCallback<MessageSayHiBean>() {
|
||||
@Override
|
||||
public void onSuccess(MessageSayHiBean data) {
|
||||
if (data.getStatus() == 0) {
|
||||
if (data.getStatus() == -1) {
|
||||
Log.i(TAG, "onSuccess: 定时器为关,不再轮训");
|
||||
return;
|
||||
}
|
||||
data.setNextTime(RandomUtil.nextInt(30));
|
||||
if(data.getStatus()==0){
|
||||
timer = new Timer();
|
||||
timer.schedule(createTask(), data.getNextTime() * 1000L);
|
||||
return;
|
||||
}
|
||||
hiBean = data;
|
||||
showDialog(data);
|
||||
}
|
||||
@@ -195,7 +203,7 @@ public class MessageSayHiNotifyManager {
|
||||
private void notifyLiveFlot(Context mContext) {
|
||||
if (startListNotifyList.iterator().hasNext()) {
|
||||
MessageUserInfoBean bean = startListNotifyList.iterator().next();
|
||||
new MessageChatNotifyDialog(AppManager.getInstance().getLastActivity(), bean).setOnDismissListener(dialog -> {
|
||||
new MessageSayHiNotifyDialog(AppManager.getInstance().getLastActivity(), bean).setOnDismissListener((bean1, position) -> {
|
||||
startListNotifyList.remove(bean);
|
||||
if (startListNotifyList.iterator().hasNext()) {
|
||||
notifyLiveFlot(mContext);
|
||||
|
||||
@@ -10,10 +10,12 @@ import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.HtmlConfig;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.RedPacketListBean;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
@@ -51,14 +53,16 @@ public class RouteUtil {
|
||||
public static final String PATH_SudGameActivity = "/live/SudGameActivity";
|
||||
public static final String PATH_COMMUNITY_Activity = "/main/MainHomeCommunityActivity";
|
||||
public static final String PATH_VIDEO_ACTIVITY = "/activity/VideoPlayActivity";
|
||||
public static final String PATH_COMMUNITY = "/common/CommunityDetailsActivity";
|
||||
public static final String PATH_USER_HOME = "/common/UserHomeActivity";
|
||||
public static final String PATH_COMMUNITY = "/main/CommunityDetailsActivity";
|
||||
public static final String PATH_USER_HOME = "/main/UserHomeActivity";
|
||||
public static final String PATH_VIDEO_PLAY = "/video/VideoPlayActivity";
|
||||
|
||||
public static void forwardUserHome(String uid) {
|
||||
ARouter.getInstance().build(PATH_USER_HOME)
|
||||
.withString(Constants.TO_UID, uid)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
public static void forwardCommunity(String id) {
|
||||
ARouter.getInstance().build(PATH_COMMUNITY)
|
||||
.withString(Constants.TO_COMMUNITY_ID, id)
|
||||
@@ -68,6 +72,7 @@ public class RouteUtil {
|
||||
public static void forwardVideoActivity() {
|
||||
|
||||
}
|
||||
|
||||
public static final String PATH_ADDRESSBOOK = "/main/MsgAddressBookActivity";
|
||||
|
||||
|
||||
@@ -153,14 +158,17 @@ public class RouteUtil {
|
||||
* 跳转到个人主页
|
||||
*/
|
||||
public static void forwardMainUserHome(Context context, String toUid, boolean fromLiveRoom, String fromLiveUid, int intoIndex) {
|
||||
String url = HtmlConfig.PERSONAL + "?touid=" + toUid + "&isHomePage=1" + "&fromType=0";
|
||||
ARouter.getInstance().build(PATH_USER_HOME)
|
||||
.withString(Constants.TO_UID, toUid)
|
||||
.navigation();
|
||||
/* String url = HtmlConfig.PERSONAL + "?touid=" + toUid + "&isHomePage=1" + "&fromType=0";
|
||||
if (!"".equals(Constants.chatActionUrl)) {
|
||||
url = Constants.chatActionUrl;
|
||||
}
|
||||
Constants.myUrl = url + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&t=" + System.currentTimeMillis() + "&isZh=" + ((IMLoginManager.get(context).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
|
||||
ARouter.getInstance().build(PATH_MYWEBVIEWACTIVTITY)
|
||||
.withString(Constants.URL, url)
|
||||
.navigation();
|
||||
.navigation();*/
|
||||
}
|
||||
|
||||
|
||||
@@ -393,4 +401,11 @@ public class RouteUtil {
|
||||
public static void forwardActivity(String path) {
|
||||
ARouter.getInstance().build(path).navigation();
|
||||
}
|
||||
|
||||
public static void forwardVideoPlayActivity(ActiveBean bean) {
|
||||
ARouter.getInstance().build(PATH_VIDEO_PLAY)
|
||||
.withParcelable("ActiveBean", bean)
|
||||
.withString(Constants.VIDEO_KEY, Constants.VIDEO_SINGLE)
|
||||
.navigation();
|
||||
}
|
||||
}
|
||||
|
||||
BIN
common/src/main/res/drawable-xhdpi/rc_ic_bubble_right.9.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
@@ -28,12 +28,29 @@
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
<RelativeLayout
|
||||
android:layout_width="68dp"
|
||||
android:layout_height="68dp"
|
||||
android:src="@mipmap/icon_data_empty"
|
||||
app:riv_corner_radius="20dp" />
|
||||
android:layout_height="80dp">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:padding="1dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<pl.droidsonroids.gif.GifImageView
|
||||
android:id="@+id/liveStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:src="@mipmap/icon_liveing"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
@@ -81,7 +98,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="关注"
|
||||
android:text="@string/follow"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -149,6 +166,7 @@
|
||||
android:textSize="12dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/share"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@mipmap/icon_share_new" />
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="请输入200字以内的文字"
|
||||
android:text="@string/_200"
|
||||
android:textColor="#333333" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -50,7 +50,7 @@
|
||||
android:layout_marginBottom="15dp"
|
||||
android:background="@color/white"
|
||||
android:gravity="start"
|
||||
android:hint="写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么..."
|
||||
android:hint="@string/video_say_something"
|
||||
android:maxEms="200"
|
||||
android:maxLength="200"
|
||||
android:textSize="14dp" />
|
||||
@@ -112,7 +112,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="图文"
|
||||
android:text="@string/pricture"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14dp" />
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="视频"
|
||||
android:text="@string/video"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14dp" />
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:text="选择话题"
|
||||
android:text="@string/choose_topic"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -218,7 +218,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:text="选择时间"
|
||||
android:text="@string/send_active_time"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -229,7 +229,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_weight="1"
|
||||
android:text="立即发表"
|
||||
android:text="@string/now_send"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12dp" />
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@mipmap/main_bg"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.yunbao.common.views.MyScrollview
|
||||
@@ -112,11 +112,11 @@
|
||||
android:id="@+id/liveStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:visibility="gone"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:src="@mipmap/icon_liveing_cn" />
|
||||
android:src="@mipmap/icon_liveing"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -169,11 +169,10 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="粉丝"
|
||||
android:text="@string/fans"
|
||||
android:textColor="#777777"
|
||||
android:textSize="12dp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -195,25 +194,25 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="获赞"
|
||||
android:text="@string/praise"
|
||||
android:textColor="#777777"
|
||||
android:textSize="12dp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/followLayout"
|
||||
android:layout_width="80dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:background="@drawable/bg_main_com_type"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/followIcon"
|
||||
@@ -226,7 +225,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="关注"
|
||||
android:text="@string/focus_on"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -256,7 +255,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="在线"
|
||||
android:text="@string/activity_msg_chat_top_status_online"
|
||||
android:textColor="#777777"
|
||||
android:textSize="10dp" />
|
||||
|
||||
@@ -312,7 +311,7 @@
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="27dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="工会"
|
||||
android:text="@string/trade_union"
|
||||
android:textColor="#F65BBB"
|
||||
android:textSize="12dp" />
|
||||
|
||||
@@ -323,7 +322,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone">
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
@@ -335,7 +334,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="真人认证"
|
||||
android:text="@string/real_person"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12dp" />
|
||||
|
||||
@@ -378,7 +377,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="主播粉絲團"
|
||||
android:text="@string/user_home_anchor"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -387,7 +386,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="粉絲團名稱"
|
||||
android:text="@string/fan_group_name"
|
||||
android:textColor="#777777"
|
||||
android:textSize="14dp" />
|
||||
|
||||
@@ -485,7 +484,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="主播守護團"
|
||||
android:text="@string/fan_group_name"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -584,7 +583,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="礼物墙"
|
||||
android:text="@string/gift_wall"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -652,7 +651,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="榮譽墻"
|
||||
android:text="@string/wall_honor"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -703,7 +702,7 @@
|
||||
android:id="@+id/moreText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="查看更多"
|
||||
android:text="@string/see_more"
|
||||
android:textColor="#FF4874"
|
||||
android:textSize="13dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -720,7 +719,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
@@ -744,7 +742,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="个人动态"
|
||||
android:text="@string/commen_user_active"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -827,7 +825,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:text="编辑资料"
|
||||
android:text="@string/edit_profile"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_item_comment"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="10dp"
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:padding="10dp"
|
||||
android:text="回复"
|
||||
android:text="@string/dialog_message_chat_notify_btn"
|
||||
android:textColor="#777777"
|
||||
android:textSize="11dp" />
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:padding="10dp"
|
||||
android:text="举报"
|
||||
android:text="@string/chat_report"
|
||||
android:textColor="#333333"
|
||||
android:textSize="11dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -171,7 +171,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:padding="10dp"
|
||||
android:text="举报"
|
||||
android:text="@string/chat_report"
|
||||
android:textColor="#333333"
|
||||
android:textSize="11dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
63
common/src/main/res/layout/view_message_chat_card.xml
Normal 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>
|
||||
@@ -10,24 +10,25 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/copy_linear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@mipmap/icon_message_copy"
|
||||
|
||||
android:drawablePadding="5dp"
|
||||
android:text="@string/copy"
|
||||
android:textColor="@color/white"
|
||||
@@ -38,18 +39,17 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/withdraw_linear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@mipmap/icon_message_withdraw"
|
||||
android:drawablePadding="5dp"
|
||||
android:text="@string/withdraw"
|
||||
android:text="@string/delete"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
@@ -58,12 +58,12 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/quote_linear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="5dp">
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<include
|
||||
android:id="@+id/age"
|
||||
layout="@layout/view_msg_chat_top_tag"
|
||||
android:layout_width="70dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tag_list_layout"
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
android:paddingLeft="15dp"
|
||||
android:gravity="center"
|
||||
android:paddingRight="15dp"
|
||||
android:text="发布"
|
||||
android:text="@string/send"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
69
common/src/main/res/layout/view_title_not_color.xml
Normal 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>
|
||||
BIN
common/src/main/res/mipmap-b+en+us/icon_img_up_label.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 320 KiB After Width: | Height: | Size: 320 KiB |
|
Before Width: | Height: | Size: 321 KiB After Width: | Height: | Size: 321 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_video_more.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/ic_chat_black.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/ic_chat_remarks.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/ic_chat_report.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
@@ -25,7 +25,8 @@
|
||||
<string name="refresh_footer_nothing">No more data</string>
|
||||
<string name="black">Pull black</string>
|
||||
<string name="black_ing">Relieving blackout</string>
|
||||
<string name="chat_remarks">Remarks</string>
|
||||
<string name="chat_remarks">Modify 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>
|
||||
@@ -145,7 +146,7 @@
|
||||
<string name="live_blowkiss_time">Free for a limited time</string>
|
||||
<string name="live_blowkiss_follow">Follow and reply</string>
|
||||
|
||||
<string name="following">Followed</string>
|
||||
<string name="following">Following</string>
|
||||
<string name="follow_my_follow">My concern</string>
|
||||
<string name="my_black">My Black List</string>
|
||||
<string name="follow_ta_follow">TA\'s attention</string>
|
||||
@@ -254,10 +255,10 @@
|
||||
<string name="login_auth_success">Login successfully</string>
|
||||
<string name="login_auth_failure">privilege grant failed</string>
|
||||
<string name="login_auth_cancle">Authorization cancelled</string>
|
||||
<string name="live">Live broadcast</string>
|
||||
<string name="live">Live</string>
|
||||
<string name="login_tip_4">Log in</string>
|
||||
<string name="shopmall">shopmall</string>
|
||||
<string name="recomment">Recommend</string>
|
||||
<string name="recomment">Hot</string>
|
||||
<string name="main_type_find">Find</string>
|
||||
<string name="cust_server">CSD</string>
|
||||
<string name="live_anchor">Anchor</string>
|
||||
@@ -425,7 +426,7 @@
|
||||
<string name="live_pk_time_2">Penalty time</string>
|
||||
<string name="live_no_data_6">No video</string>
|
||||
<string name="live_no_data_7">Let\'s release our own video</string>
|
||||
<string name="main_home">home page</string>
|
||||
<string name="main_home">Home</string>
|
||||
<string name="main_near">nearby</string>
|
||||
<string name="main_list">Ranking</string>
|
||||
<string name="main_me">My</string>
|
||||
@@ -777,9 +778,11 @@
|
||||
<string name="now_noble_time">Expiration time: </string>
|
||||
|
||||
<string name="black_succer">Successfully joined the blacklist</string>
|
||||
<string name="black_add">Add to blacklist</string>
|
||||
<string name="black_error">Failed to join blacklist</string>
|
||||
|
||||
<string name="black_succer_more">Blacklist removed successfully</string>
|
||||
<string name="black_succer_more">Succeeded in removing the blacklist</string>
|
||||
<string name="black_more">Remove blacklist</string>
|
||||
<string name="black_error_more">Failed to remove blacklist</string>
|
||||
|
||||
<string name="reply">Reply</string>
|
||||
@@ -964,7 +967,7 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="already_collected">Already collected</string>
|
||||
<string name="image_quality_selection">Image quality selection</string>
|
||||
<string name="more_settings">More Settings</string>
|
||||
<string name="moer">view more</string>
|
||||
<string name="moer">see more</string>
|
||||
<string name="gift_way">The gift is on the way...</string>
|
||||
<string name="start_pk">start pk</string>
|
||||
<string name="number_of_remaining_times">Remaining count :%s</string>
|
||||
@@ -1454,11 +1457,14 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="back_community_sure">Sure</string>
|
||||
<string name="activity_msg_chat_input_hint">Say something</string>
|
||||
|
||||
<string name="not_data_message_chat_list">暫無新消息哦~</string>
|
||||
<string name="not_data_message_chat_list_search">暫無搜索結果,換個詞試試吧~~</string>
|
||||
<string name="not_data_message_address_book_list">當前列表為空~</string>
|
||||
<string name="not_data_message_address_book_list_search">暫無搜索結果,換個詞試試吧~</string>
|
||||
<string name="not_data_message_chat_list">No new news yet~</string>
|
||||
<string name="not_data_message_chat_list_search">There are no search results yet. Try using another word~</string>
|
||||
<string name="not_data_message_address_book_list">The current list is empty ~</string>
|
||||
<string name="not_data_message_address_book_list_search">There are no search results yet. Try using another word~</string>
|
||||
<string name="dialog_message_say_hi_age">Age:</string>
|
||||
<string name="dialog_message_say_hi_btn">Say Hi</string>
|
||||
<string name="dialog_message_chat_notify_btn">Reply</string>
|
||||
<string name="activity_msg_chat_top_status_online">Online</string>
|
||||
<string name="activity_msg_chat_top_status_offline">Offline</string>
|
||||
<string name="commen_user_active">Personal updates</string>
|
||||
</resources>
|
||||
|
||||
30
common/src/main/res/values-en-rUS/strings.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="real_person">Real person</string>
|
||||
<string name="trade_union">tradeUnion</string>
|
||||
<string name="set_back">Blocked and cannot be viewed</string>
|
||||
<string name="cancel_back">Cancel blacklist</string>
|
||||
<string name="user_home_img_del_dialog">Are you sure you want to delete the picture?</string>
|
||||
<string name="upload_success">Upload successful</string>
|
||||
<string name="upload_failed">upload failed</string>
|
||||
<string name="_9">Add up to 9 pictures</string>
|
||||
<string name="not_interested">not interested</string>
|
||||
<string name="person_like">people liked it</string>
|
||||
<string name="fan_group_name">Fan group name</string>
|
||||
<string name="user_home_anchor">Anchor fan group</string>
|
||||
<string name="main_active_type_01">Beauty</string>
|
||||
<string name="main_active_type_02">Rookie</string>
|
||||
<string name="main_active_type_03">Figure</string>
|
||||
<string name="main_active_type_04">Live</string>
|
||||
<string name="main_active_type_05">Life</string>
|
||||
<string name="send_active_time">Selection period</string>
|
||||
<string name="now_send">Now</string>
|
||||
<string name="choose_topic">Select topic</string>
|
||||
<string name="pricture">picture</string>
|
||||
<string name="_200">Please enter text within 200 words</string>
|
||||
<string name="time_hour">hour</string>
|
||||
<string name="time_minute">minute</string>
|
||||
<string name="focus_on">Focus on</string>
|
||||
<string name="see_more">See more</string>
|
||||
<string name="close">close</string>
|
||||
</resources>
|
||||
@@ -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>
|
||||
@@ -819,8 +820,10 @@
|
||||
<string name="now_noble">當前貴族: </string>
|
||||
<string name="now_noble_time">到期時間: </string>
|
||||
<string name="black_succer">已加入黑名单</string>
|
||||
<string name="black_add">加入黑名單</string>
|
||||
<string name="black_error">加入黑名单失败</string>
|
||||
<string name="black_succer_more">移除黑名单成功</string>
|
||||
<string name="black_more">移除黑名單</string>
|
||||
<string name="black_error_more">移除黑名单失败</string>
|
||||
|
||||
<string name="reply">回復</string>
|
||||
@@ -1459,4 +1462,34 @@
|
||||
<string name="dialog_message_say_hi_age">年齡:</string>
|
||||
<string name="dialog_message_say_hi_btn">打招呼</string>
|
||||
<string name="dialog_message_chat_notify_btn">回復</string>
|
||||
<string name="commen_user_active">個人動態</string>
|
||||
<string name="real_person">真人認證</string>
|
||||
<string name="trade_union">工会</string>
|
||||
<string name="activity_msg_chat_top_status_online">在線</string>
|
||||
<string name="activity_msg_chat_top_status_offline">離線</string>
|
||||
<string name="set_back">已拉黑,无法查看</string>
|
||||
<string name="cancel_back">取消黑名单</string>
|
||||
<string name="user_home_img_del_dialog">確定刪除圖片?</string>
|
||||
<string name="upload_success">上传成功</string>
|
||||
<string name="upload_failed">删除成功</string>
|
||||
<string name="_9">最多添加9張圖片</string>
|
||||
<string name="not_interested">不感興趣</string>
|
||||
<string name="person_like">人觉得很赞</string>
|
||||
<string name="fan_group_name">主播守護團</string>
|
||||
<string name="user_home_anchor">主播粉絲團</string>
|
||||
<string name="main_active_type_01">美圖</string>
|
||||
<string name="main_active_type_02">新秀</string>
|
||||
<string name="main_active_type_03">身材</string>
|
||||
<string name="main_active_type_04">直播</string>
|
||||
<string name="main_active_type_05">生活</string>
|
||||
<string name="send_active_time">選擇時間</string>
|
||||
<string name="now_send">立即發表</string>
|
||||
<string name="choose_topic">選擇話題</string>
|
||||
<string name="pricture">圖文</string>
|
||||
<string name="_200">请输入200字以内的文字</string>
|
||||
<string name="time_hour">時</string>
|
||||
<string name="time_minute">分</string>
|
||||
<string name="focus_on">關注</string>
|
||||
<string name="see_more">查看更多</string>
|
||||
<string name="close">收起</string>
|
||||
</resources>
|
||||
|
||||
@@ -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>
|
||||
@@ -819,8 +820,10 @@
|
||||
<string name="now_noble">當前貴族: </string>
|
||||
<string name="now_noble_time">到期時間: </string>
|
||||
<string name="black_succer">已加入黑名单</string>
|
||||
<string name="black_add">加入黑名單</string>
|
||||
<string name="black_error">加入黑名单失败</string>
|
||||
<string name="black_succer_more">移除黑名单成功</string>
|
||||
<string name="black_more">移除黑名單</string>
|
||||
<string name="black_error_more">移除黑名单失败</string>
|
||||
|
||||
<string name="reply">回復</string>
|
||||
@@ -1458,5 +1461,35 @@
|
||||
<string name="dialog_message_say_hi_age">年齡:</string>
|
||||
<string name="dialog_message_say_hi_btn">打招呼</string>
|
||||
<string name="dialog_message_chat_notify_btn">回復</string>
|
||||
<string name="commen_user_active">個人動態</string>
|
||||
<string name="real_person">真人認證</string>
|
||||
<string name="trade_union">工会</string>
|
||||
|
||||
<string name="activity_msg_chat_top_status_online">在線</string>
|
||||
<string name="activity_msg_chat_top_status_offline">離線</string>
|
||||
<string name="set_back">已拉黑,无法查看</string>
|
||||
<string name="cancel_back">取消黑名单</string>
|
||||
<string name="user_home_img_del_dialog">確定刪除圖片?</string>
|
||||
<string name="upload_success">上传成功</string>
|
||||
<string name="upload_failed">删除成功</string>
|
||||
<string name="_9">最多添加9張圖片</string>
|
||||
<string name="not_interested">不感興趣</string>
|
||||
<string name="person_like">人觉得很赞</string>
|
||||
<string name="fan_group_name">主播守護團</string>
|
||||
<string name="user_home_anchor">主播粉絲團</string>
|
||||
<string name="main_active_type_01">美圖</string>
|
||||
<string name="main_active_type_02">新秀</string>
|
||||
<string name="main_active_type_03">身材</string>
|
||||
<string name="main_active_type_04">直播</string>
|
||||
<string name="main_active_type_05">生活</string>
|
||||
<string name="send_active_time">選擇時間</string>
|
||||
<string name="now_send">立即發表</string>
|
||||
<string name="choose_topic">選擇話題</string>
|
||||
<string name="pricture">圖文</string>
|
||||
<string name="_200">请输入200字以内的文字</string>
|
||||
<string name="time_hour">時</string>
|
||||
<string name="time_minute">分</string>
|
||||
<string name="focus_on">關注</string>
|
||||
<string name="see_more">查看更多</string>
|
||||
<string name="close">收起</string>
|
||||
</resources>
|
||||
|
||||
@@ -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>
|
||||
@@ -87,6 +88,7 @@
|
||||
<string name="edit_profile_sign_hint">留下點什麼吧~</string>
|
||||
<string name="edit_profile_name_hint">請輸入昵稱~</string>
|
||||
<string name="edit_profile_remarks">請輸入備註~</string>
|
||||
<string name="edit_profile_remarks_tips">注:新增備註後,僅本人可見且只有在消息中心內生效</string>
|
||||
<string name="edit_profile_sign_max">最多可輸入20個字</string>
|
||||
<string name="edit_profile_name_max">最多可輸入8個字</string>
|
||||
<string name="edit_profile_name_empty">請輸入昵稱</string>
|
||||
@@ -818,8 +820,10 @@
|
||||
<string name="now_noble">當前貴族: </string>
|
||||
<string name="now_noble_time">到期時間: </string>
|
||||
<string name="black_succer">已加入黑名單</string>
|
||||
<string name="black_add">加入黑名單</string>
|
||||
<string name="black_error">加入黑名單失敗</string>
|
||||
<string name="black_succer_more">移除黑名單成功</string>
|
||||
<string name="black_more">移除黑名單</string>
|
||||
<string name="black_error_more">移除黑名單失敗</string>
|
||||
|
||||
<string name="reply">回復</string>
|
||||
@@ -1455,4 +1459,35 @@
|
||||
<string name="dialog_message_say_hi_age">年齡:</string>
|
||||
<string name="dialog_message_say_hi_btn">打招呼</string>
|
||||
<string name="dialog_message_chat_notify_btn">回復</string>
|
||||
<string name="commen_user_active">個人動態</string>
|
||||
<string name="real_person">真人認證</string>
|
||||
<string name="trade_union">工会</string>
|
||||
<string name="activity_msg_chat_top_status_online">在線</string>
|
||||
<string name="activity_msg_chat_top_status_offline">離線</string>
|
||||
<string name="praise">獲贊</string>
|
||||
<string name="set_back">已拉黑,无法查看</string>
|
||||
<string name="cancel_back">取消黑名單</string>
|
||||
<string name="user_home_img_del_dialog">確定刪除圖片?</string>
|
||||
<string name="upload_success">上传成功</string>
|
||||
<string name="upload_failed">删除成功</string>
|
||||
<string name="_9">最多添加9張圖片</string>
|
||||
<string name="not_interested">不感興趣</string>
|
||||
<string name="person_like">人觉得很赞</string>
|
||||
<string name="fan_group_name">主播守護團</string>
|
||||
<string name="user_home_anchor">主播粉絲團</string>
|
||||
<string name="main_active_type_01">美圖</string>
|
||||
<string name="main_active_type_02">新秀</string>
|
||||
<string name="main_active_type_03">身材</string>
|
||||
<string name="main_active_type_04">直播</string>
|
||||
<string name="main_active_type_05">生活</string>
|
||||
<string name="send_active_time">選擇時間</string>
|
||||
<string name="now_send">立即發表</string>
|
||||
<string name="choose_topic">選擇話題</string>
|
||||
<string name="pricture">圖文</string>
|
||||
<string name="_200">请输入200字以内的文字</string>
|
||||
<string name="time_hour">時</string>
|
||||
<string name="time_minute">分</string>
|
||||
<string name="focus_on">關注</string>
|
||||
<string name="see_more">查看更多</string>
|
||||
<string name="close">收起</string>
|
||||
</resources>
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
<string name="refresh_footer_nothing">No more data</string>
|
||||
<string name="black">Pull black</string>
|
||||
<string name="black_ing">Relieving blackout</string>
|
||||
<string name="chat_remarks">Remarks</string>
|
||||
<string name="chat_remarks">Modify 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>
|
||||
@@ -62,6 +63,7 @@
|
||||
<string name="edit_profile_update_nickname">ModifyName</string>
|
||||
<string name="edit_profile_update_remarks">Modify remarks</string>
|
||||
<string name="edit_profile_remarks">Please enter comments~</string>
|
||||
<string name="edit_profile_remarks_tips">Note: New remarks are visible only to the creator and effective only within the message center.</string>
|
||||
<string name="edit_profile_update_sign">Signature</string>
|
||||
<string name="edit_profile_sign">Bio</string>
|
||||
<string name="bind_phone">Binding phone</string>
|
||||
@@ -254,10 +256,10 @@
|
||||
<string name="login_auth_success">Login successfully</string>
|
||||
<string name="login_auth_failure">privilege grant failed</string>
|
||||
<string name="login_auth_cancle">Authorization cancelled</string>
|
||||
<string name="live">Live broadcast</string>
|
||||
<string name="live">Live</string>
|
||||
<string name="login_tip_4">Log in</string>
|
||||
<string name="shopmall">shopmall</string>
|
||||
<string name="recomment">Recommend</string>
|
||||
<string name="recomment">Hot</string>
|
||||
<string name="main_type_find">Find</string>
|
||||
<string name="cust_server">CSD</string>
|
||||
<string name="live_anchor">Anchor</string>
|
||||
@@ -425,7 +427,7 @@
|
||||
<string name="live_pk_time_2">Penalty time</string>
|
||||
<string name="live_no_data_6">No video</string>
|
||||
<string name="live_no_data_7">Let\'s release our own video</string>
|
||||
<string name="main_home">home page</string>
|
||||
<string name="main_home">Home</string>
|
||||
<string name="main_near">nearby</string>
|
||||
<string name="main_list">Ranking</string>
|
||||
<string name="main_me">My</string>
|
||||
@@ -668,7 +670,7 @@
|
||||
<string name="receive_awards">ReceiveAwards</string>
|
||||
<string name="one_free">One free gift privilege!</string>
|
||||
|
||||
<string name="send">Send</string>
|
||||
<string name="send">release</string>
|
||||
<string name="sorry">I am sorry</string>
|
||||
<string name="video">video</string>
|
||||
<string name="FILE_PROVIDER">myname.pdlive.shayu.fileprovider</string>
|
||||
@@ -775,11 +777,12 @@
|
||||
|
||||
<string name="now_noble">Current VIP : </string>
|
||||
<string name="now_noble_time">Expiration time: </string>
|
||||
|
||||
<string name="black_add">Add to blacklist</string>
|
||||
<string name="black_succer">Successfully joined the blacklist</string>
|
||||
<string name="black_error">Failed to join blacklist</string>
|
||||
|
||||
<string name="black_succer_more">Blacklist removed successfully</string>
|
||||
<string name="black_succer_more">Succeeded in removing the blacklist</string>
|
||||
<string name="black_more">Remove blacklist</string>
|
||||
<string name="black_error_more">Failed to remove blacklist</string>
|
||||
|
||||
<string name="reply">Reply</string>
|
||||
@@ -1458,13 +1461,13 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="back_community_sure">Sure</string>
|
||||
<string name="activity_msg_chat_input_hint">Say something</string>
|
||||
|
||||
<string name="not_data_message_chat_list">暫無新消息哦~</string>
|
||||
<string name="not_data_message_chat_list_search">暫無搜索結果,換個詞試試吧~~</string>
|
||||
<string name="not_data_message_address_book_list">當前列表為空~</string>
|
||||
<string name="not_data_message_address_book_list_search">暫無搜索結果,換個詞試試吧~</string>
|
||||
<string name="dialog_message_say_hi_age">年齡:</string>
|
||||
<string name="dialog_message_say_hi_btn">打招呼</string>
|
||||
<string name="dialog_message_chat_notify_btn">回復</string>
|
||||
<string name="not_data_message_chat_list">No new news yet~</string>
|
||||
<string name="not_data_message_chat_list_search">There are no search results yet. Try using another word~</string>
|
||||
<string name="not_data_message_address_book_list">The current list is empty ~</string>
|
||||
<string name="not_data_message_address_book_list_search">There are no search results yet. Try using another word~</string>
|
||||
<string name="dialog_message_say_hi_age">Age:</string>
|
||||
<string name="dialog_message_say_hi_btn">Say Hi</string>
|
||||
<string name="dialog_message_chat_notify_btn">Reply</string>
|
||||
<string name="save_image_album">保存到本地相册</string>
|
||||
<string name="save_success">保存成功</string>
|
||||
<string name="done">完成</string>
|
||||
@@ -1478,9 +1481,37 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="permission_location">使用定位</string>
|
||||
<string name="permission_read_phone_state">读取手机信息</string>
|
||||
<string name="permission_storage">文件读写</string>
|
||||
|
||||
|
||||
|
||||
<string name="activity_msg_chat_top_status_online">Online</string>
|
||||
<string name="activity_msg_chat_top_status_offline">Offline</string>
|
||||
<string name="commen_user_active">个人动态</string>
|
||||
<string name="real_person">Real person</string>
|
||||
<string name="trade_union">工会</string>
|
||||
<string name="praise">Liked</string>
|
||||
<string name="set_back">已拉黑,无法查看</string>
|
||||
<string name="cancel_back">取消黑名单</string>
|
||||
<string name="user_home_img_del_dialog">確定刪除圖片?</string>
|
||||
<string name="upload_success">上传成功</string>
|
||||
<string name="upload_failed">删除成功</string>
|
||||
<string name="_9">最多添加9張圖片</string>
|
||||
<string name="not_interested">不感興趣</string>
|
||||
<string name="person_like">人觉得很赞</string>
|
||||
<string name="fan_group_name">主播守護團</string>
|
||||
<string name="user_home_anchor">主播粉絲團</string>
|
||||
<string name="main_active_type_01">美圖</string>
|
||||
<string name="main_active_type_02">新秀</string>
|
||||
<string name="main_active_type_03">身材</string>
|
||||
<string name="main_active_type_04">直播</string>
|
||||
<string name="main_active_type_05">生活</string>
|
||||
<string name="send_active_time">選擇時間</string>
|
||||
<string name="now_send">立即發表</string>
|
||||
<string name="choose_topic">選擇話題</string>
|
||||
<string name="pricture">圖文</string>
|
||||
<string name="_200">请输入200字以内的文字</string>
|
||||
<string name="time_hour">時</string>
|
||||
<string name="time_minute">分</string>
|
||||
<string name="focus_on">關注</string>
|
||||
<string name="see_more">查看更多</string>
|
||||
<string name="close">收起</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,18 @@ 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())
|
||||
.setExtraData(event.getBean().getUid())
|
||||
.build()
|
||||
)
|
||||
.showDialog();
|
||||
break;
|
||||
case WISH_LIST_PROGRESS:
|
||||
|
||||
@@ -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_more);
|
||||
} else {
|
||||
tvBlack.setVisibility(View.VISIBLE);
|
||||
tvBlackMove.setVisibility(View.GONE);
|
||||
tvBlack.setTag(null);
|
||||
tvBlack.setText(R.string.black_add);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@@ -9,14 +12,21 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.yunbao.common.message.content.MessageChatTipsContent;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.event.InputPanelViewHolderEvent;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import io.rong.common.RLog;
|
||||
import io.rong.imkit.R.string;
|
||||
import io.rong.imkit.conversation.MessageListAdapter;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imkit.utils.language.LangUtils;
|
||||
import io.rong.imkit.utils.language.RongConfigurationManager;
|
||||
import io.rong.imkit.widget.adapter.IViewProviderListener;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imlib.model.Message;
|
||||
@@ -26,6 +36,17 @@ import io.rong.imlib.model.MessageContent;
|
||||
* 会话页面更改已读未读
|
||||
*/
|
||||
public class PDLiveMessageListAdapter extends MessageListAdapter {
|
||||
private boolean isLeftLive = false;
|
||||
private boolean isRightLive = false;
|
||||
|
||||
public void setLeftLive(boolean leftLive) {
|
||||
isLeftLive = leftLive;
|
||||
}
|
||||
|
||||
public void setRightLive(boolean rightLive) {
|
||||
isRightLive = rightLive;
|
||||
}
|
||||
|
||||
public PDLiveMessageListAdapter(IViewProviderListener<UiMessage> listener) {
|
||||
super(listener);
|
||||
}
|
||||
@@ -37,28 +58,28 @@ public class PDLiveMessageListAdapter extends MessageListAdapter {
|
||||
MessageContent content = mDataList.get(position).getMessage().getContent();
|
||||
ImageView readReceipt = holder.getConvertView().findViewById(R.id.rc_read_receipt);
|
||||
TextView rcEdit = holder.getConvertView().findViewById(R.id.rc_edit);
|
||||
if (rcEdit!=null){
|
||||
if (rcEdit != null) {
|
||||
rcEdit.setVisibility(View.GONE);
|
||||
}
|
||||
holder.getConvertView().setBackgroundColor(Color.parseColor("#00000000"));
|
||||
holder.itemView.setBackgroundColor(Color.parseColor("#00000000"));
|
||||
ImageView readReceiptNew = holder.getConvertView().findViewById(R.id.rc_read_receipt_new);
|
||||
|
||||
if (readReceiptNew!=null){
|
||||
if (messageDirection==Message.MessageDirection.SEND){
|
||||
if (readReceiptNew != null) {
|
||||
if (messageDirection == Message.MessageDirection.SEND) {
|
||||
readReceiptNew.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
} else {
|
||||
readReceiptNew.setVisibility(View.GONE);
|
||||
}
|
||||
if (readReceipt.getVisibility()==View.VISIBLE) {
|
||||
if (readReceipt.getVisibility() == View.VISIBLE) {
|
||||
readReceiptNew.setBackgroundResource(R.mipmap.icon_message_read);
|
||||
} else {
|
||||
readReceiptNew.setBackgroundResource(R.mipmap.icon_message_unread);
|
||||
}
|
||||
if (readReceipt!=null){
|
||||
if (readReceipt != null) {
|
||||
readReceipt.setVisibility(View.GONE);
|
||||
}
|
||||
if(content instanceof MessageChatTipsContent){
|
||||
if (content instanceof MessageChatTipsContent) {
|
||||
readReceiptNew.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
@@ -71,6 +92,199 @@ public class PDLiveMessageListAdapter extends MessageListAdapter {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
TextView tv = holder.getView(R.id.rc_time);
|
||||
long sentTime = mDataList.get(position).getSentTime();
|
||||
boolean isSender = mDataList.get(position).getMessage().getMessageDirection().equals(Message.MessageDirection.SEND);
|
||||
tv.setText(getDateTimeString(sentTime, true, holder.getContext()));
|
||||
if (holder.getView(R.id.left_liveStatus) != null) {
|
||||
if (isLeftLive && !isSender) {
|
||||
holder.getView(R.id.left_liveStatus).setVisibility(View.VISIBLE);
|
||||
} else if (!isSender) {
|
||||
holder.getView(R.id.left_liveStatus).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
if (holder.getView(R.id.right_liveStatus)!=null) {
|
||||
if (isRightLive && isSender) {
|
||||
holder.getView(R.id.right_liveStatus).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
holder.getView(R.id.right_liveStatus).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static String getDateTimeString(long dateMillis, boolean showTime, Context context) {
|
||||
if (dateMillis <= 0L) {
|
||||
return "";
|
||||
} else {
|
||||
String formatDate = null;
|
||||
Date date = new Date(dateMillis);
|
||||
int type = judgeDate(date);
|
||||
long time = java.lang.System.currentTimeMillis();
|
||||
Calendar calendarCur = Calendar.getInstance();
|
||||
Calendar calendardate = Calendar.getInstance();
|
||||
calendardate.setTimeInMillis(dateMillis);
|
||||
calendarCur.setTimeInMillis(time);
|
||||
int month = calendardate.get(2);
|
||||
int year = calendardate.get(1);
|
||||
int weekInMonth = calendardate.get(4);
|
||||
int monthCur = calendarCur.get(2);
|
||||
int yearCur = calendarCur.get(1);
|
||||
int weekInMonthCur = calendarCur.get(4);
|
||||
switch (type) {
|
||||
case 6:
|
||||
formatDate = getTimeString(dateMillis, context);
|
||||
break;
|
||||
case 15:
|
||||
String formatString = context.getResources().getString(string.rc_date_yesterday);
|
||||
if (showTime) {
|
||||
formatDate = formatString + " " + getTimeString(dateMillis, context);
|
||||
} else {
|
||||
formatDate = formatString;
|
||||
}
|
||||
break;
|
||||
case 2014:
|
||||
if (year == yearCur) {
|
||||
if (month == monthCur && weekInMonth == weekInMonthCur) {
|
||||
formatDate = getWeekDay(context, calendardate.get(7));
|
||||
} else {
|
||||
formatDate = formatDate(date, "M/d");
|
||||
}
|
||||
} else {
|
||||
formatDate = formatDate(date, "yyyy/M/d");
|
||||
}
|
||||
|
||||
if (showTime) {
|
||||
formatDate = formatDate + " " + getTimeString(dateMillis, context);
|
||||
}
|
||||
}
|
||||
|
||||
return formatDate;
|
||||
}
|
||||
}
|
||||
|
||||
public static int judgeDate(Date date) {
|
||||
Calendar calendarToday = Calendar.getInstance();
|
||||
calendarToday.set(11, 0);
|
||||
calendarToday.set(12, 0);
|
||||
calendarToday.set(13, 0);
|
||||
calendarToday.set(14, 0);
|
||||
Calendar calendarYesterday = Calendar.getInstance();
|
||||
calendarYesterday.add(5, -1);
|
||||
calendarYesterday.set(11, 0);
|
||||
calendarYesterday.set(12, 0);
|
||||
calendarYesterday.set(13, 0);
|
||||
calendarYesterday.set(14, 0);
|
||||
Calendar calendarTomorrow = Calendar.getInstance();
|
||||
calendarTomorrow.add(5, 1);
|
||||
calendarTomorrow.set(11, 0);
|
||||
calendarTomorrow.set(12, 0);
|
||||
calendarTomorrow.set(13, 0);
|
||||
calendarTomorrow.set(14, 0);
|
||||
Calendar calendarTarget = Calendar.getInstance();
|
||||
calendarTarget.setTime(date);
|
||||
if (calendarTarget.before(calendarYesterday)) {
|
||||
return 2014;
|
||||
} else if (calendarTarget.before(calendarToday)) {
|
||||
return 15;
|
||||
} else {
|
||||
return calendarTarget.before(calendarTomorrow) ? 6 : 2014;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getWeekDay(Context context, int dayInWeek) {
|
||||
String weekDay = "";
|
||||
switch (dayInWeek) {
|
||||
case 1:
|
||||
weekDay = context.getResources().getString(string.rc_date_sunday);
|
||||
break;
|
||||
case 2:
|
||||
weekDay = context.getResources().getString(string.rc_date_monday);
|
||||
break;
|
||||
case 3:
|
||||
weekDay = context.getResources().getString(string.rc_date_tuesday);
|
||||
break;
|
||||
case 4:
|
||||
weekDay = context.getResources().getString(string.rc_date_wednesday);
|
||||
break;
|
||||
case 5:
|
||||
weekDay = context.getResources().getString(string.rc_date_thursday);
|
||||
break;
|
||||
case 6:
|
||||
weekDay = context.getResources().getString(string.rc_date_friday);
|
||||
break;
|
||||
case 7:
|
||||
weekDay = context.getResources().getString(string.rc_date_saturday);
|
||||
}
|
||||
|
||||
return weekDay;
|
||||
}
|
||||
|
||||
public static boolean isTime24Hour(Context context) {
|
||||
String timeFormat = Settings.System.getString(context.getContentResolver(), "time_12_24");
|
||||
return timeFormat != null && timeFormat.equals("24");
|
||||
}
|
||||
|
||||
private static String getTimeString(long dateMillis, Context context) {
|
||||
if (dateMillis <= 0L) {
|
||||
return "";
|
||||
} else {
|
||||
Date date = new Date(dateMillis);
|
||||
String formatTime;
|
||||
if (isTime24Hour(context) || true) {
|
||||
formatTime = formatDate(date, "HH:mm");
|
||||
} else {
|
||||
Calendar calendarTime = Calendar.getInstance();
|
||||
calendarTime.setTimeInMillis(dateMillis);
|
||||
int hour = calendarTime.get(10);
|
||||
if (calendarTime.get(9) == 0) {
|
||||
if (hour < 6) {
|
||||
if (hour == 0) {
|
||||
hour = 12;
|
||||
}
|
||||
|
||||
formatTime = context.getResources().getString(string.rc_date_morning);
|
||||
} else {
|
||||
formatTime = context.getResources().getString(string.rc_date_am);
|
||||
}
|
||||
} else if (hour == 0) {
|
||||
formatTime = context.getResources().getString(string.rc_date_noon);
|
||||
hour = 12;
|
||||
} else if (hour <= 5) {
|
||||
formatTime = context.getResources().getString(string.rc_date_pm);
|
||||
} else {
|
||||
formatTime = context.getResources().getString(string.rc_date_night);
|
||||
}
|
||||
|
||||
int minuteInt = calendarTime.get(12);
|
||||
String minuteStr = Integer.toString(minuteInt);
|
||||
if (minuteInt < 10) {
|
||||
minuteStr = "0" + minuteStr;
|
||||
}
|
||||
|
||||
String timeStr = hour + ":" + minuteStr;
|
||||
if (RongConfigurationManager.getInstance().getLanguageLocal(context) == LangUtils.RCLocale.LOCALE_CHINA) {
|
||||
formatTime = formatTime + " " + timeStr;
|
||||
} else {
|
||||
formatTime = timeStr + " " + formatTime;
|
||||
}
|
||||
}
|
||||
|
||||
return formatTime;
|
||||
}
|
||||
}
|
||||
|
||||
public static String formatDate(Date date, String fromat) {
|
||||
if (TextUtils.isEmpty(fromat)) {
|
||||
return "";
|
||||
} else {
|
||||
try {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(fromat);
|
||||
return sdf.format(date);
|
||||
} catch (IllegalArgumentException var3) {
|
||||
RLog.e("RLong", "the given pattern is invalid.");
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,15 @@ import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.yunbao.common.event.PDChatInputModeEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.live.dialog.PDLiveMessageListAdapter;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.conversation.ConversationFragment;
|
||||
import io.rong.imkit.conversation.MessageListAdapter;
|
||||
import io.rong.imkit.conversation.extension.InputMode;
|
||||
@@ -23,6 +28,16 @@ import io.rong.imkit.conversation.extension.RongExtensionViewModel;
|
||||
* 聊天详情页面
|
||||
*/
|
||||
public class PDLiveConversationFragment extends ConversationFragment {
|
||||
PDLiveMessageListAdapter adapter;
|
||||
private String targetId = "";
|
||||
|
||||
public PDLiveConversationFragment(String targetId) {
|
||||
this.targetId = targetId;
|
||||
}
|
||||
|
||||
public PDLiveConversationFragment() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
@@ -47,9 +62,36 @@ public class PDLiveConversationFragment extends ConversationFragment {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
String ids = String.format("%s,%s", targetId, IMLoginManager.get(getContext()).getUserInfo().getId());
|
||||
LiveNetManager.get(getContext())
|
||||
.getUserLiveStatus(ids, new HttpCallback<List<Integer>>() {
|
||||
@Override
|
||||
public void onSuccess(List<Integer> data) {
|
||||
if(data.isEmpty()){
|
||||
adapter.setLeftLive(false);
|
||||
adapter.setRightLive(false);
|
||||
adapter.notifyDataSetChanged();
|
||||
return;
|
||||
}
|
||||
adapter.setLeftLive(data.contains(Integer.parseInt(targetId)));
|
||||
adapter.setRightLive(data.contains((int) IMLoginManager.get(getContext()).getUserInfo().getId()));
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MessageListAdapter onResolveAdapter() {
|
||||
return new PDLiveMessageListAdapter(this);
|
||||
adapter = new PDLiveMessageListAdapter(this);
|
||||
return adapter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
android:gravity="center"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:text="注:新增備註後,僅本人可見且只有在消息中心內生效"
|
||||
android:text="@string/edit_profile_remarks_tips"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
103
live/src/main/res/layout/popwindow_chat_more_v2.xml
Normal 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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/background_d5_white"
|
||||
android:gravity="start"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lt_remarks"
|
||||
android:layout_width="wrap_content"
|
||||
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="wrap_content"
|
||||
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="wrap_content"
|
||||
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_add"
|
||||
android:textColor="@color/black1"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -91,7 +91,9 @@
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="60dp"
|
||||
android:text="你好,朋友!"
|
||||
android:text="你好,朋友!11111111111111111111111111111111111111111"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/rc_secondary_color"
|
||||
android:textSize="@dimen/rc_font_text_third_size"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
android:textColor="@color/rc_white_color"
|
||||
android:textSize="@dimen/rc_font_text_third_size"
|
||||
android:visibility="gone"
|
||||
android:textAllCaps="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -32,25 +32,60 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/ll_content" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_left_portrait"
|
||||
<RelativeLayout
|
||||
android:layout_width="@dimen/rc_message_portrait_size"
|
||||
android:layout_height="@dimen/rc_message_portrait_size"
|
||||
android:layout_marginStart="@dimen/rc_margin_size_4"
|
||||
android:src="@color/rc_secondary_color"
|
||||
android:id="@+id/rc_left_portrait_layout"
|
||||
app:layout_constraintStart_toEndOf="@id/rc_selected"
|
||||
app:layout_constraintTop_toTopOf="@id/ll_content"
|
||||
app:layout_goneMarginStart="@dimen/rc_margin_size_12" />
|
||||
app:layout_goneMarginStart="@dimen/rc_margin_size_12">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_right_portrait"
|
||||
<ImageView
|
||||
android:id="@+id/rc_left_portrait"
|
||||
android:layout_width="@dimen/rc_message_portrait_size"
|
||||
android:layout_height="@dimen/rc_message_portrait_size"
|
||||
android:src="@color/rc_secondary_color" />
|
||||
|
||||
<pl.droidsonroids.gif.GifImageView
|
||||
android:id="@+id/left_liveStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="12dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:src="@mipmap/icon_liveing"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="@dimen/rc_message_portrait_size"
|
||||
android:layout_height="@dimen/rc_message_portrait_size"
|
||||
android:layout_marginEnd="@dimen/rc_margin_size_12"
|
||||
android:src="@color/rc_secondary_color"
|
||||
android:id="@+id/rc_right_portrait_layout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/ll_content"
|
||||
app:layout_goneMarginTop="@dimen/rc_margin_size_20" />
|
||||
app:layout_goneMarginTop="@dimen/rc_margin_size_20" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_right_portrait"
|
||||
android:layout_width="@dimen/rc_message_portrait_size"
|
||||
android:layout_height="@dimen/rc_message_portrait_size"
|
||||
android:src="@color/rc_secondary_color"
|
||||
/>
|
||||
|
||||
<pl.droidsonroids.gif.GifImageView
|
||||
android:id="@+id/right_liveStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="12dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:src="@mipmap/icon_liveing"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_content"
|
||||
@@ -59,8 +94,8 @@
|
||||
android:layout_marginStart="@dimen/rc_margin_size_8"
|
||||
android:layout_marginEnd="@dimen/rc_margin_size_8"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toStartOf="@id/rc_right_portrait"
|
||||
app:layout_constraintStart_toEndOf="@id/rc_left_portrait"
|
||||
app:layout_constraintEnd_toStartOf="@id/rc_right_portrait_layout"
|
||||
app:layout_constraintStart_toEndOf="@id/rc_left_portrait_layout"
|
||||
app:layout_constraintTop_toBottomOf="@id/rc_time">
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
android:theme="@style/noAnimationStyle"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.UserHomeActivity"
|
||||
android:name=".activity.UserHomeActivityOld"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.SettingActivity"
|
||||
@@ -170,6 +170,21 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity android:name=".activity.CompleteUserInfoActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity android:name=".activity.EditUserHobbyActivity" android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.CommunitySendActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.CommunityDetailsActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.UserHomeActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.yunbao.common.activity;
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
@@ -24,6 +24,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.adapter.CommentAdapter;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.CommentBean;
|
||||
@@ -40,11 +41,15 @@ import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.NineGridLayout;
|
||||
import com.yunbao.common.views.TopGradual;
|
||||
import com.yunbao.share.bean.ShareBean;
|
||||
import com.yunbao.share.ui.SharePopDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
@Route(path = RouteUtil.PATH_COMMUNITY)
|
||||
public class CommunityDetailsActivity extends AbsActivity {
|
||||
private ActiveBean activeBean;
|
||||
@@ -68,6 +73,7 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
private ImageView send;
|
||||
private boolean isComment = false;
|
||||
private RelativeLayout videoLayout;
|
||||
private GifImageView liveStatus;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -94,6 +100,7 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
liveStatus = findViewById(R.id.liveStatus);
|
||||
videoLayout = findViewById(R.id.videoLayout);
|
||||
send = findViewById(R.id.send);
|
||||
comment = findViewById(R.id.comment);
|
||||
@@ -145,12 +152,12 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
public void callback(Integer isAttention) {
|
||||
if (isAttention == 1) {
|
||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_followed, followIcon);
|
||||
followName.setText("已关注");
|
||||
followName.setText(getResources().getString(R.string.following));
|
||||
followName.setTextColor(Color.parseColor("#777777"));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type_1));
|
||||
} else {
|
||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_follow, followIcon);
|
||||
followName.setText("关注");
|
||||
followName.setText(getResources().getString(R.string.follow));
|
||||
followName.setTextColor(getResources().getColor(R.color.white));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type));
|
||||
}
|
||||
@@ -170,11 +177,11 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
if (activeBean.getIs_love().equals("1")) {
|
||||
activeBean.setIs_love("0");
|
||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like01, like);
|
||||
likeCount.setText(Integer.parseInt(activeBean.getLove_num()) - 1 + "人觉得很赞");
|
||||
likeCount.setText(Integer.parseInt(activeBean.getLove_num()) - 1 + getResources().getString(com.yunbao.main.R.string.person_like));
|
||||
} else {
|
||||
activeBean.setIs_love("1");
|
||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like, like);
|
||||
likeCount.setText(Integer.parseInt(activeBean.getLove_num()) + 1 + "人觉得很赞");
|
||||
likeCount.setText(Integer.parseInt(activeBean.getLove_num()) + 1 + getResources().getString(com.yunbao.main.R.string.person_like));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -186,13 +193,13 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
SparseArray<String> array = new SparseArray<>();
|
||||
array.append(0, "举报");
|
||||
array.append(1, "不感兴趣");
|
||||
array.append(0, getResources().getString(R.string.report));
|
||||
array.append(1, getResources().getString(R.string.not_interested));
|
||||
DialogUitl.showStringArrayDialog(CommunityDetailsActivity.this, array, new DialogUitl.StringArrayDialogCallback() {
|
||||
@Override
|
||||
public void onItemClick(String text, int tag) {
|
||||
if (tag == 0) {
|
||||
RouteUtil.forwardCommentReportActivity(activeBean.getId(), activeBean.getId());
|
||||
RouteUtil.forwardCommentReportActivity(activeBean.getId(), "0");
|
||||
} else {
|
||||
CommonHttpUtil.noInterest(activeBean.getUser_id(), new HttpCallback() {
|
||||
@Override
|
||||
@@ -238,6 +245,18 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
|
||||
}
|
||||
});
|
||||
findViewById(R.id.share).setOnClickListener(view -> {
|
||||
String image = null;
|
||||
if (activeBean.getImg_or_video().equals("1")) {
|
||||
JSONArray jsonArray = (JSONArray) JSONArray.parse(activeBean.getImg_json());
|
||||
if (!jsonArray.isEmpty()) {
|
||||
image = jsonArray.getString(0);
|
||||
}
|
||||
} else {
|
||||
image = activeBean.getVideo() + "?vframe/jpg/offset/0";
|
||||
}
|
||||
new SharePopDialog(mContext).setShareType(SharePopDialog.TYPE_DYNAMIC).setShareData(ShareBean.ShareBuilder.create().setShareType(SharePopDialog.TYPE_DYNAMIC).setUid(CommonAppConfig.getInstance().getUid()).setCover(StringUtil.isEmpty(image) ? activeBean.getUser_avatar() : image).setTitle(StringUtil.isEmpty(activeBean.getContent()) ? activeBean.getUser_name() : JSONObject.parseObject(activeBean.getContent()).getString("msg")).setAnchorId(activeBean.getUser_id()).setAnchorName(activeBean.getUser_name()).setAnchorAvatar(activeBean.getUser_avatar()).setExtraData(activeId).build()).showDialog();
|
||||
});
|
||||
}
|
||||
|
||||
//回复评论
|
||||
@@ -283,9 +302,9 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReport(CommentBean.ReplyComment activeBean) {
|
||||
public void onReport(CommentBean.ReplyComment commentBean) {
|
||||
//二级回复 举报
|
||||
RouteUtil.forwardCommentReportActivity(activeBean.getId(), activeBean.getId());
|
||||
RouteUtil.forwardCommentReportActivity(activeBean.getId(), commentBean.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -335,14 +354,17 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
if (!StringUtil.isEmpty(activeBean.getContent())) {
|
||||
content.setText(String.valueOf(JSONObject.parseObject(activeBean.getContent()).get("msg")));
|
||||
}
|
||||
if (activeBean.getIs_live().equals("1")) {
|
||||
liveStatus.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (activeBean.getIs_attention().equals("1")) {//关注
|
||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_followed, followIcon);
|
||||
followName.setText("已关注");
|
||||
followName.setText(getResources().getString(R.string.following));
|
||||
followName.setTextColor(Color.parseColor("#777777"));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type_1));
|
||||
} else {
|
||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_follow, followIcon);
|
||||
followName.setText("关注");
|
||||
followName.setText(getResources().getString(R.string.follow));
|
||||
followName.setTextColor(getResources().getColor(R.color.white));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type));
|
||||
}
|
||||
@@ -1,29 +1,24 @@
|
||||
package com.yunbao.common.activity;
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ClipData;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.MediaStore;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.VideoView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
@@ -36,14 +31,13 @@ import com.bigkoo.pickerview.listener.OnTimeSelectListener;
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||
import com.bigkoo.pickerview.view.TimePickerView;
|
||||
import com.google.gson.Gson;
|
||||
import com.lzy.okgo.utils.HttpUtils;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.NewCommunityType;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.CommunityTypeManager;
|
||||
import com.yunbao.common.manager.OpenAdManager;
|
||||
import com.yunbao.common.upload.UploadBean;
|
||||
import com.yunbao.common.upload.UploadCallback;
|
||||
import com.yunbao.common.upload.UploadQnImpl;
|
||||
@@ -51,18 +45,18 @@ import com.yunbao.common.utils.ActiveImageAdapter;
|
||||
import com.yunbao.common.utils.DateFormatUtil;
|
||||
import com.yunbao.common.utils.FilesUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.ProcessImageUtil;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import io.rong.imkit.picture.tools.DateUtils;
|
||||
|
||||
public class CommunitySendActivity extends AbsActivity {
|
||||
public static final int PERMISSION_REQUEST_CODE_IMG = 0;
|
||||
public static final int PERMISSION_REQUEST_CODE_VIDEO = 1;
|
||||
@@ -99,7 +93,7 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
newCommunityTypeList = new CommunityTypeManager(mContext).getCommunityTypeList();
|
||||
newCommunityTypeList = CommonAppConfig.getCommunityTypeList(false, mContext);
|
||||
content = findViewById(R.id.content);
|
||||
submit = findViewById(R.id.submit);
|
||||
submit.setVisibility(View.VISIBLE);
|
||||
@@ -153,6 +147,9 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
@RequiresApi(api = Build.VERSION_CODES.TIRAMISU)
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (videoFile != null) {
|
||||
return;
|
||||
}
|
||||
String permission1 = Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||
String permission2 = Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
@@ -172,6 +169,9 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
videoLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (imgUrlList.size() > 0) {
|
||||
return;
|
||||
}
|
||||
String permission1 = Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||
String permission2 = Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
@@ -200,12 +200,13 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
activeImageAdapter.setActionListener(new ActiveImageAdapter.ActionListener() {
|
||||
@Override
|
||||
public void onAddClick() {
|
||||
|
||||
openImageChooserActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(int position) {
|
||||
|
||||
activeImageAdapter.deleteItem(position);
|
||||
activeImageAdapter.notifyItemRemoved(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -215,7 +216,7 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
|
||||
@Override
|
||||
public void onDel(int position) {
|
||||
|
||||
activeImageAdapter.deleteItem(position);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -223,12 +224,10 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
private void submit() {
|
||||
if (isImage) {
|
||||
if (imgUrlList.size() == 0) {
|
||||
ToastUtil.show("请选择图片或者视频");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (StringUtil.isEmpty(videoUrl)) {
|
||||
ToastUtil.show("请选择图片或者视频");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -237,7 +236,7 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
imgUrl = new Gson().toJson(imgUrlList);
|
||||
}
|
||||
String tempTime = "";
|
||||
if (!chooseTime.getText().toString().equals("立即发表")) {
|
||||
if (!chooseTime.getText().toString().equals("立即發表") && !chooseTime.getText().toString().equals("Now")) {
|
||||
tempTime = chooseTime.getText().toString();
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
@@ -245,8 +244,8 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
CommonHttpUtil.pushCommunity(isImage, jsonObject.toString(), String.valueOf(talkId), imgUrl, videoUrl, tempTime, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
ToastUtil.show(msg);
|
||||
if (code == 0) {
|
||||
ToastUtil.show("发布成功");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
@@ -265,7 +264,7 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
talkContent.setText(talkList.get(options1));
|
||||
talkContent.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}).setTitleText("选择话题").setContentTextSize(16).build();
|
||||
}).setTitleText(getResources().getString(R.string.choose_topic)).setContentTextSize(16).build();
|
||||
pickerView.setPicker(talkList, null, null);
|
||||
pickerView.show();
|
||||
}
|
||||
@@ -290,6 +289,18 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
public void showTimeChooseDialog() {
|
||||
Calendar startCalendar = Calendar.getInstance();
|
||||
startCalendar.set(1990, 1, 1);
|
||||
Calendar endCalendar = Calendar.getInstance();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int year = calendar.get(Calendar.YEAR);
|
||||
int month = calendar.get(Calendar.MONTH) + 1; // Calendar.MONTH 从0开始计数
|
||||
int day = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
int hour = calendar.get(Calendar.HOUR); // 使用24小时制
|
||||
int minute = calendar.get(Calendar.MINUTE);
|
||||
int second = calendar.get(Calendar.SECOND);
|
||||
endCalendar.set(year, month, day, hour, minute, second);
|
||||
|
||||
TimePickerView timePickerView = new TimePickerBuilder(CommunitySendActivity.this, new OnTimeSelectListener() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
@@ -297,13 +308,13 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
chooseTime.setText(DateFormatUtil.getTimeStrings(date.getTime()));
|
||||
}
|
||||
}).setType(new boolean[]{true, true, true, true, true, false})// 默认全部显示
|
||||
.setCancelText("Cancel")//取消按钮文字
|
||||
.setSubmitText("Sure")//确认按钮文字
|
||||
.setCancelText(getResources().getString(R.string.cancel))//取消按钮文字
|
||||
.setSubmitText(getResources().getString(R.string.back_community_sure))//确认按钮文字
|
||||
.setTitleSize(20)//标题文字大小
|
||||
.setTitleText("Title")//标题文字
|
||||
.setOutSideCancelable(false)//点击屏幕,点在控件外部范围时,是否取消显示
|
||||
.isCyclic(true)//是否循环滚动
|
||||
.setLabel("年", "月", "日", "时", "分", "")//默认设置为年月日时分秒
|
||||
.setTitleText("")//标题文字
|
||||
.setOutSideCancelable(true)//点击屏幕,点在控件外部范围时,是否取消显示
|
||||
.isCyclic(false)//是否循环滚动
|
||||
.setDate(endCalendar).setRangDate(startCalendar, endCalendar).setLabel("", "", "", "", "", "")//默认设置为年月日时分秒
|
||||
.isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。
|
||||
.build();
|
||||
timePickerView.show();
|
||||
@@ -1,29 +1,40 @@
|
||||
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.HttpCallbackModel;
|
||||
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 +74,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 +101,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();
|
||||
@@ -89,7 +117,7 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
||||
return;
|
||||
}
|
||||
if (man.getTag() == null && woman.getTag() == null) {
|
||||
ToastUtil.show("請選擇性別");
|
||||
ToastUtil.show(WordUtil.isNewZh()?"請選擇性別":"Please select gender");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -99,11 +127,22 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
||||
userName.getText().toString(),
|
||||
(String) avatar.getTag(),
|
||||
year + "-" + (month + 1) + "-" + day,
|
||||
new HttpCallback<List<BaseModel>>() {
|
||||
new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(List<BaseModel> data) {
|
||||
ToastUtil.show("註冊成功");
|
||||
finish();
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
if (data.getCode() == 500) {
|
||||
ToastUtil.show(data.getMsg());
|
||||
return;
|
||||
}
|
||||
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 +231,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 +240,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.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")));
|
||||
ViewUtils.findViewById(woman, R.id.sex_bg).setBackgroundResource(R.drawable.dialog_bg_chat_status_config_unselect);
|
||||
@@ -210,10 +251,10 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
||||
ViewUtils.findViewById(woman, R.id.sex_text, TextView.class).setText(R.string.activity_reg_user_info_sex_woman);
|
||||
ViewUtils.findViewById(woman, R.id.sex_text, TextView.class).setTextColor(Color.parseColor("#333333"));
|
||||
ViewUtils.findViewById(man, R.id.sex_text, TextView.class).setTextColor(Color.parseColor("#00A3FF"));
|
||||
man.setTag("man");
|
||||
man.setTag(null);
|
||||
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 +266,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 +278,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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,41 @@ 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());
|
||||
String height = data.getInfo().getHeight();
|
||||
if("0".equals(height)||StringUtil.isEmpty(height)){
|
||||
height="170";
|
||||
}
|
||||
((TextView) findViewById(R.id.height)).setText(height + "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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -197,6 +199,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
|
||||
private View floatWarOrder;//战令浮窗
|
||||
private List<AnchorStartLiveBean> startListNotifyList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_main;
|
||||
@@ -209,11 +212,13 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1, 0.4f, new DecelerateInterpolator()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
OpenAdManager.getInstance().dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
ActivityCompat.postponeEnterTransition(this);
|
||||
@@ -536,6 +541,24 @@ 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) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -642,7 +665,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
} else {
|
||||
if (mainHomeComViewHolder != null && mainHomeComViewHolder.isFloatWarOrder()) {
|
||||
floatWarOrder.setVisibility(View.GONE);
|
||||
}else {
|
||||
} else {
|
||||
floatWarOrder.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@@ -1118,7 +1141,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void loadPageData(int position, boolean needlLoadData) {
|
||||
if (mViewHolders == null) {
|
||||
ToastUtil.showDebug("Holders为空");
|
||||
@@ -1133,7 +1155,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
return;
|
||||
}
|
||||
if (position == 0) {
|
||||
mainHomeComViewHolder = new MainHomeComViewHolder(mContext, parent);
|
||||
mainHomeComViewHolder = new MainHomeComViewHolder(mContext, MainActivity.this, parent);
|
||||
vh = mainHomeComViewHolder;
|
||||
} else if (position == 1) {
|
||||
mainHomeViewHolder = new MainHomeViewHolder(mContext, parent);
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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,12 +36,11 @@ 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.RouteUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.ViewUtils;
|
||||
@@ -59,13 +54,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 +109,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");
|
||||
@@ -180,12 +182,10 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
|
||||
* 数据的设置
|
||||
*/
|
||||
private void initData() {
|
||||
targetId = getIntent().getStringExtra("targetId");
|
||||
NoviceInstructorModel model = NoviceInstructorManager.get(this).getNoviceInstructor();
|
||||
|
||||
//绑定聊天用户id
|
||||
inputPanel.setTargetId(targetId);
|
||||
ToastUtil.show("id:" + targetId);
|
||||
//获取用户信息
|
||||
UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(targetId);
|
||||
setUserCard();
|
||||
@@ -218,7 +218,8 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
|
||||
private void initView() {
|
||||
try {
|
||||
// 添加会话界面
|
||||
conversationFragment = new PDLiveConversationFragment();
|
||||
targetId = getIntent().getStringExtra("targetId");
|
||||
conversationFragment = new PDLiveConversationFragment(targetId);
|
||||
FragmentManager manager = getSupportFragmentManager();
|
||||
FragmentTransaction transaction = manager.beginTransaction();
|
||||
transaction.replace(R.id.container, conversationFragment);
|
||||
@@ -249,6 +250,9 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
|
||||
|
||||
}
|
||||
});
|
||||
ViewUtils.findViewById(card, R.id.rc_conversation_portrait, ImageView.class).setOnClickListener(view -> {
|
||||
RouteUtil.forwardUserHome(targetId);
|
||||
});
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -262,29 +266,42 @@ 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() == 0) {
|
||||
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_gray);
|
||||
}
|
||||
if("C".equals(data.getUser().getType())){
|
||||
ViewUtils.findViewById(card,R.id.user_auth_status).setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
ViewUtils.findViewById(card,R.id.user_auth_status).setVisibility(View.GONE);
|
||||
}
|
||||
showBanner();
|
||||
showTag();
|
||||
if(data.getUser().getAttention()==0){
|
||||
ViewUtils.findViewById(card,R.id.follow, Button.class).setOnClickListener(new View.OnClickListener() {
|
||||
if (data.getUser().getAttention() <= 1) {
|
||||
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 +322,31 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
|
||||
}
|
||||
});
|
||||
}
|
||||
private void showTag(){
|
||||
List<String> tags=new ArrayList<>();
|
||||
tags.add(userInfoBean.getInfo().getAge());
|
||||
if(!StringUtil.isEmpty(userInfoBean.getInfo().getCareer())){
|
||||
|
||||
private void showTag() {
|
||||
List<String> tags = new ArrayList<>();
|
||||
tags.add(userInfoBean.getInfo().getAge()+(WordUtil.isNewZh()?"歲":"years old"));
|
||||
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 +355,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 +453,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 +468,7 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
@@ -448,7 +485,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
private void jumpMain(boolean showInvite, String anchorId) {
|
||||
Intent intent = new Intent(activity, MainActivity.class);
|
||||
intent.putExtra(Constants.SHOW_INVITE, showInvite);
|
||||
intent.putExtra("anchor_id", anchorId);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,83 +1,788 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.ViewGroup;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Outline;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.SparseArray;
|
||||
import android.view.View;
|
||||
import android.view.ViewOutlineProvider;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.ms.banner.Banner;
|
||||
import com.xuexiang.xui.widget.flowlayout.FlowTagLayout;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.adapter.LabelTagAdapter;
|
||||
import com.yunbao.common.adapter.UserCommunityAdapter;
|
||||
import com.yunbao.common.adapter.UserHomeImgAdapter;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.ActiveOtherBean;
|
||||
import com.yunbao.common.bean.HomeUserExhibitInfoBean;
|
||||
import com.yunbao.common.bean.HomeUserInfoBean;
|
||||
import com.yunbao.common.bean.LabelBean;
|
||||
import com.yunbao.common.bean.UserHomeImgBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.upload.UploadBean;
|
||||
import com.yunbao.common.upload.UploadCallback;
|
||||
import com.yunbao.common.upload.UploadQnImpl;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.FilesUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.live.activity.LiveAddImpressActivity;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
import com.yunbao.main.views.UserHomeViewHolder2;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.UserHomeImgsViewHolder;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/25.
|
||||
*/
|
||||
//@Route(path = RouteUtil.PATH_USER_HOME)
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
@Route(path = RouteUtil.PATH_USER_HOME)
|
||||
public class UserHomeActivity extends AbsActivity {
|
||||
|
||||
private UserHomeViewHolder2 mUserHomeViewHolder;
|
||||
private final int CHOOSE_IMG = 100;//Android 5.0以下的
|
||||
public static final int PERMISSION_REQUEST_CODE_IMG = 0;
|
||||
private String uid;
|
||||
private Banner mBanner;
|
||||
private RecyclerView imgsRecyclerView;
|
||||
private UserHomeImgAdapter userHomeImgAdapter;
|
||||
private List<String> bannerImgList = new ArrayList<>();
|
||||
private List<UserHomeImgBean> tempList;
|
||||
private RoundedImageView avatar;
|
||||
private TextView userName;
|
||||
private TextView fansCount;
|
||||
private TextView likeCount;
|
||||
private LinearLayout followLayout;
|
||||
private ImageView followIcon;
|
||||
private TextView followName;
|
||||
private TextView userId;
|
||||
private TextView userStatus;
|
||||
private ImageView userStatusIcon;
|
||||
private ImageView user_sex;
|
||||
private ImageView authorIcon;
|
||||
private ImageView levelIcon;
|
||||
private LinearLayout authenticationLayout;
|
||||
private TextView signature;
|
||||
private LinearLayout moreLayout;
|
||||
private TextView moreText;
|
||||
private ImageView moreIcon;
|
||||
private HomeUserInfoBean userInfo;
|
||||
private RecyclerView communityRecyclerView;
|
||||
private LinearLayout itemLayout01;
|
||||
private LinearLayout itemLayout02;
|
||||
private LinearLayout itemLayout03;
|
||||
private LinearLayout itemLayout04;
|
||||
private FlowTagLayout myFlowTag; //我的标签
|
||||
private LabelTagAdapter myAdapter;
|
||||
private boolean isShowcase;
|
||||
private boolean isAnchor;
|
||||
private boolean isMe;
|
||||
private RelativeLayout userPresidentLayout;
|
||||
private TextView userPresidentName;
|
||||
private RoundedImageView fansImg1;
|
||||
private RoundedImageView fansImg2;
|
||||
private RoundedImageView fansImg3;
|
||||
private List<RoundedImageView> fansImgViewList = new ArrayList<>();
|
||||
private RoundedImageView guardImg1;
|
||||
private RoundedImageView guardImg2;
|
||||
private RoundedImageView guardImg3;
|
||||
private List<RoundedImageView> guardImgViewList = new ArrayList<>();
|
||||
private RoundedImageView giftImg1;
|
||||
private RoundedImageView giftImg2;
|
||||
private RoundedImageView giftImg3;
|
||||
private List<RoundedImageView> giftImgViewList = new ArrayList<>();
|
||||
private RoundedImageView honorImg1;
|
||||
private RoundedImageView honorImg2;
|
||||
private RoundedImageView honorImg3;
|
||||
private List<RoundedImageView> honorImgViewList = new ArrayList<>();
|
||||
private TextView giftCount;
|
||||
private List<String> tagList;
|
||||
private GifImageView liveStatus;
|
||||
private TextView topName;
|
||||
private LinearLayout topLayout;
|
||||
private ScrollView scrollView;
|
||||
private RelativeLayout topImgLayout;
|
||||
private ImageView imgUp;
|
||||
private ImageView imgLabel;
|
||||
private LinearLayout bottomEditLayout;
|
||||
private UploadQnImpl mUploadStrategy;
|
||||
private List<ActiveBean> videoList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_empty;
|
||||
return R.layout.activity_user_home;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isStatusBarWhite() {
|
||||
return true;
|
||||
protected void create() {
|
||||
super.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
Intent intent = getIntent();
|
||||
String toUid = intent.getStringExtra(Constants.TO_UID);
|
||||
if (TextUtils.isEmpty(toUid)) {
|
||||
uid = getIntent().getStringExtra(Constants.TO_UID);
|
||||
if (StringUtil.isEmpty(uid)) {
|
||||
ToastUtil.show("用户不存在");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
boolean fromLiveRoom = intent.getBooleanExtra(Constants.FROM_LIVE_ROOM, false);
|
||||
String fromLiveUid = fromLiveRoom ? intent.getStringExtra(Constants.LIVE_UID) : null;
|
||||
mUserHomeViewHolder = new UserHomeViewHolder2(mContext, (ViewGroup) findViewById(R.id.container), toUid, fromLiveRoom,fromLiveUid);
|
||||
mUserHomeViewHolder.addToParent();
|
||||
mUserHomeViewHolder.subscribeActivityLifeCycle();
|
||||
mUserHomeViewHolder.loadData();
|
||||
initView();
|
||||
getUseData();
|
||||
getCommunityList();
|
||||
}
|
||||
|
||||
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
||||
private void getCommunityList() {
|
||||
CommonHttpUtil.getOtherDynamicList(uid, new com.yunbao.common.http.HttpCallback() {
|
||||
@Override
|
||||
public void callback(UserBean bean) {
|
||||
UserBean userBean = CommonAppConfig.getInstance().getUserBean();
|
||||
userBean = bean;
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
List<ActiveOtherBean> beanList = JSONArray.parseArray(Arrays.toString(info), ActiveOtherBean.class);
|
||||
UserCommunityAdapter userCommunityAdapter = new UserCommunityAdapter(mContext, beanList);
|
||||
userCommunityAdapter.setOnItemClickListener(new UserCommunityAdapter.onItemClickListener() {
|
||||
@Override
|
||||
public void onImgItem(ActiveOtherBean bean, int position) {
|
||||
if (bean.getImg_or_video().equals("1")) {
|
||||
RouteUtil.forwardCommunity(bean.getId());
|
||||
} else {
|
||||
int playPosition = 0;
|
||||
for (int i = 0; i < videoList.size(); i++) {
|
||||
if (videoList.get(i).getId().equals(bean.getId())) {
|
||||
playPosition = i;
|
||||
}
|
||||
}
|
||||
RouteUtil.forwardVideoActivity();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoItem(String activeBean, int position) {
|
||||
|
||||
}
|
||||
});
|
||||
communityRecyclerView.setAdapter(userCommunityAdapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint({"SetTextI18n", "UseCompatLoadingForDrawables"})
|
||||
private void initData(HomeUserInfoBean userInfoBean) {
|
||||
userInfo = userInfoBean;
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getUser_president_name())) {
|
||||
userPresidentLayout.setVisibility(View.VISIBLE);
|
||||
userPresidentName.setText(userInfo.getUserHomeTopInfo().getUser_president_name());
|
||||
}
|
||||
isAnchor = userInfo.getUserHomeTopInfo().getIs_anchor() == 1;
|
||||
isMe = CommonAppConfig.getInstance().getUserBean().getId().equals(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()));
|
||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_avatar(), avatar);
|
||||
topName.setText(userInfo.getUserHomeTopInfo().getUser_name()); //用户名称-顶部
|
||||
userName.setText(userInfo.getUserHomeTopInfo().getUser_name());//用户名称
|
||||
fansCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_fans_num()));//粉丝数量
|
||||
likeCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_love_num()));//关注数量
|
||||
|
||||
public void addImpress(String toUid) {
|
||||
Intent intent = new Intent(mContext, LiveAddImpressActivity.class);
|
||||
intent.putExtra(Constants.TO_UID, toUid);
|
||||
startActivityForResult(intent, 100);
|
||||
if (isMe) {
|
||||
bottomEditLayout.setVisibility(View.VISIBLE);
|
||||
imgUp.setVisibility(View.VISIBLE);
|
||||
imgLabel.setVisibility(View.VISIBLE);
|
||||
followLayout.setVisibility(View.GONE);
|
||||
}
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getUser_goodnum())) {
|
||||
userId.setText("ID:" + userInfo.getUserHomeTopInfo().getUser_goodnum());//用户靓号
|
||||
} else {
|
||||
userId.setText("ID:" + userInfo.getUserHomeTopInfo().getUser_id());//用户ID
|
||||
}
|
||||
|
||||
if (userInfo.getUserHomeTopInfo().getRong_online().equals("0")) {
|
||||
userStatus.setText(getResources().getString(R.string.activity_msg_chat_top_status_online));
|
||||
userStatusIcon.setImageDrawable(getResources().getDrawable(R.mipmap.icon_green));
|
||||
} else {
|
||||
userStatus.setText(R.string.activity_msg_chat_top_status_offline);
|
||||
userStatusIcon.setImageDrawable(getResources().getDrawable(R.mipmap.icon_gray));
|
||||
}
|
||||
if (userInfo.getUserHomeTopInfo().getIs_live() == 1) {
|
||||
liveStatus.setVisibility(View.VISIBLE);
|
||||
avatar.setBackground(getResources().getDrawable(R.drawable.bg_live_1));
|
||||
}
|
||||
ImgLoader.display(UserHomeActivity.this, Integer.parseInt(String.valueOf(userInfo.getUserHomeTopInfo().getUser_sex())) == 0 ? R.mipmap.icon_man_new : R.mipmap.icon_wumen, user_sex);
|
||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_anchor_img(), authorIcon);
|
||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_img(), levelIcon);
|
||||
|
||||
if (isAnchor) {//是否是主播
|
||||
authorIcon.setVisibility(View.VISIBLE);
|
||||
authenticationLayout.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
imgUp.setVisibility(View.GONE);
|
||||
authorIcon.setVisibility(View.GONE);
|
||||
authenticationLayout.setVisibility(View.GONE);
|
||||
}
|
||||
if (userInfo.getUserHomeTopInfo().getIs_attention() == 1) {
|
||||
ImgLoader.display(UserHomeActivity.this, R.mipmap.icon_like_followed, followIcon);
|
||||
followName.setText(getResources().getString(R.string.following));
|
||||
followName.setTextColor(Color.parseColor("#777777"));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type_1));
|
||||
} else {
|
||||
ImgLoader.display(UserHomeActivity.this, R.mipmap.icon_like_follow, followIcon);
|
||||
followName.setText(getResources().getString(R.string.focus_on));
|
||||
followName.setTextColor(getResources().getColor(R.color.white));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type));
|
||||
}
|
||||
signature.setText(userInfo.getUserHomeTopInfo().getUser_signature());//个性签名
|
||||
//标签
|
||||
myAdapter = new LabelTagAdapter(mContext, new LabelTagAdapter.OnSureOnClickListener() {
|
||||
@Override
|
||||
public void sure(LabelBean.Children labelBean) {
|
||||
|
||||
}
|
||||
});
|
||||
tagList = new ArrayList<>();
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getAge())) {
|
||||
tagList.add(userInfo.getUserHomeTopInfo().getAge() + (WordUtil.isNewZh() ? "歲" : "years old"));
|
||||
}
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getHeight())) {
|
||||
tagList.add(userInfo.getUserHomeTopInfo().getHeight());
|
||||
}
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getCareer())) {
|
||||
tagList.add(userInfo.getUserHomeTopInfo().getCareer());
|
||||
}
|
||||
if (userInfo.getUserHomeTopInfo().getCn_label() != null) {
|
||||
if (userInfo.getUserHomeTopInfo().getCn_label().size() > 0) {
|
||||
for (int i = 0; i < userInfo.getUserHomeTopInfo().getCn_label().size(); i++) {
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getCn_label().get(i))) {
|
||||
tagList.add(userInfo.getUserHomeTopInfo().getCn_label().get(i));
|
||||
}
|
||||
}
|
||||
myFlowTag.setAdapter(myAdapter);
|
||||
myFlowTag.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
||||
myAdapter.setData(tagList);
|
||||
}
|
||||
}
|
||||
mBanner.setOutlineProvider(new ViewOutlineProvider() {
|
||||
@Override
|
||||
public void getOutline(View view, Outline outline) {
|
||||
outline.setRoundRect(0, 0, 0, 0, 0);
|
||||
}
|
||||
});
|
||||
mBanner.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
bannerImgList = new ArrayList<>();
|
||||
if (isAnchor) {
|
||||
if (userInfo.getUserHomeTopInfo().getUser_home_banner() == null || userInfo.getUserHomeTopInfo().getUser_home_banner().size() == 0) {
|
||||
bannerImgList.add(userInfo.getUserHomeTopInfo().getUser_avatar());
|
||||
} else {
|
||||
bannerImgList.addAll(userInfo.getUserHomeTopInfo().getUser_home_banner());
|
||||
}
|
||||
} else {
|
||||
bannerImgList.add(userInfo.getUserHomeTopInfo().getUser_avatar());
|
||||
}
|
||||
|
||||
tempList = new ArrayList<>();
|
||||
for (int i = 0; i < bannerImgList.size(); i++) {
|
||||
tempList.add(new UserHomeImgBean(bannerImgList.get(i)));
|
||||
}
|
||||
if (tempList.size() > 0) {
|
||||
tempList.get(0).setShow(true);
|
||||
}
|
||||
userHomeImgAdapter = new UserHomeImgAdapter(UserHomeActivity.this, tempList, isMe);
|
||||
imgsRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||
imgsRecyclerView.setAdapter(userHomeImgAdapter);
|
||||
|
||||
userHomeImgAdapter.setOnItemClickListener(new UserHomeImgAdapter.onItemClickListener() {
|
||||
@Override
|
||||
public void onImgItem(UserHomeImgBean activeBean, int position) {
|
||||
L.e("onImgItem:" + position);
|
||||
mBanner.setCurrentPage(position).start();
|
||||
for (int i = 0; i < tempList.size(); i++) {
|
||||
if (i == position) {
|
||||
tempList.get(i).setShow(true);
|
||||
} else {
|
||||
tempList.get(i).setShow(false);
|
||||
}
|
||||
}
|
||||
userHomeImgAdapter.setCommentBeanList(tempList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onImgDel(UserHomeImgBean activeBean, int position) {
|
||||
DialogUitl.showSimpleDialog(mContext, getResources().getString(com.yunbao.main.R.string.user_home_img_del_dialog), new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
bannerImgList.remove(position);
|
||||
uploadImg(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
mBanner.setAutoPlay(false).setPages(bannerImgList, new UserHomeImgsViewHolder()).setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
L.e("onPageSelected:" + position);
|
||||
for (int i = 0; i < tempList.size(); i++) {
|
||||
if (i == position) {
|
||||
tempList.get(i).setShow(true);
|
||||
} else {
|
||||
tempList.get(i).setShow(false);
|
||||
}
|
||||
}
|
||||
userHomeImgAdapter.setCommentBeanList(tempList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
mBanner.start();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
bottomEditLayout = findViewById(R.id.bottomEditLayout);
|
||||
imgUp = findViewById(R.id.imgUp);
|
||||
imgLabel = findViewById(R.id.imgLabel);
|
||||
topImgLayout = findViewById(R.id.topImgLayout);
|
||||
|
||||
topLayout = findViewById(R.id.topLayout);
|
||||
scrollView = findViewById(R.id.scrollView);
|
||||
|
||||
topName = findViewById(R.id.topName);
|
||||
liveStatus = findViewById(R.id.liveStatus);
|
||||
giftCount = findViewById(R.id.giftCount);
|
||||
|
||||
fansImg1 = findViewById(R.id.fansImg1);
|
||||
fansImg2 = findViewById(R.id.fansImg2);
|
||||
fansImg3 = findViewById(R.id.fansImg3);
|
||||
fansImgViewList = new ArrayList<>();
|
||||
fansImgViewList.add(fansImg1);
|
||||
fansImgViewList.add(fansImg2);
|
||||
fansImgViewList.add(fansImg3);
|
||||
|
||||
guardImg1 = findViewById(R.id.guardImg1);
|
||||
guardImg2 = findViewById(R.id.guardImg2);
|
||||
guardImg3 = findViewById(R.id.guardImg3);
|
||||
guardImgViewList = new ArrayList<>();
|
||||
guardImgViewList.add(guardImg1);
|
||||
guardImgViewList.add(guardImg2);
|
||||
guardImgViewList.add(guardImg3);
|
||||
|
||||
giftImg1 = findViewById(R.id.giftImg1);
|
||||
giftImg2 = findViewById(R.id.giftImg2);
|
||||
giftImg3 = findViewById(R.id.giftImg3);
|
||||
giftImgViewList = new ArrayList<>();
|
||||
giftImgViewList.add(giftImg1);
|
||||
giftImgViewList.add(giftImg2);
|
||||
giftImgViewList.add(giftImg3);
|
||||
|
||||
honorImg1 = findViewById(R.id.honorImg1);
|
||||
honorImg2 = findViewById(R.id.honorImg2);
|
||||
honorImg3 = findViewById(R.id.honorImg3);
|
||||
honorImgViewList = new ArrayList<>();
|
||||
honorImgViewList.add(honorImg1);
|
||||
honorImgViewList.add(honorImg2);
|
||||
honorImgViewList.add(honorImg3);
|
||||
|
||||
userPresidentLayout = findViewById(R.id.userPresidentLayout);
|
||||
userPresidentName = findViewById(R.id.userPresidentName);
|
||||
itemLayout01 = findViewById(R.id.itemLayout01);
|
||||
itemLayout02 = findViewById(R.id.itemLayout02);
|
||||
itemLayout03 = findViewById(R.id.itemLayout03);
|
||||
itemLayout04 = findViewById(R.id.itemLayout04);
|
||||
communityRecyclerView = findViewById(R.id.communityRecyclerView);
|
||||
myFlowTag = findViewById(R.id.myFlowTag);
|
||||
avatar = findViewById(R.id.avatar);
|
||||
userName = findViewById(R.id.name);
|
||||
fansCount = findViewById(R.id.fansCount);
|
||||
likeCount = findViewById(R.id.likeCount);
|
||||
followLayout = findViewById(R.id.followLayout);
|
||||
followName = findViewById(R.id.followName);
|
||||
followIcon = findViewById(R.id.followIcon);
|
||||
userId = findViewById(R.id.userId);
|
||||
userStatus = findViewById(R.id.userStatus);
|
||||
userStatusIcon = findViewById(R.id.userStatusIcon);
|
||||
user_sex = findViewById(R.id.user_sex);
|
||||
|
||||
levelIcon = findViewById(R.id.levelIcon);
|
||||
authorIcon = findViewById(R.id.authorlIcon);
|
||||
|
||||
authenticationLayout = findViewById(R.id.authenticationLayout);
|
||||
signature = findViewById(R.id.signature);
|
||||
moreLayout = findViewById(R.id.moreLayout);
|
||||
moreText = findViewById(R.id.moreText);
|
||||
moreIcon = findViewById(R.id.moreIcon);
|
||||
|
||||
mBanner = findViewById(R.id.banner);
|
||||
imgsRecyclerView = findViewById(R.id.imgsRecyclerView);
|
||||
|
||||
communityRecyclerView = findViewById(R.id.communityRecyclerView);
|
||||
communityRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
communityRecyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
|
||||
findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
followLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
CommonHttpUtil.setAttention(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()), new CommonCallback<Integer>() {
|
||||
@Override
|
||||
public void callback(Integer isAttention) {
|
||||
if (isAttention == 1) {
|
||||
ImgLoader.display(UserHomeActivity.this, R.mipmap.icon_like_followed, followIcon);
|
||||
followName.setText(getResources().getString(R.string.following));
|
||||
followName.setTextColor(Color.parseColor("#777777"));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type_1));
|
||||
} else {
|
||||
ImgLoader.display(UserHomeActivity.this, R.mipmap.icon_like_follow, followIcon);
|
||||
followName.setText(getResources().getString(R.string.follow));
|
||||
followName.setTextColor(getResources().getColor(R.color.white));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
moreLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (isShowcase) {
|
||||
if (isAnchor) {
|
||||
itemLayout01.setVisibility(View.GONE);
|
||||
itemLayout02.setVisibility(View.GONE);
|
||||
itemLayout03.setVisibility(View.GONE);
|
||||
itemLayout04.setVisibility(View.GONE);
|
||||
} else {
|
||||
itemLayout03.setVisibility(View.GONE);
|
||||
itemLayout04.setVisibility(View.GONE);
|
||||
}
|
||||
moreText.setText(getResources().getString(R.string.see_more));
|
||||
ImgLoader.display(mContext, R.mipmap.icon_down, moreIcon);
|
||||
} else {
|
||||
if (isAnchor) {
|
||||
itemLayout01.setVisibility(View.VISIBLE);
|
||||
itemLayout02.setVisibility(View.VISIBLE);
|
||||
itemLayout03.setVisibility(View.VISIBLE);
|
||||
itemLayout04.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
itemLayout03.setVisibility(View.VISIBLE);
|
||||
itemLayout04.setVisibility(View.VISIBLE);
|
||||
}
|
||||
moreText.setText(getResources().getString(com.yunbao.main.R.string.close));
|
||||
ImgLoader.display(mContext, R.mipmap.icon_up, moreIcon);
|
||||
}
|
||||
isShowcase = !isShowcase;
|
||||
}
|
||||
});
|
||||
findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
scrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
|
||||
@Override
|
||||
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
|
||||
int height = (int) (topImgLayout.getMeasuredHeight() * 1.2);
|
||||
if (scrollY <= 0) {
|
||||
//滑动之前,标题栏布局背景颜色为完全透明,标题文字完全透明
|
||||
topLayout.setBackgroundColor(Color.argb(0, 0, 0, 0));
|
||||
topName.setTextColor(Color.argb(0, 255, 255, 255));
|
||||
//让mScrollView滑动的距离在0~height之间时颜色发生渐变
|
||||
} else if (scrollY > 0 && scrollY <= height) {
|
||||
//获取渐变率
|
||||
float scale = (float) scrollY / height;
|
||||
//获取渐变数值
|
||||
float alpha = (255 * scale);
|
||||
//布局文本颜色逐渐发生变化
|
||||
topLayout.setBackgroundColor(Color.argb((int) alpha, 0, 0, 0));
|
||||
topName.setTextColor(Color.argb((int) alpha, 255, 255, 255));
|
||||
} else {
|
||||
//当滑动距离超过height,布局文本颜色完全不透明
|
||||
topLayout.setBackgroundColor(Color.argb(255, 0, 0, 0));
|
||||
topName.setTextColor(Color.argb(255, 255, 255, 255));
|
||||
}
|
||||
}
|
||||
});
|
||||
topLayout.setBackgroundColor(Color.argb(0, 0, 0, 0));
|
||||
topName.setTextColor(Color.argb(0, 255, 255, 255));
|
||||
}
|
||||
imgUp.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (bannerImgList.size() < 9) {
|
||||
selectImg();
|
||||
} else {
|
||||
ToastUtil.show(getResources().getString(com.yunbao.main.R.string._9));
|
||||
}
|
||||
}
|
||||
});
|
||||
bottomEditLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
RouteUtil.forwardEditProfileActivity();
|
||||
}
|
||||
});
|
||||
findViewById(R.id.setting).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String temp = userInfo.getCheckBlack().get(0).getU2t().equals("0") ? getResources().getString(R.string.black_add) : getResources().getString(com.yunbao.main.R.string.cancel_back);
|
||||
SparseArray<String> array = new SparseArray<>();
|
||||
array.append(1, getResources().getString(com.yunbao.main.R.string.not_interested));
|
||||
array.append(0, getResources().getString(R.string.report));
|
||||
array.append(2, temp);
|
||||
DialogUitl.showStringArrayDialog(UserHomeActivity.this, array, new DialogUitl.StringArrayDialogCallback() {
|
||||
@Override
|
||||
public void onItemClick(String text, int tag) {
|
||||
if (tag == 0) {
|
||||
RouteUtil.forwardLiveReportActivity(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()));
|
||||
} else if (tag == 1) {
|
||||
CommonHttpUtil.noInterest(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()), new com.yunbao.common.http.HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info != null) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(info[0]);
|
||||
userInfo.getCheckBlack().get(0).setU2t(jsonObject.getString("isblack"));
|
||||
}
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
CommonHttpUtil.noInterest(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()), new com.yunbao.common.http.HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info != null) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(info[0]);
|
||||
userInfo.getCheckBlack().get(0).setU2t(jsonObject.getString("isblack"));
|
||||
}
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void selectImg() {
|
||||
String permission1 = Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||
String permission2 = Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
permission1 = Manifest.permission.READ_MEDIA_IMAGES;
|
||||
permission2 = Manifest.permission.READ_MEDIA_VIDEO;
|
||||
}
|
||||
int isPermission1 = ContextCompat.checkSelfPermission(mContext, permission1);
|
||||
int isPermission2 = ContextCompat.checkSelfPermission(mContext, permission2);
|
||||
if (isPermission1 == PackageManager.PERMISSION_GRANTED && isPermission2 == PackageManager.PERMISSION_GRANTED) {
|
||||
openImageChooserActivity();
|
||||
} else {
|
||||
//申请权限
|
||||
ActivityCompat.requestPermissions(UserHomeActivity.this, new String[]{permission1, permission2}, PERMISSION_REQUEST_CODE_IMG);
|
||||
}
|
||||
}
|
||||
|
||||
private void openImageChooserActivity() {
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.setType("image/*");
|
||||
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, false);
|
||||
startActivityForResult(intent, CHOOSE_IMG);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode == 100 && resultCode == RESULT_OK) {
|
||||
if (mUserHomeViewHolder != null) {
|
||||
mUserHomeViewHolder.refreshImpress();
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
if (requestCode == PERMISSION_REQUEST_CODE_IMG) {
|
||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
openImageChooserActivity();
|
||||
} else {
|
||||
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE_IMG);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getUseData() {
|
||||
LiveNetManager.get(mContext).getUserHomeInfo(uid, new HttpCallback<HomeUserInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(HomeUserInfoBean data) {
|
||||
initData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
LiveNetManager.get(mContext).getUserExhibitInfoInfo(uid, new HttpCallback<HomeUserExhibitInfoBean>() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void onSuccess(HomeUserExhibitInfoBean data) {
|
||||
//主播粉丝团
|
||||
if (data.getUserHomeTopInfo().getFans().getList() != null) {
|
||||
if (data.getUserHomeTopInfo().getFans().getList().size() >= 3) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getFans().getList().get(i).getAvatar(), fansImgViewList.get(i));
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < data.getUserHomeTopInfo().getFans().getList().size(); i++) {
|
||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getFans().getList().get(i).getAvatar(), fansImgViewList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
//主播守护团
|
||||
if (data.getUserHomeTopInfo().getGuard() != null) {
|
||||
if (data.getUserHomeTopInfo().getGuard().size() >= 3) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getGuard().get(i).getAvatar(), guardImgViewList.get(i));
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < data.getUserHomeTopInfo().getGuard().size(); i++) {
|
||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getGuard().get(i).getAvatar(), guardImgViewList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
//礼物墙
|
||||
if (data.getGiftAlreadyWall().getGift_wall() != null) {
|
||||
if (data.getGiftAlreadyWall().getGift_wall().size() >= 3) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ImgLoader.display(mContext, data.getGiftAlreadyWall().getGift_wall().get(i).getGifticon(), giftImgViewList.get(i));
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < data.getGiftAlreadyWall().getGift_wall().size(); i++) {
|
||||
ImgLoader.display(mContext, data.getGiftAlreadyWall().getGift_wall().get(i).getGifticon(), giftImgViewList.get(i));
|
||||
}
|
||||
}
|
||||
giftCount.setText(data.getGiftAlreadyWall().getGift_wall().size() + "/36");
|
||||
}
|
||||
//荣誉墙
|
||||
if (data.getUserHomeTopInfo().getDress() != null) {
|
||||
if (data.getUserHomeTopInfo().getDress().size() >= 3) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getDress().get(i).getDisplay_src(), honorImgViewList.get(i));
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < data.getUserHomeTopInfo().getDress().size(); i++) {
|
||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getDress().get(i).getDisplay_src(), honorImgViewList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (mUserHomeViewHolder != null) {
|
||||
mUserHomeViewHolder.release();
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK && requestCode == CHOOSE_IMG) {
|
||||
// 获取用户选择的图片 URI
|
||||
Uri[] imageUris = null;
|
||||
if (data != null) {
|
||||
imageUris = new Uri[]{data.getData()};
|
||||
File file = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, imageUris[0])));
|
||||
uploadFile(file);
|
||||
}
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
private void uploadFile(File file) {
|
||||
if (mUploadStrategy == null) {
|
||||
mUploadStrategy = new UploadQnImpl(mContext);
|
||||
}
|
||||
List<UploadBean> uploadBeans = new ArrayList<>();
|
||||
UploadBean upVideoBean = new UploadBean(file, UploadBean.IMG);
|
||||
uploadBeans.add(upVideoBean);
|
||||
mUploadStrategy.upload(uploadBeans, true, new UploadCallback() {
|
||||
@Override
|
||||
public void onFinish(List<UploadBean> list, boolean success) {
|
||||
if (!success) {
|
||||
return;
|
||||
}
|
||||
bannerImgList.add("https://downs.yaoulive.com/" + list.get(0).getRemoteAccessUrl());
|
||||
uploadImg(true);
|
||||
L.e(new Gson().toJson(list));
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
private void uploadImg(boolean isUp) {
|
||||
CommonHttpUtil.uploadUserInfoImg(new Gson().toJson(bannerImgList), new com.yunbao.common.http.HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info != null) {
|
||||
if (isUp) {
|
||||
ToastUtil.show(getResources().getString(com.yunbao.main.R.string.upload_success));
|
||||
} else {
|
||||
ToastUtil.show(getResources().getString(com.yunbao.main.R.string.upload_failed));
|
||||
}
|
||||
mBanner.setPages(bannerImgList, new UserHomeImgsViewHolder()).start();
|
||||
tempList = new ArrayList<>();
|
||||
for (int i = 0; i < bannerImgList.size(); i++) {
|
||||
tempList.add(new UserHomeImgBean(bannerImgList.get(i)));
|
||||
}
|
||||
if (tempList.size() > 0) {
|
||||
tempList.get(0).setShow(true);
|
||||
}
|
||||
userHomeImgAdapter.setCommentBeanList(tempList);
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.live.activity.LiveAddImpressActivity;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
import com.yunbao.main.views.UserHomeViewHolder2;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/25.
|
||||
*/
|
||||
//@Route(path = RouteUtil.PATH_USER_HOME)
|
||||
public class UserHomeActivityOld extends AbsActivity {
|
||||
|
||||
private UserHomeViewHolder2 mUserHomeViewHolder;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_empty;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isStatusBarWhite() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
Intent intent = getIntent();
|
||||
String toUid = intent.getStringExtra(Constants.TO_UID);
|
||||
if (TextUtils.isEmpty(toUid)) {
|
||||
return;
|
||||
}
|
||||
boolean fromLiveRoom = intent.getBooleanExtra(Constants.FROM_LIVE_ROOM, false);
|
||||
String fromLiveUid = fromLiveRoom ? intent.getStringExtra(Constants.LIVE_UID) : null;
|
||||
mUserHomeViewHolder = new UserHomeViewHolder2(mContext, (ViewGroup) findViewById(R.id.container), toUid, fromLiveRoom,fromLiveUid);
|
||||
mUserHomeViewHolder.addToParent();
|
||||
mUserHomeViewHolder.subscribeActivityLifeCycle();
|
||||
mUserHomeViewHolder.loadData();
|
||||
|
||||
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
||||
@Override
|
||||
public void callback(UserBean bean) {
|
||||
UserBean userBean = CommonAppConfig.getInstance().getUserBean();
|
||||
userBean = bean;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void addImpress(String toUid) {
|
||||
Intent intent = new Intent(mContext, LiveAddImpressActivity.class);
|
||||
intent.putExtra(Constants.TO_UID, toUid);
|
||||
startActivityForResult(intent, 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode == 100 && resultCode == RESULT_OK) {
|
||||
if (mUserHomeViewHolder != null) {
|
||||
mUserHomeViewHolder.refreshImpress();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (mUserHomeViewHolder != null) {
|
||||
mUserHomeViewHolder.release();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
@@ -120,6 +121,9 @@ public class MainMsgAddressBookListAdapter extends BaseAdapter<MessageChatUserBe
|
||||
} else {
|
||||
holder.getView(R.id.btn).setVisibility(View.GONE);
|
||||
}
|
||||
holder.getView(R.id.rc_conversation_portrait).setOnClickListener(view -> {
|
||||
RouteUtil.forwardUserHome(mDataList.get(position).getId());
|
||||
});
|
||||
holder.getView(R.id.btn).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
@@ -19,7 +19,6 @@ public class MessageChatTopImageListAdapter extends RecyclerView.Adapter<com.yun
|
||||
List<String> urls = new ArrayList<>();
|
||||
|
||||
public void setUrls(List<String> urls) {
|
||||
ToastUtil.show("照片数量:"+urls.size());
|
||||
this.urls = urls;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.PluginManager;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.LiveConfig;
|
||||
@@ -37,6 +38,7 @@ import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||
import com.yunbao.live.bean.LiveKsyConfigBean;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.CommunitySendActivity;
|
||||
import com.yunbao.main.activity.MyWebViewActivity;
|
||||
import com.yunbao.main.interfaces.MainStartChooseCallback;
|
||||
|
||||
@@ -165,13 +167,13 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
if (isAnchor) {
|
||||
String[] permissions;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
permissions=new String[]{
|
||||
permissions = new String[]{
|
||||
Manifest.permission.READ_MEDIA_IMAGES,
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
};
|
||||
}else{
|
||||
permissions=new String[]{
|
||||
} else {
|
||||
permissions = new String[]{
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.CAMERA,
|
||||
@@ -191,13 +193,13 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
if (isAnchor) {
|
||||
String[] permissions;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
permissions=new String[]{
|
||||
permissions = new String[]{
|
||||
Manifest.permission.READ_MEDIA_IMAGES,
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
};
|
||||
}else{
|
||||
permissions=new String[]{
|
||||
} else {
|
||||
permissions = new String[]{
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.CAMERA,
|
||||
@@ -244,9 +246,9 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
LiveHttpUtil.getLiveSdk(mGetLiveSdkCallback);
|
||||
});
|
||||
} else {
|
||||
String tips="需要下載開播插件,是否下載";
|
||||
if(!WordUtil.isNewZh()){
|
||||
tips="You need to download the plug-in, whether to download";
|
||||
String tips = "需要下載開播插件,是否下載";
|
||||
if (!WordUtil.isNewZh()) {
|
||||
tips = "You need to download the plug-in, whether to download";
|
||||
}
|
||||
DialogUitl.showSimpleDialog(mContext, tips, new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
@@ -270,7 +272,9 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
private Runnable mStartVideoRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String mBeautySdkType = CommonAppConfig.getInstance().getBeautySdkType();
|
||||
Intent intent = new Intent(mContext, CommunitySendActivity.class);
|
||||
startActivity(intent);
|
||||
/*String mBeautySdkType = CommonAppConfig.getInstance().getBeautySdkType();
|
||||
if ("2".equals(mBeautySdkType)) {
|
||||
Constants.myIntoIndex = 2;
|
||||
Intent intent = new Intent(mContext, MyWebViewActivity.class);
|
||||
@@ -281,7 +285,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
Intent intent = new Intent(mContext, MyWebViewActivity.class);
|
||||
intent.putExtra(Constants.URL, CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ/release" + "?token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isRelease=1"+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0));
|
||||
CommonAppContext.getTopActivity().startActivity(intent);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -395,7 +395,7 @@ public class MainHttpUtil {
|
||||
* @param fields 用户资料 ,以json形式出现
|
||||
*/
|
||||
public static void updateFields(String fields, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.updateFields", MainHttpConsts.UPDATE_FIELDS)
|
||||
HttpClient.getInstance().get("Pdluser.updateFields", MainHttpConsts.UPDATE_FIELDS)
|
||||
.params("fields", fields)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||