Compare commits
5 Commits
pandorapan
...
dev_聊天
| Author | SHA1 | Date | |
|---|---|---|---|
| d17f89b5c1 | |||
| 938bee4fdb | |||
| 3127a5faaf | |||
| d130c1565c | |||
| b3b46ccff3 |
@@ -7,7 +7,7 @@ import android.net.Uri;
|
|||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
import com.twitter.sdk.android.tweetcomposer.TweetUploadService;
|
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 com.yunbao.share.receiver.TwitterResultReceiver;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -23,7 +23,7 @@ public abstract class AbsShareInterface {
|
|||||||
context.registerReceiver(new TwitterResultReceiver(), filter);
|
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){
|
public Uri fileToUri(File file){
|
||||||
return FileProvider.getUriForFile(mContext,
|
return FileProvider.getUriForFile(mContext,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.yunbao.share.adapters;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -75,6 +76,10 @@ public class InternalShareAdapter extends RecyclerView.Adapter<InternalShareAdap
|
|||||||
} else {
|
} else {
|
||||||
radioButton.setChecked(false);
|
radioButton.setChecked(false);
|
||||||
}
|
}
|
||||||
|
radioButton.setOnClickListener(view -> {
|
||||||
|
selectPosition = position;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
});
|
||||||
itemView.setOnClickListener(view -> {
|
itemView.setOnClickListener(view -> {
|
||||||
selectPosition = position;
|
selectPosition = position;
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.yunbao.share.adapters;
|
package com.yunbao.share.adapters;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Environment;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -15,7 +14,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
|
|
||||||
import com.pdlive.shayu.R;
|
import com.pdlive.shayu.R;
|
||||||
import com.yunbao.share.ICallback;
|
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.FacebookShare;
|
||||||
import com.yunbao.share.platform.Instagram;
|
import com.yunbao.share.platform.Instagram;
|
||||||
import com.yunbao.share.platform.Internal;
|
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.TwitterShare;
|
||||||
import com.yunbao.share.platform.WhatsApp;
|
import com.yunbao.share.platform.WhatsApp;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppViewHolder> {
|
public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppViewHolder> {
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private List<ShareBuilder> list;
|
private List<ShareBean> list;
|
||||||
ShareCallback shareCallback;
|
ShareCallback shareCallback;
|
||||||
|
|
||||||
public ShareAppAdapter(Context mContext) {
|
public ShareAppAdapter(Context mContext) {
|
||||||
@@ -38,7 +36,7 @@ public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppVie
|
|||||||
this.mContext = mContext;
|
this.mContext = mContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setList(List<ShareBuilder> list) {
|
public void setList(List<ShareBean> list) {
|
||||||
this.list = list;
|
this.list = list;
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
@@ -51,27 +49,28 @@ public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppVie
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull AppViewHolder holder, int position) {
|
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()) {
|
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);
|
holder.setData(builder, R.mipmap.icon_share_facebook, R.string.dialog_share_app_facebook);
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_LINE:
|
case ShareBean.APP_LINE:
|
||||||
holder.setData(builder, R.mipmap.icon_share_line, R.string.dialog_share_app_line);
|
holder.setData(builder, R.mipmap.icon_share_line, R.string.dialog_share_app_line);
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_TWITTER:
|
case ShareBean.APP_TWITTER:
|
||||||
holder.setData(builder, R.mipmap.icon_share_twitter, R.string.dialog_share_app_twitter);
|
holder.setData(builder, R.mipmap.icon_share_twitter, R.string.dialog_share_app_twitter);
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_WHATSAPP:
|
case ShareBean.APP_WHATSAPP:
|
||||||
holder.setData(builder, R.mipmap.icon_share_whatsapp, R.string.dialog_share_app_whatsapp);
|
holder.setData(builder, R.mipmap.icon_share_whatsapp, R.string.dialog_share_app_whatsapp);
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_MESSENGER:
|
case ShareBean.APP_MESSENGER:
|
||||||
holder.setData(builder, R.mipmap.icon_share_messenger, R.string.dialog_share_app_messenger);
|
holder.setData(builder, R.mipmap.icon_share_messenger, R.string.dialog_share_app_messenger);
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_INSTAGRAM:
|
case ShareBean.APP_INSTAGRAM:
|
||||||
holder.setData(builder, R.mipmap.icon_share_instagram, R.string.dialog_share_app_instagram);
|
holder.setData(builder, R.mipmap.icon_share_instagram, R.string.dialog_share_app_instagram);
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_INTERNAL:
|
case ShareBean.APP_INTERNAL:
|
||||||
holder.setData(builder, R.mipmap.ic_share_friend, R.string.dialog_share_app_internal);
|
holder.setData(builder, R.mipmap.ic_share_friend, R.string.dialog_share_app_internal);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -99,30 +98,30 @@ public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppVie
|
|||||||
title = itemView.findViewById(R.id.share_app_name);
|
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);
|
icon.setImageResource(iconId);
|
||||||
title.setText(appName);
|
title.setText(appName);
|
||||||
itemView.setOnClickListener(v -> {
|
itemView.setOnClickListener(v -> {
|
||||||
switch (bean.getType()) {
|
switch (bean.getType()) {
|
||||||
case ShareBuilder.APP_FACEBOOK:
|
case ShareBean.APP_FACEBOOK:
|
||||||
new FacebookShare(itemView.getContext()).share(bean, new ShareCallback());
|
new FacebookShare(itemView.getContext()).share(bean, new ShareCallback());
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_LINE:
|
case ShareBean.APP_LINE:
|
||||||
new Line(itemView.getContext()).share(bean, new ShareCallback());
|
new Line(itemView.getContext()).share(bean, new ShareCallback());
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_TWITTER:
|
case ShareBean.APP_TWITTER:
|
||||||
new TwitterShare(itemView.getContext()).share(bean, new ShareCallback());
|
new TwitterShare(itemView.getContext()).share(bean, new ShareCallback());
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_WHATSAPP:
|
case ShareBean.APP_WHATSAPP:
|
||||||
new WhatsApp(itemView.getContext()).share(bean, new ShareCallback());
|
new WhatsApp(itemView.getContext()).share(bean, new ShareCallback());
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_MESSENGER:
|
case ShareBean.APP_MESSENGER:
|
||||||
new MessengerShare(itemView.getContext()).share(bean, new ShareCallback());
|
new MessengerShare(itemView.getContext()).share(bean, new ShareCallback());
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_INSTAGRAM:
|
case ShareBean.APP_INSTAGRAM:
|
||||||
new Instagram(itemView.getContext()).share(bean, new ShareCallback());
|
new Instagram(itemView.getContext()).share(bean, new ShareCallback());
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_INTERNAL:
|
case ShareBean.APP_INTERNAL:
|
||||||
new Internal(itemView.getContext()).share(bean, shareCallback);
|
new Internal(itemView.getContext()).share(bean, shareCallback);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
260
Share/src/main/java/com/yunbao/share/bean/ShareBean.java
Normal file
@@ -0,0 +1,260 @@
|
|||||||
|
package com.yunbao.share.bean;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
import com.yunbao.share.ui.SharePopDialog;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class ShareBean {
|
||||||
|
public static final int APP_FACEBOOK = 0;
|
||||||
|
public static final int APP_LINE = 1;
|
||||||
|
public static final int APP_TWITTER = 2;
|
||||||
|
public static final int APP_WHATSAPP = 3;
|
||||||
|
public static final int APP_MESSENGER = 4;
|
||||||
|
public static final int APP_INSTAGRAM = 5;
|
||||||
|
public static final int APP_INTERNAL = 6;
|
||||||
|
|
||||||
|
private String text;
|
||||||
|
private String link;
|
||||||
|
private File file;
|
||||||
|
private int type;
|
||||||
|
private String uid;
|
||||||
|
private String anchorId;
|
||||||
|
private String anchorName;
|
||||||
|
private String anchorAvatar;
|
||||||
|
private int shareType;
|
||||||
|
private String cover;
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
|
||||||
|
public static String createLiveShareLink(String shareUid, String anchorId, String anchorName, String anchorAvatar) {
|
||||||
|
return String.format(CommonAppConfig.HOST +
|
||||||
|
"/index.php?g=Appapi&m=home&a=share&uid=%s&user_id=%s&isGoogle=%s",
|
||||||
|
anchorId,
|
||||||
|
shareUid,
|
||||||
|
CommonAppConfig.IS_GOOGLE_PLAY
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String createInviteLink(String shareUid) {
|
||||||
|
return String.format("https://www.pdlive.com/public/app/download/index.html?user_id=%s&isGoogle=%s",
|
||||||
|
shareUid,
|
||||||
|
CommonAppConfig.IS_GOOGLE_PLAY
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ShareBean builder(int type) {
|
||||||
|
return new ShareBean(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ShareBean(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getShareType() {
|
||||||
|
return shareType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShareType(int shareType) {
|
||||||
|
this.shareType = shareType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCover() {
|
||||||
|
return cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCover(String cover) {
|
||||||
|
this.cover = cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnchorId() {
|
||||||
|
return anchorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnchorId(String anchorId) {
|
||||||
|
this.anchorId = anchorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnchorName() {
|
||||||
|
return anchorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnchorName(String anchorName) {
|
||||||
|
this.anchorName = anchorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnchorAvatar() {
|
||||||
|
return anchorAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnchorAvatar(String anchorAvatar) {
|
||||||
|
this.anchorAvatar = anchorAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBean setText(String text) {
|
||||||
|
this.text = text;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBean setLink(String link) {
|
||||||
|
this.link = link;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBean setFile(File file) {
|
||||||
|
this.file = file;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getText() {
|
||||||
|
if (StringUtil.isEmpty(text)) {
|
||||||
|
return getLink();
|
||||||
|
}
|
||||||
|
return text + "\n" + getLink();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLink() {
|
||||||
|
if (StringUtil.isEmpty(link)) {
|
||||||
|
link = createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
|
||||||
|
}
|
||||||
|
return link;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getFile() {
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ShareBuilder{" +
|
||||||
|
"text='" + text + '\'' +
|
||||||
|
", link='" + link + '\'' +
|
||||||
|
", file=" + file +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* private String text;
|
||||||
|
* private String link;
|
||||||
|
* private File file;
|
||||||
|
* private int type;
|
||||||
|
* private String uid;
|
||||||
|
* private String anchorId;
|
||||||
|
* private String anchorName;
|
||||||
|
* private String anchorAvatar;
|
||||||
|
* private int shareType;
|
||||||
|
* private String cover;
|
||||||
|
* private String title;
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ShareBean clone(){
|
||||||
|
ShareBean bean=new ShareBean(type);
|
||||||
|
bean.anchorId=anchorId;
|
||||||
|
bean.anchorName=anchorName;
|
||||||
|
bean.anchorAvatar=anchorAvatar;
|
||||||
|
bean.text=text;
|
||||||
|
bean.link=link;
|
||||||
|
bean.file=file;
|
||||||
|
bean.uid=uid;
|
||||||
|
bean.shareType=shareType;
|
||||||
|
bean.cover=cover;
|
||||||
|
bean.title=title;
|
||||||
|
return bean;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ShareBuilder {
|
||||||
|
ShareBean bean;
|
||||||
|
|
||||||
|
public ShareBuilder() {
|
||||||
|
bean = new ShareBean(APP_FACEBOOK);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setShareType(int shareType) {
|
||||||
|
bean.setShareType(shareType);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setCover(String cover) {
|
||||||
|
bean.setCover(cover);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setTitle(String title) {
|
||||||
|
bean.setTitle(title);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setUid(String uid) {
|
||||||
|
bean.setUid(uid);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setAnchorId(String anchorId) {
|
||||||
|
bean.setAnchorId(anchorId);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setAnchorName(String anchorName) {
|
||||||
|
bean.setAnchorName(anchorName);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setAnchorAvatar(String anchorAvatar) {
|
||||||
|
bean.setAnchorAvatar(anchorAvatar);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setText(String text) {
|
||||||
|
bean.setText(text);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setLink(String link) {
|
||||||
|
bean.setLink(link);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setFile(File file) {
|
||||||
|
bean.setFile(file);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public ShareBean build() {
|
||||||
|
return bean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static ShareBuilder create() {
|
||||||
|
return new ShareBuilder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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.Sharer;
|
||||||
import com.facebook.share.model.ShareLinkContent;
|
import com.facebook.share.model.ShareLinkContent;
|
||||||
import com.facebook.share.widget.ShareDialog;
|
import com.facebook.share.widget.ShareDialog;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
|
||||||
import com.yunbao.share.AbsShareInterface;
|
import com.yunbao.share.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
|
|
||||||
public class FacebookShare extends AbsShareInterface {
|
public class FacebookShare extends AbsShareInterface {
|
||||||
public static CallbackManager callbackManager;
|
public static CallbackManager callbackManager;
|
||||||
@@ -24,7 +23,7 @@ public class FacebookShare extends AbsShareInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder builder, ICallback callback) {
|
public void share(ShareBean builder, ICallback callback) {
|
||||||
callbackManager= CallbackManager.Factory.create();
|
callbackManager= CallbackManager.Factory.create();
|
||||||
ShareLinkContent content = new ShareLinkContent.Builder()
|
ShareLinkContent content = new ShareLinkContent.Builder()
|
||||||
.setContentUrl(Uri.parse(builder.getLink()))
|
.setContentUrl(Uri.parse(builder.getLink()))
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import android.net.Uri;
|
|||||||
|
|
||||||
import com.yunbao.share.AbsShareInterface;
|
import com.yunbao.share.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
|
|
||||||
public class Instagram extends AbsShareInterface {
|
public class Instagram extends AbsShareInterface {
|
||||||
public Instagram(Context context) {
|
public Instagram(Context context) {
|
||||||
@@ -14,7 +14,7 @@ public class Instagram extends AbsShareInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder builder, ICallback callback) {
|
public void share(ShareBean builder, ICallback callback) {
|
||||||
String type = "image/*";
|
String type = "image/*";
|
||||||
Intent share = new Intent(Intent.ACTION_SEND);
|
Intent share = new Intent(Intent.ACTION_SEND);
|
||||||
Uri uri = fileToUri(builder.getFile());
|
Uri uri = fileToUri(builder.getFile());
|
||||||
|
|||||||
@@ -3,20 +3,23 @@ package com.yunbao.share.platform;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
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.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
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.AppInternalShareDialog;
|
||||||
import com.yunbao.share.ui.ShareSuccessNotifyDialog;
|
import com.yunbao.share.ui.ShareSuccessNotifyDialog;
|
||||||
|
|
||||||
|
import io.rong.imlib.model.Conversation;
|
||||||
|
|
||||||
public class Internal extends AbsShareInterface {
|
public class Internal extends AbsShareInterface {
|
||||||
public Internal(Context context) {
|
public Internal(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder builder, ICallback callback) {
|
public void share(ShareBean builder, ICallback callback) {
|
||||||
new AppInternalShareDialog(mContext)
|
new AppInternalShareDialog(mContext)
|
||||||
.setOnItemClickListener(new OnItemClickListener<String>() {
|
.setOnItemClickListener(new OnItemClickListener<String>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -26,10 +29,36 @@ public class Internal extends AbsShareInterface {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
builder.setUid(toUid);
|
builder.setUid(toUid);
|
||||||
|
sendMessage(builder);
|
||||||
new ShareSuccessNotifyDialog(mContext, builder)
|
new ShareSuccessNotifyDialog(mContext, builder)
|
||||||
.showDialog();
|
.showDialog();
|
||||||
callback.onSuccess();
|
callback.onSuccess();
|
||||||
}
|
}
|
||||||
}).showDialog();
|
}).showDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sendMessage(ShareBean builder) {
|
||||||
|
MessageChatCardContent.sendMessage(Conversation.ConversationType.PRIVATE, builder.getUid(),
|
||||||
|
MessageChatCardContent.obtain(
|
||||||
|
builder.getCover(),
|
||||||
|
builder.getTitle(),
|
||||||
|
builder.getAnchorAvatar(),
|
||||||
|
builder.getAnchorName(),
|
||||||
|
builder.getAnchorId(),
|
||||||
|
builder.getShareType() + "",
|
||||||
|
builder.getAnchorId()
|
||||||
|
),
|
||||||
|
new OnSendMessageListener<Object>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String token, Object bean) {
|
||||||
|
super.onSuccess(token, bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int status, String msg) {
|
||||||
|
super.onError(status, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import android.net.Uri;
|
|||||||
|
|
||||||
import com.yunbao.share.AbsShareInterface;
|
import com.yunbao.share.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
|
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ public class Line extends AbsShareInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder builder, ICallback callback) {
|
public void share(ShareBean builder, ICallback callback) {
|
||||||
try {
|
try {
|
||||||
Intent share = new Intent(Intent.ACTION_VIEW, Uri.parse("https://line.me/R/share?text=" + URLEncoder.encode(builder.getText(), "UTF-8")));
|
Intent share = new Intent(Intent.ACTION_VIEW, Uri.parse("https://line.me/R/share?text=" + URLEncoder.encode(builder.getText(), "UTF-8")));
|
||||||
mContext.startActivity(share);
|
mContext.startActivity(share);
|
||||||
|
|||||||
@@ -13,10 +13,9 @@ import com.facebook.FacebookSdk;
|
|||||||
import com.facebook.share.Sharer;
|
import com.facebook.share.Sharer;
|
||||||
import com.facebook.share.model.ShareLinkContent;
|
import com.facebook.share.model.ShareLinkContent;
|
||||||
import com.facebook.share.widget.MessageDialog;
|
import com.facebook.share.widget.MessageDialog;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
|
||||||
import com.yunbao.share.AbsShareInterface;
|
import com.yunbao.share.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
|
|
||||||
public class MessengerShare extends AbsShareInterface {
|
public class MessengerShare extends AbsShareInterface {
|
||||||
public static CallbackManager callbackManager;
|
public static CallbackManager callbackManager;
|
||||||
@@ -27,7 +26,7 @@ public class MessengerShare extends AbsShareInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder builder, ICallback callback) {
|
public void share(ShareBean builder, ICallback callback) {
|
||||||
callbackManager = CallbackManager.Factory.create();
|
callbackManager = CallbackManager.Factory.create();
|
||||||
ShareLinkContent content = new ShareLinkContent.Builder()
|
ShareLinkContent content = new ShareLinkContent.Builder()
|
||||||
.setContentUrl(Uri.parse(builder.getLink()))
|
.setContentUrl(Uri.parse(builder.getLink()))
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import android.net.Uri;
|
|||||||
import com.twitter.sdk.android.core.Twitter;
|
import com.twitter.sdk.android.core.Twitter;
|
||||||
import com.yunbao.share.AbsShareInterface;
|
import com.yunbao.share.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
|
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ public class TwitterShare extends AbsShareInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder date, ICallback callback) {
|
public void share(ShareBean date, ICallback callback) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
new TwitterAuthClient().authorize((Activity) mContext, new Callback<TwitterSession>() {
|
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.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
|
|
||||||
public class WhatsApp extends AbsShareInterface {
|
public class WhatsApp extends AbsShareInterface {
|
||||||
public WhatsApp(Context context) {
|
public WhatsApp(Context context) {
|
||||||
@@ -13,7 +13,7 @@ public class WhatsApp extends AbsShareInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder builder, ICallback callback) {
|
public void share(ShareBean builder, ICallback callback) {
|
||||||
try {
|
try {
|
||||||
Intent sendIntent = new Intent();
|
Intent sendIntent = new Intent();
|
||||||
sendIntent.setAction(Intent.ACTION_SEND);
|
sendIntent.setAction(Intent.ACTION_SEND);
|
||||||
|
|||||||
@@ -2,27 +2,21 @@ package com.yunbao.share.ui;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.pdlive.shayu.R;
|
import com.pdlive.shayu.R;
|
||||||
import com.yunbao.common.bean.MessageChatUserBean;
|
|
||||||
import com.yunbao.common.dialog.AbsDialogFullScreenPopupWindow;
|
import com.yunbao.common.dialog.AbsDialogFullScreenPopupWindow;
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.ViewUtils;
|
|
||||||
import com.yunbao.share.adapters.InternalShareAdapter;
|
import com.yunbao.share.adapters.InternalShareAdapter;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.rong.imkit.conversationlist.model.SingleConversation;
|
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.SmartRefreshLayout;
|
||||||
import io.rong.imkit.widget.refresh.api.RefreshLayout;
|
import io.rong.imkit.widget.refresh.api.RefreshLayout;
|
||||||
import io.rong.imkit.widget.refresh.listener.OnLoadMoreListener;
|
import io.rong.imkit.widget.refresh.listener.OnLoadMoreListener;
|
||||||
@@ -31,7 +25,6 @@ import io.rong.imkit.widget.refresh.wrapper.RongRefreshHeader;
|
|||||||
import io.rong.imlib.IRongCoreCallback;
|
import io.rong.imlib.IRongCoreCallback;
|
||||||
import io.rong.imlib.IRongCoreEnum;
|
import io.rong.imlib.IRongCoreEnum;
|
||||||
import io.rong.imlib.RongCoreClient;
|
import io.rong.imlib.RongCoreClient;
|
||||||
import io.rong.imlib.RongIMClient;
|
|
||||||
import io.rong.imlib.model.Conversation;
|
import io.rong.imlib.model.Conversation;
|
||||||
|
|
||||||
public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow {
|
public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow {
|
||||||
@@ -72,6 +65,10 @@ public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow {
|
|||||||
dismiss();
|
dismiss();
|
||||||
});
|
});
|
||||||
findViewById(R.id.btn_share).setOnClickListener(view -> {
|
findViewById(R.id.btn_share).setOnClickListener(view -> {
|
||||||
|
if(adapter.getSelectPosition()==-1){
|
||||||
|
ToastUtil.show(R.string.dialog_share_failure_not_select);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (onItemClickListener != null) {
|
if (onItemClickListener != null) {
|
||||||
onItemClickListener.onItemClick(listData.get(adapter.getSelectPosition()).mCore.getTargetId(), adapter.getSelectPosition());
|
onItemClickListener.onItemClick(listData.get(adapter.getSelectPosition()).mCore.getTargetId(), adapter.getSelectPosition());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,12 @@ package com.yunbao.share.ui;
|
|||||||
|
|
||||||
import static android.content.Context.CLIPBOARD_SERVICE;
|
import static android.content.Context.CLIPBOARD_SERVICE;
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.LinearGradient;
|
import android.graphics.LinearGradient;
|
||||||
import android.graphics.Shader;
|
import android.graphics.Shader;
|
||||||
import android.view.ViewTreeObserver;
|
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -22,10 +20,8 @@ import com.makeramen.roundedimageview.RoundedImageView;
|
|||||||
import com.pdlive.shayu.R;
|
import com.pdlive.shayu.R;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
|
||||||
import com.yunbao.share.adapters.ShareAppAdapter;
|
import com.yunbao.share.adapters.ShareAppAdapter;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -38,7 +34,7 @@ public class InvitePopDialog extends AbsDialogPopupWindow {
|
|||||||
private TextView info;
|
private TextView info;
|
||||||
private TextView link;
|
private TextView link;
|
||||||
private TextView title;
|
private TextView title;
|
||||||
private List<ShareBuilder> data;
|
private List<ShareBean> data;
|
||||||
|
|
||||||
private String uid;
|
private String uid;
|
||||||
private String anchorId;
|
private String anchorId;
|
||||||
@@ -123,18 +119,18 @@ public class InvitePopDialog extends AbsDialogPopupWindow {
|
|||||||
|
|
||||||
private void initData() {
|
private void initData() {
|
||||||
data = new ArrayList<>();
|
data = new ArrayList<>();
|
||||||
data.add(builder(ShareBuilder.APP_FACEBOOK));
|
data.add(builder(ShareBean.APP_FACEBOOK));
|
||||||
data.add(builder(ShareBuilder.APP_LINE));
|
data.add(builder(ShareBean.APP_LINE));
|
||||||
data.add(builder(ShareBuilder.APP_TWITTER));
|
data.add(builder(ShareBean.APP_TWITTER));
|
||||||
data.add(builder(ShareBuilder.APP_WHATSAPP));
|
data.add(builder(ShareBean.APP_WHATSAPP));
|
||||||
data.add(builder(ShareBuilder.APP_MESSENGER));
|
data.add(builder(ShareBean.APP_MESSENGER));
|
||||||
// data.add(builder(ShareBuilder.APP_INSTAGRAM));
|
// data.add(builder(ShareBuilder.APP_INSTAGRAM));
|
||||||
adapter.setList(data);
|
adapter.setList(data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ShareBuilder builder(int type) {
|
private ShareBean builder(int type) {
|
||||||
ShareBuilder builder = ShareBuilder.builder(type);
|
ShareBean builder = ShareBean.builder(type);
|
||||||
builder.setText(getContext().getString(R.string.dialog_invite_info));
|
builder.setText(getContext().getString(R.string.dialog_invite_info));
|
||||||
builder.setLink(url);
|
builder.setLink(url);
|
||||||
builder.setUid(uid);
|
builder.setUid(uid);
|
||||||
|
|||||||
@@ -12,58 +12,48 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
|||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.lxj.xpopup.util.XPopupUtils;
|
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
import com.pdlive.shayu.R;
|
import com.pdlive.shayu.R;
|
||||||
|
import com.yunbao.common.dialog.AbsDialogCenterPopupWindow;
|
||||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.share.adapters.ShareAppAdapter;
|
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.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class SharePopDialog extends AbsDialogPopupWindow {
|
public class SharePopDialog extends AbsDialogPopupWindow {
|
||||||
|
public static final int TYPE_LIVE = 1;
|
||||||
|
public static final int TYPE_DYNAMIC = 0;
|
||||||
private ShareAppAdapter adapter;
|
private ShareAppAdapter adapter;
|
||||||
private RecyclerView list;
|
private RecyclerView list;
|
||||||
private RoundedImageView avatar;
|
private RoundedImageView avatar;
|
||||||
private TextView info;
|
private TextView info;
|
||||||
private TextView link;
|
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 String shareLink;
|
||||||
|
private int type;
|
||||||
|
private ShareBean bean;
|
||||||
|
|
||||||
public SharePopDialog(@NonNull Context context) {
|
public SharePopDialog(@NonNull Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SharePopDialog setUid(String uid) {
|
|
||||||
this.uid = uid;
|
public SharePopDialog setShareType(int type) {
|
||||||
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SharePopDialog setAnchorId(String anchorId) {
|
public SharePopDialog setShareData(ShareBean build) {
|
||||||
this.anchorId = anchorId;
|
this.bean=build;
|
||||||
return this;
|
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) {
|
public SharePopDialog setShareLink(String link) {
|
||||||
this.shareLink = link + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
this.shareLink = link + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||||
return this;
|
return this;
|
||||||
@@ -89,7 +79,7 @@ public class SharePopDialog extends AbsDialogPopupWindow {
|
|||||||
info = findViewById(R.id.share_info);
|
info = findViewById(R.id.share_info);
|
||||||
link = findViewById(R.id.share_link);
|
link = findViewById(R.id.share_link);
|
||||||
adapter = new ShareAppAdapter(getContext());
|
adapter = new ShareAppAdapter(getContext());
|
||||||
adapter.setOnShareStatusListener(new ShareAppAdapter.ShareCallback(){
|
adapter.setOnShareStatusListener(new ShareAppAdapter.ShareCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
super.onSuccess();
|
super.onSuccess();
|
||||||
@@ -103,16 +93,16 @@ public class SharePopDialog extends AbsDialogPopupWindow {
|
|||||||
|
|
||||||
private void initData() {
|
private void initData() {
|
||||||
data = new ArrayList<>();
|
data = new ArrayList<>();
|
||||||
data.add(builder(ShareBuilder.APP_FACEBOOK));
|
data.add(builder(ShareBean.APP_FACEBOOK));
|
||||||
data.add(builder(ShareBuilder.APP_LINE));
|
data.add(builder(ShareBean.APP_LINE));
|
||||||
data.add(builder(ShareBuilder.APP_TWITTER));
|
data.add(builder(ShareBean.APP_TWITTER));
|
||||||
data.add(builder(ShareBuilder.APP_WHATSAPP));
|
data.add(builder(ShareBean.APP_WHATSAPP));
|
||||||
data.add(builder(ShareBuilder.APP_MESSENGER));
|
data.add(builder(ShareBean.APP_MESSENGER));
|
||||||
data.add(builder(ShareBuilder.APP_INTERNAL));
|
data.add(builder(ShareBean.APP_INTERNAL));
|
||||||
adapter.setList(data);
|
adapter.setList(data);
|
||||||
String url;
|
String url;
|
||||||
if (shareLink == null) {
|
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 {
|
} else {
|
||||||
if (shareLink.length() > 40) {
|
if (shareLink.length() > 40) {
|
||||||
url = shareLink.substring(0, 40) + "...";
|
url = shareLink.substring(0, 40) + "...";
|
||||||
@@ -122,20 +112,14 @@ public class SharePopDialog extends AbsDialogPopupWindow {
|
|||||||
}
|
}
|
||||||
url = url + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
url = url + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||||
link.setText(url);
|
link.setText(url);
|
||||||
info.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName));
|
info.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(bean.getAnchorName()) ? "" : bean.getAnchorName()));
|
||||||
ImgLoader.display(getContext(), anchorAvatar, avatar);
|
ImgLoader.display(getContext(), bean.getAnchorAvatar(), avatar);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ShareBuilder builder(int type) {
|
private ShareBean builder(int type) {
|
||||||
ShareBuilder builder = ShareBuilder.builder(type);
|
ShareBean builder = bean.clone();
|
||||||
builder.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName));
|
builder.setType(type);
|
||||||
builder.setUid(uid);
|
builder.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(bean.getAnchorName()) ? "" : bean.getAnchorName()));
|
||||||
builder.setAnchorId(anchorId);
|
|
||||||
builder.setAnchorName(anchorName);
|
|
||||||
builder.setAnchorAvatar(anchorAvatar);
|
|
||||||
if (shareLink != null) {
|
|
||||||
builder.setLink(shareLink);
|
|
||||||
}
|
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,11 +128,12 @@ public class SharePopDialog extends AbsDialogPopupWindow {
|
|||||||
if (shareLink != null) {
|
if (shareLink != null) {
|
||||||
url = shareLink;
|
url = shareLink;
|
||||||
} else {
|
} 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);
|
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(CLIPBOARD_SERVICE);
|
||||||
ClipData clipData = ClipData.newPlainText("text", info.getText().toString() + "\n" + url + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0));
|
ClipData clipData = ClipData.newPlainText("text", info.getText().toString() + "\n" + url + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0));
|
||||||
cm.setPrimaryClip(clipData);
|
cm.setPrimaryClip(clipData);
|
||||||
ToastUtil.show(getContext().getString(com.yunbao.common.R.string.copy_success));
|
ToastUtil.show(getContext().getString(com.yunbao.common.R.string.copy_success));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,19 +11,16 @@ import androidx.annotation.NonNull;
|
|||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.lxj.xpopup.enums.PopupAnimation;
|
import com.lxj.xpopup.enums.PopupAnimation;
|
||||||
import com.pdlive.shayu.R;
|
import com.pdlive.shayu.R;
|
||||||
import com.yunbao.common.bean.MessageUserInfoBean;
|
|
||||||
import com.yunbao.common.custom.RatioRoundImageView;
|
import com.yunbao.common.custom.RatioRoundImageView;
|
||||||
import com.yunbao.common.dialog.AbsDialogPositionPopupWindow;
|
import com.yunbao.common.dialog.AbsDialogPositionPopupWindow;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
|
||||||
import com.yunbao.common.utils.DpUtil;
|
import com.yunbao.common.utils.DpUtil;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
|
||||||
|
|
||||||
import io.rong.imkit.utils.RouteUtils;
|
import io.rong.imkit.utils.RouteUtils;
|
||||||
import io.rong.imlib.model.Conversation;
|
import io.rong.imlib.model.Conversation;
|
||||||
|
|
||||||
public class ShareSuccessNotifyDialog extends AbsDialogPositionPopupWindow {
|
public class ShareSuccessNotifyDialog extends AbsDialogPositionPopupWindow {
|
||||||
private ShareBuilder bean;
|
private ShareBean bean;
|
||||||
private DialogInterface.OnDismissListener onDismissListener;
|
private DialogInterface.OnDismissListener onDismissListener;
|
||||||
|
|
||||||
private TextView anchorName;
|
private TextView anchorName;
|
||||||
@@ -34,7 +31,7 @@ public class ShareSuccessNotifyDialog extends AbsDialogPositionPopupWindow {
|
|||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShareSuccessNotifyDialog(@NonNull Context context, ShareBuilder bean) {
|
public ShareSuccessNotifyDialog(@NonNull Context context, ShareBean bean) {
|
||||||
super(context);
|
super(context);
|
||||||
this.bean = bean;
|
this.bean = bean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,4 +12,5 @@
|
|||||||
<string name="dialog_share_internal_list_btn">Share</string>
|
<string name="dialog_share_internal_list_btn">Share</string>
|
||||||
<string name="dialog_share_success">Success</string>
|
<string name="dialog_share_success">Success</string>
|
||||||
<string name="dialog_share_success_btn">Chat</string>
|
<string name="dialog_share_success_btn">Chat</string>
|
||||||
|
<string name="dialog_share_failure_not_select">Please select friends</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -21,4 +21,5 @@
|
|||||||
<string name="dialog_share_internal_list_btn">發送</string>
|
<string name="dialog_share_internal_list_btn">發送</string>
|
||||||
<string name="dialog_share_success">分享成功</string>
|
<string name="dialog_share_success">分享成功</string>
|
||||||
<string name="dialog_share_success_btn">去聊聊</string>
|
<string name="dialog_share_success_btn">去聊聊</string>
|
||||||
|
<string name="dialog_share_failure_not_select">请选择好友</string>
|
||||||
</resources>
|
</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.MessageIMManager;
|
||||||
import com.yunbao.common.manager.imrongcloud.RecommendLiveRoom;
|
import com.yunbao.common.manager.imrongcloud.RecommendLiveRoom;
|
||||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
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.message.content.MessageChatTipsContent;
|
||||||
|
import com.yunbao.common.provider.MessageChatCardItemProvider;
|
||||||
import com.yunbao.common.provider.MessageChatTipsItemProvider;
|
import com.yunbao.common.provider.MessageChatTipsItemProvider;
|
||||||
import com.yunbao.common.utils.AppManager;
|
import com.yunbao.common.utils.AppManager;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
@@ -60,6 +62,7 @@ import com.yunbao.live.socket.SocketRyClient;
|
|||||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||||
import com.yunbao.live.views.PortraitLiveManager;
|
import com.yunbao.live.views.PortraitLiveManager;
|
||||||
import com.yunbao.live.views.RecommendLiveRoomProvider;
|
import com.yunbao.live.views.RecommendLiveRoomProvider;
|
||||||
|
import com.yunbao.main.activity.CompleteUserInfoActivity;
|
||||||
import com.yunbao.main.activity.MainActivity;
|
import com.yunbao.main.activity.MainActivity;
|
||||||
import com.yunbao.main.activity.MainHomeCommunityActivity;
|
import com.yunbao.main.activity.MainHomeCommunityActivity;
|
||||||
import com.yunbao.main.activity.MsgSettActivity;
|
import com.yunbao.main.activity.MsgSettActivity;
|
||||||
@@ -108,17 +111,21 @@ public class AppContext extends CommonAppContext {
|
|||||||
MessageSayHiNotifyManager.getInstance().stop();
|
MessageSayHiNotifyManager.getInstance().stop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(activity instanceof MainHomeCommunityActivity){
|
if (activity instanceof MainHomeCommunityActivity) {
|
||||||
MessageSayHiNotifyManager.getInstance().stop();
|
MessageSayHiNotifyManager.getInstance().stop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(activity instanceof SudGameActivity){
|
if (activity instanceof SudGameActivity) {
|
||||||
MessageSayHiNotifyManager.getInstance().stop();
|
MessageSayHiNotifyManager.getInstance().stop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (activity instanceof MainActivity && !MessageSayHiNotifyManager.getInstance().isInit()) {
|
if (activity instanceof MainActivity && !MessageSayHiNotifyManager.getInstance().isInit()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (activity instanceof CompleteUserInfoActivity) {
|
||||||
|
MessageSayHiNotifyManager.getInstance().stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
MessageSayHiNotifyManager.getInstance().reload();
|
MessageSayHiNotifyManager.getInstance().reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,12 +227,14 @@ public class AppContext extends CommonAppContext {
|
|||||||
myMessages.add(RecommendLiveRoom.class);
|
myMessages.add(RecommendLiveRoom.class);
|
||||||
myMessages.add(InstructorSendReward.class);
|
myMessages.add(InstructorSendReward.class);
|
||||||
myMessages.add(MessageChatTipsContent.class);
|
myMessages.add(MessageChatTipsContent.class);
|
||||||
|
myMessages.add(MessageChatCardContent.class);
|
||||||
|
|
||||||
RongIMClient.registerMessageType(myMessages);
|
RongIMClient.registerMessageType(myMessages);
|
||||||
// 注册自定义消息模板
|
// 注册自定义消息模板
|
||||||
RongConfigCenter.conversationConfig().addMessageProvider(new InstructorSendRewardProvider(getApplicationContext()));
|
RongConfigCenter.conversationConfig().addMessageProvider(new InstructorSendRewardProvider(getApplicationContext()));
|
||||||
RongConfigCenter.conversationConfig().addMessageProvider(new RecommendLiveRoomProvider(getApplicationContext()));
|
RongConfigCenter.conversationConfig().addMessageProvider(new RecommendLiveRoomProvider(getApplicationContext()));
|
||||||
RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatTipsItemProvider(getApplicationContext()));
|
RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatTipsItemProvider(getApplicationContext()));
|
||||||
|
RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatCardItemProvider(getApplicationContext()));
|
||||||
|
|
||||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -260,6 +269,10 @@ public class AppContext extends CommonAppContext {
|
|||||||
|
|
||||||
} else if (message.getConversationType() == Conversation.ConversationType.PRIVATE) {//私聊信息
|
} else if (message.getConversationType() == Conversation.ConversationType.PRIVATE) {//私聊信息
|
||||||
EventBus.getDefault().post(message);
|
EventBus.getDefault().post(message);
|
||||||
|
if (AppManager.getInstance().getLastActivity() instanceof CompleteUserInfoActivity) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
MessageChatNotifyManager.getInstance().setShieldClass(CompleteUserInfoActivity.class);
|
||||||
MessageChatNotifyManager.getInstance().push(AppManager.getInstance().getLastActivity()
|
MessageChatNotifyManager.getInstance().push(AppManager.getInstance().getLastActivity()
|
||||||
, message.getTargetId(),
|
, message.getTargetId(),
|
||||||
content.getContent()
|
content.getContent()
|
||||||
@@ -358,9 +371,9 @@ public class AppContext extends CommonAppContext {
|
|||||||
activity.get().finish();
|
activity.get().finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setFirebaseCrashData();
|
||||||
Process.killProcess(Process.myPid());
|
Process.killProcess(Process.myPid());
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
setFirebaseCrashData();
|
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|||||||
@@ -15,12 +15,6 @@ android {
|
|||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||||
}
|
}
|
||||||
|
|
||||||
javaCompileOptions {
|
|
||||||
annotationProcessorOptions {
|
|
||||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
@@ -71,7 +65,6 @@ repositories {
|
|||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||||
api files('libs/jcc-bate-0.7.3.jar')
|
api files('libs/jcc-bate-0.7.3.jar')
|
||||||
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
||||||
|
|||||||
@@ -240,8 +240,6 @@ public class Constants {
|
|||||||
public static final String VIDEO_ID = "videoId";
|
public static final String VIDEO_ID = "videoId";
|
||||||
public static final String VIDEO_COMMENT_BEAN = "videoCommnetBean";
|
public static final String VIDEO_COMMENT_BEAN = "videoCommnetBean";
|
||||||
public static final String VIDEO_FACE_OPEN = "videoOpenFace";
|
public static final String VIDEO_FACE_OPEN = "videoOpenFace";
|
||||||
public static final String VIDEO_IS_COMMENT = "videoIsComment";
|
|
||||||
public static final String VIDEO_REPLY_ID = "VIDEO_REPLY_ID";
|
|
||||||
public static final String VIDEO_FACE_HEIGHT = "videoFaceHeight";
|
public static final String VIDEO_FACE_HEIGHT = "videoFaceHeight";
|
||||||
public static final String VIDEO_DURATION = "videoDuration";
|
public static final String VIDEO_DURATION = "videoDuration";
|
||||||
public static final String VIDEO_PATH = "videoPath";
|
public static final String VIDEO_PATH = "videoPath";
|
||||||
@@ -308,6 +306,5 @@ public class Constants {
|
|||||||
public static String isSetRemarkText = "";//修改的备注信息
|
public static String isSetRemarkText = "";//修改的备注信息
|
||||||
public static boolean isShowLiveDialog = false;//是否在直播间打开单聊
|
public static boolean isShowLiveDialog = false;//是否在直播间打开单聊
|
||||||
public static int firstInto = 0;//
|
public static int firstInto = 0;//
|
||||||
public static final String TO_COMMUNITY_ID = "to_id";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,18 +11,15 @@ import android.view.inputmethod.InputMethodManager;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.adapter.CommentAdapter;
|
import com.yunbao.common.adapter.CommentAdapter;
|
||||||
import com.yunbao.common.bean.ActiveBean;
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
@@ -31,7 +28,6 @@ import com.yunbao.common.dialog.ImagePreviewDialog;
|
|||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
import com.yunbao.common.interfaces.CommonCallback;
|
||||||
import com.yunbao.common.manager.OpenAdManager;
|
import com.yunbao.common.manager.OpenAdManager;
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
@@ -45,10 +41,8 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Route(path = RouteUtil.PATH_COMMUNITY)
|
|
||||||
public class CommunityDetailsActivity extends AbsActivity {
|
public class CommunityDetailsActivity extends AbsActivity {
|
||||||
private ActiveBean activeBean;
|
ActiveBean activeBean;
|
||||||
private String activeId;
|
|
||||||
private ImageView avatar;
|
private ImageView avatar;
|
||||||
private TextView name;
|
private TextView name;
|
||||||
private TextView time;
|
private TextView time;
|
||||||
@@ -67,7 +61,6 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
private EditText comment;
|
private EditText comment;
|
||||||
private ImageView send;
|
private ImageView send;
|
||||||
private boolean isComment = false;
|
private boolean isComment = false;
|
||||||
private RelativeLayout videoLayout;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
@@ -88,13 +81,13 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void main() {
|
protected void main() {
|
||||||
activeId = getIntent().getStringExtra(Constants.TO_COMMUNITY_ID);
|
activeBean = getIntent().getParcelableExtra("active");
|
||||||
initView();
|
initView();
|
||||||
initData();
|
initData();
|
||||||
|
getReply();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initView() {
|
private void initView() {
|
||||||
videoLayout = findViewById(R.id.videoLayout);
|
|
||||||
send = findViewById(R.id.send);
|
send = findViewById(R.id.send);
|
||||||
comment = findViewById(R.id.comment);
|
comment = findViewById(R.id.comment);
|
||||||
replyCount = findViewById(R.id.replyCount);
|
replyCount = findViewById(R.id.replyCount);
|
||||||
@@ -229,13 +222,7 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
findViewById(R.id.userLayout).setOnClickListener(new View.OnClickListener() {
|
findViewById(R.id.userLayout).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
RouteUtil.forwardUserHome(activeBean.getUser_id());
|
UserHomeActivity.forwardUserHomeActivity(CommunityDetailsActivity.this, activeBean.getUser_id());
|
||||||
}
|
|
||||||
});
|
|
||||||
videoLayout.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -244,7 +231,7 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
CommentBean replyComment;
|
CommentBean replyComment;
|
||||||
|
|
||||||
private void getReply() {
|
private void getReply() {
|
||||||
CommonHttpUtil.getCommunityComment(activeBean.getId(), activeBean.getUser_id(), 1, new HttpCallback() {
|
CommonHttpUtil.getCommunityComment(activeBean.getId(), activeBean.getUser_id(), new HttpCallback() {
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
@@ -269,7 +256,7 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDel(CommentBean activeBean) {
|
public void onDel(CommentBean activeBean, int position) {
|
||||||
//一级回复 删除
|
//一级回复 删除
|
||||||
CommonHttpUtil.delCom(activeBean.getId(), new HttpCallback() {
|
CommonHttpUtil.delCom(activeBean.getId(), new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
@@ -311,22 +298,6 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
|
|
||||||
@SuppressLint("UseCompatLoadingForDrawables")
|
@SuppressLint("UseCompatLoadingForDrawables")
|
||||||
private void initData() {
|
private void initData() {
|
||||||
LiveNetManager.get(mContext).getDynamicInfo(activeId, new com.yunbao.common.http.base.HttpCallback<ActiveBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(ActiveBean data) {
|
|
||||||
activeBean = data;
|
|
||||||
initInfo();
|
|
||||||
getReply();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(String error) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initInfo() {
|
|
||||||
ImgLoader.display(CommunityDetailsActivity.this, CommonAppConfig.getInstance().getUserBean().getAvatarThumb(), userAvatar);
|
ImgLoader.display(CommunityDetailsActivity.this, CommonAppConfig.getInstance().getUserBean().getAvatarThumb(), userAvatar);
|
||||||
ImgLoader.display(CommunityDetailsActivity.this, activeBean.getUser_avatar(), avatar);
|
ImgLoader.display(CommunityDetailsActivity.this, activeBean.getUser_avatar(), avatar);
|
||||||
name.setText(activeBean.getUser_name());
|
name.setText(activeBean.getUser_name());
|
||||||
@@ -354,8 +325,7 @@ public class CommunityDetailsActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
mNineGridLayout.setData(tempList);
|
mNineGridLayout.setData(tempList);
|
||||||
} else {
|
} else {
|
||||||
ImgLoader.display(CommunityDetailsActivity.this, activeBean.getVideo() + "?vframe/jpg/offset/0", videoImage);
|
ImgLoader.display(CommunityDetailsActivity.this, activeBean.getUser_avatar(), videoImage);
|
||||||
videoLayout.setVisibility(View.VISIBLE);
|
|
||||||
}
|
}
|
||||||
if (activeBean.getIs_love().equals("1")) {
|
if (activeBean.getIs_love().equals("1")) {
|
||||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like, like);
|
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like, like);
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import androidx.fragment.app.FragmentActivity;
|
|||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||||
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
||||||
import com.bigkoo.pickerview.listener.OnDismissListener;
|
import com.bigkoo.pickerview.listener.OnDismissListener;
|
||||||
@@ -35,33 +34,23 @@ import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
|
|||||||
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
|
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
|
||||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||||
import com.bigkoo.pickerview.view.TimePickerView;
|
import com.bigkoo.pickerview.view.TimePickerView;
|
||||||
import com.google.gson.Gson;
|
|
||||||
import com.lzy.okgo.utils.HttpUtils;
|
import com.lzy.okgo.utils.HttpUtils;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.NewCommunityType;
|
|
||||||
import com.yunbao.common.custom.ItemDecoration;
|
import com.yunbao.common.custom.ItemDecoration;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.manager.CommunityTypeManager;
|
|
||||||
import com.yunbao.common.manager.OpenAdManager;
|
import com.yunbao.common.manager.OpenAdManager;
|
||||||
import com.yunbao.common.upload.UploadBean;
|
|
||||||
import com.yunbao.common.upload.UploadCallback;
|
|
||||||
import com.yunbao.common.upload.UploadQnImpl;
|
|
||||||
import com.yunbao.common.utils.ActiveImageAdapter;
|
import com.yunbao.common.utils.ActiveImageAdapter;
|
||||||
import com.yunbao.common.utils.DateFormatUtil;
|
import com.yunbao.common.utils.DateFormatUtil;
|
||||||
import com.yunbao.common.utils.FilesUtils;
|
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
import com.yunbao.common.utils.ProcessImageUtil;
|
import com.yunbao.common.utils.ProcessImageUtil;
|
||||||
import com.yunbao.common.utils.ProcessResultUtil;
|
import com.yunbao.common.utils.ProcessResultUtil;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class CommunitySendActivity extends AbsActivity {
|
public class CommunitySendActivity extends AbsActivity {
|
||||||
public static final int PERMISSION_REQUEST_CODE_IMG = 0;
|
public static final int PERMISSION_REQUEST_CODE_IMG = 0;
|
||||||
@@ -76,7 +65,7 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
private final int CHOOSE_IMG = 100;//Android 5.0以下的
|
private final int CHOOSE_IMG = 100;//Android 5.0以下的
|
||||||
private final int CHOOSE_VIDEO = 200;//Android 5.0以上的
|
private final int CHOOSE_VIDEO = 200;//Android 5.0以上的
|
||||||
private List<Uri> uriList = new ArrayList<>();
|
private List<Uri> uriList = new ArrayList<>();
|
||||||
private File videoFile;
|
private Uri videoUri;
|
||||||
private ActiveImageAdapter activeImageAdapter;
|
private ActiveImageAdapter activeImageAdapter;
|
||||||
private VideoView videoView;
|
private VideoView videoView;
|
||||||
private RelativeLayout videoViewLayout;
|
private RelativeLayout videoViewLayout;
|
||||||
@@ -85,12 +74,6 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
private List<String> talkList = new ArrayList<>();
|
private List<String> talkList = new ArrayList<>();
|
||||||
private TextView submit;
|
private TextView submit;
|
||||||
private boolean isImage;
|
private boolean isImage;
|
||||||
UploadQnImpl mUploadStrategy;
|
|
||||||
|
|
||||||
private List<String> imgUrlList = new ArrayList<>();
|
|
||||||
private String videoUrl;
|
|
||||||
List<NewCommunityType> newCommunityTypeList = new ArrayList<>();
|
|
||||||
int talkId;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
@@ -99,7 +82,14 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void main() {
|
protected void main() {
|
||||||
newCommunityTypeList = new CommunityTypeManager(mContext).getCommunityTypeList();
|
talkList.add("热门");
|
||||||
|
talkList.add("新秀");
|
||||||
|
talkList.add("颜值");
|
||||||
|
talkList.add("舞蹈");
|
||||||
|
talkList.add("男神");
|
||||||
|
talkList.add("音乐");
|
||||||
|
talkList.add("英语");
|
||||||
|
|
||||||
content = findViewById(R.id.content);
|
content = findViewById(R.id.content);
|
||||||
submit = findViewById(R.id.submit);
|
submit = findViewById(R.id.submit);
|
||||||
submit.setVisibility(View.VISIBLE);
|
submit.setVisibility(View.VISIBLE);
|
||||||
@@ -116,23 +106,13 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
submit.setOnClickListener(new View.OnClickListener() {
|
submit.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
List<UploadBean> uploadBeanList = new ArrayList<>();
|
submit();
|
||||||
if (isImage) {
|
|
||||||
for (int i = 0; i < activeImageAdapter.getImageFileList().size(); i++) {
|
|
||||||
UploadBean uploadBean = new UploadBean(activeImageAdapter.getImageFileList().get(i), UploadBean.IMG);
|
|
||||||
uploadBeanList.add(uploadBean);
|
|
||||||
}
|
|
||||||
uploadFile(uploadBeanList, true);
|
|
||||||
} else {
|
|
||||||
uploadBeanList.add(new UploadBean(videoFile, UploadBean.VIDEO));
|
|
||||||
uploadFile(uploadBeanList, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
delVideo.setOnClickListener(new View.OnClickListener() {
|
delVideo.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
videoFile = null;
|
videoUri = null;
|
||||||
videoView.stopPlayback();
|
videoView.stopPlayback();
|
||||||
videoViewLayout.setVisibility(View.GONE);
|
videoViewLayout.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
@@ -221,49 +201,31 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void submit() {
|
private void submit() {
|
||||||
|
StringBuffer files = new StringBuffer();
|
||||||
if (isImage) {
|
if (isImage) {
|
||||||
if (imgUrlList.size() == 0) {
|
for (int i = 0; i < uriList.size(); i++) {
|
||||||
ToastUtil.show("请选择图片或者视频");
|
if (i == 0) {
|
||||||
return;
|
files.append(uri2File(uriList.get(i)).getPath());
|
||||||
|
} else {
|
||||||
|
files.append("," + uri2File(uriList.get(i)).getPath());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (StringUtil.isEmpty(videoUrl)) {
|
files.append(uri2File(videoUri).getPath());
|
||||||
ToastUtil.show("请选择图片或者视频");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
String imgUrl = "";
|
CommonHttpUtil.pushCommunity(isImage, content.getText().toString(), "1", files.toString(), chooseTime.getText().toString(), new HttpCallback() {
|
||||||
if (isImage) {
|
|
||||||
imgUrl = new Gson().toJson(imgUrlList);
|
|
||||||
}
|
|
||||||
String tempTime = "";
|
|
||||||
if (!chooseTime.getText().toString().equals("立即发表")) {
|
|
||||||
tempTime = chooseTime.getText().toString();
|
|
||||||
}
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
jsonObject.put("msg", content.getText().toString());
|
|
||||||
CommonHttpUtil.pushCommunity(isImage, jsonObject.toString(), String.valueOf(talkId), imgUrl, videoUrl, tempTime, new HttpCallback() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if (code == 0) {
|
|
||||||
ToastUtil.show("发布成功");
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showTalkChooseDialog() {
|
private void showTalkChooseDialog() {
|
||||||
talkList = new ArrayList<>();
|
|
||||||
for (int i = 0; i < newCommunityTypeList.size(); i++) {
|
|
||||||
talkList.add(newCommunityTypeList.get(i).getTalk_name());
|
|
||||||
}
|
|
||||||
OptionsPickerView pickerView = new OptionsPickerBuilder(CommunitySendActivity.this, new OnOptionsSelectListener() {
|
OptionsPickerView pickerView = new OptionsPickerBuilder(CommunitySendActivity.this, new OnOptionsSelectListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||||
talkId = newCommunityTypeList.get(options1).getId();
|
|
||||||
talkContent.setText(talkList.get(options1));
|
talkContent.setText(talkList.get(options1));
|
||||||
talkContent.setVisibility(View.VISIBLE);
|
|
||||||
}
|
}
|
||||||
}).setTitleText("选择话题").setContentTextSize(16).build();
|
}).setTitleText("选择话题").setContentTextSize(16).build();
|
||||||
pickerView.setPicker(talkList, null, null);
|
pickerView.setPicker(talkList, null, null);
|
||||||
@@ -342,7 +304,7 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
List<String> tempList = new ArrayList<>();
|
List<String> tempList = new ArrayList<>();
|
||||||
for (int i = 0; i < clipData.getItemCount(); i++) {
|
for (int i = 0; i < clipData.getItemCount(); i++) {
|
||||||
imageUris[i] = clipData.getItemAt(i).getUri();
|
imageUris[i] = clipData.getItemAt(i).getUri();
|
||||||
File file = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, imageUris[i])));
|
File file = new File(uri2File(imageUris[i]).getPath());
|
||||||
tempList.add(file.getPath());
|
tempList.add(file.getPath());
|
||||||
L.e("imageUris:" + imageUris[i].getPath() + "_" + imageUris[i].getEncodedPath());
|
L.e("imageUris:" + imageUris[i].getPath() + "_" + imageUris[i].getEncodedPath());
|
||||||
}
|
}
|
||||||
@@ -352,7 +314,7 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
imageUris = new Uri[]{data.getData()};
|
imageUris = new Uri[]{data.getData()};
|
||||||
uriList.add(imageUris[0]);
|
uriList.add(imageUris[0]);
|
||||||
List<String> tempList = new ArrayList<>();
|
List<String> tempList = new ArrayList<>();
|
||||||
File file = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, imageUris[0])));
|
File file = new File(uri2File(imageUris[0]).getPath());
|
||||||
tempList.add(file.getPath());
|
tempList.add(file.getPath());
|
||||||
activeImageAdapter.insertList(tempList);
|
activeImageAdapter.insertList(tempList);
|
||||||
}
|
}
|
||||||
@@ -360,34 +322,26 @@ public class CommunitySendActivity extends AbsActivity {
|
|||||||
isImage = true;
|
isImage = true;
|
||||||
} else if (requestCode == CHOOSE_VIDEO && resultCode == RESULT_OK && data != null) {
|
} else if (requestCode == CHOOSE_VIDEO && resultCode == RESULT_OK && data != null) {
|
||||||
Uri uri = data.getData();
|
Uri uri = data.getData();
|
||||||
videoFile = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, uri)));
|
videoUri = uri;
|
||||||
videoView.setVideoURI(uri);
|
videoView.setVideoURI(videoUri);
|
||||||
videoView.start();
|
videoView.start();
|
||||||
videoViewLayout.setVisibility(View.VISIBLE);
|
videoViewLayout.setVisibility(View.VISIBLE);
|
||||||
isImage = false;
|
isImage = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void uploadFile(List<UploadBean> uploadBeans, boolean isImg) {
|
private File uri2File(Uri uri) {
|
||||||
if (mUploadStrategy == null) {
|
String img_path;
|
||||||
mUploadStrategy = new UploadQnImpl(mContext);
|
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);
|
||||||
}
|
}
|
||||||
mUploadStrategy.upload(uploadBeans, true, new UploadCallback() {
|
File file = new File(img_path);
|
||||||
@Override
|
return file;
|
||||||
public void onFinish(List<UploadBean> list, boolean success) {
|
|
||||||
if (!success) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (isImage) {
|
|
||||||
for (int i = 0; i < list.size(); i++) {
|
|
||||||
imgUrlList.add(list.get(i).getRemoteAccessUrl());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
videoUrl = list.get(0).getRemoteAccessUrl();
|
|
||||||
}
|
|
||||||
submit();
|
|
||||||
L.e(new Gson().toJson(list));
|
|
||||||
}
|
|
||||||
}, isImg);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,24 @@
|
|||||||
package com.yunbao.common.activity;
|
package com.yunbao.common.activity;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.content.Context;
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.database.Cursor;
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Outline;
|
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.View;
|
||||||
import android.view.ViewOutlineProvider;
|
import android.view.ViewOutlineProvider;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.ScrollView;
|
|
||||||
import android.widget.TextView;
|
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.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import androidx.viewpager.widget.ViewPager;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.google.gson.Gson;
|
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
import com.ms.banner.Banner;
|
import com.ms.banner.Banner;
|
||||||
|
import com.ms.banner.listener.OnBannerClickListener;
|
||||||
import com.xuexiang.xui.widget.flowlayout.FlowTagLayout;
|
import com.xuexiang.xui.widget.flowlayout.FlowTagLayout;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
@@ -38,40 +26,27 @@ import com.yunbao.common.R;
|
|||||||
import com.yunbao.common.adapter.LabelTagAdapter;
|
import com.yunbao.common.adapter.LabelTagAdapter;
|
||||||
import com.yunbao.common.adapter.UserCommunityAdapter;
|
import com.yunbao.common.adapter.UserCommunityAdapter;
|
||||||
import com.yunbao.common.adapter.UserHomeImgAdapter;
|
import com.yunbao.common.adapter.UserHomeImgAdapter;
|
||||||
import com.yunbao.common.bean.ActiveBean;
|
|
||||||
import com.yunbao.common.bean.ActiveOtherBean;
|
import com.yunbao.common.bean.ActiveOtherBean;
|
||||||
import com.yunbao.common.bean.HomeUserExhibitInfoBean;
|
import com.yunbao.common.bean.HomeUserExhibitInfoBean;
|
||||||
import com.yunbao.common.bean.HomeUserInfoBean;
|
import com.yunbao.common.bean.HomeUserInfoBean;
|
||||||
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
import com.yunbao.common.bean.LabelBean;
|
import com.yunbao.common.bean.LabelBean;
|
||||||
|
import com.yunbao.common.bean.MessageUserInfoBean;
|
||||||
import com.yunbao.common.bean.UserHomeImgBean;
|
import com.yunbao.common.bean.UserHomeImgBean;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
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.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.views.UserHomeImgsViewHolder;
|
import com.yunbao.common.views.UserHomeImgsViewHolder;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import pl.droidsonroids.gif.GifImageView;
|
|
||||||
|
|
||||||
@Route(path = RouteUtil.PATH_USER_HOME)
|
|
||||||
public class UserHomeActivity extends AbsActivity {
|
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 String uid;
|
||||||
private Banner mBanner;
|
private Banner mBanner;
|
||||||
private RecyclerView imgsRecyclerView;
|
private RecyclerView imgsRecyclerView;
|
||||||
@@ -90,53 +65,39 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
private ImageView userStatusIcon;
|
private ImageView userStatusIcon;
|
||||||
private ImageView user_sex;
|
private ImageView user_sex;
|
||||||
private ImageView authorIcon;
|
private ImageView authorIcon;
|
||||||
|
private TextView level;
|
||||||
private ImageView levelIcon;
|
private ImageView levelIcon;
|
||||||
|
private TextView vipLevel;
|
||||||
private LinearLayout authenticationLayout;
|
private LinearLayout authenticationLayout;
|
||||||
private TextView signature;
|
private TextView signature;
|
||||||
private LinearLayout moreLayout;
|
private LinearLayout moreLayout;
|
||||||
private TextView moreText;
|
private TextView moreText;
|
||||||
private ImageView moreIcon;
|
private ImageView moreIcon;
|
||||||
private HomeUserInfoBean userInfo;
|
private HomeUserInfoBean userInfo;
|
||||||
private RecyclerView communityRecyclerView;
|
RecyclerView communityRecyclerView;
|
||||||
private LinearLayout itemLayout01;
|
private LinearLayout itemLayout01;
|
||||||
private LinearLayout itemLayout02;
|
private LinearLayout itemLayout02;
|
||||||
private LinearLayout itemLayout03;
|
private LinearLayout itemLayout03;
|
||||||
private LinearLayout itemLayout04;
|
private LinearLayout itemLayout04;
|
||||||
private FlowTagLayout myFlowTag; //我的标签
|
FlowTagLayout myFlowTag; //我的标签
|
||||||
private LabelTagAdapter myAdapter;
|
LabelTagAdapter myAdapter;
|
||||||
private boolean isShowcase;
|
private boolean isShowcase;
|
||||||
private boolean isAnchor;
|
private boolean isAnchor;
|
||||||
private boolean isMe;
|
|
||||||
private RelativeLayout userPresidentLayout;
|
private RelativeLayout userPresidentLayout;
|
||||||
private TextView userPresidentName;
|
private TextView userPresidentName;
|
||||||
|
private RelativeLayout authorLayout;
|
||||||
|
private RelativeLayout levelLayout;
|
||||||
private RoundedImageView fansImg1;
|
private RoundedImageView fansImg1;
|
||||||
private RoundedImageView fansImg2;
|
private RoundedImageView fansImg2;
|
||||||
private RoundedImageView fansImg3;
|
private RoundedImageView fansImg3;
|
||||||
|
|
||||||
private List<RoundedImageView> fansImgViewList = new ArrayList<>();
|
private List<RoundedImageView> fansImgViewList = new ArrayList<>();
|
||||||
private RoundedImageView guardImg1;
|
|
||||||
private RoundedImageView guardImg2;
|
public static void forwardUserHomeActivity(Context content, String uid) {
|
||||||
private RoundedImageView guardImg3;
|
Intent intent = new Intent(content, UserHomeActivity.class);
|
||||||
private List<RoundedImageView> guardImgViewList = new ArrayList<>();
|
intent.putExtra(Constants.TO_UID, uid);
|
||||||
private RoundedImageView giftImg1;
|
content.startActivity(intent);
|
||||||
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
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
@@ -167,33 +128,11 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
List<ActiveOtherBean> beanList = JSONArray.parseArray(Arrays.toString(info), ActiveOtherBean.class);
|
List<ActiveOtherBean> beanList = JSONArray.parseArray(Arrays.toString(info), ActiveOtherBean.class);
|
||||||
UserCommunityAdapter userCommunityAdapter = new UserCommunityAdapter(mContext, beanList);
|
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);
|
communityRecyclerView.setAdapter(userCommunityAdapter);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint({"SetTextI18n", "UseCompatLoadingForDrawables"})
|
|
||||||
private void initData(HomeUserInfoBean userInfoBean) {
|
private void initData(HomeUserInfoBean userInfoBean) {
|
||||||
userInfo = userInfoBean;
|
userInfo = userInfoBean;
|
||||||
if (!userInfo.getCheckBlack().get(0).getU2t().equals("0")) {
|
if (!userInfo.getCheckBlack().get(0).getU2t().equals("0")) {
|
||||||
@@ -206,46 +145,30 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
userPresidentName.setText(userInfo.getUserHomeTopInfo().getUser_president_name());
|
userPresidentName.setText(userInfo.getUserHomeTopInfo().getUser_president_name());
|
||||||
}
|
}
|
||||||
isAnchor = userInfo.getUserHomeTopInfo().getIs_anchor() == 1;
|
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);
|
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_avatar(), avatar);
|
||||||
topName.setText(userInfo.getUserHomeTopInfo().getUser_name()); //用户名称-顶部
|
|
||||||
userName.setText(userInfo.getUserHomeTopInfo().getUser_name());//用户名称
|
userName.setText(userInfo.getUserHomeTopInfo().getUser_name());//用户名称
|
||||||
fansCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_fans_num()));//粉丝数量
|
fansCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_fans_num()));//粉丝数量
|
||||||
likeCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_love_num()));//关注数量
|
likeCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_love_num()));//关注数量
|
||||||
|
|
||||||
if (isMe) {
|
userId.setText("ID:" + userInfo.getUserHomeTopInfo().getUser_id());//用户ID
|
||||||
bottomEditLayout.setVisibility(View.VISIBLE);
|
userStatus.setText("");//认证状态
|
||||||
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, 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, CommonAppConfig.HOST + userInfo.getUserHomeTopInfo().getUser_level_anchor_img(), authorIcon);
|
||||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_img(), levelIcon);
|
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_img(), levelIcon);
|
||||||
|
|
||||||
if (isAnchor) {//是否是主播
|
if (isAnchor) {//是否是主播
|
||||||
authorIcon.setVisibility(View.VISIBLE);
|
authorLayout.setVisibility(View.VISIBLE);
|
||||||
|
levelLayout.setVisibility(View.VISIBLE);
|
||||||
authenticationLayout.setVisibility(View.VISIBLE);
|
authenticationLayout.setVisibility(View.VISIBLE);
|
||||||
|
itemLayout01.setVisibility(View.VISIBLE);
|
||||||
|
itemLayout02.setVisibility(View.VISIBLE);
|
||||||
|
itemLayout03.setVisibility(View.VISIBLE);
|
||||||
|
itemLayout04.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
authorIcon.setVisibility(View.GONE);
|
authorLayout.setVisibility(View.GONE);
|
||||||
authenticationLayout.setVisibility(View.GONE);
|
authenticationLayout.setVisibility(View.GONE);
|
||||||
|
itemLayout03.setVisibility(View.VISIBLE);
|
||||||
|
itemLayout04.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
signature.setText(userInfo.getUserHomeTopInfo().getUser_signature());//个性签名
|
signature.setText(userInfo.getUserHomeTopInfo().getUser_signature());//个性签名
|
||||||
//标签
|
//标签
|
||||||
@@ -255,26 +178,11 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
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() != null) {
|
||||||
if (userInfo.getUserHomeTopInfo().getCn_label().size() > 0) {
|
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.setAdapter(myAdapter);
|
||||||
myFlowTag.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
myFlowTag.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
||||||
myAdapter.setData(tagList);
|
myAdapter.setData(userInfo.getUserHomeTopInfo().getCn_label());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mBanner.setOutlineProvider(new ViewOutlineProvider() {
|
mBanner.setOutlineProvider(new ViewOutlineProvider() {
|
||||||
@@ -304,18 +212,16 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
for (int i = 0; i < bannerImgList.size(); i++) {
|
for (int i = 0; i < bannerImgList.size(); i++) {
|
||||||
tempList.add(new UserHomeImgBean(bannerImgList.get(i)));
|
tempList.add(new UserHomeImgBean(bannerImgList.get(i)));
|
||||||
}
|
}
|
||||||
if (tempList.size() > 0) {
|
tempList.get(0).setShow(true);
|
||||||
tempList.get(0).setShow(true);
|
userHomeImgAdapter = new UserHomeImgAdapter(UserHomeActivity.this, tempList);
|
||||||
}
|
|
||||||
userHomeImgAdapter = new UserHomeImgAdapter(UserHomeActivity.this, tempList, isMe);
|
|
||||||
imgsRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
imgsRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||||
imgsRecyclerView.setAdapter(userHomeImgAdapter);
|
imgsRecyclerView.setAdapter(userHomeImgAdapter);
|
||||||
|
|
||||||
userHomeImgAdapter.setOnItemClickListener(new UserHomeImgAdapter.onItemClickListener() {
|
userHomeImgAdapter.setOnItemClickListener(new UserHomeImgAdapter.onItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onImgItem(UserHomeImgBean activeBean, int position) {
|
public void onImgItem(UserHomeImgBean activeBean, int position) {
|
||||||
L.e("onImgItem:" + position);
|
mBanner.onPageSelected(position);
|
||||||
mBanner.setCurrentPage(position).start();
|
mBanner.setCurrentPage(position);
|
||||||
for (int i = 0; i < tempList.size(); i++) {
|
for (int i = 0; i < tempList.size(); i++) {
|
||||||
if (i == position) {
|
if (i == position) {
|
||||||
tempList.get(i).setShow(true);
|
tempList.get(i).setShow(true);
|
||||||
@@ -325,53 +231,16 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
userHomeImgAdapter.setCommentBeanList(tempList);
|
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() {
|
mBanner.setAutoPlay(false).setPages(bannerImgList, new UserHomeImgsViewHolder()).setOnBannerClickListener(new OnBannerClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
public void onBannerClick(List datas, int position) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}).start();
|
||||||
@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() {
|
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);
|
fansImg1 = findViewById(R.id.fansImg1);
|
||||||
fansImg2 = findViewById(R.id.fansImg2);
|
fansImg2 = findViewById(R.id.fansImg2);
|
||||||
fansImg3 = findViewById(R.id.fansImg3);
|
fansImg3 = findViewById(R.id.fansImg3);
|
||||||
@@ -379,31 +248,8 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
fansImgViewList.add(fansImg1);
|
fansImgViewList.add(fansImg1);
|
||||||
fansImgViewList.add(fansImg2);
|
fansImgViewList.add(fansImg2);
|
||||||
fansImgViewList.add(fansImg3);
|
fansImgViewList.add(fansImg3);
|
||||||
|
authorLayout = findViewById(R.id.authorLayout);
|
||||||
guardImg1 = findViewById(R.id.guardImg1);
|
levelLayout = findViewById(R.id.levelLayout);
|
||||||
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);
|
userPresidentLayout = findViewById(R.id.userPresidentLayout);
|
||||||
userPresidentName = findViewById(R.id.userPresidentName);
|
userPresidentName = findViewById(R.id.userPresidentName);
|
||||||
itemLayout01 = findViewById(R.id.itemLayout01);
|
itemLayout01 = findViewById(R.id.itemLayout01);
|
||||||
@@ -423,10 +269,9 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
userStatus = findViewById(R.id.userStatus);
|
userStatus = findViewById(R.id.userStatus);
|
||||||
userStatusIcon = findViewById(R.id.userStatusIcon);
|
userStatusIcon = findViewById(R.id.userStatusIcon);
|
||||||
user_sex = findViewById(R.id.user_sex);
|
user_sex = findViewById(R.id.user_sex);
|
||||||
|
|
||||||
levelIcon = findViewById(R.id.levelIcon);
|
levelIcon = findViewById(R.id.levelIcon);
|
||||||
|
level = findViewById(R.id.level);
|
||||||
authorIcon = findViewById(R.id.authorlIcon);
|
authorIcon = findViewById(R.id.authorlIcon);
|
||||||
|
|
||||||
authenticationLayout = findViewById(R.id.authenticationLayout);
|
authenticationLayout = findViewById(R.id.authenticationLayout);
|
||||||
signature = findViewById(R.id.signature);
|
signature = findViewById(R.id.signature);
|
||||||
moreLayout = findViewById(R.id.moreLayout);
|
moreLayout = findViewById(R.id.moreLayout);
|
||||||
@@ -504,110 +349,6 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
finish();
|
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() {
|
private void getUseData() {
|
||||||
@@ -623,56 +364,11 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
LiveNetManager.get(mContext).getUserExhibitInfoInfo(uid, new HttpCallback<HomeUserExhibitInfoBean>() {
|
LiveNetManager.get(mContext).getUserExhibitInfoInfo(uid, new HttpCallback<HomeUserExhibitInfoBean>() {
|
||||||
@SuppressLint("SetTextI18n")
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(HomeUserExhibitInfoBean data) {
|
public void onSuccess(HomeUserExhibitInfoBean data) {
|
||||||
//主播粉丝团
|
|
||||||
if (data.getUserHomeTopInfo().getFans().getList() != null) {
|
if (data.getUserHomeTopInfo().getFans().getList() != null) {
|
||||||
if (data.getUserHomeTopInfo().getFans().getList().size() >= 3) {
|
for (int i = 0; i < data.getUserHomeTopInfo().getFans().getList().size(); i++) {
|
||||||
for (int i = 0; i < 3; i++) {
|
ImgLoader.display(mContext, data.getUserHomeTopInfo().getFans().getList().get(i).getAvatar(), fansImgViewList.get(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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -685,75 +381,7 @@ public class UserHomeActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, intent);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,16 +117,7 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (onItemClickListener != null) {
|
if (onItemClickListener != null) {
|
||||||
CommentBean bean = (CommentBean) v.getTag();
|
CommentBean bean = (CommentBean) v.getTag();
|
||||||
onItemClickListener.onDel(bean);
|
onItemClickListener.onDel(bean, 0);
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
del1.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (onItemClickListener != null) {
|
|
||||||
CommentBean.ReplyComment bean = (CommentBean.ReplyComment) v.getTag();
|
|
||||||
onItemClickListener.onDel(bean);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -134,7 +125,6 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
public void setData(CommentBean bean) {
|
public void setData(CommentBean bean) {
|
||||||
del.setTag(bean);
|
|
||||||
report.setTag(bean);
|
report.setTag(bean);
|
||||||
replyTextView.setTag(bean);
|
replyTextView.setTag(bean);
|
||||||
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
||||||
@@ -153,7 +143,6 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
if (bean.getReplyCommentList() != null) {
|
if (bean.getReplyCommentList() != null) {
|
||||||
replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>");
|
replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>");
|
||||||
if (bean.getReplyCommentList().size() > 0) {
|
if (bean.getReplyCommentList().size() > 0) {
|
||||||
del1.setTag(bean.getReplyCommentList().get(0));
|
|
||||||
replyContent.setText(bean.getReplyCommentList().get(0).getContent());
|
replyContent.setText(bean.getReplyCommentList().get(0).getContent());
|
||||||
ImgLoader.display(itemView.getContext(), bean.getReplyCommentList().get(0).getUser_avatar(), mAvatar01);
|
ImgLoader.display(itemView.getContext(), bean.getReplyCommentList().get(0).getUser_avatar(), mAvatar01);
|
||||||
firstName.setText(bean.getReplyCommentList().get(0).getUser_name());
|
firstName.setText(bean.getReplyCommentList().get(0).getUser_name());
|
||||||
@@ -163,10 +152,10 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
} else {
|
} else {
|
||||||
isAuth.setVisibility(View.GONE);
|
isAuth.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
if (bean.getReplyCommentList().get(0).getUser_id().equals(myUid)) {
|
if (bean.getUser_id().equals(myUid)) {
|
||||||
del1.setVisibility(View.VISIBLE);
|
del.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
del1.setVisibility(View.GONE);
|
del.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
replyLayout.setVisibility(View.GONE);
|
replyLayout.setVisibility(View.GONE);
|
||||||
@@ -221,9 +210,9 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
void onReport(CommentBean activeBean);
|
void onReport(CommentBean activeBean);
|
||||||
|
|
||||||
void onReport(CommentBean.ReplyComment activeBean);
|
void onDel(CommentBean activeBean, int position);
|
||||||
|
|
||||||
void onDel(CommentBean activeBean);
|
void onReport(CommentBean.ReplyComment activeBean);
|
||||||
|
|
||||||
void onDel(CommentBean.ReplyComment activeBean);
|
void onDel(CommentBean.ReplyComment activeBean);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,231 +0,0 @@
|
|||||||
package com.yunbao.common.adapter;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
|
||||||
import com.yunbao.common.CommonAppConfig;
|
|
||||||
import com.yunbao.common.R;
|
|
||||||
import com.yunbao.common.bean.CommentBean;
|
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
|
||||||
import com.yunbao.common.views.TopGradual;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class CommentVideoAdapter extends RefreshAdapter<CommentBean> {
|
|
||||||
private Context mContext;
|
|
||||||
private String authorId;
|
|
||||||
private String myUid;
|
|
||||||
private onItemClickListener onItemClickListener;
|
|
||||||
|
|
||||||
public void setOnItemClickListener(CommentVideoAdapter.onItemClickListener onItemClickListener) {
|
|
||||||
this.onItemClickListener = onItemClickListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CommentVideoAdapter(Context content, String authorId,CommentVideoAdapter.onItemClickListener onItemClickListener ) {
|
|
||||||
super(content);
|
|
||||||
this.onItemClickListener = onItemClickListener;
|
|
||||||
this.mContext = content;
|
|
||||||
this.authorId = authorId;
|
|
||||||
myUid = CommonAppConfig.getInstance().getUid();
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
|
||||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_comment_video_view, parent, false);
|
|
||||||
return new CommentViewHolder(view);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
|
||||||
CommentViewHolder commentViewHolder = (CommentViewHolder) holder;
|
|
||||||
commentViewHolder.setData(mList.get(position));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
return mList.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
class CommentViewHolder extends RecyclerView.ViewHolder {
|
|
||||||
private RoundedImageView mAvatar;
|
|
||||||
private TextView name;
|
|
||||||
private TextView content;
|
|
||||||
private TextView report;
|
|
||||||
private TextView replyTextView;
|
|
||||||
private RoundedImageView mAvatar01;
|
|
||||||
private TextView replyContent;
|
|
||||||
private TextView replyCount;
|
|
||||||
private RecyclerView recyclerView;
|
|
||||||
private LinearLayout replyLayout;
|
|
||||||
private TextView firstName;
|
|
||||||
private TextView isAuth;
|
|
||||||
private TextView del;
|
|
||||||
private TextView author;
|
|
||||||
private TextView del1;
|
|
||||||
private TextView report1;
|
|
||||||
|
|
||||||
public CommentViewHolder(@NonNull View itemView) {
|
|
||||||
super(itemView);
|
|
||||||
firstName = itemView.findViewById(R.id.firstName);
|
|
||||||
mAvatar = itemView.findViewById(R.id.avatar);
|
|
||||||
name = itemView.findViewById(R.id.name);
|
|
||||||
content = itemView.findViewById(R.id.content);
|
|
||||||
replyTextView = itemView.findViewById(R.id.replyTextView);
|
|
||||||
report = itemView.findViewById(R.id.report);
|
|
||||||
mAvatar01 = itemView.findViewById(R.id.avatar01);
|
|
||||||
isAuth = itemView.findViewById(R.id.isAuth);
|
|
||||||
replyContent = itemView.findViewById(R.id.replyContent);
|
|
||||||
replyCount = itemView.findViewById(R.id.expand);
|
|
||||||
replyLayout = itemView.findViewById(R.id.replyLayout);
|
|
||||||
recyclerView = itemView.findViewById(R.id.recyclerView);
|
|
||||||
del = itemView.findViewById(R.id.del);
|
|
||||||
author = itemView.findViewById(R.id.author);
|
|
||||||
del1 = itemView.findViewById(R.id.del1);
|
|
||||||
report1 = itemView.findViewById(R.id.report1);
|
|
||||||
report.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (onItemClickListener != null) {
|
|
||||||
CommentBean bean = (CommentBean) v.getTag();
|
|
||||||
onItemClickListener.onReport(bean);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
replyTextView.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (onItemClickListener != null) {
|
|
||||||
CommentBean bean = (CommentBean) v.getTag();
|
|
||||||
onItemClickListener.onReply(bean);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
del.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (onItemClickListener != null) {
|
|
||||||
CommentBean bean = (CommentBean) v.getTag();
|
|
||||||
onItemClickListener.onDel(bean);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
del1.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (onItemClickListener != null) {
|
|
||||||
CommentBean.ReplyComment bean = (CommentBean.ReplyComment) v.getTag();
|
|
||||||
onItemClickListener.onDel(bean);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
|
||||||
public void setData(CommentBean bean) {
|
|
||||||
del.setTag(bean);
|
|
||||||
report.setTag(bean);
|
|
||||||
replyTextView.setTag(bean);
|
|
||||||
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
|
||||||
name.setText(bean.getUser_name());
|
|
||||||
content.setText(bean.getContent());
|
|
||||||
if (bean.getUser_id().equals(authorId)) {
|
|
||||||
author.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
author.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
if (bean.getUser_id().equals(myUid)) {
|
|
||||||
del.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
del.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
if (bean.getReplyCommentList() != null) {
|
|
||||||
replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>");
|
|
||||||
if (bean.getReplyCommentList().size() > 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);
|
|
||||||
firstName.setText(bean.getReplyCommentList().get(0).getUser_name());
|
|
||||||
replyLayout.setVisibility(View.VISIBLE);
|
|
||||||
if (bean.getReplyCommentList().get(0).getUser_id().equals(authorId)) {
|
|
||||||
isAuth.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
isAuth.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
if (bean.getReplyCommentList().get(0).getUser_id().equals(myUid)) {
|
|
||||||
del1.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
del1.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
replyLayout.setVisibility(View.GONE);
|
|
||||||
replyCount.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
if (bean.getReplyCommentList().size() > 1) {
|
|
||||||
replyCount.setVisibility(View.VISIBLE);
|
|
||||||
replyLayout.setVisibility(View.VISIBLE);
|
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
|
||||||
recyclerView.addItemDecoration(new TopGradual());
|
|
||||||
List<CommentBean.ReplyComment> tempList = new ArrayList<>();
|
|
||||||
tempList.addAll(bean.getReplyCommentList());
|
|
||||||
tempList.remove(0);
|
|
||||||
CommentReplyAdapter commentReplyAdapter = new CommentReplyAdapter(mContext, tempList, authorId);
|
|
||||||
commentReplyAdapter.setOnItemClickListener(new CommentReplyAdapter.onItemClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onReport(CommentBean.ReplyComment activeBean) {
|
|
||||||
if (onItemClickListener != null) {
|
|
||||||
onItemClickListener.onReport(activeBean);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDel(CommentBean.ReplyComment activeBean) {
|
|
||||||
if (onItemClickListener != null) {
|
|
||||||
onItemClickListener.onDel(activeBean);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
recyclerView.setAdapter(commentReplyAdapter);
|
|
||||||
recyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
|
||||||
replyCount.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (!bean.isShow()) {
|
|
||||||
recyclerView.setVisibility(View.VISIBLE);
|
|
||||||
replyCount.setText("收起");
|
|
||||||
} else {
|
|
||||||
recyclerView.setVisibility(View.GONE);
|
|
||||||
replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>");
|
|
||||||
}
|
|
||||||
bean.setShow(!bean.isShow());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface onItemClickListener {
|
|
||||||
void onReply(CommentBean activeBean);
|
|
||||||
|
|
||||||
void onReport(CommentBean activeBean);
|
|
||||||
|
|
||||||
void onReport(CommentBean.ReplyComment activeBean);
|
|
||||||
|
|
||||||
void onDel(CommentBean activeBean);
|
|
||||||
|
|
||||||
void onDel(CommentBean.ReplyComment activeBean);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -37,6 +37,7 @@ public class LabelTagAdapter extends BaseTagAdapter<String, TextView> {
|
|||||||
@Override
|
@Override
|
||||||
protected void convert(TextView textView, String item, int position) {
|
protected void convert(TextView textView, String item, int position) {
|
||||||
textView.setText(item);
|
textView.setText(item);
|
||||||
|
textView.setTextColor(mContext.getResources().getColor(R.color.black2));
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnSureOnClickListener {
|
public interface OnSureOnClickListener {
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
package com.yunbao.common.adapter;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.xuexiang.xui.widget.flowlayout.BaseTagAdapter;
|
|
||||||
import com.yunbao.common.R;
|
|
||||||
import com.yunbao.common.bean.LabelBean;
|
|
||||||
|
|
||||||
public class LabelVideoTagAdapter extends BaseTagAdapter<String, TextView> {
|
|
||||||
|
|
||||||
OnSureOnClickListener onSureOnClickListener;
|
|
||||||
|
|
||||||
Context mContext;
|
|
||||||
|
|
||||||
public LabelVideoTagAdapter(Context context, OnSureOnClickListener onSureOnClickListener) {
|
|
||||||
super(context);
|
|
||||||
this.onSureOnClickListener = onSureOnClickListener;
|
|
||||||
this.mContext = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LabelVideoTagAdapter(Context context) {
|
|
||||||
super(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected TextView newViewHolder(View convertView) {
|
|
||||||
return (TextView) convertView.findViewById(R.id.tv_tag);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int getLayoutId() {
|
|
||||||
return R.layout.adapter_video_tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void convert(TextView textView, String item, int position) {
|
|
||||||
textView.setText(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface OnSureOnClickListener {
|
|
||||||
void sure(LabelBean.Children labelBean);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -16,9 +16,7 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.activity.AbsActivity;
|
|
||||||
import com.yunbao.common.bean.ActiveOtherBean;
|
import com.yunbao.common.bean.ActiveOtherBean;
|
||||||
import com.yunbao.common.dialog.ImagePreviewDialog;
|
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.views.NineGridLayout;
|
import com.yunbao.common.views.NineGridLayout;
|
||||||
@@ -83,17 +81,16 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
|||||||
comCount = itemView.findViewById(R.id.comCount);
|
comCount = itemView.findViewById(R.id.comCount);
|
||||||
shareCount = itemView.findViewById(R.id.shareCount);
|
shareCount = itemView.findViewById(R.id.shareCount);
|
||||||
|
|
||||||
itemView.setOnClickListener(new View.OnClickListener() {
|
mAvatar.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
onItemClickListener.onImgItem((ActiveOtherBean) v.getTag(), getPosition());
|
onItemClickListener.onImgItem((String) v.getTag(), getPosition());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
public void setData(ActiveOtherBean bean) {
|
public void setData(ActiveOtherBean bean) {
|
||||||
itemView.setTag(bean);
|
|
||||||
mAvatar.setTag(bean);
|
mAvatar.setTag(bean);
|
||||||
ImgLoader.display(mContext, bean.getUser_avatar(), mAvatar);
|
ImgLoader.display(mContext, bean.getUser_avatar(), mAvatar);
|
||||||
userName.setText(bean.getUser_name());
|
userName.setText(bean.getUser_name());
|
||||||
@@ -107,19 +104,7 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
|||||||
nineGridLayout.setActionListener(new NineGridLayout.ActionListener() {
|
nineGridLayout.setActionListener(new NineGridLayout.ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(List<?> dataList, int position) {
|
public void onItemClick(List<?> dataList, int position) {
|
||||||
ImagePreviewDialog dialog = new ImagePreviewDialog();
|
|
||||||
dialog.setImageInfo(dataList.size(), position, false, new ImagePreviewDialog.ActionListener() {
|
|
||||||
@Override
|
|
||||||
public void loadImage(ImageView imageView, int position) {
|
|
||||||
ImgLoader.display(mContext, (String) (dataList.get(position)), imageView);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDeleteClick(int position) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
dialog.show(((AbsActivity) mContext).getSupportFragmentManager(), "ImagePreviewDialog");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -134,18 +119,14 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
|||||||
tempList.add(String.valueOf(jsonArray.get(i)));
|
tempList.add(String.valueOf(jsonArray.get(i)));
|
||||||
}
|
}
|
||||||
nineGridLayout.setData(tempList);
|
nineGridLayout.setData(tempList);
|
||||||
videoLayout.setVisibility(View.GONE);
|
|
||||||
} else {
|
} else {
|
||||||
videoLayout.setVisibility(View.VISIBLE);
|
ImgLoader.display(mContext, bean.getUser_avatar(), videoImage);
|
||||||
ImgLoader.display(mContext, bean.getVideo() + "?vframe/jpg/offset/0", videoImage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface onItemClickListener {
|
public interface onItemClickListener {
|
||||||
void onImgItem(ActiveOtherBean activeBean, int position);
|
void onImgItem(String activeBean, int position);
|
||||||
|
|
||||||
void onVideoItem(String activeBean, int position);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
@@ -21,15 +22,17 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter {
|
|||||||
private List<UserHomeImgBean> commentBeanList;
|
private List<UserHomeImgBean> commentBeanList;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private onItemClickListener onItemClickListener;
|
private onItemClickListener onItemClickListener;
|
||||||
private boolean isMe;
|
|
||||||
|
|
||||||
public void setOnItemClickListener(UserHomeImgAdapter.onItemClickListener onItemClickListener) {
|
public void setOnItemClickListener(UserHomeImgAdapter.onItemClickListener onItemClickListener) {
|
||||||
this.onItemClickListener = onItemClickListener;
|
this.onItemClickListener = onItemClickListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserHomeImgAdapter(Context content, List<UserHomeImgBean> commentBeanList, boolean isMe) {
|
public List<UserHomeImgBean> getCommentBeanList() {
|
||||||
|
return commentBeanList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserHomeImgAdapter(Context content, List<UserHomeImgBean> commentBeanList) {
|
||||||
this.mContext = content;
|
this.mContext = content;
|
||||||
this.isMe = isMe;
|
|
||||||
this.commentBeanList = commentBeanList;
|
this.commentBeanList = commentBeanList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,13 +61,11 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter {
|
|||||||
class CommentViewHolder extends RecyclerView.ViewHolder {
|
class CommentViewHolder extends RecyclerView.ViewHolder {
|
||||||
RoundedImageView mAvatar01;
|
RoundedImageView mAvatar01;
|
||||||
RoundedImageView mAvatar02;
|
RoundedImageView mAvatar02;
|
||||||
ImageView del;
|
|
||||||
|
|
||||||
public CommentViewHolder(@NonNull View itemView) {
|
public CommentViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
mAvatar01 = itemView.findViewById(R.id.avatar01);
|
mAvatar01 = itemView.findViewById(R.id.avatar01);
|
||||||
mAvatar02 = itemView.findViewById(R.id.avatar02);
|
mAvatar02 = itemView.findViewById(R.id.avatar02);
|
||||||
del = itemView.findViewById(R.id.del);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
@@ -73,29 +74,15 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter {
|
|||||||
mAvatar01.setOnClickListener(new View.OnClickListener() {
|
mAvatar01.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (onItemClickListener != null) {
|
onItemClickListener.onImgItem((UserHomeImgBean) v.getTag(), position);
|
||||||
onItemClickListener.onImgItem((UserHomeImgBean) v.getTag(), position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
del.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (onItemClickListener != null) {
|
|
||||||
onItemClickListener.onImgDel((UserHomeImgBean) v.getTag(), position);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ImgLoader.display(mContext, bean.getImgurl(), mAvatar01);
|
ImgLoader.display(mContext, bean.getImgurl(), mAvatar01);
|
||||||
ImgLoader.display(mContext, bean.getImgurl(), mAvatar02);
|
ImgLoader.display(mContext, bean.getImgurl(), mAvatar02);
|
||||||
if (bean.isShow()) {
|
if (bean.isShow()) {
|
||||||
if (isMe) {
|
|
||||||
del.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
mAvatar01.setVisibility(View.GONE);
|
mAvatar01.setVisibility(View.GONE);
|
||||||
mAvatar02.setVisibility(View.VISIBLE);
|
mAvatar02.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
del.setVisibility(View.GONE);
|
|
||||||
mAvatar01.setVisibility(View.VISIBLE);
|
mAvatar01.setVisibility(View.VISIBLE);
|
||||||
mAvatar02.setVisibility(View.GONE);
|
mAvatar02.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
@@ -104,7 +91,5 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
public interface onItemClickListener {
|
public interface onItemClickListener {
|
||||||
void onImgItem(UserHomeImgBean activeBean, int position);
|
void onImgItem(UserHomeImgBean activeBean, int position);
|
||||||
|
|
||||||
void onImgDel(UserHomeImgBean activeBean, int position);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +1,11 @@
|
|||||||
package com.yunbao.common.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
import android.os.Parcel;
|
|
||||||
import android.os.Parcelable;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 社區动态
|
* 社區动态
|
||||||
*/
|
*/
|
||||||
public class CommentBean extends BaseModel implements Parcelable {
|
public class CommentBean extends BaseModel {
|
||||||
private String id;
|
private String id;
|
||||||
private String dynamic_id;
|
private String dynamic_id;
|
||||||
private String uid;
|
private String uid;
|
||||||
@@ -22,40 +17,8 @@ public class CommentBean extends BaseModel implements Parcelable {
|
|||||||
private String user_name;
|
private String user_name;
|
||||||
private String user_id;
|
private String user_id;
|
||||||
private String user_avatar;
|
private String user_avatar;
|
||||||
private boolean mParentNode;//是否是父元素
|
|
||||||
private List<ReplyComment> child;
|
private List<ReplyComment> child;
|
||||||
|
|
||||||
public CommentBean() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public CommentBean(Parcel in) {
|
|
||||||
id = in.readString();
|
|
||||||
dynamic_id = in.readString();
|
|
||||||
uid = in.readString();
|
|
||||||
to_comment_id = in.readString();
|
|
||||||
content = in.readString();
|
|
||||||
create_time = in.readString();
|
|
||||||
status = in.readString();
|
|
||||||
is_dynamic_user = in.readString();
|
|
||||||
user_name = in.readString();
|
|
||||||
user_id = in.readString();
|
|
||||||
user_avatar = in.readString();
|
|
||||||
mParentNode = in.readByte() != 0;
|
|
||||||
isShow = in.readByte() != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final Creator<CommentBean> CREATOR = new Creator<CommentBean>() {
|
|
||||||
@Override
|
|
||||||
public CommentBean createFromParcel(Parcel in) {
|
|
||||||
return new CommentBean(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CommentBean[] newArray(int size) {
|
|
||||||
return new CommentBean[size];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public List<ReplyComment> getChild() {
|
public List<ReplyComment> getChild() {
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
@@ -64,14 +27,6 @@ public class CommentBean extends BaseModel implements Parcelable {
|
|||||||
this.child = child;
|
this.child = child;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean ismParentNode() {
|
|
||||||
return mParentNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentNode(boolean mParentNode) {
|
|
||||||
this.mParentNode = mParentNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isShow;
|
private boolean isShow;
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
@@ -178,28 +133,6 @@ public class CommentBean extends BaseModel implements Parcelable {
|
|||||||
isShow = show;
|
isShow = show;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int describeContents() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
|
||||||
dest.writeString(id);
|
|
||||||
dest.writeString(dynamic_id);
|
|
||||||
dest.writeString(uid);
|
|
||||||
dest.writeString(to_comment_id);
|
|
||||||
dest.writeString(content);
|
|
||||||
dest.writeString(create_time);
|
|
||||||
dest.writeString(status);
|
|
||||||
dest.writeString(is_dynamic_user);
|
|
||||||
dest.writeString(user_name);
|
|
||||||
dest.writeString(user_id);
|
|
||||||
dest.writeString(user_avatar);
|
|
||||||
dest.writeByte((byte) (mParentNode ? 1 : 0));
|
|
||||||
dest.writeByte((byte) (isShow ? 1 : 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class ReplyComment {
|
public static class ReplyComment {
|
||||||
private String id;
|
private String id;
|
||||||
private String dynamic_id;
|
private String dynamic_id;
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class FirstLoginBean extends BaseModel{
|
||||||
|
@SerializedName("status")
|
||||||
|
int status;//0是第一次登陸,1是已經登錄過的
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,13 +4,13 @@ import java.util.List;
|
|||||||
|
|
||||||
public class HomeUserExhibitInfoBean extends BaseModel {
|
public class HomeUserExhibitInfoBean extends BaseModel {
|
||||||
public UserHomeTopInfo userHomeTopInfo;
|
public UserHomeTopInfo userHomeTopInfo;
|
||||||
public GiftAlreadyWall giftAlreadyWall;
|
public List<GiftAlreadyWall> giftAlreadyWall;
|
||||||
|
|
||||||
public GiftAlreadyWall getGiftAlreadyWall() {
|
public List<GiftAlreadyWall> getGiftAlreadyWall() {
|
||||||
return giftAlreadyWall;
|
return giftAlreadyWall;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGiftAlreadyWall(GiftAlreadyWall giftAlreadyWall) {
|
public void setGiftAlreadyWall(List<GiftAlreadyWall> giftAlreadyWall) {
|
||||||
this.giftAlreadyWall = giftAlreadyWall;
|
this.giftAlreadyWall = giftAlreadyWall;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,26 +22,9 @@ public class HomeUserExhibitInfoBean extends BaseModel {
|
|||||||
this.userHomeTopInfo = userHomeTopInfo;
|
this.userHomeTopInfo = userHomeTopInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class UserHomeTopInfo {
|
public class UserHomeTopInfo {
|
||||||
public Fans fans;
|
Fans fans;
|
||||||
public List<Guard> guard;
|
|
||||||
public List<Dress> dress;
|
|
||||||
|
|
||||||
public List<Guard> getGuard() {
|
|
||||||
return guard;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGuard(List<Guard> guard) {
|
|
||||||
this.guard = guard;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Dress> getDress() {
|
|
||||||
return dress;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDress(List<Dress> dress) {
|
|
||||||
this.dress = dress;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Fans getFans() {
|
public Fans getFans() {
|
||||||
return fans;
|
return fans;
|
||||||
@@ -109,6 +92,7 @@ public class HomeUserExhibitInfoBean extends BaseModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class GiftAlreadyWall {
|
public class GiftAlreadyWall {
|
||||||
private String gift_wall_lighten_number;
|
private String gift_wall_lighten_number;
|
||||||
private String gift_wall_lighten_total;
|
private String gift_wall_lighten_total;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.yunbao.common.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class HomeUserInfoBean extends BaseModel {
|
public class HomeUserInfoBean extends BaseModel {
|
||||||
@@ -47,53 +45,6 @@ public class HomeUserInfoBean extends BaseModel {
|
|||||||
private List<String> cn_label;
|
private List<String> cn_label;
|
||||||
private List<String> en_label;
|
private List<String> en_label;
|
||||||
|
|
||||||
private String age;
|
|
||||||
private String height;
|
|
||||||
private String career;
|
|
||||||
private String en_career;
|
|
||||||
|
|
||||||
private String rong_online;
|
|
||||||
|
|
||||||
public String getRong_online() {
|
|
||||||
return rong_online;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRong_online(String rong_online) {
|
|
||||||
this.rong_online = rong_online;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAge() {
|
|
||||||
return age;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAge(String age) {
|
|
||||||
this.age = age;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getHeight() {
|
|
||||||
return height;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHeight(String height) {
|
|
||||||
this.height = height;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCareer() {
|
|
||||||
return career;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCareer(String career) {
|
|
||||||
this.career = career;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEn_career() {
|
|
||||||
return en_career;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEn_career(String en_career) {
|
|
||||||
this.en_career = en_career;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getCn_label() {
|
public List<String> getCn_label() {
|
||||||
return cn_label;
|
return cn_label;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import java.util.List;
|
|||||||
public class MessageUserInfoBean extends BaseModel{
|
public class MessageUserInfoBean extends BaseModel{
|
||||||
IMLoginModel user;
|
IMLoginModel user;
|
||||||
UserInfo info;
|
UserInfo info;
|
||||||
UserLevel level;
|
//UserLevel level;
|
||||||
@SerializedName("gift_num")
|
@SerializedName("gift_num")
|
||||||
int giftNum;
|
int giftNum;
|
||||||
@SerializedName("msg")
|
@SerializedName("msg")
|
||||||
@@ -60,13 +60,13 @@ public class MessageUserInfoBean extends BaseModel{
|
|||||||
this.info = info;
|
this.info = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserLevel getLevel() {
|
/*public UserLevel getLevel() {
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLevel(UserLevel level) {
|
public void setLevel(UserLevel level) {
|
||||||
this.level = level;
|
this.level = level;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
public int getGiftNum() {
|
public int getGiftNum() {
|
||||||
return giftNum;
|
return giftNum;
|
||||||
@@ -107,6 +107,20 @@ public class MessageUserInfoBean extends BaseModel{
|
|||||||
private String age;
|
private String age;
|
||||||
@SerializedName("open_off")
|
@SerializedName("open_off")
|
||||||
private int openOff;//接单设置 1开启 2关闭
|
private int openOff;//接单设置 1开启 2关闭
|
||||||
|
@SerializedName("rong_online")
|
||||||
|
private int rongOnline;
|
||||||
|
|
||||||
|
public void setOpenOff(int openOff) {
|
||||||
|
this.openOff = openOff;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRongOnline() {
|
||||||
|
return rongOnline;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRongOnline(int rongOnline) {
|
||||||
|
this.rongOnline = rongOnline;
|
||||||
|
}
|
||||||
|
|
||||||
public int getOpenOff() {
|
public int getOpenOff() {
|
||||||
return openOff;
|
return openOff;
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ import java.util.Locale;
|
|||||||
|
|
||||||
public class CommonHttpUtil {
|
public class CommonHttpUtil {
|
||||||
|
|
||||||
public static final String GET_UPLOAD_QI_NIU_TOKEN = "getUploadQiNiuToken";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化
|
* 初始化
|
||||||
@@ -507,13 +506,12 @@ public class CommonHttpUtil {
|
|||||||
* @param createAt
|
* @param createAt
|
||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
public static void pushCommunity(boolean isImgOrVideo, String content, String talkId, String fileAry, String videoUrl, String createAt, HttpCallback callback) {
|
public static void pushCommunity(boolean isImgOrVideo, String content, String talkId, String fileAry, String createAt, HttpCallback callback) {
|
||||||
HttpClient.getInstance().post("Pdlcommunity.sendDynamic", CommonHttpConsts.GET_USER_BASEINFO)
|
HttpClient.getInstance().get("Pdlcommunity.sendDynamic", CommonHttpConsts.GET_USER_BASEINFO)
|
||||||
.params("img_or_video", isImgOrVideo ? 1 : 2)
|
.params("img_or_video", isImgOrVideo ? 1 : 2)
|
||||||
.params("content", content)
|
.params("content", content)
|
||||||
.params("talk_id", talkId)
|
.params("talk_id", talkId)
|
||||||
.params("file_name_ary", fileAry)
|
.params("file_name_ary", fileAry)
|
||||||
.params("video", videoUrl)
|
|
||||||
.params("created_at", createAt)
|
.params("created_at", createAt)
|
||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
@@ -524,21 +522,31 @@ public class CommonHttpUtil {
|
|||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
public static void getCommunityHotList(int p, HttpCallback callback) {
|
public static void getCommunityHotList(int p, HttpCallback callback) {
|
||||||
HttpClient.getInstance().get("Pdlcommunity.getHotDynamicList", "Pdlcommunity.getHotDynamicList")
|
HttpClient.getInstance().get("Pdlcommunity.getFindDynamicList", "Pdlcommunity.getFindDynamicList")
|
||||||
.params("p", p)
|
.params("p", p)
|
||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取动态列表-热门
|
||||||
|
*
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
public static void getCommunityDetails(String dynamic_id, HttpCallback callback) {
|
||||||
|
HttpClient.getInstance().get("Pdlcommunity.getDynamicInfo", "Pdlcommunity.getDynamicInfo")
|
||||||
|
.params("dynamic_id", dynamic_id)
|
||||||
|
.execute(callback);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取动态列表-评论
|
* 获取动态列表-评论
|
||||||
*
|
*
|
||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
public static void getCommunityComment(String dynamic_id, String dynamic_uid, int p, HttpCallback callback) {
|
public static void getCommunityComment(String dynamic_id, String dynamic_uid, HttpCallback callback) {
|
||||||
HttpClient.getInstance().get("Pdlcommunity.getDynamicCommentList", "Pdlcommunity.getDynamicCommentList")
|
HttpClient.getInstance().get("Pdlcommunity.getDynamicCommentList", "Pdlcommunity.getDynamicCommentList")
|
||||||
.params("dynamic_id", dynamic_id)
|
.params("dynamic_id", dynamic_id)
|
||||||
.params("dynamic_uid", dynamic_uid)
|
.params("dynamic_uid", dynamic_uid)
|
||||||
.params("p", p)
|
|
||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -579,7 +587,7 @@ public class CommonHttpUtil {
|
|||||||
* 获取动态-关注
|
* 获取动态-关注
|
||||||
*/
|
*/
|
||||||
public static void getCommunityFollow(int p, HttpCallback callback) {
|
public static void getCommunityFollow(int p, HttpCallback callback) {
|
||||||
HttpClient.getInstance().get("Pdlcommunity.getAttentionDynamicList", "Pdlcommunity.getAttentionDynamicList")
|
HttpClient.getInstance().get("Pdlcommunity.getFindDynamicList", "Pdlcommunity.getFindDynamicList")
|
||||||
.params("p", p)
|
.params("p", p)
|
||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
@@ -588,7 +596,7 @@ public class CommonHttpUtil {
|
|||||||
* 获取动态-分类
|
* 获取动态-分类
|
||||||
*/
|
*/
|
||||||
public static void getTag(HttpCallback callback) {
|
public static void getTag(HttpCallback callback) {
|
||||||
HttpClient.getInstance().get("Pdlcommunity.getHotTalk", "Pdlcommunity.getHotTalk")
|
HttpClient.getInstance().get("Pdlcommunity.getTalkBanner", "Pdlcommunity.getTalkBanner")
|
||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,25 +640,7 @@ public class CommonHttpUtil {
|
|||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 上传文件 获取七牛云token的接口
|
|
||||||
*/
|
|
||||||
public static void getUploadQiNiuToken(HttpCallback callback, boolean isImg) {
|
|
||||||
HttpClient.getInstance().get("Pdluserhome.getQiNiuToken", "Pdluserhome.getQiNiuToken")
|
|
||||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
|
||||||
.params("token", CommonAppConfig.getInstance().getToken())
|
|
||||||
.params("ext", isImg ? ".jpeg" : ".mp4")
|
|
||||||
.execute(callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改用户背景墙
|
|
||||||
*/
|
|
||||||
public static void uploadUserInfoImg(String imgs, HttpCallback callback) {
|
|
||||||
HttpClient.getInstance().post("Pdluserhome.saveUserHomeBanner", "Userhome.saveUserHomeBanner")
|
|
||||||
.params("home_banner_url_ary", imgs)
|
|
||||||
.execute(callback);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.yunbao.common.http;
|
package com.yunbao.common.http;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.yunbao.common.bean.ActiveBean;
|
|
||||||
import com.yunbao.common.bean.ActiveModel;
|
import com.yunbao.common.bean.ActiveModel;
|
||||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||||
@@ -11,6 +10,7 @@ import com.yunbao.common.bean.BattlePassPoints;
|
|||||||
import com.yunbao.common.bean.BattlePassTask;
|
import com.yunbao.common.bean.BattlePassTask;
|
||||||
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
||||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||||
|
import com.yunbao.common.bean.CareerBean;
|
||||||
import com.yunbao.common.bean.CheckLiveModel;
|
import com.yunbao.common.bean.CheckLiveModel;
|
||||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||||
import com.yunbao.common.bean.ContributeModel;
|
import com.yunbao.common.bean.ContributeModel;
|
||||||
@@ -23,6 +23,7 @@ import com.yunbao.common.bean.FaceBookUpModel;
|
|||||||
import com.yunbao.common.bean.FansCheckRed;
|
import com.yunbao.common.bean.FansCheckRed;
|
||||||
import com.yunbao.common.bean.FansGroupGiftPack;
|
import com.yunbao.common.bean.FansGroupGiftPack;
|
||||||
import com.yunbao.common.bean.FansGroupGiftPackInfo;
|
import com.yunbao.common.bean.FansGroupGiftPackInfo;
|
||||||
|
import com.yunbao.common.bean.FirstLoginBean;
|
||||||
import com.yunbao.common.bean.GiftAlreadyWallModel;
|
import com.yunbao.common.bean.GiftAlreadyWallModel;
|
||||||
import com.yunbao.common.bean.GiftGuideModel;
|
import com.yunbao.common.bean.GiftGuideModel;
|
||||||
import com.yunbao.common.bean.GiftNamingInfoModel;
|
import com.yunbao.common.bean.GiftNamingInfoModel;
|
||||||
@@ -211,7 +212,6 @@ public interface PDLiveApi {
|
|||||||
/**
|
/**
|
||||||
* 获取直播间信息
|
* 获取直播间信息
|
||||||
*
|
*
|
||||||
* @param liveui 主播id
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Live.getLiveInfo")
|
@GET("/api/public/?service=Live.getLiveInfo")
|
||||||
@@ -1196,7 +1196,6 @@ public interface PDLiveApi {
|
|||||||
@GET("/api/public/?service=Userhome.getUserHomeBanner")
|
@GET("/api/public/?service=Userhome.getUserHomeBanner")
|
||||||
Observable<ResponseModel<List<String>>> getUserHomeBanner(@Query("select_uid") String tuid);
|
Observable<ResponseModel<List<String>>> getUserHomeBanner(@Query("select_uid") String tuid);
|
||||||
|
|
||||||
|
|
||||||
@GET("/api/public/?service=Pdlinfos.getIsAnchor")
|
@GET("/api/public/?service=Pdlinfos.getIsAnchor")
|
||||||
Observable<ResponseModel<MessageChatIsAnchor>> getIsAnchor();
|
Observable<ResponseModel<MessageChatIsAnchor>> getIsAnchor();
|
||||||
|
|
||||||
@@ -1270,7 +1269,27 @@ public interface PDLiveApi {
|
|||||||
@GET("/api/public/?service=Pdluserhome.getUserHomeInfo")
|
@GET("/api/public/?service=Pdluserhome.getUserHomeInfo")
|
||||||
Observable<ResponseModel<HomeUserExhibitInfoBean>> getUserHomeExhibitInfo(@Query("select_uid") String tuid);
|
Observable<ResponseModel<HomeUserExhibitInfoBean>> getUserHomeExhibitInfo(@Query("select_uid") String tuid);
|
||||||
|
|
||||||
@GET("/api/public/?service=Pdlcommunity.getDynamicInfo")
|
@GET("/api/public/?service=Pdlinfos.getCareer")
|
||||||
Observable<ResponseModel<ActiveBean>> getDynamicInfo(@Query("dynamic_id") String dynamic_id);
|
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(
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.ActiveBean;
|
|
||||||
import com.yunbao.common.bean.ActiveModel;
|
import com.yunbao.common.bean.ActiveModel;
|
||||||
import com.yunbao.common.bean.AvatarBean;
|
import com.yunbao.common.bean.AvatarBean;
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
@@ -16,6 +15,7 @@ import com.yunbao.common.bean.BattlePassPoints;
|
|||||||
import com.yunbao.common.bean.BattlePassTask;
|
import com.yunbao.common.bean.BattlePassTask;
|
||||||
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
||||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||||
|
import com.yunbao.common.bean.CareerBean;
|
||||||
import com.yunbao.common.bean.CheckLiveModel;
|
import com.yunbao.common.bean.CheckLiveModel;
|
||||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||||
import com.yunbao.common.bean.CoolConfig;
|
import com.yunbao.common.bean.CoolConfig;
|
||||||
@@ -26,6 +26,7 @@ import com.yunbao.common.bean.EnterRoomNewModel;
|
|||||||
import com.yunbao.common.bean.FansCheckRed;
|
import com.yunbao.common.bean.FansCheckRed;
|
||||||
import com.yunbao.common.bean.FansGroupGiftPack;
|
import com.yunbao.common.bean.FansGroupGiftPack;
|
||||||
import com.yunbao.common.bean.FansGroupGiftPackInfo;
|
import com.yunbao.common.bean.FansGroupGiftPackInfo;
|
||||||
|
import com.yunbao.common.bean.FirstLoginBean;
|
||||||
import com.yunbao.common.bean.GiftAlreadyWallModel;
|
import com.yunbao.common.bean.GiftAlreadyWallModel;
|
||||||
import com.yunbao.common.bean.GiftGuideModel;
|
import com.yunbao.common.bean.GiftGuideModel;
|
||||||
import com.yunbao.common.bean.GiftNamingInfoModel;
|
import com.yunbao.common.bean.GiftNamingInfoModel;
|
||||||
@@ -3382,18 +3383,109 @@ public class LiveNetManager {
|
|||||||
}
|
}
|
||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
public void getCareer(HttpCallback<List<CareerBean>> callback) {
|
||||||
public void getDynamicInfo(String dynamic_id, HttpCallback<ActiveBean> callback) {
|
|
||||||
API.get().pdLiveApi(mContext)
|
API.get().pdLiveApi(mContext)
|
||||||
.getDynamicInfo(dynamic_id)
|
.getCareer()
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Consumer<ResponseModel<ActiveBean>>() {
|
.subscribe(roomMicStatusModelResponseModel -> {
|
||||||
@Override
|
if (callback != null) {
|
||||||
public void accept(ResponseModel<ActiveBean> messageUserInfoBeanResponseModel) throws Exception {
|
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
|
||||||
if (callback != null) {
|
}
|
||||||
callback.onSuccess(messageUserInfoBeanResponseModel.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>() {
|
}, new Consumer<Throwable>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -3405,7 +3497,6 @@ public class LiveNetManager {
|
|||||||
}
|
}
|
||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
private MultipartBody.Part createUploadFile(File file) {
|
private MultipartBody.Part createUploadFile(File file) {
|
||||||
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||||
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ import android.content.Context;
|
|||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.yunbao.common.bean.FansModel;
|
||||||
import com.yunbao.common.bean.NewCommunityType;
|
import com.yunbao.common.bean.NewCommunityType;
|
||||||
|
import com.yunbao.common.bean.NewLevelModel;
|
||||||
import com.yunbao.common.manager.base.BaseCacheManager;
|
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -28,7 +30,7 @@ public class CommunityTypeManager extends BaseCacheManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void UpCommunityType(String json) {
|
public void UpCommunityType(String json) {
|
||||||
newCommunityTypeList = new Gson().fromJson(json, new TypeToken<List<NewCommunityType>>() {
|
newCommunityTypeList = new Gson().fromJson(json, new TypeToken<List<NewLevelModel>>() {
|
||||||
}.getType());
|
}.getType());
|
||||||
put(KEY_COMMUNITY_TYPE, newCommunityTypeList);
|
put(KEY_COMMUNITY_TYPE, newCommunityTypeList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.os.Parcelable;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.yunbao.common.interfaces.OnSendMessageListener;
|
import com.yunbao.common.interfaces.OnSendMessageListener;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -14,6 +15,7 @@ import java.io.UnsupportedEncodingException;
|
|||||||
|
|
||||||
import io.rong.common.ParcelUtils;
|
import io.rong.common.ParcelUtils;
|
||||||
import io.rong.imkit.IMCenter;
|
import io.rong.imkit.IMCenter;
|
||||||
|
import io.rong.imlib.IRongCallback;
|
||||||
import io.rong.imlib.MessageTag;
|
import io.rong.imlib.MessageTag;
|
||||||
import io.rong.imlib.RongIMClient;
|
import io.rong.imlib.RongIMClient;
|
||||||
import io.rong.imlib.model.Conversation;
|
import io.rong.imlib.model.Conversation;
|
||||||
@@ -31,20 +33,29 @@ public class MessageChatCardContent extends MessageContent implements Parcelable
|
|||||||
private String extraData;
|
private String extraData;
|
||||||
|
|
||||||
public static <T> void sendMessage(Conversation.ConversationType type, String targetId, MessageChatCardContent tipsContent, OnSendMessageListener<T> listener) {
|
public static <T> void sendMessage(Conversation.ConversationType type, String targetId, MessageChatCardContent tipsContent, OnSendMessageListener<T> listener) {
|
||||||
IMCenter.getInstance().insertOutgoingMessage(type, targetId, Message.SentStatus.SENT, tipsContent, System.currentTimeMillis(), new RongIMClient.ResultCallback<Message>() {
|
ToastUtil.show("发送给:"+targetId);
|
||||||
|
Message message=Message.obtain(targetId, type,tipsContent);
|
||||||
|
IMCenter.getInstance().sendMessage(message,null,null,new IRongCallback.ISendMessageCallback(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAttached(Message message) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Message message) {
|
public void onSuccess(Message message) {
|
||||||
|
ToastUtil.show("发送成功");
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
listener.onSuccess(null, null);
|
listener.onSuccess(null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(RongIMClient.ErrorCode e) {
|
public void onError(Message message, RongIMClient.ErrorCode e) {
|
||||||
|
ToastUtil.show("发送失败:"+e.getMessage());
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
listener.onError(e.code, e.msg);
|
listener.onError(e.code, e.msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,19 @@ import android.content.Context;
|
|||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.LiveBean;
|
||||||
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.http.LiveHttpUtil;
|
||||||
import com.yunbao.common.message.content.MessageChatCardContent;
|
import com.yunbao.common.message.content.MessageChatCardContent;
|
||||||
import com.yunbao.common.message.content.MessageChatTipsContent;
|
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||||
|
import com.yunbao.common.utils.MicStatusManager;
|
||||||
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -21,34 +31,74 @@ public class MessageChatCardItemProvider extends BaseMessageItemProvider<Message
|
|||||||
|
|
||||||
public MessageChatCardItemProvider(Context mContext) {
|
public MessageChatCardItemProvider(Context mContext) {
|
||||||
this.mContext = mContext;
|
this.mContext = mContext;
|
||||||
mConfig.showPortrait = false;
|
mConfig.showPortrait = true;
|
||||||
mConfig.showSummaryWithName = false;
|
mConfig.showSummaryWithName = true;
|
||||||
mConfig.showContentBubble = false;
|
mConfig.showContentBubble = false;
|
||||||
mConfig.centerInHorizontal = true;
|
mConfig.centerInHorizontal = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ViewHolder onCreateMessageContentViewHolder(ViewGroup parent, int viewType) {
|
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
|
@Override
|
||||||
protected void bindMessageContentViewHolder(ViewHolder holder, ViewHolder parentHolder, MessageChatCardContent content, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
|
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
|
@Override
|
||||||
protected boolean onItemClick(ViewHolder holder, MessageChatCardContent messageChatTipsContent, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
|
protected boolean onItemClick(ViewHolder holder, MessageChatCardContent content, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
|
||||||
|
if ("1".equals(content.getType())) {
|
||||||
|
gotoLive(content.getExtraData());
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isMessageViewType(MessageContent messageContent) {
|
protected boolean isMessageViewType(MessageContent messageContent) {
|
||||||
return messageContent instanceof MessageChatTipsContent;
|
return messageContent instanceof MessageChatCardContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Spannable getSummarySpannable(Context context, MessageChatCardContent content) {
|
public Spannable getSummarySpannable(Context context, MessageChatCardContent content) {
|
||||||
return null;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,92 +0,0 @@
|
|||||||
package com.yunbao.common.upload;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by cxf on 2019/4/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class UploadBean {
|
|
||||||
|
|
||||||
public static final int IMG = 0;
|
|
||||||
public static final int VIDEO = 1;
|
|
||||||
public static final int VOICE = 2;
|
|
||||||
private File mOriginFile;//要被上传的源文件
|
|
||||||
private File mCompressFile;//压缩后的图片文件
|
|
||||||
private String mRemoteFileName;//上传成功后在云存储上的文件名字
|
|
||||||
private String mRemoteAccessUrl;//上传成功后在云存储上的访问地址
|
|
||||||
private boolean mSuccess;//是否上传成功了
|
|
||||||
private int mType;
|
|
||||||
private Object mTag;
|
|
||||||
|
|
||||||
public UploadBean() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public UploadBean(File originFile, int type) {
|
|
||||||
mOriginFile = originFile;
|
|
||||||
mType = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public File getOriginFile() {
|
|
||||||
return mOriginFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOriginFile(File originFile) {
|
|
||||||
mOriginFile = originFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRemoteFileName() {
|
|
||||||
return mRemoteFileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRemoteFileName(String remoteFileName) {
|
|
||||||
mRemoteFileName = remoteFileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRemoteAccessUrl() {
|
|
||||||
return mRemoteAccessUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRemoteAccessUrl(String remoteAccessUrl) {
|
|
||||||
mRemoteAccessUrl = remoteAccessUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public File getCompressFile() {
|
|
||||||
return mCompressFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCompressFile(File compressFile) {
|
|
||||||
mCompressFile = compressFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSuccess() {
|
|
||||||
return mSuccess;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSuccess(boolean success) {
|
|
||||||
mSuccess = success;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setEmpty() {
|
|
||||||
mOriginFile = null;
|
|
||||||
mRemoteFileName = null;
|
|
||||||
mRemoteAccessUrl = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEmpty() {
|
|
||||||
return mOriginFile == null && mRemoteFileName == null && mRemoteAccessUrl == null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getType() {
|
|
||||||
return mType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getTag() {
|
|
||||||
return mTag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTag(Object tag) {
|
|
||||||
mTag = tag;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package com.yunbao.common.upload;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by cxf on 2019/4/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface UploadCallback {
|
|
||||||
void onFinish(List<UploadBean> list, boolean success);
|
|
||||||
}
|
|
||||||
@@ -1,215 +0,0 @@
|
|||||||
package com.yunbao.common.upload;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.qiniu.android.common.ServiceAddress;
|
|
||||||
import com.qiniu.android.common.Zone;
|
|
||||||
import com.qiniu.android.http.ResponseInfo;
|
|
||||||
import com.qiniu.android.storage.Configuration;
|
|
||||||
import com.qiniu.android.storage.UpCompletionHandler;
|
|
||||||
import com.qiniu.android.storage.UploadManager;
|
|
||||||
import com.yunbao.common.CommonAppConfig;
|
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
|
||||||
import com.yunbao.common.http.HttpCallback;
|
|
||||||
import com.yunbao.common.utils.L;
|
|
||||||
import com.yunbao.common.utils.StringUtil;
|
|
||||||
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import top.zibin.luban.Luban;
|
|
||||||
import top.zibin.luban.OnCompressListener;
|
|
||||||
import top.zibin.luban.OnRenameListener;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by cxf on 2019/4/16.
|
|
||||||
* 七牛上传文件
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class UploadQnImpl implements UploadStrategy {
|
|
||||||
|
|
||||||
private static final String TAG = "UploadQnImpl";
|
|
||||||
private Context mContext;
|
|
||||||
private List<UploadBean> mList;
|
|
||||||
private int mIndex;
|
|
||||||
private boolean mNeedCompress;
|
|
||||||
private UploadCallback mUploadCallback;
|
|
||||||
private HttpCallback mGetUploadTokenCallback;
|
|
||||||
private String mToken;
|
|
||||||
private UploadManager mUploadManager;
|
|
||||||
private UpCompletionHandler mCompletionHandler;//上传回调
|
|
||||||
private Luban.Builder mLubanBuilder;
|
|
||||||
|
|
||||||
public UploadQnImpl(Context context) {
|
|
||||||
mContext = context;
|
|
||||||
mCompletionHandler = new UpCompletionHandler() {
|
|
||||||
@Override
|
|
||||||
public void complete(String key, ResponseInfo info, JSONObject response) {
|
|
||||||
L.e("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
|
|
||||||
try {
|
|
||||||
assert response != null;
|
|
||||||
mList.get(mIndex).setRemoteAccessUrl(response.getString("key"));
|
|
||||||
} catch (JSONException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
if (mList == null || mList.size() == 0) {
|
|
||||||
if (mUploadCallback != null) {
|
|
||||||
mUploadCallback.onFinish(mList, false);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
UploadBean uploadBean = mList.get(mIndex);
|
|
||||||
if (info.isOK()) {
|
|
||||||
uploadBean.setSuccess(true);
|
|
||||||
if (uploadBean.getType() == UploadBean.IMG && mNeedCompress) {
|
|
||||||
//上传完成后把 压缩后的图片 删掉
|
|
||||||
File compressedFile = uploadBean.getCompressFile();
|
|
||||||
if (compressedFile != null && compressedFile.exists()) {
|
|
||||||
File originFile = uploadBean.getOriginFile();
|
|
||||||
if (originFile != null && !compressedFile.getAbsolutePath().equals(originFile.getAbsolutePath())) {
|
|
||||||
compressedFile.delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mIndex++;
|
|
||||||
if (mIndex < mList.size()) {
|
|
||||||
uploadNext();
|
|
||||||
} else {
|
|
||||||
if (mUploadCallback != null) {
|
|
||||||
mUploadCallback.onFinish(mList, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
upload(mList.get(mIndex));//上传失败后 重新上传
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void upload(List<UploadBean> list, boolean needCompress, UploadCallback callback, boolean isImg) {
|
|
||||||
if (callback == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (list == null || list.size() == 0) {
|
|
||||||
callback.onFinish(list, false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
boolean hasFile = false;
|
|
||||||
for (UploadBean bean : list) {
|
|
||||||
if (bean.getOriginFile() != null) {
|
|
||||||
hasFile = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!hasFile) {
|
|
||||||
callback.onFinish(list, true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mList = list;
|
|
||||||
mNeedCompress = needCompress;
|
|
||||||
mUploadCallback = callback;
|
|
||||||
mIndex = 0;
|
|
||||||
|
|
||||||
if (mGetUploadTokenCallback == null) {
|
|
||||||
mGetUploadTokenCallback = new HttpCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
if (code == 0 && info.length > 0) {
|
|
||||||
mToken = info[0];
|
|
||||||
L.e(TAG, "-------上传的token------>" + mToken);
|
|
||||||
uploadNext();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
CommonHttpUtil.getUploadQiNiuToken(mGetUploadTokenCallback, isImg);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void cancelUpload() {
|
|
||||||
CommonHttpUtil.cancel(CommonHttpUtil.GET_UPLOAD_QI_NIU_TOKEN);
|
|
||||||
if (mList != null) {
|
|
||||||
mList.clear();
|
|
||||||
}
|
|
||||||
mUploadCallback = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void uploadNext() {
|
|
||||||
UploadBean bean = null;
|
|
||||||
while (mIndex < mList.size() && (bean = mList.get(mIndex)).getOriginFile() == null) {
|
|
||||||
mIndex++;
|
|
||||||
}
|
|
||||||
if (mIndex >= mList.size()) {
|
|
||||||
if (mUploadCallback != null) {
|
|
||||||
mUploadCallback.onFinish(mList, true);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (bean.getType() == UploadBean.IMG) {
|
|
||||||
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".jpg"));
|
|
||||||
} else if (bean.getType() == UploadBean.VIDEO) {
|
|
||||||
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".mp4"));
|
|
||||||
} else if (bean.getType() == UploadBean.VOICE) {
|
|
||||||
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".m4a"));
|
|
||||||
}
|
|
||||||
if (bean.getType() == UploadBean.IMG && mNeedCompress) {
|
|
||||||
if (mLubanBuilder == null) {
|
|
||||||
mLubanBuilder = Luban.with(mContext).ignoreBy(8)//8k以下不压缩
|
|
||||||
.setTargetDir(CommonAppConfig.INNER_PATH).setRenameListener(new OnRenameListener() {
|
|
||||||
@Override
|
|
||||||
public String rename(String filePath) {
|
|
||||||
return mList.get(mIndex).getRemoteFileName();
|
|
||||||
}
|
|
||||||
}).setCompressListener(new OnCompressListener() {
|
|
||||||
@Override
|
|
||||||
public void onStart() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(File file) {
|
|
||||||
UploadBean uploadBean = mList.get(mIndex);
|
|
||||||
uploadBean.setCompressFile(file);
|
|
||||||
upload(uploadBean);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
upload(mList.get(mIndex));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
mLubanBuilder.load(bean.getOriginFile()).launch();
|
|
||||||
} else {
|
|
||||||
upload(bean);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void upload(UploadBean bean) {
|
|
||||||
if (bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null) {
|
|
||||||
if (mUploadManager == null) {
|
|
||||||
Zone zone = new Zone(new ServiceAddress("http://upload-z0.qiniup.com"), new ServiceAddress("http://up-z0.qiniup.com"));
|
|
||||||
Configuration configuration = new Configuration.Builder().zone(zone).build();
|
|
||||||
mUploadManager = new UploadManager(configuration);
|
|
||||||
}
|
|
||||||
File uploadFile = bean.getOriginFile();
|
|
||||||
if (bean.getType() == UploadBean.IMG && mNeedCompress) {
|
|
||||||
File compressedFile = bean.getCompressFile();
|
|
||||||
if (compressedFile != null && compressedFile.exists()) {
|
|
||||||
uploadFile = compressedFile;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mUploadManager.put(uploadFile, bean.getRemoteFileName(), mToken, mCompletionHandler, null);
|
|
||||||
} else {
|
|
||||||
if (mUploadCallback != null) {
|
|
||||||
mUploadCallback.onFinish(mList, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
package com.yunbao.common.upload;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by cxf on 2019/4/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface UploadStrategy {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行上传
|
|
||||||
*
|
|
||||||
* @param list 被上传的文件列表
|
|
||||||
* @param needCompress 是否需要压缩
|
|
||||||
* @param callback 上传回调
|
|
||||||
*/
|
|
||||||
void upload(List<UploadBean> list, boolean needCompress, UploadCallback callback,boolean isImg);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消上传
|
|
||||||
*/
|
|
||||||
void cancelUpload();
|
|
||||||
}
|
|
||||||
@@ -24,7 +24,6 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
|||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
private View.OnClickListener mOnClickListener;
|
private View.OnClickListener mOnClickListener;
|
||||||
private View.OnClickListener mODelListener;
|
private View.OnClickListener mODelListener;
|
||||||
private View.OnClickListener onAddClick;
|
|
||||||
private ActionListener mActionListener;
|
private ActionListener mActionListener;
|
||||||
|
|
||||||
public ActiveImageAdapter(Context context) {
|
public ActiveImageAdapter(Context context) {
|
||||||
@@ -71,14 +70,6 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
onAddClick = new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (mActionListener != null) {
|
|
||||||
mActionListener.onAddClick();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActionListener(ActionListener actionListener) {
|
public void setActionListener(ActionListener actionListener) {
|
||||||
@@ -183,7 +174,6 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
|||||||
del = itemView.findViewById(R.id.del);
|
del = itemView.findViewById(R.id.del);
|
||||||
itemView.setOnClickListener(mOnClickListener);
|
itemView.setOnClickListener(mOnClickListener);
|
||||||
del.setOnClickListener(mODelListener);
|
del.setOnClickListener(mODelListener);
|
||||||
mIconAdd.setOnClickListener(onAddClick);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setData(ActiveImageBean bean, int position) {
|
void setData(ActiveImageBean bean, int position) {
|
||||||
@@ -193,15 +183,15 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
|||||||
if (mIconAdd.getVisibility() != View.VISIBLE) {
|
if (mIconAdd.getVisibility() != View.VISIBLE) {
|
||||||
mIconAdd.setVisibility(View.VISIBLE);
|
mIconAdd.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
if (del.getVisibility() != View.GONE) {
|
if (del.getVisibility() != View.VISIBLE) {
|
||||||
del.setVisibility(View.GONE);
|
del.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mIconAdd.getVisibility() == View.VISIBLE) {
|
if (mIconAdd.getVisibility() == View.VISIBLE) {
|
||||||
mIconAdd.setVisibility(View.INVISIBLE);
|
mIconAdd.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
if (del.getVisibility() == View.GONE) {
|
if (del.getVisibility() == View.VISIBLE) {
|
||||||
del.setVisibility(View.VISIBLE);
|
del.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
ImgLoader.display(mContext, bean.getImageFile(), mImg);
|
ImgLoader.display(mContext, bean.getImageFile(), mImg);
|
||||||
}
|
}
|
||||||
@@ -211,11 +201,8 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
public interface ActionListener {
|
public interface ActionListener {
|
||||||
void onAddClick();
|
void onAddClick();
|
||||||
|
|
||||||
void onItemClick(int position);
|
void onItemClick(int position);
|
||||||
|
|
||||||
void onDeleteAll();
|
void onDeleteAll();
|
||||||
|
|
||||||
void onDel(int position);
|
void onDel(int position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,11 +36,12 @@ public class DateFormatUtil {
|
|||||||
|
|
||||||
public static String getTimeStrings(long time) {
|
public static String getTimeStrings(long time) {
|
||||||
Date date = new Date(time); // 创建Date对象并传入时间戳参数
|
Date date = new Date(time); // 创建Date对象并传入时间戳参数
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 设置日期格式
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // 设置日期格式
|
||||||
String formattedDate = sdf.format(date); // 格式化日期字符串
|
String formattedDate = sdf.format(date); // 格式化日期字符串
|
||||||
return formattedDate;
|
return formattedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String getVideoCurTimeString() {
|
public static String getVideoCurTimeString() {
|
||||||
return sFormat2.format(new Date());
|
return sFormat2.format(new Date());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,368 +0,0 @@
|
|||||||
package com.yunbao.common.utils;
|
|
||||||
|
|
||||||
import android.content.ContentUris;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.database.Cursor;
|
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.media.MediaMetadataRetriever;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Environment;
|
|
||||||
import android.provider.DocumentsContract;
|
|
||||||
import android.provider.MediaStore;
|
|
||||||
import android.provider.OpenableColumns;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
|
|
||||||
import java.io.BufferedOutputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
public class FilesUtils {
|
|
||||||
|
|
||||||
public final static String FILE_TAG = "/rich_editor";
|
|
||||||
public static final String DOCUMENTS_DIR = "documents";
|
|
||||||
|
|
||||||
public static String getPath(final Context context, final Uri uri) {
|
|
||||||
// DocumentProvider
|
|
||||||
if (hasKitKat() && DocumentsContract.isDocumentUri(context, uri)) {
|
|
||||||
// ExternalStorageProvider
|
|
||||||
if (isExternalStorageDocument(uri)) {
|
|
||||||
final String docId = DocumentsContract.getDocumentId(uri);
|
|
||||||
final String[] split = docId.split(":");
|
|
||||||
final String type = split[0];
|
|
||||||
|
|
||||||
if ("primary".equalsIgnoreCase(type)) {
|
|
||||||
return Environment.getExternalStorageDirectory() + "/" + split[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO handle non-primary volumes
|
|
||||||
} else if (isDownloadsDocument(uri)) { // DownloadsProvider
|
|
||||||
final String id = DocumentsContract.getDocumentId(uri);
|
|
||||||
if (id != null && id.startsWith("raw:")) {
|
|
||||||
return id.substring(4);
|
|
||||||
}
|
|
||||||
String[] contentUriPrefixesToTry = new String[]{
|
|
||||||
"content://downloads/public_downloads",
|
|
||||||
"content://downloads/my_downloads"
|
|
||||||
};
|
|
||||||
for (String contentUriPrefix : contentUriPrefixesToTry) {
|
|
||||||
Uri contentUri = ContentUris.withAppendedId(Uri.parse(contentUriPrefix), Long.valueOf(id));
|
|
||||||
try {
|
|
||||||
String path = getDataColumn(context, contentUri, null, null);
|
|
||||||
if (path != null && !path.equals("")) {
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// path could not be retrieved using ContentResolver, therefore copy file to accessible cache using streams
|
|
||||||
String fileName = getFileName(context, uri);
|
|
||||||
File cacheDir = getDocumentCacheDir(context);
|
|
||||||
File file = generateFileNamePlus(fileName, cacheDir);
|
|
||||||
String destinationPath = null;
|
|
||||||
if (file != null) {
|
|
||||||
destinationPath = file.getAbsolutePath();
|
|
||||||
saveFileFromUri(context, uri, destinationPath);
|
|
||||||
}
|
|
||||||
return destinationPath;
|
|
||||||
} else if (isMediaDocument(uri)) { // MediaProvider
|
|
||||||
final String docId = DocumentsContract.getDocumentId(uri);
|
|
||||||
final String[] split = docId.split(":");
|
|
||||||
final String type = split[0];
|
|
||||||
|
|
||||||
Uri contentUri = null;
|
|
||||||
if ("image".equals(type)) {
|
|
||||||
contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
|
|
||||||
} else if ("video".equals(type)) {
|
|
||||||
contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
|
|
||||||
} else if ("audio".equals(type)) {
|
|
||||||
contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
|
|
||||||
} else {
|
|
||||||
//其它类型
|
|
||||||
contentUri = MediaStore.Files.getContentUri("external");
|
|
||||||
}
|
|
||||||
|
|
||||||
final String selection = "_id=?";
|
|
||||||
final String[] selectionArgs = new String[]{
|
|
||||||
split[1]
|
|
||||||
};
|
|
||||||
|
|
||||||
return getDataColumn(context, contentUri, selection, selectionArgs);
|
|
||||||
}
|
|
||||||
} else if ("content".equalsIgnoreCase(uri.getScheme())) { // MediaStore (and general)
|
|
||||||
return getDataColumn(context, uri, null, null);
|
|
||||||
} else if ("file".equalsIgnoreCase(uri.getScheme())) { // File
|
|
||||||
return uri.getPath();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
public static File generateFileNamePlus(@Nullable String name, File directory) {
|
|
||||||
if (name == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
File file = new File(directory, name);
|
|
||||||
|
|
||||||
if (file.exists()) {
|
|
||||||
String fileName = name;
|
|
||||||
String extension = "";
|
|
||||||
int dotIndex = name.lastIndexOf('.');
|
|
||||||
if (dotIndex > 0) {
|
|
||||||
fileName = name.substring(0, dotIndex);
|
|
||||||
extension = name.substring(dotIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
int index = 0;
|
|
||||||
|
|
||||||
while (file.exists()) {
|
|
||||||
index++;
|
|
||||||
name = fileName + '(' + index + ')' + extension;
|
|
||||||
file = new File(directory, name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (!file.createNewFile()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static String getFileName(@NonNull Context context, Uri uri) {
|
|
||||||
String mimeType = context.getContentResolver().getType(uri);
|
|
||||||
String filename = null;
|
|
||||||
|
|
||||||
if (mimeType == null && context != null) {
|
|
||||||
String path = getPath(context, uri);
|
|
||||||
if (path == null) {
|
|
||||||
filename = getName(uri.toString());
|
|
||||||
} else {
|
|
||||||
File file = new File(path);
|
|
||||||
filename = file.getName();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Cursor returnCursor = context.getContentResolver().query(uri, null,
|
|
||||||
null, null, null);
|
|
||||||
if (returnCursor != null) {
|
|
||||||
int nameIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
|
|
||||||
returnCursor.moveToFirst();
|
|
||||||
filename = returnCursor.getString(nameIndex);
|
|
||||||
returnCursor.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getName(String filename) {
|
|
||||||
if (filename == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
int index = filename.lastIndexOf('/');
|
|
||||||
return filename.substring(index + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static File getDocumentCacheDir(@NonNull Context context) {
|
|
||||||
File dir = new File(context.getCacheDir(), DOCUMENTS_DIR);
|
|
||||||
if (!dir.exists()) {
|
|
||||||
dir.mkdirs();
|
|
||||||
}
|
|
||||||
|
|
||||||
return dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static void saveFileFromUri(Context context, Uri uri, String destinationPath) {
|
|
||||||
InputStream is = null;
|
|
||||||
BufferedOutputStream bos = null;
|
|
||||||
try {
|
|
||||||
is = context.getContentResolver().openInputStream(uri);
|
|
||||||
bos = new BufferedOutputStream(new FileOutputStream(destinationPath, false));
|
|
||||||
byte[] buf = new byte[1024];
|
|
||||||
is.read(buf);
|
|
||||||
do {
|
|
||||||
bos.write(buf);
|
|
||||||
} while (is.read(buf) != -1);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} finally {
|
|
||||||
try {
|
|
||||||
if (is != null) is.close();
|
|
||||||
if (bos != null) bos.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the value of the data column for this Uri. This is useful for
|
|
||||||
* MediaStore Uris, and other file-based ContentProviders.
|
|
||||||
*
|
|
||||||
* @param context The context.
|
|
||||||
* @param uri The Uri to query.
|
|
||||||
* @param selection (Optional) Filter used in the query.
|
|
||||||
* @param selectionArgs (Optional) Selection arguments used in the query.
|
|
||||||
* @return The value of the _data column, which is typically a file path.
|
|
||||||
*/
|
|
||||||
public static String getDataColumn(Context context, Uri uri, String selection,
|
|
||||||
String[] selectionArgs) {
|
|
||||||
|
|
||||||
Cursor cursor = null;
|
|
||||||
final String column = "_data";
|
|
||||||
final String[] projection = {
|
|
||||||
column
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null);
|
|
||||||
if (cursor != null && cursor.moveToFirst()) {
|
|
||||||
final int columnIndex = cursor.getColumnIndexOrThrow(column);
|
|
||||||
return cursor.getString(columnIndex);
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
if (cursor != null) {
|
|
||||||
cursor.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param uri The Uri to check.
|
|
||||||
* @return Whether the Uri authority is ExternalStorageProvider.
|
|
||||||
*/
|
|
||||||
public static boolean isExternalStorageDocument(Uri uri) {
|
|
||||||
return "com.android.externalstorage.documents".equals(uri.getAuthority());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param uri The Uri to check.
|
|
||||||
* @return Whether the Uri authority is DownloadsProvider.
|
|
||||||
*/
|
|
||||||
public static boolean isDownloadsDocument(Uri uri) {
|
|
||||||
return "com.android.providers.downloads.documents".equals(uri.getAuthority());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param uri The Uri to check.
|
|
||||||
* @return Whether the Uri authority is MediaProvider.
|
|
||||||
*/
|
|
||||||
public static boolean isMediaDocument(Uri uri) {
|
|
||||||
return "com.android.providers.media.documents".equals(uri.getAuthority());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean hasICS() {
|
|
||||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean hasKitKat() {
|
|
||||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final String IN_PATH = "/rich_editor/pic/";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 随机生产文件名
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private static String generateFileName() {
|
|
||||||
return "poster" + System.currentTimeMillis();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void clearLocalRichEditorCache() {
|
|
||||||
File file = new File(Environment.getExternalStorageDirectory().getPath() + FILE_TAG);
|
|
||||||
deleteDirectory(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String saveBitmap(Bitmap bmp) {
|
|
||||||
String parent = Environment.getExternalStorageDirectory().getPath() + FILE_TAG;
|
|
||||||
File parentF = new File(parent);
|
|
||||||
File f = new File(parent, generateFileName() + ".png");
|
|
||||||
if (!parentF.exists()) {
|
|
||||||
parentF.mkdirs();
|
|
||||||
}
|
|
||||||
if (f.exists()) {
|
|
||||||
f.delete();
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
FileOutputStream out = new FileOutputStream(f);
|
|
||||||
bmp.compress(Bitmap.CompressFormat.PNG, 90, out);
|
|
||||||
out.flush();
|
|
||||||
out.close();
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return f.getAbsolutePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取视频缩略图
|
|
||||||
*
|
|
||||||
* @param filePath
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Bitmap getVideoThumbnail(String filePath) {
|
|
||||||
Bitmap frameAtTime = null;
|
|
||||||
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
|
||||||
try {
|
|
||||||
retriever.setDataSource(filePath);
|
|
||||||
frameAtTime = retriever.getFrameAtTime();
|
|
||||||
return frameAtTime;
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (RuntimeException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
|
|
||||||
} finally {
|
|
||||||
try {
|
|
||||||
retriever.release();
|
|
||||||
} catch (RuntimeException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return frameAtTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static void deleteDirectory(File file) {
|
|
||||||
if (file == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (file.isFile()) {
|
|
||||||
file.delete();
|
|
||||||
} else {
|
|
||||||
String[] childFilePaths = file.list();
|
|
||||||
if (childFilePaths == null || childFilePaths.length == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (String childFilePath : childFilePaths) {
|
|
||||||
File childFile = new File(file.getAbsolutePath() + "/" + childFilePath);
|
|
||||||
deleteDirectory(childFile);
|
|
||||||
}
|
|
||||||
file.delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -13,6 +13,7 @@ import java.util.List;
|
|||||||
public class MessageChatNotifyManager {
|
public class MessageChatNotifyManager {
|
||||||
private static MessageChatNotifyManager instance;
|
private static MessageChatNotifyManager instance;
|
||||||
private List<MessageUserInfoBean> startListNotifyList = new ArrayList<>();
|
private List<MessageUserInfoBean> startListNotifyList = new ArrayList<>();
|
||||||
|
Class<?> clazz;
|
||||||
|
|
||||||
public static MessageChatNotifyManager getInstance() {
|
public static MessageChatNotifyManager getInstance() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
@@ -21,6 +22,10 @@ public class MessageChatNotifyManager {
|
|||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setShieldClass(Class<?> clazz) {
|
||||||
|
this.clazz = clazz;
|
||||||
|
}
|
||||||
|
|
||||||
public void push(Context mContext, MessageUserInfoBean userInfo) {
|
public void push(Context mContext, MessageUserInfoBean userInfo) {
|
||||||
if (startListNotifyList.isEmpty()) {
|
if (startListNotifyList.isEmpty()) {
|
||||||
startListNotifyList.add(userInfo);
|
startListNotifyList.add(userInfo);
|
||||||
@@ -31,6 +36,10 @@ public class MessageChatNotifyManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void notifyLiveFlot(Context mContext) {
|
private void notifyLiveFlot(Context mContext) {
|
||||||
|
if (AppManager.getInstance().getLastActivity().getClass().getSimpleName().equals(clazz.getSimpleName())) {
|
||||||
|
ToastUtil.showDebug("屏蔽类,不展示");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (startListNotifyList.iterator().hasNext()) {
|
if (startListNotifyList.iterator().hasNext()) {
|
||||||
MessageUserInfoBean bean = startListNotifyList.iterator().next();
|
MessageUserInfoBean bean = startListNotifyList.iterator().next();
|
||||||
new MessageChatNotifyDialog(AppManager.getInstance().getLastActivity(), bean).setOnDismissListener(dialog -> {
|
new MessageChatNotifyDialog(AppManager.getInstance().getLastActivity(), bean).setOnDismissListener(dialog -> {
|
||||||
|
|||||||
@@ -50,24 +50,6 @@ public class RouteUtil {
|
|||||||
public static final String PATH_BattlePassActivity = "/main/BattlePassActivity";
|
public static final String PATH_BattlePassActivity = "/main/BattlePassActivity";
|
||||||
public static final String PATH_SudGameActivity = "/live/SudGameActivity";
|
public static final String PATH_SudGameActivity = "/live/SudGameActivity";
|
||||||
public static final String PATH_COMMUNITY_Activity = "/main/MainHomeCommunityActivity";
|
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 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)
|
|
||||||
.navigation();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void forwardVideoActivity() {
|
|
||||||
|
|
||||||
}
|
|
||||||
public static final String PATH_ADDRESSBOOK = "/main/MsgAddressBookActivity";
|
public static final String PATH_ADDRESSBOOK = "/main/MsgAddressBookActivity";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -160,16 +160,4 @@ public class StringUtil {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取随机文件名
|
|
||||||
*/
|
|
||||||
public static String generateFileName() {
|
|
||||||
return contact("android_",
|
|
||||||
CommonAppConfig.getInstance().getUid(),
|
|
||||||
"_",
|
|
||||||
DateFormatUtil.getVideoCurTimeString(),
|
|
||||||
String.valueOf(sRandom.nextInt(9999)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<solid android:color="@color/white" />
|
|
||||||
<stroke
|
|
||||||
android:width="1dp"
|
|
||||||
android:color="#EB6FFF" />
|
|
||||||
<corners android:radius="90dp" />
|
|
||||||
</shape>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<gradient
|
|
||||||
android:angle="90"
|
|
||||||
android:endColor="#f9f7ff"
|
|
||||||
android:startColor="#e5ecff" />
|
|
||||||
<corners android:radius="6dp" />
|
|
||||||
</shape>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<solid android:color="@color/white" />
|
|
||||||
<stroke
|
|
||||||
android:width="1dp"
|
|
||||||
android:color="@color/white" />
|
|
||||||
<corners android:radius="15dp" />
|
|
||||||
</shape>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<corners
|
|
||||||
android:bottomLeftRadius="90dp"
|
|
||||||
android:bottomRightRadius="90dp"
|
|
||||||
android:topLeftRadius="90dp"
|
|
||||||
android:topRightRadius="90dp" />
|
|
||||||
|
|
||||||
<solid android:color="#15151D" />
|
|
||||||
</shape>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item>
|
|
||||||
<shape android:shape="rectangle">
|
|
||||||
<corners android:radius="8dp" />
|
|
||||||
<solid android:color="@color/transparent" />
|
|
||||||
<stroke android:width="1dp" android:color="#FF88BA" />
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
</selector>
|
|
||||||
@@ -105,19 +105,18 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
app:ngl_corner_radius="5dp"
|
app:ngl_corner_radius="5dp"
|
||||||
app:ngl_divider_width="6dp"
|
app:ngl_divider_width="6dp"
|
||||||
app:ngl_space="50dp" />
|
app:ngl_space="30dp" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/videoLayout"
|
android:id="@+id/videoLayout"
|
||||||
android:layout_width="200dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="200dp"
|
android:layout_height="400dp"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/videoImage"
|
android:id="@+id/videoImage"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="200dp"
|
android:layout_height="400dp" />
|
||||||
android:scaleType="centerCrop" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="15dp"
|
android:layout_marginLeft="15dp"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp"
|
||||||
android:visibility="gone">
|
android:visibility="visible">
|
||||||
|
|
||||||
<VideoView
|
<VideoView
|
||||||
android:id="@+id/videoView"
|
android:id="@+id/videoView"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/itemLayout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/transparent"
|
android:background="@color/transparent"
|
||||||
@@ -68,20 +67,19 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
app:ngl_corner_radius="5dp"
|
app:ngl_corner_radius="5dp"
|
||||||
app:ngl_divider_width="6dp"
|
app:ngl_divider_width="6dp"
|
||||||
app:ngl_space="90dp" />
|
app:ngl_space="30dp" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/videoLayout"
|
android:id="@+id/videoLayout"
|
||||||
android:layout_width="200dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="200dp"
|
android:layout_height="400dp"
|
||||||
android:layout_marginLeft="50dp"
|
android:layout_marginLeft="50dp"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/videoImage"
|
android:id="@+id/videoImage"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="200dp"
|
android:layout_height="400dp" />
|
||||||
android:scaleType="centerCrop" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
|
|||||||
@@ -6,8 +6,9 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_tag"
|
android:id="@+id/tv_tag"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="26dp"
|
android:layout_height="32dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:background="@drawable/bg_flow_tag"
|
android:background="@drawable/bg_flow_tag"
|
||||||
android:paddingStart="15dp"
|
android:paddingStart="15dp"
|
||||||
@@ -15,7 +16,6 @@
|
|||||||
android:paddingEnd="15dp"
|
android:paddingEnd="15dp"
|
||||||
android:paddingBottom="5dp"
|
android:paddingBottom="5dp"
|
||||||
android:text="标签"
|
android:text="标签"
|
||||||
android:textColor="@color/black2"
|
android:textColor="@color/black2" />
|
||||||
android:textSize="11dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
<?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">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_tag"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="26dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:background="@drawable/bg_video_flow_tag"
|
|
||||||
android:paddingStart="15dp"
|
|
||||||
android:paddingTop="5dp"
|
|
||||||
android:paddingEnd="15dp"
|
|
||||||
android:paddingBottom="5dp"
|
|
||||||
android:text=""
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="11dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@@ -1,213 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout 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="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingLeft="20dp"
|
|
||||||
android:paddingRight="10dp"
|
|
||||||
tools:ignore="MissingDefaultResource">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
|
||||||
android:id="@+id/avatar"
|
|
||||||
android:layout_width="30dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:src="@mipmap/icon_data_empty"
|
|
||||||
app:riv_oval="true" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginTop="7dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/name"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="栗子栗子🌰zzz"
|
|
||||||
android:textColor="#777777"
|
|
||||||
android:textSize="12dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/content"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:text="栗子栗子🌰zzz"
|
|
||||||
android:textColor="#333333"
|
|
||||||
android:textSize="12dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/author"
|
|
||||||
android:layout_width="45dp"
|
|
||||||
android:layout_height="17dp"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:background="@drawable/bg_main_com_author"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:text="作者"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="10dp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/del"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:text="删除"
|
|
||||||
android:textColor="#777777"
|
|
||||||
android:textSize="11dp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/replyTextView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:text="回复"
|
|
||||||
android:textColor="#777777"
|
|
||||||
android:textSize="11dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/report"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:text="举报"
|
|
||||||
android:textColor="#333333"
|
|
||||||
android:textSize="11dp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/replyLayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="50dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:background="@drawable/bg_item_comment"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:visibility="visible">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
|
||||||
android:id="@+id/avatar01"
|
|
||||||
android:layout_width="23dp"
|
|
||||||
android:layout_height="23dp"
|
|
||||||
android:src="@mipmap/icon_data_empty"
|
|
||||||
app:riv_corner_radius="20dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/firstName"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="5dp"
|
|
||||||
android:text=""
|
|
||||||
android:textColor="#333333"
|
|
||||||
android:textSize="12dp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/isAuth"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:background="@drawable/bg_main_com_author"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:text="作者"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="11dp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/del1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:text="删除"
|
|
||||||
android:textColor="#777777"
|
|
||||||
android:textSize="11dp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/report1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:text="举报"
|
|
||||||
android:textColor="#333333"
|
|
||||||
android:textSize="11dp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/replyContent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="30dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:text=""
|
|
||||||
android:textColor="#777777"
|
|
||||||
android:textSize="11dp" />
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/recyclerView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/expand"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="30dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:text="共4条回复>"
|
|
||||||
android:textColor="#FF4874"
|
|
||||||
android:textSize="12dp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@@ -163,7 +163,7 @@
|
|||||||
android:text="删除"
|
android:text="删除"
|
||||||
android:textColor="#777777"
|
android:textColor="#777777"
|
||||||
android:textSize="11dp"
|
android:textSize="11dp"
|
||||||
android:visibility="gone" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/report1"
|
android:id="@+id/report1"
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/itemLayout"
|
android:id="@+id/itemLayout"
|
||||||
android:layout_width="63dp"
|
android:layout_width="65dp"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:ignore="MissingDefaultResource">
|
tools:ignore="MissingDefaultResource">
|
||||||
|
|
||||||
@@ -12,8 +13,6 @@
|
|||||||
android:id="@+id/avatar01"
|
android:id="@+id/avatar01"
|
||||||
android:layout_width="42dp"
|
android:layout_width="42dp"
|
||||||
android:layout_height="42dp"
|
android:layout_height="42dp"
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/icon_data_empty"
|
android:src="@mipmap/icon_data_empty"
|
||||||
app:riv_corner_radius="15dp" />
|
app:riv_corner_radius="15dp" />
|
||||||
@@ -22,21 +21,8 @@
|
|||||||
android:id="@+id/avatar02"
|
android:id="@+id/avatar02"
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:padding="1dp"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/icon_data_empty"
|
android:src="@mipmap/icon_data_empty"
|
||||||
android:background="@drawable/bg_user_home_img"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:riv_corner_radius="15dp" />
|
app:riv_corner_radius="15dp" />
|
||||||
|
</LinearLayout>
|
||||||
<ImageView
|
|
||||||
android:id="@+id/del"
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:src="@mipmap/icon_img_del"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
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>
|
||||||
@@ -57,14 +57,15 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/submit"
|
android:id="@+id/submit"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="30dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@drawable/main_community_send"
|
android:background="@drawable/main_community_send"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
android:gravity="center"
|
android:paddingTop="10dp"
|
||||||
android:paddingRight="15dp"
|
android:paddingRight="15dp"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
android:text="发布"
|
android:text="发布"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="16dp"
|
android:textSize="16dp"
|
||||||
|
|||||||
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>
|
||||||
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 346 B |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 321 KiB |
|
Before Width: | Height: | Size: 320 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
BIN
common/src/main/res/mipmap-mdpi/temp.png
Normal file
|
After Width: | Height: | Size: 1005 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 |
@@ -26,6 +26,7 @@
|
|||||||
<string name="black">Pull black</string>
|
<string name="black">Pull black</string>
|
||||||
<string name="black_ing">Relieving blackout</string>
|
<string name="black_ing">Relieving blackout</string>
|
||||||
<string name="chat_remarks">Remarks</string>
|
<string name="chat_remarks">Remarks</string>
|
||||||
|
<string name="chat_report">Report</string>
|
||||||
<string name="bonus_sign">Sign in immediately</string>
|
<string name="bonus_sign">Sign in immediately</string>
|
||||||
<string name="bonus_sign_1">Continuously signed in</string>
|
<string name="bonus_sign_1">Continuously signed in</string>
|
||||||
<string name="bonus_day">day</string>
|
<string name="bonus_day">day</string>
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
<string name="refresh_footer_nothing">沒有更多數據了</string>
|
<string name="refresh_footer_nothing">沒有更多數據了</string>
|
||||||
<string name="black">拉黑</string>
|
<string name="black">拉黑</string>
|
||||||
<string name="black_ing">解除拉黑</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">立即簽到</string>
|
||||||
<string name="bonus_sign_1">已連續簽到</string>
|
<string name="bonus_sign_1">已連續簽到</string>
|
||||||
<string name="bonus_day">天</string>
|
<string name="bonus_day">天</string>
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
<string name="refresh_footer_nothing">沒有更多數據了</string>
|
<string name="refresh_footer_nothing">沒有更多數據了</string>
|
||||||
<string name="black">拉黑</string>
|
<string name="black">拉黑</string>
|
||||||
<string name="black_ing">解除拉黑</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">立即簽到</string>
|
||||||
<string name="bonus_sign_1">已連續簽到</string>
|
<string name="bonus_sign_1">已連續簽到</string>
|
||||||
<string name="bonus_day">天</string>
|
<string name="bonus_day">天</string>
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
<string name="refresh_footer_nothing">沒有更多數據了</string>
|
<string name="refresh_footer_nothing">沒有更多數據了</string>
|
||||||
<string name="black">拉黑</string>
|
<string name="black">拉黑</string>
|
||||||
<string name="black_ing">解除拉黑</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">立即簽到</string>
|
||||||
<string name="bonus_sign_1">已連續簽到</string>
|
<string name="bonus_sign_1">已連續簽到</string>
|
||||||
<string name="bonus_day">天</string>
|
<string name="bonus_day">天</string>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
<string name="black">Pull black</string>
|
<string name="black">Pull black</string>
|
||||||
<string name="black_ing">Relieving blackout</string>
|
<string name="black_ing">Relieving blackout</string>
|
||||||
<string name="chat_remarks">Remarks</string>
|
<string name="chat_remarks">Remarks</string>
|
||||||
|
<string name="chat_report">Report</string>
|
||||||
<string name="bonus_sign">Sign in immediately</string>
|
<string name="bonus_sign">Sign in immediately</string>
|
||||||
<string name="bonus_sign_1">Continuously signed in</string>
|
<string name="bonus_sign_1">Continuously signed in</string>
|
||||||
<string name="bonus_day">day</string>
|
<string name="bonus_day">day</string>
|
||||||
|
|||||||
@@ -98,6 +98,13 @@
|
|||||||
<item name="android:paddingRight">15dp</item>
|
<item name="android:paddingRight">15dp</item>
|
||||||
<item name="android:background">@color/white</item>
|
<item name="android:background">@color/white</item>
|
||||||
</style>
|
</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">
|
<style name="Theme.PayssionTrans" parent="Theme.AppCompat.Light">
|
||||||
<item name="android:windowIsTranslucent">true</item>
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class Adapter extends RecyclerView.Adapter<VH> {
|
|||||||
context = ctx;
|
context = ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setSelectedCountries(ArrayList<Country> selectedCountries) {
|
public void setSelectedCountries(ArrayList<Country> selectedCountries) {
|
||||||
this.selectedCountries = selectedCountries;
|
this.selectedCountries = selectedCountries;
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ import com.yunbao.live.http.ImHttpUtil;
|
|||||||
import com.yunbao.live.views.LiveRoomPlayViewHolder;
|
import com.yunbao.live.views.LiveRoomPlayViewHolder;
|
||||||
import com.yunbao.live.views.LiveRoomViewHolder;
|
import com.yunbao.live.views.LiveRoomViewHolder;
|
||||||
import com.yunbao.live.views.PortraitLiveManager;
|
import com.yunbao.live.views.PortraitLiveManager;
|
||||||
|
import com.yunbao.share.bean.ShareBean;
|
||||||
import com.yunbao.share.ui.SharePopDialog;
|
import com.yunbao.share.ui.SharePopDialog;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@@ -865,7 +866,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
if (!TextUtils.isEmpty(event.getMethod())) {
|
if (!TextUtils.isEmpty(event.getMethod())) {
|
||||||
if (TextUtils.equals(event.getMethod(), "closeLiveRoom")) {
|
if (TextUtils.equals(event.getMethod(), "closeLiveRoom")) {
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
}else if (TextUtils.equals(event.getMethod(), "androidtoCommunityVideo")) {
|
} else if (TextUtils.equals(event.getMethod(), "androidtoCommunityVideo")) {
|
||||||
RouteUtil.forwardCommunityActivity();
|
RouteUtil.forwardCommunityActivity();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1460,10 +1461,17 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
break;
|
break;
|
||||||
case LIVE_SHARE:
|
case LIVE_SHARE:
|
||||||
new SharePopDialog(mContext)
|
new SharePopDialog(mContext)
|
||||||
.setUid(CommonAppConfig.getInstance().getUid())
|
.setShareType(SharePopDialog.TYPE_LIVE)
|
||||||
.setAnchorId(event.getBean().getUid())
|
.setShareData(ShareBean.ShareBuilder.create()
|
||||||
.setAnchorName(event.getBean().getUserNiceName())
|
.setShareType(SharePopDialog.TYPE_LIVE)
|
||||||
.setAnchorAvatar(event.getBean().getAvatar())
|
.setUid(CommonAppConfig.getInstance().getUid())
|
||||||
|
.setCover(StringUtil.isEmpty(event.getBean().getImg()) ? event.getBean().getAvatar() : event.getBean().getImg())
|
||||||
|
.setTitle(StringUtil.isEmpty(event.getBean().getTitle()) ? event.getBean().getUserNiceName() : event.getBean().getTitle())
|
||||||
|
.setAnchorId(event.getBean().getUid())
|
||||||
|
.setAnchorName(event.getBean().getUserNiceName())
|
||||||
|
.setAnchorAvatar(event.getBean().getAvatar())
|
||||||
|
.build()
|
||||||
|
)
|
||||||
.showDialog();
|
.showDialog();
|
||||||
break;
|
break;
|
||||||
case WISH_LIST_PROGRESS:
|
case WISH_LIST_PROGRESS:
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import android.widget.PopupWindow;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.yunbao.common.http.HttpClient;
|
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.common.utils.ToastUtil;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
import com.yunbao.live.activity.EditNameRemarksActivity;
|
import com.yunbao.live.activity.EditNameRemarksActivity;
|
||||||
@@ -26,15 +28,15 @@ import io.rong.imlib.RongIMClient;
|
|||||||
public class MenuPopuwWindow implements View.OnClickListener {
|
public class MenuPopuwWindow implements View.OnClickListener {
|
||||||
private Activity mContext;
|
private Activity mContext;
|
||||||
private String userId;
|
private String userId;
|
||||||
private View popupView;
|
private View popupView, ltBlack, ltReport;
|
||||||
private TextView tvBlack, tvBlackMove;
|
private TextView tvBlack;
|
||||||
private LinearLayout ltRemarks;
|
private LinearLayout ltRemarks;
|
||||||
private PopupWindow popupWindow;
|
private PopupWindow popupWindow;
|
||||||
private Handler netHandler = new Handler();
|
private Handler netHandler = new Handler();
|
||||||
|
|
||||||
public MenuPopuwWindow(Activity context) {
|
public MenuPopuwWindow(Activity context) {
|
||||||
this.mContext = 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();
|
initView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,19 +45,18 @@ public class MenuPopuwWindow implements View.OnClickListener {
|
|||||||
|
|
||||||
if (TextUtils.equals(isAdmin, "1")) {
|
if (TextUtils.equals(isAdmin, "1")) {
|
||||||
tvBlack.setVisibility(View.GONE);
|
tvBlack.setVisibility(View.GONE);
|
||||||
tvBlackMove.setVisibility(View.GONE);
|
|
||||||
ltRemarks.setVisibility(View.VISIBLE);
|
ltRemarks.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
ltRemarks.setVisibility(View.GONE);
|
ltRemarks.setVisibility(View.VISIBLE);
|
||||||
RongIMClient.getInstance().getBlacklistStatus(userId, new RongIMClient.ResultCallback<RongIMClient.BlacklistStatus>() {
|
RongIMClient.getInstance().getBlacklistStatus(userId, new RongIMClient.ResultCallback<RongIMClient.BlacklistStatus>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(RongIMClient.BlacklistStatus blacklistStatus) {
|
public void onSuccess(RongIMClient.BlacklistStatus blacklistStatus) {
|
||||||
if (blacklistStatus == RongIMClient.BlacklistStatus.IN_BLACK_LIST) {
|
if (blacklistStatus == RongIMClient.BlacklistStatus.IN_BLACK_LIST) {
|
||||||
tvBlackMove.setVisibility(View.VISIBLE);
|
tvBlack.setTag("1");
|
||||||
tvBlack.setVisibility(View.GONE);
|
tvBlack.setText(R.string.black_ing);
|
||||||
} else {
|
} else {
|
||||||
tvBlack.setVisibility(View.VISIBLE);
|
tvBlack.setTag(null);
|
||||||
tvBlackMove.setVisibility(View.GONE);
|
tvBlack.setText(R.string.black);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,10 +74,11 @@ public class MenuPopuwWindow implements View.OnClickListener {
|
|||||||
*/
|
*/
|
||||||
private void initView() {
|
private void initView() {
|
||||||
tvBlack = popupView.findViewById(R.id.tv_black);
|
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);
|
ltRemarks = popupView.findViewById(R.id.lt_remarks);
|
||||||
tvBlack.setOnClickListener(this);
|
ltBlack.setOnClickListener(this);
|
||||||
tvBlackMove.setOnClickListener(this);
|
ltReport.setOnClickListener(this);
|
||||||
ltRemarks.setOnClickListener(this);
|
ltRemarks.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +89,7 @@ public class MenuPopuwWindow implements View.OnClickListener {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void show(View view) {
|
public void show(View view) {
|
||||||
popupWindow = new PopupWindow(popupView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
|
popupWindow = new PopupWindow(popupView, DpUtil.dp2px(97), ViewGroup.LayoutParams.WRAP_CONTENT, true);
|
||||||
popupWindow.showAsDropDown(view);
|
popupWindow.showAsDropDown(view);
|
||||||
WindowManager.LayoutParams lp = mContext.getWindow().getAttributes();
|
WindowManager.LayoutParams lp = mContext.getWindow().getAttributes();
|
||||||
lp.alpha = 0.8f;
|
lp.alpha = 0.8f;
|
||||||
@@ -105,40 +107,14 @@ public class MenuPopuwWindow implements View.OnClickListener {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
//拉黑
|
//拉黑
|
||||||
if (id == R.id.tv_black) {
|
if (id == R.id.lt_black) {
|
||||||
RongIMClient.getInstance().addToBlacklist(userId, new RongIMClient.OperationCallback() {
|
if (tvBlack.getTag() == null) {
|
||||||
@Override
|
black();
|
||||||
public void onSuccess() {
|
} else {
|
||||||
ToastUtil.show(mContext.getResources().getString(R.string.black_succer));
|
unblack();
|
||||||
popupWindow.dismiss();
|
}
|
||||||
tvBlack.setVisibility(View.VISIBLE);
|
} else if (id == R.id.lt_report) {//移出黑名单
|
||||||
tvBlackMove.setVisibility(View.GONE);
|
RouteUtil.forwardLiveReportActivity(userId);
|
||||||
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();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (id == R.id.lt_remarks) {//添加备注
|
} else if (id == R.id.lt_remarks) {//添加备注
|
||||||
Intent intent = new Intent(mContext, EditNameRemarksActivity.class);
|
Intent intent = new Intent(mContext, EditNameRemarksActivity.class);
|
||||||
intent.putExtra(EditNameRemarksActivity.NAMEREMARK, userId);
|
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() {
|
private Runnable setBlackRunnable = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
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="97dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/background_d5_white"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lt_remarks"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:gravity="start|center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:layout_marginEnd="7dp"
|
||||||
|
android:src="@mipmap/ic_chat_remarks" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_remarks"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/chat_remarks"
|
||||||
|
android:textColor="@color/black1"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="visible" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0.5dp"
|
||||||
|
android:layout_marginLeft="6dp"
|
||||||
|
android:layout_marginRight="6dp"
|
||||||
|
android:background="@color/gray_dcdcdc" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lt_report"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:gravity="start|center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:layout_marginEnd="7dp"
|
||||||
|
android:src="@mipmap/ic_chat_report" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_report"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/chat_report"
|
||||||
|
android:textColor="@color/black1"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0.5dp"
|
||||||
|
android:layout_marginLeft="6dp"
|
||||||
|
android:layout_marginRight="6dp"
|
||||||
|
android:background="@color/gray_dcdcdc" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lt_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:gravity="start|center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:layout_marginEnd="7dp"
|
||||||
|
android:src="@mipmap/ic_chat_black" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_black"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/black"
|
||||||
|
android:textColor="@color/black1"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -170,6 +170,7 @@
|
|||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity android:name=".activity.CompleteUserInfoActivity"
|
<activity android:name=".activity.CompleteUserInfoActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
|
<activity android:name=".activity.EditUserHobbyActivity" android:screenOrientation="portrait" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -1,29 +1,39 @@
|
|||||||
package com.yunbao.main.activity;
|
package com.yunbao.main.activity;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
||||||
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
|
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
|
||||||
import com.bigkoo.pickerview.view.TimePickerView;
|
import com.bigkoo.pickerview.view.TimePickerView;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.activity.AbsActivity;
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
import com.yunbao.common.bean.LiveBean;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.http.LiveHttpUtil;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.interfaces.ImageResultCallback;
|
import com.yunbao.common.interfaces.ImageResultCallback;
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
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.DialogUitl;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
|
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||||
import com.yunbao.common.utils.ProcessImageUtil;
|
import com.yunbao.common.utils.ProcessImageUtil;
|
||||||
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.ViewUtils;
|
import com.yunbao.common.utils.ViewUtils;
|
||||||
@@ -63,6 +73,20 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
|||||||
initView();
|
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 year;
|
||||||
int month;
|
int month;
|
||||||
int day;
|
int day;
|
||||||
@@ -76,6 +100,9 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
|||||||
birthday = findViewById(R.id.birthday);
|
birthday = findViewById(R.id.birthday);
|
||||||
submit = findViewById(R.id.submit);
|
submit = findViewById(R.id.submit);
|
||||||
|
|
||||||
|
userName.setHint(R.string.complete_user_info_username_hint);
|
||||||
|
userName.setText(IMLoginManager.get(this).getUserInfo().getUserNicename());
|
||||||
|
|
||||||
initSexView();
|
initSexView();
|
||||||
initBirthdayView();
|
initBirthdayView();
|
||||||
initAvatarView();
|
initAvatarView();
|
||||||
@@ -102,8 +129,15 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
|||||||
new HttpCallback<List<BaseModel>>() {
|
new HttpCallback<List<BaseModel>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<BaseModel> data) {
|
public void onSuccess(List<BaseModel> data) {
|
||||||
ToastUtil.show("註冊成功");
|
String anchorId = getIntent().getStringExtra("anchor_id");
|
||||||
finish();
|
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
|
@Override
|
||||||
@@ -192,6 +226,7 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onItemClick(String bean, int position) {
|
public void onItemClick(String bean, int position) {
|
||||||
avatar.setTag(bean);
|
avatar.setTag(bean);
|
||||||
|
ImgLoader.display(mContext,bean,avatar);
|
||||||
loading.dismiss();
|
loading.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -200,8 +235,9 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void initSexView() {
|
void initSexView() {
|
||||||
ViewUtils.findViewById(man, R.id.sex_bg).setBackgroundResource(R.drawable.dialog_bg_chat_status_config_select);
|
ViewUtils.findViewById(man, R.id.sex_bg).setBackgroundResource(R.drawable.complete_user_info_sex_man);
|
||||||
ViewUtils.findViewById(man, R.id.sex_icon, ImageView.class).setImageTintList(ColorStateList.valueOf(Color.parseColor("#00A3FF")));
|
ViewUtils.findViewById(man, R.id.sex_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(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);
|
ViewUtils.findViewById(woman, R.id.sex_bg).setBackgroundResource(R.drawable.dialog_bg_chat_status_config_unselect);
|
||||||
@@ -213,7 +249,7 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
|||||||
man.setTag("man");
|
man.setTag("man");
|
||||||
woman.setTag(null);
|
woman.setTag(null);
|
||||||
man.setOnClickListener(view -> {
|
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(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_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(man, R.id.sex_top_icon, ImageView.class).setImageTintList(ColorStateList.valueOf(Color.parseColor("#00A3FF")));
|
||||||
@@ -225,7 +261,7 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
|||||||
woman.setTag(null);
|
woman.setTag(null);
|
||||||
});
|
});
|
||||||
woman.setOnClickListener(view -> {
|
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(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_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")));
|
ViewUtils.findViewById(woman, R.id.sex_top_icon, ImageView.class).setImageTintList(ColorStateList.valueOf(Color.parseColor("#FF4874")));
|
||||||
@@ -237,4 +273,34 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
|||||||
woman.setTag("man");
|
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.android.arouter.facade.annotation.Route;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
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.XPopup;
|
||||||
import com.lxj.xpopup.core.BasePopupView;
|
import com.lxj.xpopup.core.BasePopupView;
|
||||||
import com.lxj.xpopup.interfaces.XPopupCallback;
|
import com.lxj.xpopup.interfaces.XPopupCallback;
|
||||||
@@ -27,6 +31,9 @@ import com.yunbao.common.CommonAppConfig;
|
|||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.activity.AbsActivity;
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
import com.yunbao.common.activity.WebViewActivity;
|
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.bean.UserBean;
|
||||||
import com.yunbao.common.event.UpdateFieldEvent;
|
import com.yunbao.common.event.UpdateFieldEvent;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
@@ -59,6 +66,8 @@ import org.greenrobot.eventbus.ThreadMode;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import cn.qqtheme.framework.entity.City;
|
import cn.qqtheme.framework.entity.City;
|
||||||
import cn.qqtheme.framework.entity.County;
|
import cn.qqtheme.framework.entity.County;
|
||||||
@@ -90,6 +99,7 @@ public class EditProfileActivity extends AbsActivity {
|
|||||||
private View viewProgress1, viewProgress2, viewProgress3;
|
private View viewProgress1, viewProgress2, viewProgress3;
|
||||||
private FrameLayout completeInformation, completeInformation1, completeInformation2, completeInformation3;
|
private FrameLayout completeInformation, completeInformation1, completeInformation2, completeInformation3;
|
||||||
private TextView information, information1, information2, information3, submit;
|
private TextView information, information1, information2, information3, submit;
|
||||||
|
private MessageUserInfoBean userInfoBean;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
@@ -130,10 +140,10 @@ public class EditProfileActivity extends AbsActivity {
|
|||||||
public void onSuccess(File file) {
|
public void onSuccess(File file) {
|
||||||
|
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
System.err.println("头像---->收到头像文件 file = "+file.getAbsolutePath()+" | length = "+file.length());
|
System.err.println("头像---->收到头像文件 file = " + file.getAbsolutePath() + " | length = " + file.length());
|
||||||
if (file.getName().contains(".gif")){
|
if (file.getName().contains(".gif")) {
|
||||||
ToastUtil.show(WordUtil.isNewZh()?"暫不支持該文件":"This file is not supported");
|
ToastUtil.show(WordUtil.isNewZh() ? "暫不支持該文件" : "This file is not supported");
|
||||||
}else {
|
} else {
|
||||||
ImgLoader.display(mContext, file, mAvatar);
|
ImgLoader.display(mContext, file, mAvatar);
|
||||||
MainHttpUtil.updateAvatar(file, new HttpCallback() {
|
MainHttpUtil.updateAvatar(file, new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
@@ -185,12 +195,14 @@ public class EditProfileActivity extends AbsActivity {
|
|||||||
mUserBean = CommonAppConfig.getInstance().getUserBean();
|
mUserBean = CommonAppConfig.getInstance().getUserBean();
|
||||||
if (mUserBean != null) {
|
if (mUserBean != null) {
|
||||||
showData(mUserBean);
|
showData(mUserBean);
|
||||||
|
initUserInfoData();
|
||||||
} else {
|
} else {
|
||||||
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void callback(UserBean u) {
|
public void callback(UserBean u) {
|
||||||
mUserBean = u;
|
mUserBean = u;
|
||||||
showData(u);
|
showData(u);
|
||||||
|
initUserInfoData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -399,9 +411,102 @@ public class EditProfileActivity extends AbsActivity {
|
|||||||
.putExtra("token", CommonAppConfig.getInstance().getToken())
|
.putExtra("token", CommonAppConfig.getInstance().getToken())
|
||||||
.putExtra("isBind", isBind)
|
.putExtra("isBind", isBind)
|
||||||
.putExtra("mobile", mobile));
|
.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() {
|
private void showTaskDialog() {
|
||||||
final Dialog dialog = new Dialog(EditProfileActivity.this, com.yunbao.live.R.style.dialog);
|
final Dialog dialog = new Dialog(EditProfileActivity.this, com.yunbao.live.R.style.dialog);
|
||||||
dialog.setContentView(R.layout.dialog_task);
|
dialog.setContentView(R.layout.dialog_task);
|
||||||
@@ -418,7 +523,7 @@ public class EditProfileActivity extends AbsActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
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";
|
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();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -453,7 +558,7 @@ public class EditProfileActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
Constants.myIntoIndex = 2;
|
Constants.myIntoIndex = 2;
|
||||||
Intent intent = new Intent(mContext, MyWebViewActivity2.class);
|
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);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -767,12 +872,37 @@ public class EditProfileActivity extends AbsActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initUserInfoData() {
|
||||||
|
LiveNetManager.get(mContext)
|
||||||
|
.getOtherInfo(userModel.getId() + "", new com.yunbao.common.http.base.HttpCallback<MessageUserInfoBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MessageUserInfoBean data) {
|
||||||
|
userInfoBean = data;
|
||||||
|
((TextView) findViewById(R.id.occupation)).setText(data.getInfo().getCareer());
|
||||||
|
((TextView) findViewById(R.id.height)).setText(data.getInfo().getHeight() + "cm");
|
||||||
|
List<String> tags = WordUtil.isNewZh() ? data.getInfo().getCn_label() : data.getInfo().getEn_label();
|
||||||
|
if (tags == null || tags.isEmpty()) return;
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (String tag : tags) {
|
||||||
|
sb.append(tag).append(",");
|
||||||
|
}
|
||||||
|
((TextView) findViewById(R.id.hobby)).setText(sb.substring(0, sb.length() - 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
if (Constants.isShowPage != -1) {
|
if (Constants.isShowPage != -1) {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
initUserInfoData();
|
||||||
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void callback(UserBean u) {
|
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.AnchorStartLiveBean;
|
||||||
import com.yunbao.common.bean.ChatRemarksBean;
|
import com.yunbao.common.bean.ChatRemarksBean;
|
||||||
import com.yunbao.common.bean.ConfigBean;
|
import com.yunbao.common.bean.ConfigBean;
|
||||||
|
import com.yunbao.common.bean.FirstLoginBean;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
import com.yunbao.common.bean.LiveBean;
|
import com.yunbao.common.bean.LiveBean;
|
||||||
import com.yunbao.common.bean.LiveSvgGiftBean;
|
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.HttpCallback;
|
||||||
import com.yunbao.common.http.LiveHttpConsts;
|
import com.yunbao.common.http.LiveHttpConsts;
|
||||||
import com.yunbao.common.http.LiveHttpUtil;
|
import com.yunbao.common.http.LiveHttpUtil;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.http.main.MainNetManager;
|
import com.yunbao.common.http.main.MainNetManager;
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
import com.yunbao.common.interfaces.CommonCallback;
|
||||||
import com.yunbao.common.manager.APKManager;
|
import com.yunbao.common.manager.APKManager;
|
||||||
@@ -162,7 +164,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
private ViewPager mViewPager;
|
private ViewPager mViewPager;
|
||||||
private List<FrameLayout> mViewList;
|
private List<FrameLayout> mViewList;
|
||||||
private MainHomeComViewHolder mainHomeComViewHolder;
|
private MainHomeComViewHolder mainHomeComViewHolder;
|
||||||
private MainHomeViewHolder mainHomeViewHolder;
|
private MainHomeLiveViewHolder mainHomeLiveViewHolder;
|
||||||
private MainHomeCommunityViewHolder mMainHomeCommunityViewHolder;
|
private MainHomeCommunityViewHolder mMainHomeCommunityViewHolder;
|
||||||
private MainMessageViewHolder mainMessageViewHolder;
|
private MainMessageViewHolder mainMessageViewHolder;
|
||||||
private MainMeViewHolder mMeViewHolder;
|
private MainMeViewHolder mMeViewHolder;
|
||||||
@@ -197,6 +199,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
|
|
||||||
private View floatWarOrder;//战令浮窗
|
private View floatWarOrder;//战令浮窗
|
||||||
private List<AnchorStartLiveBean> startListNotifyList = new ArrayList<>();
|
private List<AnchorStartLiveBean> startListNotifyList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
return R.layout.activity_main;
|
return R.layout.activity_main;
|
||||||
@@ -209,11 +213,13 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1, 0.4f, new DecelerateInterpolator()));
|
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1, 0.4f, new DecelerateInterpolator()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
OpenAdManager.getInstance().dismiss();
|
OpenAdManager.getInstance().dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void main() {
|
protected void main() {
|
||||||
ActivityCompat.postponeEnterTransition(this);
|
ActivityCompat.postponeEnterTransition(this);
|
||||||
@@ -536,6 +542,23 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
ConversationIMListManager.get(this).getUserInstructor(this);
|
ConversationIMListManager.get(this).getUserInstructor(this);
|
||||||
checkVersion();
|
checkVersion();
|
||||||
MessageSayHiNotifyManager.getInstance().start();
|
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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -932,7 +955,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
|
|
||||||
for (int j = 0; j < list.size(); j++) {
|
for (int j = 0; j < list.size(); j++) {
|
||||||
Log.e("--->", list.get(j).getGiftname() + list.get(j).getSwf());
|
Log.e("--->", list.get(j).getGiftname() + list.get(j).getSwf());
|
||||||
|
|
||||||
|
|
||||||
Log.e("--->", list.get(j).getGiftname() + list.get(j).getSwf());
|
Log.e("--->", list.get(j).getGiftname() + list.get(j).getSwf());
|
||||||
|
|
||||||
GiftCacheUtil.getFile(MainActivity.this, Constants.GIF_GIFT_PREFIX + list.get(j).getId(), list.get(j).getSwf(), "0", new CommonCallback<File>() {
|
GiftCacheUtil.getFile(MainActivity.this, Constants.GIF_GIFT_PREFIX + list.get(j).getId(), list.get(j).getSwf(), "0", new CommonCallback<File>() {
|
||||||
@Override
|
@Override
|
||||||
public void callback(File bean) {
|
public void callback(File bean) {
|
||||||
@@ -1136,10 +1162,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
mainHomeComViewHolder = new MainHomeComViewHolder(mContext, parent);
|
mainHomeComViewHolder = new MainHomeComViewHolder(mContext, parent);
|
||||||
vh = mainHomeComViewHolder;
|
vh = mainHomeComViewHolder;
|
||||||
} else if (position == 1) {
|
} else if (position == 1) {
|
||||||
mainHomeViewHolder = new MainHomeViewHolder(mContext, parent);
|
/* mainHomeLiveViewHolder = new MainHomeLiveViewHolder(mContext, parent);//直播
|
||||||
vh = mainHomeViewHolder;
|
vh = mainHomeLiveViewHolder;*/
|
||||||
/* mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//直播
|
mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//直播
|
||||||
vh = mMainHomeCommunityViewHolder;*/
|
vh = mMainHomeCommunityViewHolder;
|
||||||
} else if (position == 2) {
|
} else if (position == 2) {
|
||||||
mainMessageViewHolder = new MainMessageViewHolder(this, parent);
|
mainMessageViewHolder = new MainMessageViewHolder(this, parent);
|
||||||
vh = mainMessageViewHolder;
|
vh = mainMessageViewHolder;
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ import com.yunbao.live.activity.LiveAudienceActivity;
|
|||||||
import com.yunbao.live.views.LiveRoomViewHolder;
|
import com.yunbao.live.views.LiveRoomViewHolder;
|
||||||
import com.yunbao.main.dialog.EncourageDialog;
|
import com.yunbao.main.dialog.EncourageDialog;
|
||||||
import com.yunbao.main.http.MainHttpUtil;
|
import com.yunbao.main.http.MainHttpUtil;
|
||||||
|
import com.yunbao.share.bean.ShareBean;
|
||||||
import com.yunbao.share.ui.SharePopDialog;
|
import com.yunbao.share.ui.SharePopDialog;
|
||||||
import com.yunbao.video.activity.VideoPlayActivity;
|
import com.yunbao.video.activity.VideoPlayActivity;
|
||||||
import com.yunbao.video.utils.VideoStorge;
|
import com.yunbao.video.utils.VideoStorge;
|
||||||
@@ -569,8 +570,8 @@ public class MyWebViewActivity extends AbsActivity {
|
|||||||
Constants.firstInto = 0;
|
Constants.firstInto = 0;
|
||||||
EventBus.getDefault().post(new MainHomeCommunityToChatEvent().setTargetId(event.getUserId()));
|
EventBus.getDefault().post(new MainHomeCommunityToChatEvent().setTargetId(event.getUserId()));
|
||||||
} else if (TextUtils.equals(event.getMethod(), "androidPlayVideo")) {
|
} else if (TextUtils.equals(event.getMethod(), "androidPlayVideo")) {
|
||||||
/*VideoStorge.getInstance().put(Constants.VIDEO_COMMUNITY, event.getVideoBeanList());
|
VideoStorge.getInstance().put(Constants.VIDEO_COMMUNITY, event.getVideoBeanList());
|
||||||
VideoPlayActivity.forward(mContext, event.getPosition(), Constants.VIDEO_COMMUNITY, 1);*/
|
VideoPlayActivity.forward(mContext, event.getPosition(), Constants.VIDEO_COMMUNITY, 1);
|
||||||
} else if (TextUtils.equals(event.getMethod(), "openUpdataName")) {
|
} else if (TextUtils.equals(event.getMethod(), "openUpdataName")) {
|
||||||
isUpdataUser = event.isUpdataUser();
|
isUpdataUser = event.isUpdataUser();
|
||||||
} else if (TextUtils.equals(event.getMethod(), "openUpdataAutograph")) {
|
} else if (TextUtils.equals(event.getMethod(), "openUpdataAutograph")) {
|
||||||
@@ -592,8 +593,13 @@ public class MyWebViewActivity extends AbsActivity {
|
|||||||
} else if (TextUtils.equals(event.getMethod(), "androidCommunityShare")) {
|
} else if (TextUtils.equals(event.getMethod(), "androidCommunityShare")) {
|
||||||
JSONObject json = JSONObject.parseObject(event.getData());
|
JSONObject json = JSONObject.parseObject(event.getData());
|
||||||
new SharePopDialog(mContext)
|
new SharePopDialog(mContext)
|
||||||
|
.setShareType(SharePopDialog.TYPE_DYNAMIC)
|
||||||
|
.setShareData(ShareBean.ShareBuilder
|
||||||
|
.create()
|
||||||
|
.setAnchorAvatar(json.getString("avatar"))
|
||||||
|
.build()
|
||||||
|
)
|
||||||
.setShareLink(CommonAppConfig.HOST + json.getString("link"))
|
.setShareLink(CommonAppConfig.HOST + json.getString("link"))
|
||||||
.setAnchorAvatar(json.getString("avatar"))
|
|
||||||
.showDialog();
|
.showDialog();
|
||||||
} else if (TextUtils.equals(event.getMethod(), "androidCancelAnchorAttention")) {
|
} else if (TextUtils.equals(event.getMethod(), "androidCancelAnchorAttention")) {
|
||||||
if (!StringUtil.isEmpty(LiveAudienceActivity.is_fans)) {
|
if (!StringUtil.isEmpty(LiveAudienceActivity.is_fans)) {
|
||||||
|
|||||||
@@ -416,8 +416,8 @@ public class MyWebViewActivity2 extends AbsActivity {
|
|||||||
Constants.firstInto = 0;
|
Constants.firstInto = 0;
|
||||||
SystemMessageActivity.forward(mContext, "-2", event.getUserId(), event.getName(), event.getImage());
|
SystemMessageActivity.forward(mContext, "-2", event.getUserId(), event.getName(), event.getImage());
|
||||||
} else if (TextUtils.equals(event.getMethod(), "androidPlayVideo")) {
|
} else if (TextUtils.equals(event.getMethod(), "androidPlayVideo")) {
|
||||||
/*VideoStorge.getInstance().put(Constants.VIDEO_COMMUNITY, event.getVideoBeanList());
|
VideoStorge.getInstance().put(Constants.VIDEO_COMMUNITY, event.getVideoBeanList());
|
||||||
VideoPlayActivity.forward(mContext, event.getPosition(), Constants.VIDEO_COMMUNITY, 1);*/
|
VideoPlayActivity.forward(mContext, event.getPosition(), Constants.VIDEO_COMMUNITY, 1);
|
||||||
} else if (TextUtils.equals(event.getMethod(), "openWebView")) {
|
} else if (TextUtils.equals(event.getMethod(), "openWebView")) {
|
||||||
ZhuangBanActivity.forward(mContext, event.getData(), false);
|
ZhuangBanActivity.forward(mContext, event.getData(), false);
|
||||||
}
|
}
|
||||||
|
|||||||