Compare commits
52 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b90d86d90f | ||
|
|
0324b638fa | ||
|
|
28f00f1c8a | ||
| dd582c10c7 | |||
| bd6ddf7153 | |||
| c20708d633 | |||
| d08861a082 | |||
| 12989e12ce | |||
| 77530340d0 | |||
| a387b30893 | |||
| 889f8dcfe8 | |||
| 88e822004f | |||
| b954e9d451 | |||
| 578de1f101 | |||
| 62419c86cf | |||
| 434486387d | |||
| 7cf7c1e993 | |||
|
|
9427fb8aaa | ||
|
|
4d4d3d1bae | ||
| 2cc58b920f | |||
| 3b4ffe8c51 | |||
| cd3a86c6b7 | |||
| 82c4edf7e4 | |||
| bd598176c1 | |||
|
|
02bc604685 | ||
|
|
5ebb97cd3c | ||
|
|
e9a3e8aa2f | ||
| 61dcf0916d | |||
| 7167ad8e97 | |||
| 9992dec28e | |||
| 04980cbb2f | |||
|
|
f2b2c39168 | ||
| d39facbcc7 | |||
|
|
c3ca76df07 | ||
| 34dae7d981 | |||
| ce568c6d87 | |||
| c7ba98acb4 | |||
|
|
f8cb1d0a4b | ||
|
|
94d05a3929 | ||
| 1c74689e90 | |||
| a5acbb0146 | |||
| 457e47e885 | |||
| 1442d05262 | |||
| 9e80e77297 | |||
| ab6d871b38 | |||
|
|
0e83f4fbaf | ||
|
|
434474bd98 | ||
| f3d19e37bb | |||
|
|
f662ec4259 | ||
| bfa4a52dd4 | |||
|
|
307ded37fc | ||
|
|
04d3faa0cb |
1
.gitignore
vendored
@@ -14,3 +14,4 @@ local.properties
|
||||
/live/build/
|
||||
/main/build/
|
||||
/video/build/
|
||||
/tmp/full-r8-config.txt
|
||||
@@ -29,6 +29,7 @@ public class ShareBean {
|
||||
private int shareType;
|
||||
private String cover;
|
||||
private String title;
|
||||
private String extraData;
|
||||
|
||||
|
||||
public static String createLiveShareLink(String shareUid, String anchorId, String anchorName, String anchorAvatar) {
|
||||
@@ -119,6 +120,14 @@ public class ShareBean {
|
||||
this.anchorAvatar = anchorAvatar;
|
||||
}
|
||||
|
||||
public String getExtraData() {
|
||||
return extraData;
|
||||
}
|
||||
|
||||
public void setExtraData(String extraData) {
|
||||
this.extraData = extraData;
|
||||
}
|
||||
|
||||
public ShareBean setText(String text) {
|
||||
this.text = text;
|
||||
return this;
|
||||
@@ -189,6 +198,7 @@ public class ShareBean {
|
||||
bean.shareType = shareType;
|
||||
bean.cover = cover;
|
||||
bean.title = title;
|
||||
bean.extraData = extraData;
|
||||
return bean;
|
||||
}
|
||||
|
||||
@@ -248,6 +258,12 @@ public class ShareBean {
|
||||
bean.setFile(file);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ShareBuilder setExtraData(String extraData) {
|
||||
bean.setExtraData(extraData);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ShareBean build() {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.yunbao.share.AbsShareInterface;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBean;
|
||||
import com.yunbao.share.ui.AppInternalShareDialog;
|
||||
import com.yunbao.share.ui.SharePopDialog;
|
||||
import com.yunbao.share.ui.ShareSuccessNotifyDialog;
|
||||
|
||||
import io.rong.imlib.model.Conversation;
|
||||
@@ -46,7 +47,7 @@ public class Internal extends AbsShareInterface {
|
||||
builder.getAnchorName(),
|
||||
builder.getAnchorId(),
|
||||
builder.getShareType() + "",
|
||||
builder.getAnchorId()
|
||||
builder.getExtraData()
|
||||
),
|
||||
new OnSendMessageListener<Object>() {
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.yunbao.share.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.widget.EditText;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -10,6 +12,7 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.pdlive.shayu.R;
|
||||
import com.yunbao.common.dialog.AbsDialogFullScreenPopupWindow;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.share.adapters.InternalShareAdapter;
|
||||
|
||||
@@ -82,6 +85,37 @@ public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow {
|
||||
initRefreshView();
|
||||
|
||||
refreshData();
|
||||
search.addTextChangedListener(new TextWatcher() {
|
||||
List<SingleConversation> searchList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
String key = editable.toString();
|
||||
searchList.clear();
|
||||
if (StringUtil.isEmpty(key)) {
|
||||
adapter.setList(listData);
|
||||
return;
|
||||
}
|
||||
for (SingleConversation datum : listData) {
|
||||
if (datum.mCore.getConversationTitle().contains(key)) {
|
||||
searchList.add(datum);
|
||||
}
|
||||
}
|
||||
adapter.setList(searchList);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.util.List;
|
||||
public class SharePopDialog extends AbsDialogPopupWindow {
|
||||
public static final int TYPE_LIVE = 1;
|
||||
public static final int TYPE_DYNAMIC = 0;
|
||||
public static final int TYPE_VIDEO = 2;
|
||||
private ShareAppAdapter adapter;
|
||||
private RecyclerView list;
|
||||
private RoundedImageView avatar;
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.enums.PopupAnimation;
|
||||
import com.pdlive.shayu.R;
|
||||
import com.yunbao.common.custom.RatioRoundImageView;
|
||||
import com.yunbao.common.dialog.AbsDialogCenterPopupWindow;
|
||||
import com.yunbao.common.dialog.AbsDialogPositionPopupWindow;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.share.bean.ShareBean;
|
||||
@@ -19,7 +20,7 @@ import com.yunbao.share.bean.ShareBean;
|
||||
import io.rong.imkit.utils.RouteUtils;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
|
||||
public class ShareSuccessNotifyDialog extends AbsDialogPositionPopupWindow {
|
||||
public class ShareSuccessNotifyDialog extends AbsDialogCenterPopupWindow {
|
||||
private ShareBean bean;
|
||||
private DialogInterface.OnDismissListener onDismissListener;
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ import com.yunbao.main.activity.MainActivity;
|
||||
import com.yunbao.main.activity.MainHomeCommunityActivity;
|
||||
import com.yunbao.main.activity.MsgSettActivity;
|
||||
import com.yunbao.main.activity.PDLiveConversationActivity;
|
||||
import com.yunbao.video.activity.VideoPlayActivity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@@ -126,6 +127,10 @@ public class AppContext extends CommonAppContext {
|
||||
MessageSayHiNotifyManager.getInstance().stop();
|
||||
return;
|
||||
}
|
||||
if(activity instanceof VideoPlayActivity){
|
||||
MessageSayHiNotifyManager.getInstance().stop();
|
||||
return;
|
||||
}
|
||||
MessageSayHiNotifyManager.getInstance().reload();
|
||||
}
|
||||
|
||||
@@ -236,6 +241,10 @@ public class AppContext extends CommonAppContext {
|
||||
RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatTipsItemProvider(getApplicationContext()));
|
||||
RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatCardItemProvider(getApplicationContext()));
|
||||
|
||||
//注册屏蔽push弹窗的类
|
||||
MessageChatNotifyManager.getInstance().addShieldClass(CompleteUserInfoActivity.class);
|
||||
MessageChatNotifyManager.getInstance().addShieldClass(PDLiveConversationActivity.class);
|
||||
|
||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||
@Override
|
||||
public boolean onReceived(io.rong.imlib.model.Message message, int i, boolean b, boolean b1) {
|
||||
@@ -272,7 +281,6 @@ public class AppContext extends CommonAppContext {
|
||||
if (AppManager.getInstance().getLastActivity() instanceof CompleteUserInfoActivity) {
|
||||
return false;
|
||||
}
|
||||
MessageChatNotifyManager.getInstance().setShieldClass(CompleteUserInfoActivity.class);
|
||||
MessageChatNotifyManager.getInstance().push(AppManager.getInstance().getLastActivity()
|
||||
, message.getTargetId(),
|
||||
content.getContent()
|
||||
|
||||
@@ -15,6 +15,12 @@ android {
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
}
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
@@ -65,6 +71,7 @@ repositories {
|
||||
|
||||
|
||||
dependencies {
|
||||
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
api files('libs/jcc-bate-0.7.3.jar')
|
||||
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
||||
|
||||
@@ -65,18 +65,6 @@
|
||||
android:name="com.yunbao.common.activity.PreviewVideoActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.CommunitySendActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.CommunityDetailsActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.UserHomeActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yunbao.common;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
@@ -12,6 +13,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.FansMedalBean;
|
||||
import com.yunbao.common.bean.NewCommunityType;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.bean.UserItemBean;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
@@ -117,10 +119,46 @@ public class CommonAppConfig {
|
||||
private String mAppName;
|
||||
private Boolean mTiBeautyEnable;//是否使用萌颜 true使用萌颜 false 使用基础美颜
|
||||
|
||||
public static List<NewCommunityType> getCommunityTypeList(boolean isHome, Context mContext) {
|
||||
List<NewCommunityType> newCommunityTypeList = new ArrayList<>();
|
||||
if (isHome) {
|
||||
NewCommunityType type0 = new NewCommunityType();
|
||||
type0.setId(0);
|
||||
type0.setTalk_name(mContext.getString(R.string.recomment));
|
||||
newCommunityTypeList.add(type0);
|
||||
}
|
||||
NewCommunityType type17 = new NewCommunityType();
|
||||
type17.setId(17);
|
||||
type17.setTalk_name(mContext.getResources().getString(R.string.main_active_type_01));
|
||||
|
||||
NewCommunityType type16 = new NewCommunityType();
|
||||
type16.setId(16);
|
||||
type16.setTalk_name(mContext.getResources().getString(R.string.main_active_type_02));
|
||||
|
||||
NewCommunityType type15 = new NewCommunityType();
|
||||
type15.setId(15);
|
||||
type15.setTalk_name(mContext.getResources().getString(R.string.main_active_type_03));
|
||||
|
||||
NewCommunityType type14 = new NewCommunityType();
|
||||
type14.setId(14);
|
||||
type14.setTalk_name(mContext.getResources().getString(R.string.main_active_type_04));
|
||||
|
||||
NewCommunityType type13 = new NewCommunityType();
|
||||
type13.setId(13);
|
||||
type13.setTalk_name(mContext.getResources().getString(R.string.main_active_type_05));
|
||||
|
||||
newCommunityTypeList.add(type17);
|
||||
newCommunityTypeList.add(type16);
|
||||
newCommunityTypeList.add(type15);
|
||||
newCommunityTypeList.add(type14);
|
||||
newCommunityTypeList.add(type13);
|
||||
return newCommunityTypeList;
|
||||
}
|
||||
|
||||
|
||||
public String getUid() {
|
||||
if (TextUtils.isEmpty(mUid)) {
|
||||
String[] uidAndToken = SpUtil.getInstance()
|
||||
.getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
|
||||
String[] uidAndToken = SpUtil.getInstance().getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
|
||||
if (uidAndToken != null) {
|
||||
if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) {
|
||||
mUid = uidAndToken[0];
|
||||
@@ -311,9 +349,7 @@ public class CommonAppConfig {
|
||||
mUid = null;
|
||||
mToken = null;
|
||||
mLoginIM = false;
|
||||
SpUtil.getInstance().removeValue(
|
||||
SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN
|
||||
);
|
||||
SpUtil.getInstance().removeValue(SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN);
|
||||
}
|
||||
|
||||
|
||||
@@ -349,12 +385,7 @@ public class CommonAppConfig {
|
||||
mProvince = null;
|
||||
mCity = null;
|
||||
mDistrict = null;
|
||||
SpUtil.getInstance().removeValue(
|
||||
SpUtil.LOCATION_LNG,
|
||||
SpUtil.LOCATION_LAT,
|
||||
SpUtil.LOCATION_PROVINCE,
|
||||
SpUtil.LOCATION_CITY,
|
||||
SpUtil.LOCATION_DISTRICT);
|
||||
SpUtil.getInstance().removeValue(SpUtil.LOCATION_LNG, SpUtil.LOCATION_LAT, SpUtil.LOCATION_PROVINCE, SpUtil.LOCATION_CITY, SpUtil.LOCATION_DISTRICT);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -240,6 +240,8 @@ public class Constants {
|
||||
public static final String VIDEO_ID = "videoId";
|
||||
public static final String VIDEO_COMMENT_BEAN = "videoCommnetBean";
|
||||
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_DURATION = "videoDuration";
|
||||
public static final String VIDEO_PATH = "videoPath";
|
||||
@@ -306,5 +308,6 @@ public class Constants {
|
||||
public static String isSetRemarkText = "";//修改的备注信息
|
||||
public static boolean isShowLiveDialog = false;//是否在直播间打开单聊
|
||||
public static int firstInto = 0;//
|
||||
public static final String TO_COMMUNITY_ID = "to_id";
|
||||
|
||||
}
|
||||
|
||||
@@ -1,387 +0,0 @@
|
||||
package com.yunbao.common.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Outline;
|
||||
import android.view.View;
|
||||
import android.view.ViewOutlineProvider;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.ms.banner.Banner;
|
||||
import com.ms.banner.listener.OnBannerClickListener;
|
||||
import com.xuexiang.xui.widget.flowlayout.FlowTagLayout;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.LabelTagAdapter;
|
||||
import com.yunbao.common.adapter.UserCommunityAdapter;
|
||||
import com.yunbao.common.adapter.UserHomeImgAdapter;
|
||||
import com.yunbao.common.bean.ActiveOtherBean;
|
||||
import com.yunbao.common.bean.HomeUserExhibitInfoBean;
|
||||
import com.yunbao.common.bean.HomeUserInfoBean;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LabelBean;
|
||||
import com.yunbao.common.bean.MessageUserInfoBean;
|
||||
import com.yunbao.common.bean.UserHomeImgBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.UserHomeImgsViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class UserHomeActivity extends AbsActivity {
|
||||
private String uid;
|
||||
private Banner mBanner;
|
||||
private RecyclerView imgsRecyclerView;
|
||||
private UserHomeImgAdapter userHomeImgAdapter;
|
||||
private List<String> bannerImgList = new ArrayList<>();
|
||||
private List<UserHomeImgBean> tempList;
|
||||
private RoundedImageView avatar;
|
||||
private TextView userName;
|
||||
private TextView fansCount;
|
||||
private TextView likeCount;
|
||||
private LinearLayout followLayout;
|
||||
private ImageView followIcon;
|
||||
private TextView followName;
|
||||
private TextView userId;
|
||||
private TextView userStatus;
|
||||
private ImageView userStatusIcon;
|
||||
private ImageView user_sex;
|
||||
private ImageView authorIcon;
|
||||
private TextView level;
|
||||
private ImageView levelIcon;
|
||||
private TextView vipLevel;
|
||||
private LinearLayout authenticationLayout;
|
||||
private TextView signature;
|
||||
private LinearLayout moreLayout;
|
||||
private TextView moreText;
|
||||
private ImageView moreIcon;
|
||||
private HomeUserInfoBean userInfo;
|
||||
RecyclerView communityRecyclerView;
|
||||
private LinearLayout itemLayout01;
|
||||
private LinearLayout itemLayout02;
|
||||
private LinearLayout itemLayout03;
|
||||
private LinearLayout itemLayout04;
|
||||
FlowTagLayout myFlowTag; //我的标签
|
||||
LabelTagAdapter myAdapter;
|
||||
private boolean isShowcase;
|
||||
private boolean isAnchor;
|
||||
private RelativeLayout userPresidentLayout;
|
||||
private TextView userPresidentName;
|
||||
private RelativeLayout authorLayout;
|
||||
private RelativeLayout levelLayout;
|
||||
private RoundedImageView fansImg1;
|
||||
private RoundedImageView fansImg2;
|
||||
private RoundedImageView fansImg3;
|
||||
|
||||
private List<RoundedImageView> fansImgViewList = new ArrayList<>();
|
||||
|
||||
public static void forwardUserHomeActivity(Context content, String uid) {
|
||||
Intent intent = new Intent(content, UserHomeActivity.class);
|
||||
intent.putExtra(Constants.TO_UID, uid);
|
||||
content.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_user_home;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void create() {
|
||||
super.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
uid = getIntent().getStringExtra(Constants.TO_UID);
|
||||
if (StringUtil.isEmpty(uid)) {
|
||||
ToastUtil.show("用户不存在");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
initView();
|
||||
getUseData();
|
||||
getCommunityList();
|
||||
}
|
||||
|
||||
private void getCommunityList() {
|
||||
CommonHttpUtil.getOtherDynamicList(uid, new com.yunbao.common.http.HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
List<ActiveOtherBean> beanList = JSONArray.parseArray(Arrays.toString(info), ActiveOtherBean.class);
|
||||
UserCommunityAdapter userCommunityAdapter = new UserCommunityAdapter(mContext, beanList);
|
||||
communityRecyclerView.setAdapter(userCommunityAdapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initData(HomeUserInfoBean userInfoBean) {
|
||||
userInfo = userInfoBean;
|
||||
if (!userInfo.getCheckBlack().get(0).getU2t().equals("0")) {
|
||||
ToastUtil.show("已拉黑,无法查看");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getUser_president_name())) {
|
||||
userPresidentLayout.setVisibility(View.VISIBLE);
|
||||
userPresidentName.setText(userInfo.getUserHomeTopInfo().getUser_president_name());
|
||||
}
|
||||
isAnchor = userInfo.getUserHomeTopInfo().getIs_anchor() == 1;
|
||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_avatar(), avatar);
|
||||
userName.setText(userInfo.getUserHomeTopInfo().getUser_name());//用户名称
|
||||
fansCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_fans_num()));//粉丝数量
|
||||
likeCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_love_num()));//关注数量
|
||||
|
||||
userId.setText("ID:" + userInfo.getUserHomeTopInfo().getUser_id());//用户ID
|
||||
userStatus.setText("");//认证状态
|
||||
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, CommonAppConfig.HOST + userInfo.getUserHomeTopInfo().getUser_level_anchor_img(), authorIcon);
|
||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_img(), levelIcon);
|
||||
|
||||
if (isAnchor) {//是否是主播
|
||||
authorLayout.setVisibility(View.VISIBLE);
|
||||
levelLayout.setVisibility(View.VISIBLE);
|
||||
authenticationLayout.setVisibility(View.VISIBLE);
|
||||
itemLayout01.setVisibility(View.VISIBLE);
|
||||
itemLayout02.setVisibility(View.VISIBLE);
|
||||
itemLayout03.setVisibility(View.VISIBLE);
|
||||
itemLayout04.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
authorLayout.setVisibility(View.GONE);
|
||||
authenticationLayout.setVisibility(View.GONE);
|
||||
itemLayout03.setVisibility(View.VISIBLE);
|
||||
itemLayout04.setVisibility(View.VISIBLE);
|
||||
}
|
||||
signature.setText(userInfo.getUserHomeTopInfo().getUser_signature());//个性签名
|
||||
//标签
|
||||
myAdapter = new LabelTagAdapter(mContext, new LabelTagAdapter.OnSureOnClickListener() {
|
||||
@Override
|
||||
public void sure(LabelBean.Children labelBean) {
|
||||
|
||||
}
|
||||
});
|
||||
if (userInfo.getUserHomeTopInfo().getCn_label() != null) {
|
||||
if (userInfo.getUserHomeTopInfo().getCn_label().size() > 0) {
|
||||
myFlowTag.setAdapter(myAdapter);
|
||||
myFlowTag.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
||||
myAdapter.setData(userInfo.getUserHomeTopInfo().getCn_label());
|
||||
}
|
||||
}
|
||||
mBanner.setOutlineProvider(new ViewOutlineProvider() {
|
||||
@Override
|
||||
public void getOutline(View view, Outline outline) {
|
||||
outline.setRoundRect(0, 0, 0, 0, 0);
|
||||
}
|
||||
});
|
||||
mBanner.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
bannerImgList = userInfo.getUserHomeTopInfo().getUser_home_banner();
|
||||
tempList = new ArrayList<>();
|
||||
for (int i = 0; i < bannerImgList.size(); i++) {
|
||||
tempList.add(new UserHomeImgBean(bannerImgList.get(i)));
|
||||
}
|
||||
tempList.get(0).setShow(true);
|
||||
userHomeImgAdapter = new UserHomeImgAdapter(UserHomeActivity.this, tempList);
|
||||
imgsRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||
imgsRecyclerView.setAdapter(userHomeImgAdapter);
|
||||
|
||||
userHomeImgAdapter.setOnItemClickListener(new UserHomeImgAdapter.onItemClickListener() {
|
||||
@Override
|
||||
public void onImgItem(UserHomeImgBean activeBean, int position) {
|
||||
mBanner.onPageSelected(position);
|
||||
mBanner.setCurrentPage(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);
|
||||
}
|
||||
});
|
||||
mBanner.setAutoPlay(false).setPages(bannerImgList, new UserHomeImgsViewHolder()).setOnBannerClickListener(new OnBannerClickListener() {
|
||||
@Override
|
||||
public void onBannerClick(List datas, int position) {
|
||||
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
fansImg1 = findViewById(R.id.fansImg1);
|
||||
fansImg2 = findViewById(R.id.fansImg2);
|
||||
fansImg3 = findViewById(R.id.fansImg3);
|
||||
fansImgViewList = new ArrayList<>();
|
||||
fansImgViewList.add(fansImg1);
|
||||
fansImgViewList.add(fansImg2);
|
||||
fansImgViewList.add(fansImg3);
|
||||
authorLayout = findViewById(R.id.authorLayout);
|
||||
levelLayout = findViewById(R.id.levelLayout);
|
||||
userPresidentLayout = findViewById(R.id.userPresidentLayout);
|
||||
userPresidentName = findViewById(R.id.userPresidentName);
|
||||
itemLayout01 = findViewById(R.id.itemLayout01);
|
||||
itemLayout02 = findViewById(R.id.itemLayout02);
|
||||
itemLayout03 = findViewById(R.id.itemLayout03);
|
||||
itemLayout04 = findViewById(R.id.itemLayout04);
|
||||
communityRecyclerView = findViewById(R.id.communityRecyclerView);
|
||||
myFlowTag = findViewById(R.id.myFlowTag);
|
||||
avatar = findViewById(R.id.avatar);
|
||||
userName = findViewById(R.id.name);
|
||||
fansCount = findViewById(R.id.fansCount);
|
||||
likeCount = findViewById(R.id.likeCount);
|
||||
followLayout = findViewById(R.id.followLayout);
|
||||
followName = findViewById(R.id.followName);
|
||||
followIcon = findViewById(R.id.followIcon);
|
||||
userId = findViewById(R.id.userId);
|
||||
userStatus = findViewById(R.id.userStatus);
|
||||
userStatusIcon = findViewById(R.id.userStatusIcon);
|
||||
user_sex = findViewById(R.id.user_sex);
|
||||
levelIcon = findViewById(R.id.levelIcon);
|
||||
level = findViewById(R.id.level);
|
||||
authorIcon = findViewById(R.id.authorlIcon);
|
||||
authenticationLayout = findViewById(R.id.authenticationLayout);
|
||||
signature = findViewById(R.id.signature);
|
||||
moreLayout = findViewById(R.id.moreLayout);
|
||||
moreText = findViewById(R.id.moreText);
|
||||
moreIcon = findViewById(R.id.moreIcon);
|
||||
|
||||
mBanner = findViewById(R.id.banner);
|
||||
imgsRecyclerView = findViewById(R.id.imgsRecyclerView);
|
||||
|
||||
communityRecyclerView = findViewById(R.id.communityRecyclerView);
|
||||
communityRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
communityRecyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
|
||||
findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
followLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
CommonHttpUtil.setAttention(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()), new CommonCallback<Integer>() {
|
||||
@Override
|
||||
public void callback(Integer isAttention) {
|
||||
if (isAttention == 1) {
|
||||
ImgLoader.display(UserHomeActivity.this, R.mipmap.icon_like_followed, followIcon);
|
||||
followName.setText("已关注");
|
||||
followName.setTextColor(Color.parseColor("#777777"));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type_1));
|
||||
} else {
|
||||
ImgLoader.display(UserHomeActivity.this, R.mipmap.icon_like_follow, followIcon);
|
||||
followName.setText("关注");
|
||||
followName.setTextColor(getResources().getColor(R.color.white));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
moreLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (isShowcase) {
|
||||
if (isAnchor) {
|
||||
itemLayout01.setVisibility(View.GONE);
|
||||
itemLayout02.setVisibility(View.GONE);
|
||||
itemLayout03.setVisibility(View.GONE);
|
||||
itemLayout04.setVisibility(View.GONE);
|
||||
} else {
|
||||
itemLayout03.setVisibility(View.GONE);
|
||||
itemLayout04.setVisibility(View.GONE);
|
||||
}
|
||||
moreText.setText("查看更多");
|
||||
ImgLoader.display(mContext, R.mipmap.icon_down, moreIcon);
|
||||
} else {
|
||||
if (isAnchor) {
|
||||
itemLayout01.setVisibility(View.VISIBLE);
|
||||
itemLayout02.setVisibility(View.VISIBLE);
|
||||
itemLayout03.setVisibility(View.VISIBLE);
|
||||
itemLayout04.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
itemLayout01.setVisibility(View.GONE);
|
||||
itemLayout02.setVisibility(View.GONE);
|
||||
}
|
||||
moreText.setText("收起");
|
||||
ImgLoader.display(mContext, R.mipmap.icon_up, moreIcon);
|
||||
}
|
||||
isShowcase = !isShowcase;
|
||||
}
|
||||
});
|
||||
findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getUseData() {
|
||||
LiveNetManager.get(mContext).getUserHomeInfo(uid, new HttpCallback<HomeUserInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(HomeUserInfoBean data) {
|
||||
initData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
LiveNetManager.get(mContext).getUserExhibitInfoInfo(uid, new HttpCallback<HomeUserExhibitInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(HomeUserExhibitInfoBean data) {
|
||||
if (data.getUserHomeTopInfo().getFans().getList() != null) {
|
||||
for (int i = 0; i < data.getUserHomeTopInfo().getFans().getList().size(); i++) {
|
||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getFans().getList().get(i).getAvatar(), fansImgViewList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
||||
super.onActivityResult(requestCode, resultCode, intent);
|
||||
}
|
||||
}
|
||||
@@ -103,6 +103,15 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
}
|
||||
});
|
||||
report1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (onItemClickListener != null) {
|
||||
CommentBean.ReplyComment bean = (CommentBean.ReplyComment) v.getTag();
|
||||
onItemClickListener.onReport(bean);
|
||||
}
|
||||
}
|
||||
});
|
||||
replyTextView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -117,7 +126,16 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
||||
public void onClick(View v) {
|
||||
if (onItemClickListener != null) {
|
||||
CommentBean bean = (CommentBean) v.getTag();
|
||||
onItemClickListener.onDel(bean, 0);
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -125,6 +143,8 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void setData(CommentBean bean) {
|
||||
del.setTag(bean);
|
||||
del1.setTag(bean);
|
||||
report.setTag(bean);
|
||||
replyTextView.setTag(bean);
|
||||
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
||||
@@ -143,6 +163,8 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
||||
if (bean.getReplyCommentList() != null) {
|
||||
replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>");
|
||||
if (bean.getReplyCommentList().size() > 0) {
|
||||
report1.setTag(bean.getReplyCommentList().get(0));
|
||||
del1.setTag(bean.getReplyCommentList().get(0));
|
||||
replyContent.setText(bean.getReplyCommentList().get(0).getContent());
|
||||
ImgLoader.display(itemView.getContext(), bean.getReplyCommentList().get(0).getUser_avatar(), mAvatar01);
|
||||
firstName.setText(bean.getReplyCommentList().get(0).getUser_name());
|
||||
@@ -152,10 +174,10 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
||||
} else {
|
||||
isAuth.setVisibility(View.GONE);
|
||||
}
|
||||
if (bean.getUser_id().equals(myUid)) {
|
||||
del.setVisibility(View.VISIBLE);
|
||||
if (bean.getReplyCommentList().get(0).getUser_id().equals(myUid)) {
|
||||
del1.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
del.setVisibility(View.GONE);
|
||||
del1.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
replyLayout.setVisibility(View.GONE);
|
||||
@@ -210,10 +232,10 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
||||
|
||||
void onReport(CommentBean activeBean);
|
||||
|
||||
void onDel(CommentBean activeBean, int position);
|
||||
|
||||
void onReport(CommentBean.ReplyComment activeBean);
|
||||
|
||||
void onDel(CommentBean activeBean);
|
||||
|
||||
void onDel(CommentBean.ReplyComment activeBean);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
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);
|
||||
report1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (onItemClickListener != null) {
|
||||
CommentBean.ReplyComment bean = (CommentBean.ReplyComment) v.getTag();
|
||||
onItemClickListener.onReport(bean);
|
||||
}
|
||||
}
|
||||
});
|
||||
report.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
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);
|
||||
report1.setTag(bean);
|
||||
report.setTag(bean);
|
||||
replyTextView.setTag(bean);
|
||||
del1.setTag(bean);
|
||||
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
||||
name.setText(bean.getUser_name());
|
||||
content.setText(bean.getContent());
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,8 +36,7 @@ public class LabelTagAdapter extends BaseTagAdapter<String, TextView> {
|
||||
|
||||
@Override
|
||||
protected void convert(TextView textView, String item, int position) {
|
||||
textView.setText(item);
|
||||
textView.setTextColor(mContext.getResources().getColor(R.color.black2));
|
||||
textView.setText("#"+item);
|
||||
}
|
||||
|
||||
public interface OnSureOnClickListener {
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
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,7 +16,9 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.ActiveOtherBean;
|
||||
import com.yunbao.common.dialog.ImagePreviewDialog;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.views.NineGridLayout;
|
||||
@@ -81,16 +83,17 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
||||
comCount = itemView.findViewById(R.id.comCount);
|
||||
shareCount = itemView.findViewById(R.id.shareCount);
|
||||
|
||||
mAvatar.setOnClickListener(new View.OnClickListener() {
|
||||
itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onItemClickListener.onImgItem((String) v.getTag(), getPosition());
|
||||
onItemClickListener.onImgItem((ActiveOtherBean) v.getTag(), getPosition());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void setData(ActiveOtherBean bean) {
|
||||
itemView.setTag(bean);
|
||||
mAvatar.setTag(bean);
|
||||
ImgLoader.display(mContext, bean.getUser_avatar(), mAvatar);
|
||||
userName.setText(bean.getUser_name());
|
||||
@@ -104,7 +107,19 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
||||
nineGridLayout.setActionListener(new NineGridLayout.ActionListener() {
|
||||
@Override
|
||||
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
|
||||
@@ -119,14 +134,18 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
||||
tempList.add(String.valueOf(jsonArray.get(i)));
|
||||
}
|
||||
nineGridLayout.setData(tempList);
|
||||
videoLayout.setVisibility(View.GONE);
|
||||
} else {
|
||||
ImgLoader.display(mContext, bean.getUser_avatar(), videoImage);
|
||||
videoLayout.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display(mContext, bean.getVideo() + "?vframe/jpg/offset/0", videoImage);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public interface onItemClickListener {
|
||||
void onImgItem(String activeBean, int position);
|
||||
void onImgItem(ActiveOtherBean activeBean, int position);
|
||||
|
||||
void onVideoItem(String activeBean, int position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@@ -22,17 +21,15 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter {
|
||||
private List<UserHomeImgBean> commentBeanList;
|
||||
private Context mContext;
|
||||
private onItemClickListener onItemClickListener;
|
||||
private boolean isMe;
|
||||
|
||||
public void setOnItemClickListener(UserHomeImgAdapter.onItemClickListener onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
public List<UserHomeImgBean> getCommentBeanList() {
|
||||
return commentBeanList;
|
||||
}
|
||||
|
||||
public UserHomeImgAdapter(Context content, List<UserHomeImgBean> commentBeanList) {
|
||||
public UserHomeImgAdapter(Context content, List<UserHomeImgBean> commentBeanList, boolean isMe) {
|
||||
this.mContext = content;
|
||||
this.isMe = isMe;
|
||||
this.commentBeanList = commentBeanList;
|
||||
}
|
||||
|
||||
@@ -61,11 +58,13 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter {
|
||||
class CommentViewHolder extends RecyclerView.ViewHolder {
|
||||
RoundedImageView mAvatar01;
|
||||
RoundedImageView mAvatar02;
|
||||
ImageView del;
|
||||
|
||||
public CommentViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
mAvatar01 = itemView.findViewById(R.id.avatar01);
|
||||
mAvatar02 = itemView.findViewById(R.id.avatar02);
|
||||
del = itemView.findViewById(R.id.del);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@@ -74,15 +73,29 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter {
|
||||
mAvatar01.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (onItemClickListener != null) {
|
||||
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(), mAvatar02);
|
||||
if (bean.isShow()) {
|
||||
if (isMe) {
|
||||
del.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mAvatar01.setVisibility(View.GONE);
|
||||
mAvatar02.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
del.setVisibility(View.GONE);
|
||||
mAvatar01.setVisibility(View.VISIBLE);
|
||||
mAvatar02.setVisibility(View.GONE);
|
||||
}
|
||||
@@ -91,5 +104,7 @@ public class UserHomeImgAdapter extends RecyclerView.Adapter {
|
||||
|
||||
public interface onItemClickListener {
|
||||
void onImgItem(UserHomeImgBean activeBean, int position);
|
||||
|
||||
void onImgDel(UserHomeImgBean activeBean, int position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 社區动态
|
||||
*/
|
||||
public class CommentBean extends BaseModel {
|
||||
public class CommentBean extends BaseModel implements Parcelable {
|
||||
private String id;
|
||||
private String dynamic_id;
|
||||
private String uid;
|
||||
@@ -17,8 +22,40 @@ public class CommentBean extends BaseModel {
|
||||
private String user_name;
|
||||
private String user_id;
|
||||
private String user_avatar;
|
||||
private boolean mParentNode;//是否是父元素
|
||||
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() {
|
||||
return child;
|
||||
}
|
||||
@@ -27,6 +64,14 @@ public class CommentBean extends BaseModel {
|
||||
this.child = child;
|
||||
}
|
||||
|
||||
public boolean ismParentNode() {
|
||||
return mParentNode;
|
||||
}
|
||||
|
||||
public void setParentNode(boolean mParentNode) {
|
||||
this.mParentNode = mParentNode;
|
||||
}
|
||||
|
||||
private boolean isShow;
|
||||
|
||||
public String getId() {
|
||||
@@ -133,6 +178,28 @@ public class CommentBean extends BaseModel {
|
||||
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 {
|
||||
private String id;
|
||||
private String dynamic_id;
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class FirstLoginBean extends BaseModel{
|
||||
@SerializedName("status")
|
||||
int status;//0是第一次登陸,1是已經登錄過的
|
||||
int status=-1;//0是第一次登陸,1是已經登錄過的
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
|
||||
@@ -4,13 +4,13 @@ import java.util.List;
|
||||
|
||||
public class HomeUserExhibitInfoBean extends BaseModel {
|
||||
public UserHomeTopInfo userHomeTopInfo;
|
||||
public List<GiftAlreadyWall> giftAlreadyWall;
|
||||
public GiftAlreadyWall giftAlreadyWall;
|
||||
|
||||
public List<GiftAlreadyWall> getGiftAlreadyWall() {
|
||||
public GiftAlreadyWall getGiftAlreadyWall() {
|
||||
return giftAlreadyWall;
|
||||
}
|
||||
|
||||
public void setGiftAlreadyWall(List<GiftAlreadyWall> giftAlreadyWall) {
|
||||
public void setGiftAlreadyWall(GiftAlreadyWall giftAlreadyWall) {
|
||||
this.giftAlreadyWall = giftAlreadyWall;
|
||||
}
|
||||
|
||||
@@ -22,9 +22,26 @@ public class HomeUserExhibitInfoBean extends BaseModel {
|
||||
this.userHomeTopInfo = userHomeTopInfo;
|
||||
}
|
||||
|
||||
|
||||
public class UserHomeTopInfo {
|
||||
Fans fans;
|
||||
public 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() {
|
||||
return fans;
|
||||
@@ -92,7 +109,6 @@ public class HomeUserExhibitInfoBean extends BaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class GiftAlreadyWall {
|
||||
private String gift_wall_lighten_number;
|
||||
private String gift_wall_lighten_total;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HomeUserInfoBean extends BaseModel {
|
||||
@@ -45,6 +47,53 @@ public class HomeUserInfoBean extends BaseModel {
|
||||
private List<String> cn_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() {
|
||||
return cn_label;
|
||||
}
|
||||
|
||||
@@ -256,7 +256,9 @@ public class IMLoginModel extends BaseModel {
|
||||
@SerializedName("guard_type")
|
||||
private String guardType = "";
|
||||
@SerializedName("isAttention")
|
||||
private int attention;
|
||||
private int attention;//1被关注 2已关注 3互关 0没关系
|
||||
@SerializedName("type")
|
||||
private String type;
|
||||
|
||||
public int getAttention() {
|
||||
return attention;
|
||||
@@ -270,6 +272,14 @@ public class IMLoginModel extends BaseModel {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public IMLoginModel setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
return this;
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
public class MessageSayHiStartBean extends BaseModel{
|
||||
@SerializedName("time")
|
||||
private int nextTime;
|
||||
|
||||
private int status;
|
||||
public int getNextTime() {
|
||||
return nextTime;
|
||||
}
|
||||
@@ -13,4 +13,20 @@ public class MessageSayHiStartBean extends BaseModel{
|
||||
public void setNextTime(int nextTime) {
|
||||
this.nextTime = nextTime;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MessageSayHiStartBean{" +
|
||||
"nextTime=" + nextTime +
|
||||
", status=" + status +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class MessageUserInfoBean extends BaseModel{
|
||||
@SerializedName("open_off")
|
||||
private int openOff;//接单设置 1开启 2关闭
|
||||
@SerializedName("rong_online")
|
||||
private int rongOnline;
|
||||
private int rongOnline;//0 在线 非0 其他
|
||||
|
||||
public void setOpenOff(int openOff) {
|
||||
this.openOff = openOff;
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.yunbao.common.bean;
|
||||
public class NewCommunityType extends BaseModel {
|
||||
private int id;
|
||||
private String talk_name;
|
||||
private String talk_name_en;
|
||||
private String img;
|
||||
private String is_hot;
|
||||
private String hot_time;
|
||||
@@ -11,13 +12,12 @@ public class NewCommunityType extends BaseModel {
|
||||
public NewCommunityType() {
|
||||
}
|
||||
|
||||
public NewCommunityType(int id, String talk_name, String img, String is_hot, String hot_time, String sort) {
|
||||
this.id = id;
|
||||
this.talk_name = talk_name;
|
||||
this.img = img;
|
||||
this.is_hot = is_hot;
|
||||
this.hot_time = hot_time;
|
||||
this.sort = sort;
|
||||
public String getTalk_name_en() {
|
||||
return talk_name_en;
|
||||
}
|
||||
|
||||
public void setTalk_name_en(String talk_name_en) {
|
||||
this.talk_name_en = talk_name_en;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
|
||||
@@ -94,8 +94,8 @@ public class InstructorOperationDialog extends AbsDialogFragment {
|
||||
mRootView.findViewById(R.id.to_msg).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
EventBus.getDefault().post(new InstructorOperationEvent());
|
||||
dismiss();
|
||||
EventBus.getDefault().post(new InstructorOperationEvent());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,14 +52,14 @@ public class MessageLongClickPopuwindow implements View.OnClickListener {
|
||||
Log.e("MessageLongClick ", "currentTimeMillis:" + System.currentTimeMillis());
|
||||
Log.e("MessageLongClick ", "秒:" + ((System.currentTimeMillis() - sentTime) / 1000));
|
||||
//超过俩分钟无法撤回
|
||||
if (((System.currentTimeMillis() - sentTime) / 1000) > 120) {
|
||||
/* if (((System.currentTimeMillis() - sentTime) / 1000) > 120) {
|
||||
withdrawLinear.setVisibility(View.GONE);
|
||||
}
|
||||
//只可以撤回自己的消息
|
||||
IMLoginModel model = IMLoginManager.get(mContext).getUserInfo();
|
||||
if (!message.getSenderUserId().equals(String.valueOf(model.getId()))) {
|
||||
withdrawLinear.setVisibility(View.GONE);
|
||||
}
|
||||
}*/
|
||||
//非文字信息无法复制
|
||||
if (!message.getObjectName().equals("RC:TxtMsg")) {
|
||||
copyLinear.setVisibility(View.GONE);
|
||||
@@ -106,7 +106,8 @@ public class MessageLongClickPopuwindow implements View.OnClickListener {
|
||||
copyMethod();
|
||||
popupWindow.dismiss();
|
||||
} else if (id == R.id.withdraw_linear) {//撤回
|
||||
withdrawMethod();
|
||||
// withdrawMethod();
|
||||
delete();
|
||||
popupWindow.dismiss();
|
||||
} else if (id == R.id.quote_linear) {//引用
|
||||
List<MessageItemLongClickAction> messageItemLongClickActionList = MessageItemLongClickActionManager.getInstance().getMessageItemLongClickActions();
|
||||
@@ -115,6 +116,20 @@ public class MessageLongClickPopuwindow implements View.OnClickListener {
|
||||
|
||||
}
|
||||
|
||||
private void delete() {
|
||||
IMCenter.getInstance().deleteMessages(message.getConversationType(), message.getTargetId(), new int[]{message.getMessageId()}, new RongIMClient.ResultCallback<Boolean>() {
|
||||
@Override
|
||||
public void onSuccess(Boolean aBoolean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void copyMethod() {
|
||||
//文字消息支持复制
|
||||
if (message.getContent() instanceof TextMessage) {
|
||||
|
||||
@@ -76,9 +76,9 @@ public class MessageSayHiNotifyDialog extends AbsDialogCenterPopupWindow {
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
super.onDismiss();
|
||||
if (onDismissListener != null) {
|
||||
/*if (onDismissListener != null) {
|
||||
onDismissListener.onItemClick(userInfoBean.getUser().getId() + "", isSayHi ? 2 : 1);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
boolean isSayHi = false;
|
||||
@@ -93,15 +93,19 @@ public class MessageSayHiNotifyDialog extends AbsDialogCenterPopupWindow {
|
||||
sendMsg(userInfoBean.getSayHiMsg());
|
||||
dismiss();
|
||||
});
|
||||
avatar = findViewById(R.id.avatar);
|
||||
/* avatar = findViewById(R.id.avatar);
|
||||
anchorName = findViewById(R.id.anchorName);
|
||||
ImgLoader.display(mContext, userInfoBean.getUser().getAvatar(), avatar);
|
||||
anchorName.setText(userInfoBean.getUser().getUserNicename());
|
||||
((TextView) findViewById(R.id.description)).setText(userInfoBean.getUser().getSignature());
|
||||
ViewUtils.findViewById(findViewById(R.id.age), R.id.tag, TextView.class).setText(String.format("%s%s",
|
||||
// ((TextView) findViewById(R.id.description)).setText(userInfoBean.getUser().getSignature());
|
||||
((TextView) findViewById(R.id.description)).setText(WordUtil.isNewZh()?"他就在你附近,來看看~":"He is near you, come and see~");
|
||||
ViewUtils.findViewById(findViewById(R.id.age), R.id.tag, TextView.class).setText(String.format("%s%s%s",
|
||||
WordUtil.getNewString(R.string.dialog_message_say_hi_age)
|
||||
, userInfoBean.getInfo().getAge()));
|
||||
showTag();
|
||||
, userInfoBean.getInfo().getAge()
|
||||
,WordUtil.isNewZh()?"歲":"years old"
|
||||
)
|
||||
);
|
||||
showTag();*/
|
||||
}
|
||||
|
||||
private void showTag() {
|
||||
|
||||
@@ -44,6 +44,7 @@ import java.util.Locale;
|
||||
|
||||
public class CommonHttpUtil {
|
||||
|
||||
public static final String GET_UPLOAD_QI_NIU_TOKEN = "getUploadQiNiuToken";
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
@@ -506,12 +507,13 @@ public class CommonHttpUtil {
|
||||
* @param createAt
|
||||
* @param callback
|
||||
*/
|
||||
public static void pushCommunity(boolean isImgOrVideo, String content, String talkId, String fileAry, String createAt, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Pdlcommunity.sendDynamic", CommonHttpConsts.GET_USER_BASEINFO)
|
||||
public static void pushCommunity(boolean isImgOrVideo, String content, String talkId, String fileAry, String videoUrl, String createAt, HttpCallback callback) {
|
||||
HttpClient.getInstance().post("Pdlcommunity.sendDynamic", CommonHttpConsts.GET_USER_BASEINFO)
|
||||
.params("img_or_video", isImgOrVideo ? 1 : 2)
|
||||
.params("content", content)
|
||||
.params("talk_id", talkId)
|
||||
.params("file_name_ary", fileAry)
|
||||
.params("video", videoUrl)
|
||||
.params("created_at", createAt)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -522,31 +524,21 @@ public class CommonHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getCommunityHotList(int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Pdlcommunity.getFindDynamicList", "Pdlcommunity.getFindDynamicList")
|
||||
HttpClient.getInstance().get("Pdlcommunity.getHotDynamicList", "Pdlcommunity.getHotDynamicList")
|
||||
.params("p", p)
|
||||
.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
|
||||
*/
|
||||
public static void getCommunityComment(String dynamic_id, String dynamic_uid, HttpCallback callback) {
|
||||
public static void getCommunityComment(String dynamic_id, String dynamic_uid, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Pdlcommunity.getDynamicCommentList", "Pdlcommunity.getDynamicCommentList")
|
||||
.params("dynamic_id", dynamic_id)
|
||||
.params("dynamic_uid", dynamic_uid)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -587,7 +579,7 @@ public class CommonHttpUtil {
|
||||
* 获取动态-关注
|
||||
*/
|
||||
public static void getCommunityFollow(int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Pdlcommunity.getFindDynamicList", "Pdlcommunity.getFindDynamicList")
|
||||
HttpClient.getInstance().get("Pdlcommunity.getAttentionDynamicList", "Pdlcommunity.getAttentionDynamicList")
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -596,7 +588,7 @@ public class CommonHttpUtil {
|
||||
* 获取动态-分类
|
||||
*/
|
||||
public static void getTag(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Pdlcommunity.getTalkBanner", "Pdlcommunity.getTalkBanner")
|
||||
HttpClient.getInstance().get("Pdlcommunity.getHotTalk", "Pdlcommunity.getHotTalk")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -626,7 +618,7 @@ public class CommonHttpUtil {
|
||||
* 动态-不感兴趣
|
||||
*/
|
||||
public static void noInterest(String uid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.setBlack", "User.setBlack")
|
||||
HttpClient.getInstance().get("Pdluser.setBlack", "User.setBlack")
|
||||
.params("touid", uid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -640,7 +632,25 @@ public class CommonHttpUtil {
|
||||
.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,6 +1,7 @@
|
||||
package com.yunbao.common.http;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
@@ -212,6 +213,7 @@ public interface PDLiveApi {
|
||||
/**
|
||||
* 获取直播间信息
|
||||
*
|
||||
* @param liveui 主播id
|
||||
* @return
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getLiveInfo")
|
||||
@@ -1269,6 +1271,9 @@ public interface PDLiveApi {
|
||||
@GET("/api/public/?service=Pdluserhome.getUserHomeInfo")
|
||||
Observable<ResponseModel<HomeUserExhibitInfoBean>> getUserHomeExhibitInfo(@Query("select_uid") String tuid);
|
||||
|
||||
@GET("/api/public/?service=Pdlcommunity.getDynamicInfo")
|
||||
Observable<ResponseModel<ActiveBean>> getDynamicInfo(@Query("dynamic_id") String dynamic_id);
|
||||
|
||||
@GET("/api/public/?service=Pdlinfos.getCareer")
|
||||
Observable<ResponseModel<List<CareerBean>>> getCareer();
|
||||
|
||||
@@ -1292,4 +1297,8 @@ public interface PDLiveApi {
|
||||
@GET("/api/public/?service=Pdlinfos.getIsSet")
|
||||
Observable<ResponseModel<FirstLoginBean>> isFirstLogin(
|
||||
);
|
||||
@GET("/api/public/?service=Pdlinfos.getIsLive")
|
||||
Observable<ResponseModel<List<Integer>>> getUserLiveStatus(
|
||||
@Query("ids")String ids
|
||||
);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AvatarBean;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
@@ -3232,14 +3233,14 @@ public class LiveNetManager {
|
||||
String user_nicename,
|
||||
String avatar,
|
||||
String birthday,
|
||||
HttpCallback<List<BaseModel>> callback) {
|
||||
HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.initUserInfo(sex, user_nicename, avatar, birthday)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(roomMicStatusModelResponseModel -> {
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
|
||||
callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.getData().getMsg()));
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
@@ -3383,6 +3384,30 @@ public class LiveNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getDynamicInfo(String dynamic_id, HttpCallback<ActiveBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getDynamicInfo(dynamic_id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<ActiveBean>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<ActiveBean> messageUserInfoBeanResponseModel) throws Exception {
|
||||
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 getCareer(HttpCallback<List<CareerBean>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getCareer()
|
||||
@@ -3497,6 +3522,25 @@ public class LiveNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void getUserLiveStatus(String ids,HttpCallback<List<Integer>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getUserLiveStatus(ids)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(roomMicStatusModelResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
private MultipartBody.Part createUploadFile(File file) {
|
||||
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
||||
|
||||
@@ -4,9 +4,7 @@ import android.content.Context;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.yunbao.common.bean.FansModel;
|
||||
import com.yunbao.common.bean.NewCommunityType;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -30,7 +28,7 @@ public class CommunityTypeManager extends BaseCacheManager {
|
||||
}
|
||||
|
||||
public void UpCommunityType(String json) {
|
||||
newCommunityTypeList = new Gson().fromJson(json, new TypeToken<List<NewLevelModel>>() {
|
||||
newCommunityTypeList = new Gson().fromJson(json, new TypeToken<List<NewCommunityType>>() {
|
||||
}.getType());
|
||||
put(KEY_COMMUNITY_TYPE, newCommunityTypeList);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ public class MessageChatCardContent extends MessageContent implements Parcelable
|
||||
private String extraData;
|
||||
|
||||
public static <T> void sendMessage(Conversation.ConversationType type, String targetId, MessageChatCardContent tipsContent, OnSendMessageListener<T> listener) {
|
||||
ToastUtil.show("发送给:"+targetId);
|
||||
Message message=Message.obtain(targetId, type,tipsContent);
|
||||
IMCenter.getInstance().sendMessage(message,null,null,new IRongCallback.ISendMessageCallback(){
|
||||
|
||||
@@ -44,7 +43,6 @@ public class MessageChatCardContent extends MessageContent implements Parcelable
|
||||
|
||||
@Override
|
||||
public void onSuccess(Message message) {
|
||||
ToastUtil.show("发送成功");
|
||||
if (listener != null) {
|
||||
listener.onSuccess(null, null);
|
||||
}
|
||||
@@ -52,7 +50,6 @@ public class MessageChatCardContent extends MessageContent implements Parcelable
|
||||
|
||||
@Override
|
||||
public void onError(Message message, RongIMClient.ErrorCode e) {
|
||||
ToastUtil.show("发送失败:"+e.getMessage());
|
||||
if (listener != null) {
|
||||
listener.onError(e.code, e.msg);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
package com.yunbao.common.provider;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.Spannable;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.message.content.MessageChatCardContent;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
@@ -18,6 +22,7 @@ import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.conversation.messgelist.provider.BaseMessageItemProvider;
|
||||
@@ -56,6 +61,20 @@ public class MessageChatCardItemProvider extends BaseMessageItemProvider<Message
|
||||
protected boolean onItemClick(ViewHolder holder, MessageChatCardContent content, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
|
||||
if ("1".equals(content.getType())) {
|
||||
gotoLive(content.getExtraData());
|
||||
}else if("0".equals(content.getType())){
|
||||
RouteUtil.forwardCommunity(content.getExtraData());
|
||||
}else if("2".equals(content.getType())){
|
||||
LiveNetManager.get(mContext).getDynamicInfo(content.getExtraData(), new com.yunbao.common.http.base.HttpCallback<ActiveBean>() {
|
||||
@Override
|
||||
public void onSuccess(ActiveBean data) {
|
||||
RouteUtil.forwardVideoPlayActivity(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
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);
|
||||
}
|
||||
215
common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java
Normal file
@@ -0,0 +1,215 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
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,6 +24,7 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
||||
private LayoutInflater mInflater;
|
||||
private View.OnClickListener mOnClickListener;
|
||||
private View.OnClickListener mODelListener;
|
||||
private View.OnClickListener onAddClick;
|
||||
private ActionListener mActionListener;
|
||||
|
||||
public ActiveImageAdapter(Context context) {
|
||||
@@ -70,6 +71,14 @@ 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) {
|
||||
@@ -174,24 +183,26 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
||||
del = itemView.findViewById(R.id.del);
|
||||
itemView.setOnClickListener(mOnClickListener);
|
||||
del.setOnClickListener(mODelListener);
|
||||
mIconAdd.setOnClickListener(onAddClick);
|
||||
}
|
||||
|
||||
void setData(ActiveImageBean bean, int position) {
|
||||
itemView.setTag(position);
|
||||
del.setTag(position);
|
||||
if (bean.getImageFile() == null) {
|
||||
mImg.setImageDrawable(null);
|
||||
if (mIconAdd.getVisibility() != View.VISIBLE) {
|
||||
mIconAdd.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (del.getVisibility() != View.VISIBLE) {
|
||||
del.setVisibility(View.VISIBLE);
|
||||
if (del.getVisibility() != View.GONE) {
|
||||
del.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
if (mIconAdd.getVisibility() == View.VISIBLE) {
|
||||
mIconAdd.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
if (del.getVisibility() == View.VISIBLE) {
|
||||
del.setVisibility(View.GONE);
|
||||
if (del.getVisibility() == View.GONE) {
|
||||
del.setVisibility(View.VISIBLE);
|
||||
}
|
||||
ImgLoader.display(mContext, bean.getImageFile(), mImg);
|
||||
}
|
||||
@@ -201,8 +212,11 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
|
||||
|
||||
public interface ActionListener {
|
||||
void onAddClick();
|
||||
|
||||
void onItemClick(int position);
|
||||
|
||||
void onDeleteAll();
|
||||
|
||||
void onDel(int position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,12 +36,11 @@ public class DateFormatUtil {
|
||||
|
||||
public static String getTimeStrings(long time) {
|
||||
Date date = new Date(time); // 创建Date对象并传入时间戳参数
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // 设置日期格式
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 设置日期格式
|
||||
String formattedDate = sdf.format(date); // 格式化日期字符串
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
|
||||
public static String getVideoCurTimeString() {
|
||||
return sFormat2.format(new Date());
|
||||
}
|
||||
|
||||
368
common/src/main/java/com/yunbao/common/utils/FilesUtils.java
Normal file
@@ -0,0 +1,368 @@
|
||||
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,7 +13,7 @@ import java.util.List;
|
||||
public class MessageChatNotifyManager {
|
||||
private static MessageChatNotifyManager instance;
|
||||
private List<MessageUserInfoBean> startListNotifyList = new ArrayList<>();
|
||||
Class<?> clazz;
|
||||
List<String> clazzList = new ArrayList<>();
|
||||
|
||||
public static MessageChatNotifyManager getInstance() {
|
||||
if (instance == null) {
|
||||
@@ -22,8 +22,10 @@ public class MessageChatNotifyManager {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void setShieldClass(Class<?> clazz) {
|
||||
this.clazz = clazz;
|
||||
public void addShieldClass(Class<?> clazz) {
|
||||
if (!clazzList.contains(clazz.getSimpleName())) {
|
||||
clazzList.add(clazz.getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
public void push(Context mContext, MessageUserInfoBean userInfo) {
|
||||
@@ -36,7 +38,8 @@ public class MessageChatNotifyManager {
|
||||
}
|
||||
|
||||
private void notifyLiveFlot(Context mContext) {
|
||||
if (AppManager.getInstance().getLastActivity().getClass().getSimpleName().equals(clazz.getSimpleName())) {
|
||||
String simpleName = AppManager.getInstance().getLastActivity().getClass().getSimpleName();
|
||||
if (clazzList.contains(simpleName)) {
|
||||
ToastUtil.showDebug("屏蔽类,不展示");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,10 @@ public class MessageSayHiNotifyManager {
|
||||
.getMessageSayHiStartTimer(new HttpCallback<MessageSayHiStartBean>() {
|
||||
@Override
|
||||
public void onSuccess(MessageSayHiStartBean data) {
|
||||
if(data.getStatus()==0){
|
||||
Log.i(TAG, "onSuccess: 初始化定时器,定时器关:" + data.toString());
|
||||
return;
|
||||
}
|
||||
timer = new Timer();
|
||||
timer.schedule(createTask(), data.getNextTime() * 1000L);
|
||||
hiBean = new MessageSayHiBean();
|
||||
@@ -72,11 +76,15 @@ public class MessageSayHiNotifyManager {
|
||||
.getMessageSayHiTimer(new HttpCallback<MessageSayHiBean>() {
|
||||
@Override
|
||||
public void onSuccess(MessageSayHiBean data) {
|
||||
if (data.getStatus() == 0) {
|
||||
if (data.getStatus() == -1) {
|
||||
Log.i(TAG, "onSuccess: 定时器为关,不再轮训");
|
||||
return;
|
||||
}
|
||||
data.setNextTime(RandomUtil.nextInt(30));
|
||||
if(data.getStatus()==0){
|
||||
timer = new Timer();
|
||||
timer.schedule(createTask(), data.getNextTime() * 1000L);
|
||||
return;
|
||||
}
|
||||
hiBean = data;
|
||||
showDialog(data);
|
||||
}
|
||||
@@ -195,7 +203,7 @@ public class MessageSayHiNotifyManager {
|
||||
private void notifyLiveFlot(Context mContext) {
|
||||
if (startListNotifyList.iterator().hasNext()) {
|
||||
MessageUserInfoBean bean = startListNotifyList.iterator().next();
|
||||
new MessageChatNotifyDialog(AppManager.getInstance().getLastActivity(), bean).setOnDismissListener(dialog -> {
|
||||
new MessageSayHiNotifyDialog(AppManager.getInstance().getLastActivity(), bean).setOnDismissListener((bean1, position) -> {
|
||||
startListNotifyList.remove(bean);
|
||||
if (startListNotifyList.iterator().hasNext()) {
|
||||
notifyLiveFlot(mContext);
|
||||
|
||||
@@ -10,10 +10,12 @@ import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.HtmlConfig;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.RedPacketListBean;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
@@ -50,6 +52,27 @@ public class RouteUtil {
|
||||
public static final String PATH_BattlePassActivity = "/main/BattlePassActivity";
|
||||
public static final String PATH_SudGameActivity = "/live/SudGameActivity";
|
||||
public static final String PATH_COMMUNITY_Activity = "/main/MainHomeCommunityActivity";
|
||||
public static final String PATH_VIDEO_ACTIVITY = "/activity/VideoPlayActivity";
|
||||
public static final String PATH_COMMUNITY = "/main/CommunityDetailsActivity";
|
||||
public static final String PATH_USER_HOME = "/main/UserHomeActivity";
|
||||
public static final String PATH_VIDEO_PLAY = "/video/VideoPlayActivity";
|
||||
|
||||
public static void forwardUserHome(String uid) {
|
||||
ARouter.getInstance().build(PATH_USER_HOME)
|
||||
.withString(Constants.TO_UID, uid)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
public static void forwardCommunity(String id) {
|
||||
ARouter.getInstance().build(PATH_COMMUNITY)
|
||||
.withString(Constants.TO_COMMUNITY_ID, id)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
public static void forwardVideoActivity() {
|
||||
|
||||
}
|
||||
|
||||
public static final String PATH_ADDRESSBOOK = "/main/MsgAddressBookActivity";
|
||||
|
||||
|
||||
@@ -135,14 +158,17 @@ public class RouteUtil {
|
||||
* 跳转到个人主页
|
||||
*/
|
||||
public static void forwardMainUserHome(Context context, String toUid, boolean fromLiveRoom, String fromLiveUid, int intoIndex) {
|
||||
String url = HtmlConfig.PERSONAL + "?touid=" + toUid + "&isHomePage=1" + "&fromType=0";
|
||||
ARouter.getInstance().build(PATH_USER_HOME)
|
||||
.withString(Constants.TO_UID, toUid)
|
||||
.navigation();
|
||||
/* String url = HtmlConfig.PERSONAL + "?touid=" + toUid + "&isHomePage=1" + "&fromType=0";
|
||||
if (!"".equals(Constants.chatActionUrl)) {
|
||||
url = Constants.chatActionUrl;
|
||||
}
|
||||
Constants.myUrl = url + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&t=" + System.currentTimeMillis() + "&isZh=" + ((IMLoginManager.get(context).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
|
||||
ARouter.getInstance().build(PATH_MYWEBVIEWACTIVTITY)
|
||||
.withString(Constants.URL, url)
|
||||
.navigation();
|
||||
.navigation();*/
|
||||
}
|
||||
|
||||
|
||||
@@ -375,4 +401,11 @@ public class RouteUtil {
|
||||
public static void forwardActivity(String path) {
|
||||
ARouter.getInstance().build(path).navigation();
|
||||
}
|
||||
|
||||
public static void forwardVideoPlayActivity(ActiveBean bean) {
|
||||
ARouter.getInstance().build(PATH_VIDEO_PLAY)
|
||||
.withParcelable("ActiveBean", bean)
|
||||
.withString(Constants.VIDEO_KEY, Constants.VIDEO_SINGLE)
|
||||
.navigation();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,4 +160,16 @@ public class StringUtil {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取随机文件名
|
||||
*/
|
||||
public static String generateFileName() {
|
||||
return contact("android_",
|
||||
CommonAppConfig.getInstance().getUid(),
|
||||
"_",
|
||||
DateFormatUtil.getVideoCurTimeString(),
|
||||
String.valueOf(sRandom.nextInt(9999)));
|
||||
}
|
||||
}
|
||||
|
||||
BIN
common/src/main/res/drawable-xhdpi/rc_ic_bubble_right.9.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
8
common/src/main/res/drawable/bg_live_1.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?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>
|
||||
8
common/src/main/res/drawable/bg_user_home_gift.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?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>
|
||||
8
common/src/main/res/drawable/bg_user_home_img.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?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>
|
||||
10
common/src/main/res/drawable/bg_user_stauts.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?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>
|
||||
11
common/src/main/res/drawable/bg_video_flow_tag.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?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>
|
||||
@@ -28,12 +28,29 @@
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="68dp"
|
||||
android:layout_height="80dp">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="68dp"
|
||||
android:layout_height="68dp"
|
||||
android:src="@mipmap/icon_data_empty"
|
||||
app:riv_corner_radius="20dp" />
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:padding="1dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<pl.droidsonroids.gif.GifImageView
|
||||
android:id="@+id/liveStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:src="@mipmap/icon_liveing"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
@@ -81,7 +98,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="关注"
|
||||
android:text="@string/follow"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -105,18 +122,19 @@
|
||||
android:layout_marginTop="15dp"
|
||||
app:ngl_corner_radius="5dp"
|
||||
app:ngl_divider_width="6dp"
|
||||
app:ngl_space="30dp" />
|
||||
app:ngl_space="50dp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/videoLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="400dp"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/videoImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="400dp" />
|
||||
android:layout_height="200dp"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
@@ -148,6 +166,7 @@
|
||||
android:textSize="12dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/share"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@mipmap/icon_share_new" />
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="请输入200字以内的文字"
|
||||
android:text="@string/_200"
|
||||
android:textColor="#333333" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -50,7 +50,7 @@
|
||||
android:layout_marginBottom="15dp"
|
||||
android:background="@color/white"
|
||||
android:gravity="start"
|
||||
android:hint="写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么..."
|
||||
android:hint="@string/video_say_something"
|
||||
android:maxEms="200"
|
||||
android:maxLength="200"
|
||||
android:textSize="14dp" />
|
||||
@@ -70,7 +70,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="visible">
|
||||
android:visibility="gone">
|
||||
|
||||
<VideoView
|
||||
android:id="@+id/videoView"
|
||||
@@ -112,7 +112,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="图文"
|
||||
android:text="@string/pricture"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14dp" />
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="视频"
|
||||
android:text="@string/video"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14dp" />
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:text="选择话题"
|
||||
android:text="@string/choose_topic"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -218,7 +218,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:text="选择时间"
|
||||
android:text="@string/send_active_time"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -229,7 +229,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_weight="1"
|
||||
android:text="立即发表"
|
||||
android:text="@string/now_send"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12dp" />
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?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"
|
||||
android:id="@+id/itemLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/transparent"
|
||||
@@ -67,19 +68,20 @@
|
||||
android:layout_marginTop="15dp"
|
||||
app:ngl_corner_radius="5dp"
|
||||
app:ngl_divider_width="6dp"
|
||||
app:ngl_space="30dp" />
|
||||
app:ngl_space="90dp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/videoLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="400dp"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_marginLeft="50dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/videoImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="400dp" />
|
||||
android:layout_height="200dp"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.yunbao.common.views.MyScrollview xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@mipmap/main_bg"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.yunbao.common.views.MyScrollview
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
@@ -27,6 +32,7 @@
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/topImgLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="380dp"
|
||||
android:background="@color/gray1">
|
||||
@@ -35,17 +41,45 @@
|
||||
android:id="@+id/banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/temp" />
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="35dp"
|
||||
android:gravity="bottom"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/imgsRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="35dp"
|
||||
android:layout_weight="1"
|
||||
android:paddingStart="10dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imgUp"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@mipmap/icon_img_up"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imgLabel"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="80dp"
|
||||
android:src="@mipmap/icon_img_up_label"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -62,13 +96,29 @@
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="90dp">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:padding="1dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/temp"
|
||||
app:riv_corner_radius="20dp" />
|
||||
app:riv_oval="true" />
|
||||
|
||||
<pl.droidsonroids.gif.GifImageView
|
||||
android:id="@+id/liveStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:src="@mipmap/icon_liveing"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
@@ -119,11 +169,10 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="粉丝"
|
||||
android:text="@string/fans"
|
||||
android:textColor="#777777"
|
||||
android:textSize="12dp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -145,25 +194,25 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="获赞"
|
||||
android:text="@string/praise"
|
||||
android:textColor="#777777"
|
||||
android:textSize="12dp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/followLayout"
|
||||
android:layout_width="80dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:background="@drawable/bg_main_com_type"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/followIcon"
|
||||
@@ -176,7 +225,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="关注"
|
||||
android:text="@string/focus_on"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -206,7 +255,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="在线"
|
||||
android:text="@string/activity_msg_chat_top_status_online"
|
||||
android:textColor="#777777"
|
||||
android:textSize="10dp" />
|
||||
|
||||
@@ -223,7 +272,7 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
@@ -233,58 +282,15 @@
|
||||
android:layout_height="20dp"
|
||||
android:src="@mipmap/icon_wumen" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/authorLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/authorlIcon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/author"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Lv 42"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/levelLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone">
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="20dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/levelIcon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="27dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Lv 42"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="20dp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/userPresidentLayout"
|
||||
@@ -305,7 +311,7 @@
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="27dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="工会"
|
||||
android:text="@string/trade_union"
|
||||
android:textColor="#F65BBB"
|
||||
android:textSize="12dp" />
|
||||
|
||||
@@ -316,7 +322,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone">
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
@@ -328,7 +334,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="真人认证"
|
||||
android:text="@string/real_person"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12dp" />
|
||||
|
||||
@@ -365,13 +371,13 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:gravity="center"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="主播粉絲團"
|
||||
android:text="@string/user_home_anchor"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -380,7 +386,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="粉絲團名稱"
|
||||
android:text="@string/fan_group_name"
|
||||
android:textColor="#777777"
|
||||
android:textSize="14dp" />
|
||||
|
||||
@@ -403,10 +409,11 @@
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/fansImg1"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true" />
|
||||
android:layout_centerVertical="true"
|
||||
app:riv_oval="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -421,10 +428,11 @@
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/fansImg2"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true" />
|
||||
android:layout_centerVertical="true"
|
||||
app:riv_oval="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -439,10 +447,11 @@
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/fansImg3"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true" />
|
||||
android:layout_centerVertical="true"
|
||||
app:riv_oval="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -475,7 +484,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="主播守護團"
|
||||
android:text="@string/fan_group_name"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -488,23 +497,63 @@
|
||||
android:gravity="center_vertical|right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/img_no1" />
|
||||
|
||||
<ImageView
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/guardImg1"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
app:riv_oval="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:src="@mipmap/img_no2" />
|
||||
android:layout_height="50dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/img_no2" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/guardImg2"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
app:riv_oval="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:src="@mipmap/img_no3" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/guardImg3"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
app:riv_oval="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
@@ -520,11 +569,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/bg_user_home_04"
|
||||
android:background="@drawable/bg_user_home_gift"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
@@ -535,12 +583,13 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="礼物墙"
|
||||
android:text="@string/gift_wall"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/giftCount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
@@ -556,18 +605,21 @@
|
||||
android:gravity="center_vertical|right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp" />
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/giftImg1"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/giftImg2"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginLeft="5dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/giftImg3"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginLeft="5dp" />
|
||||
|
||||
<ImageView
|
||||
@@ -599,7 +651,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="榮譽墻"
|
||||
android:text="@string/wall_honor"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -612,20 +664,22 @@
|
||||
android:gravity="center_vertical|right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp" />
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/honorImg1"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/honorImg2"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginLeft="5dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:src="@mipmap/img_honor_default" />
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/honorImg3"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginLeft="5dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="12dp"
|
||||
@@ -648,7 +702,7 @@
|
||||
android:id="@+id/moreText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="查看更多"
|
||||
android:text="@string/see_more"
|
||||
android:textColor="#FF4874"
|
||||
android:textSize="13dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -665,7 +719,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
@@ -689,7 +742,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="个人动态"
|
||||
android:text="@string/commen_user_active"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -710,15 +763,18 @@
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</com.yunbao.common.views.MyScrollview>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/topLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:clickable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="40dp"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingRight="20dp">
|
||||
|
||||
<ImageView
|
||||
@@ -728,15 +784,16 @@
|
||||
android:src="@mipmap/icon_left" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/topName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="用户名称"
|
||||
android:text=""
|
||||
android:textColor="#333333"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="invisible" />
|
||||
android:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/setting"
|
||||
@@ -746,5 +803,33 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottomEditLayout"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:background="@drawable/bg_main_com_type"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@mipmap/icon_user_home_edit_new" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:text="@string/edit_profile"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</com.yunbao.common.views.MyScrollview>
|
||||
@@ -6,9 +6,8 @@
|
||||
<TextView
|
||||
android:id="@+id/tv_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_height="26dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/bg_flow_tag"
|
||||
android:paddingStart="15dp"
|
||||
@@ -16,6 +15,7 @@
|
||||
android:paddingEnd="15dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="标签"
|
||||
android:textColor="@color/black2" />
|
||||
android:textColor="@color/black2"
|
||||
android:textSize="11dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
21
common/src/main/res/layout/adapter_video_tag.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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>
|
||||
214
common/src/main/res/layout/item_comment_video_view.xml
Normal file
@@ -0,0 +1,214 @@
|
||||
<?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:background="@drawable/bg_item_comment"
|
||||
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>
|
||||
@@ -83,7 +83,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:padding="10dp"
|
||||
android:text="回复"
|
||||
android:text="@string/dialog_message_chat_notify_btn"
|
||||
android:textColor="#777777"
|
||||
android:textSize="11dp" />
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:padding="10dp"
|
||||
android:text="举报"
|
||||
android:text="@string/chat_report"
|
||||
android:textColor="#333333"
|
||||
android:textSize="11dp"
|
||||
android:textStyle="bold" />
|
||||
@@ -163,7 +163,7 @@
|
||||
android:text="删除"
|
||||
android:textColor="#777777"
|
||||
android:textSize="11dp"
|
||||
android:visibility="visible" />
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/report1"
|
||||
@@ -171,7 +171,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:padding="10dp"
|
||||
android:text="举报"
|
||||
android:text="@string/chat_report"
|
||||
android:textColor="#333333"
|
||||
android:textSize="11dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout 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:id="@+id/itemLayout"
|
||||
android:layout_width="65dp"
|
||||
android:layout_width="63dp"
|
||||
android:layout_height="70dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
@@ -13,6 +12,8 @@
|
||||
android:id="@+id/avatar01"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/icon_data_empty"
|
||||
app:riv_corner_radius="15dp" />
|
||||
@@ -21,8 +22,21 @@
|
||||
android:id="@+id/avatar02"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:padding="1dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/icon_data_empty"
|
||||
android:background="@drawable/bg_user_home_img"
|
||||
android:visibility="gone"
|
||||
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>
|
||||
@@ -10,24 +10,25 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/copy_linear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@mipmap/icon_message_copy"
|
||||
|
||||
android:drawablePadding="5dp"
|
||||
android:text="@string/copy"
|
||||
android:textColor="@color/white"
|
||||
@@ -38,18 +39,17 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/withdraw_linear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@mipmap/icon_message_withdraw"
|
||||
android:drawablePadding="5dp"
|
||||
android:text="@string/withdraw"
|
||||
android:text="@string/delete"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
@@ -58,12 +58,12 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/quote_linear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="5dp">
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<include
|
||||
android:id="@+id/age"
|
||||
layout="@layout/view_msg_chat_top_tag"
|
||||
android:layout_width="70dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tag_list_layout"
|
||||
|
||||
@@ -57,16 +57,15 @@
|
||||
<TextView
|
||||
android:id="@+id/submit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/main_community_send"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingTop="10dp"
|
||||
android:gravity="center"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="发布"
|
||||
android:text="@string/send"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
BIN
common/src/main/res/mipmap-b+en+us/icon_img_up_label.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
common/src/main/res/mipmap-b+en+us/icon_liveing.gif
Normal file
|
After Width: | Height: | Size: 320 KiB |
BIN
common/src/main/res/mipmap-mdpi/bg_avatar.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 2.0 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_gray.png
Normal file
|
After Width: | Height: | Size: 346 B |
BIN
common/src/main/res/mipmap-mdpi/icon_img_del.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_img_up.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_img_up_label.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_liveing.gif
Normal file
|
After Width: | Height: | Size: 321 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_user_home_edit_new.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
common/src/main/res/mipmap-mdpi/icon_video_more.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
common/src/main/res/mipmap-mdpi/liveing.gif
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 1005 KiB |
@@ -25,7 +25,7 @@
|
||||
<string name="refresh_footer_nothing">No more data</string>
|
||||
<string name="black">Pull black</string>
|
||||
<string name="black_ing">Relieving blackout</string>
|
||||
<string name="chat_remarks">Remarks</string>
|
||||
<string name="chat_remarks">Modify remarks</string>
|
||||
<string name="chat_report">Report</string>
|
||||
<string name="bonus_sign">Sign in immediately</string>
|
||||
<string name="bonus_sign_1">Continuously signed in</string>
|
||||
@@ -146,7 +146,7 @@
|
||||
<string name="live_blowkiss_time">Free for a limited time</string>
|
||||
<string name="live_blowkiss_follow">Follow and reply</string>
|
||||
|
||||
<string name="following">Followed</string>
|
||||
<string name="following">Following</string>
|
||||
<string name="follow_my_follow">My concern</string>
|
||||
<string name="my_black">My Black List</string>
|
||||
<string name="follow_ta_follow">TA\'s attention</string>
|
||||
@@ -255,10 +255,10 @@
|
||||
<string name="login_auth_success">Login successfully</string>
|
||||
<string name="login_auth_failure">privilege grant failed</string>
|
||||
<string name="login_auth_cancle">Authorization cancelled</string>
|
||||
<string name="live">Live broadcast</string>
|
||||
<string name="live">Live</string>
|
||||
<string name="login_tip_4">Log in</string>
|
||||
<string name="shopmall">shopmall</string>
|
||||
<string name="recomment">Recommend</string>
|
||||
<string name="recomment">Hot</string>
|
||||
<string name="main_type_find">Find</string>
|
||||
<string name="cust_server">CSD</string>
|
||||
<string name="live_anchor">Anchor</string>
|
||||
@@ -426,7 +426,7 @@
|
||||
<string name="live_pk_time_2">Penalty time</string>
|
||||
<string name="live_no_data_6">No video</string>
|
||||
<string name="live_no_data_7">Let\'s release our own video</string>
|
||||
<string name="main_home">home page</string>
|
||||
<string name="main_home">Home</string>
|
||||
<string name="main_near">nearby</string>
|
||||
<string name="main_list">Ranking</string>
|
||||
<string name="main_me">My</string>
|
||||
@@ -778,9 +778,11 @@
|
||||
<string name="now_noble_time">Expiration time: </string>
|
||||
|
||||
<string name="black_succer">Successfully joined the blacklist</string>
|
||||
<string name="black_add">Add to blacklist</string>
|
||||
<string name="black_error">Failed to join blacklist</string>
|
||||
|
||||
<string name="black_succer_more">Blacklist removed successfully</string>
|
||||
<string name="black_succer_more">Succeeded in removing the blacklist</string>
|
||||
<string name="black_more">Remove blacklist</string>
|
||||
<string name="black_error_more">Failed to remove blacklist</string>
|
||||
|
||||
<string name="reply">Reply</string>
|
||||
@@ -965,7 +967,7 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="already_collected">Already collected</string>
|
||||
<string name="image_quality_selection">Image quality selection</string>
|
||||
<string name="more_settings">More Settings</string>
|
||||
<string name="moer">view more</string>
|
||||
<string name="moer">see more</string>
|
||||
<string name="gift_way">The gift is on the way...</string>
|
||||
<string name="start_pk">start pk</string>
|
||||
<string name="number_of_remaining_times">Remaining count :%s</string>
|
||||
@@ -1455,11 +1457,14 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="back_community_sure">Sure</string>
|
||||
<string name="activity_msg_chat_input_hint">Say something</string>
|
||||
|
||||
<string name="not_data_message_chat_list">暫無新消息哦~</string>
|
||||
<string name="not_data_message_chat_list_search">暫無搜索結果,換個詞試試吧~~</string>
|
||||
<string name="not_data_message_address_book_list">當前列表為空~</string>
|
||||
<string name="not_data_message_address_book_list_search">暫無搜索結果,換個詞試試吧~</string>
|
||||
<string name="not_data_message_chat_list">No new news yet~</string>
|
||||
<string name="not_data_message_chat_list_search">There are no search results yet. Try using another word~</string>
|
||||
<string name="not_data_message_address_book_list">The current list is empty ~</string>
|
||||
<string name="not_data_message_address_book_list_search">There are no search results yet. Try using another word~</string>
|
||||
<string name="dialog_message_say_hi_age">Age:</string>
|
||||
<string name="dialog_message_say_hi_btn">Say Hi</string>
|
||||
<string name="dialog_message_chat_notify_btn">Reply</string>
|
||||
<string name="activity_msg_chat_top_status_online">Online</string>
|
||||
<string name="activity_msg_chat_top_status_offline">Offline</string>
|
||||
<string name="commen_user_active">Personal updates</string>
|
||||
</resources>
|
||||
|
||||
30
common/src/main/res/values-en-rUS/strings.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="real_person">Real person</string>
|
||||
<string name="trade_union">tradeUnion</string>
|
||||
<string name="set_back">Blocked and cannot be viewed</string>
|
||||
<string name="cancel_back">Cancel blacklist</string>
|
||||
<string name="user_home_img_del_dialog">Are you sure you want to delete the picture?</string>
|
||||
<string name="upload_success">Upload successful</string>
|
||||
<string name="upload_failed">upload failed</string>
|
||||
<string name="_9">Add up to 9 pictures</string>
|
||||
<string name="not_interested">not interested</string>
|
||||
<string name="person_like">people liked it</string>
|
||||
<string name="fan_group_name">Fan group name</string>
|
||||
<string name="user_home_anchor">Anchor fan group</string>
|
||||
<string name="main_active_type_01">Beauty</string>
|
||||
<string name="main_active_type_02">Rookie</string>
|
||||
<string name="main_active_type_03">Figure</string>
|
||||
<string name="main_active_type_04">Live</string>
|
||||
<string name="main_active_type_05">Life</string>
|
||||
<string name="send_active_time">Selection period</string>
|
||||
<string name="now_send">Now</string>
|
||||
<string name="choose_topic">Select topic</string>
|
||||
<string name="pricture">picture</string>
|
||||
<string name="_200">Please enter text within 200 words</string>
|
||||
<string name="time_hour">hour</string>
|
||||
<string name="time_minute">minute</string>
|
||||
<string name="focus_on">Focus on</string>
|
||||
<string name="see_more">See more</string>
|
||||
<string name="close">close</string>
|
||||
</resources>
|
||||
@@ -820,8 +820,10 @@
|
||||
<string name="now_noble">當前貴族: </string>
|
||||
<string name="now_noble_time">到期時間: </string>
|
||||
<string name="black_succer">已加入黑名单</string>
|
||||
<string name="black_add">加入黑名單</string>
|
||||
<string name="black_error">加入黑名单失败</string>
|
||||
<string name="black_succer_more">移除黑名单成功</string>
|
||||
<string name="black_more">移除黑名單</string>
|
||||
<string name="black_error_more">移除黑名单失败</string>
|
||||
|
||||
<string name="reply">回復</string>
|
||||
@@ -1460,4 +1462,34 @@
|
||||
<string name="dialog_message_say_hi_age">年齡:</string>
|
||||
<string name="dialog_message_say_hi_btn">打招呼</string>
|
||||
<string name="dialog_message_chat_notify_btn">回復</string>
|
||||
<string name="commen_user_active">個人動態</string>
|
||||
<string name="real_person">真人認證</string>
|
||||
<string name="trade_union">工会</string>
|
||||
<string name="activity_msg_chat_top_status_online">在線</string>
|
||||
<string name="activity_msg_chat_top_status_offline">離線</string>
|
||||
<string name="set_back">已拉黑,无法查看</string>
|
||||
<string name="cancel_back">取消黑名单</string>
|
||||
<string name="user_home_img_del_dialog">確定刪除圖片?</string>
|
||||
<string name="upload_success">上传成功</string>
|
||||
<string name="upload_failed">删除成功</string>
|
||||
<string name="_9">最多添加9張圖片</string>
|
||||
<string name="not_interested">不感興趣</string>
|
||||
<string name="person_like">人觉得很赞</string>
|
||||
<string name="fan_group_name">主播守護團</string>
|
||||
<string name="user_home_anchor">主播粉絲團</string>
|
||||
<string name="main_active_type_01">美圖</string>
|
||||
<string name="main_active_type_02">新秀</string>
|
||||
<string name="main_active_type_03">身材</string>
|
||||
<string name="main_active_type_04">直播</string>
|
||||
<string name="main_active_type_05">生活</string>
|
||||
<string name="send_active_time">選擇時間</string>
|
||||
<string name="now_send">立即發表</string>
|
||||
<string name="choose_topic">選擇話題</string>
|
||||
<string name="pricture">圖文</string>
|
||||
<string name="_200">请输入200字以内的文字</string>
|
||||
<string name="time_hour">時</string>
|
||||
<string name="time_minute">分</string>
|
||||
<string name="focus_on">關注</string>
|
||||
<string name="see_more">查看更多</string>
|
||||
<string name="close">收起</string>
|
||||
</resources>
|
||||
|
||||
@@ -820,8 +820,10 @@
|
||||
<string name="now_noble">當前貴族: </string>
|
||||
<string name="now_noble_time">到期時間: </string>
|
||||
<string name="black_succer">已加入黑名单</string>
|
||||
<string name="black_add">加入黑名單</string>
|
||||
<string name="black_error">加入黑名单失败</string>
|
||||
<string name="black_succer_more">移除黑名单成功</string>
|
||||
<string name="black_more">移除黑名單</string>
|
||||
<string name="black_error_more">移除黑名单失败</string>
|
||||
|
||||
<string name="reply">回復</string>
|
||||
@@ -1459,5 +1461,35 @@
|
||||
<string name="dialog_message_say_hi_age">年齡:</string>
|
||||
<string name="dialog_message_say_hi_btn">打招呼</string>
|
||||
<string name="dialog_message_chat_notify_btn">回復</string>
|
||||
<string name="commen_user_active">個人動態</string>
|
||||
<string name="real_person">真人認證</string>
|
||||
<string name="trade_union">工会</string>
|
||||
|
||||
<string name="activity_msg_chat_top_status_online">在線</string>
|
||||
<string name="activity_msg_chat_top_status_offline">離線</string>
|
||||
<string name="set_back">已拉黑,无法查看</string>
|
||||
<string name="cancel_back">取消黑名单</string>
|
||||
<string name="user_home_img_del_dialog">確定刪除圖片?</string>
|
||||
<string name="upload_success">上传成功</string>
|
||||
<string name="upload_failed">删除成功</string>
|
||||
<string name="_9">最多添加9張圖片</string>
|
||||
<string name="not_interested">不感興趣</string>
|
||||
<string name="person_like">人觉得很赞</string>
|
||||
<string name="fan_group_name">主播守護團</string>
|
||||
<string name="user_home_anchor">主播粉絲團</string>
|
||||
<string name="main_active_type_01">美圖</string>
|
||||
<string name="main_active_type_02">新秀</string>
|
||||
<string name="main_active_type_03">身材</string>
|
||||
<string name="main_active_type_04">直播</string>
|
||||
<string name="main_active_type_05">生活</string>
|
||||
<string name="send_active_time">選擇時間</string>
|
||||
<string name="now_send">立即發表</string>
|
||||
<string name="choose_topic">選擇話題</string>
|
||||
<string name="pricture">圖文</string>
|
||||
<string name="_200">请输入200字以内的文字</string>
|
||||
<string name="time_hour">時</string>
|
||||
<string name="time_minute">分</string>
|
||||
<string name="focus_on">關注</string>
|
||||
<string name="see_more">查看更多</string>
|
||||
<string name="close">收起</string>
|
||||
</resources>
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
<string name="edit_profile_sign_hint">留下點什麼吧~</string>
|
||||
<string name="edit_profile_name_hint">請輸入昵稱~</string>
|
||||
<string name="edit_profile_remarks">請輸入備註~</string>
|
||||
<string name="edit_profile_remarks_tips">注:新增備註後,僅本人可見且只有在消息中心內生效</string>
|
||||
<string name="edit_profile_sign_max">最多可輸入20個字</string>
|
||||
<string name="edit_profile_name_max">最多可輸入8個字</string>
|
||||
<string name="edit_profile_name_empty">請輸入昵稱</string>
|
||||
@@ -819,8 +820,10 @@
|
||||
<string name="now_noble">當前貴族: </string>
|
||||
<string name="now_noble_time">到期時間: </string>
|
||||
<string name="black_succer">已加入黑名單</string>
|
||||
<string name="black_add">加入黑名單</string>
|
||||
<string name="black_error">加入黑名單失敗</string>
|
||||
<string name="black_succer_more">移除黑名單成功</string>
|
||||
<string name="black_more">移除黑名單</string>
|
||||
<string name="black_error_more">移除黑名單失敗</string>
|
||||
|
||||
<string name="reply">回復</string>
|
||||
@@ -1456,4 +1459,35 @@
|
||||
<string name="dialog_message_say_hi_age">年齡:</string>
|
||||
<string name="dialog_message_say_hi_btn">打招呼</string>
|
||||
<string name="dialog_message_chat_notify_btn">回復</string>
|
||||
<string name="commen_user_active">個人動態</string>
|
||||
<string name="real_person">真人認證</string>
|
||||
<string name="trade_union">工会</string>
|
||||
<string name="activity_msg_chat_top_status_online">在線</string>
|
||||
<string name="activity_msg_chat_top_status_offline">離線</string>
|
||||
<string name="praise">獲贊</string>
|
||||
<string name="set_back">已拉黑,无法查看</string>
|
||||
<string name="cancel_back">取消黑名單</string>
|
||||
<string name="user_home_img_del_dialog">確定刪除圖片?</string>
|
||||
<string name="upload_success">上传成功</string>
|
||||
<string name="upload_failed">删除成功</string>
|
||||
<string name="_9">最多添加9張圖片</string>
|
||||
<string name="not_interested">不感興趣</string>
|
||||
<string name="person_like">人觉得很赞</string>
|
||||
<string name="fan_group_name">主播守護團</string>
|
||||
<string name="user_home_anchor">主播粉絲團</string>
|
||||
<string name="main_active_type_01">美圖</string>
|
||||
<string name="main_active_type_02">新秀</string>
|
||||
<string name="main_active_type_03">身材</string>
|
||||
<string name="main_active_type_04">直播</string>
|
||||
<string name="main_active_type_05">生活</string>
|
||||
<string name="send_active_time">選擇時間</string>
|
||||
<string name="now_send">立即發表</string>
|
||||
<string name="choose_topic">選擇話題</string>
|
||||
<string name="pricture">圖文</string>
|
||||
<string name="_200">请输入200字以内的文字</string>
|
||||
<string name="time_hour">時</string>
|
||||
<string name="time_minute">分</string>
|
||||
<string name="focus_on">關注</string>
|
||||
<string name="see_more">查看更多</string>
|
||||
<string name="close">收起</string>
|
||||
</resources>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<string name="refresh_footer_nothing">No more data</string>
|
||||
<string name="black">Pull black</string>
|
||||
<string name="black_ing">Relieving blackout</string>
|
||||
<string name="chat_remarks">Remarks</string>
|
||||
<string name="chat_remarks">Modify remarks</string>
|
||||
<string name="chat_report">Report</string>
|
||||
<string name="bonus_sign">Sign in immediately</string>
|
||||
<string name="bonus_sign_1">Continuously signed in</string>
|
||||
@@ -63,6 +63,7 @@
|
||||
<string name="edit_profile_update_nickname">ModifyName</string>
|
||||
<string name="edit_profile_update_remarks">Modify remarks</string>
|
||||
<string name="edit_profile_remarks">Please enter comments~</string>
|
||||
<string name="edit_profile_remarks_tips">Note: New remarks are visible only to the creator and effective only within the message center.</string>
|
||||
<string name="edit_profile_update_sign">Signature</string>
|
||||
<string name="edit_profile_sign">Bio</string>
|
||||
<string name="bind_phone">Binding phone</string>
|
||||
@@ -255,10 +256,10 @@
|
||||
<string name="login_auth_success">Login successfully</string>
|
||||
<string name="login_auth_failure">privilege grant failed</string>
|
||||
<string name="login_auth_cancle">Authorization cancelled</string>
|
||||
<string name="live">Live broadcast</string>
|
||||
<string name="live">Live</string>
|
||||
<string name="login_tip_4">Log in</string>
|
||||
<string name="shopmall">shopmall</string>
|
||||
<string name="recomment">Recommend</string>
|
||||
<string name="recomment">Hot</string>
|
||||
<string name="main_type_find">Find</string>
|
||||
<string name="cust_server">CSD</string>
|
||||
<string name="live_anchor">Anchor</string>
|
||||
@@ -426,7 +427,7 @@
|
||||
<string name="live_pk_time_2">Penalty time</string>
|
||||
<string name="live_no_data_6">No video</string>
|
||||
<string name="live_no_data_7">Let\'s release our own video</string>
|
||||
<string name="main_home">home page</string>
|
||||
<string name="main_home">Home</string>
|
||||
<string name="main_near">nearby</string>
|
||||
<string name="main_list">Ranking</string>
|
||||
<string name="main_me">My</string>
|
||||
@@ -669,7 +670,7 @@
|
||||
<string name="receive_awards">ReceiveAwards</string>
|
||||
<string name="one_free">One free gift privilege!</string>
|
||||
|
||||
<string name="send">Send</string>
|
||||
<string name="send">release</string>
|
||||
<string name="sorry">I am sorry</string>
|
||||
<string name="video">video</string>
|
||||
<string name="FILE_PROVIDER">myname.pdlive.shayu.fileprovider</string>
|
||||
@@ -776,11 +777,12 @@
|
||||
|
||||
<string name="now_noble">Current VIP : </string>
|
||||
<string name="now_noble_time">Expiration time: </string>
|
||||
|
||||
<string name="black_add">Add to blacklist</string>
|
||||
<string name="black_succer">Successfully joined the blacklist</string>
|
||||
<string name="black_error">Failed to join blacklist</string>
|
||||
|
||||
<string name="black_succer_more">Blacklist removed successfully</string>
|
||||
<string name="black_succer_more">Succeeded in removing the blacklist</string>
|
||||
<string name="black_more">Remove blacklist</string>
|
||||
<string name="black_error_more">Failed to remove blacklist</string>
|
||||
|
||||
<string name="reply">Reply</string>
|
||||
@@ -1459,13 +1461,13 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="back_community_sure">Sure</string>
|
||||
<string name="activity_msg_chat_input_hint">Say something</string>
|
||||
|
||||
<string name="not_data_message_chat_list">暫無新消息哦~</string>
|
||||
<string name="not_data_message_chat_list_search">暫無搜索結果,換個詞試試吧~~</string>
|
||||
<string name="not_data_message_address_book_list">當前列表為空~</string>
|
||||
<string name="not_data_message_address_book_list_search">暫無搜索結果,換個詞試試吧~</string>
|
||||
<string name="dialog_message_say_hi_age">年齡:</string>
|
||||
<string name="dialog_message_say_hi_btn">打招呼</string>
|
||||
<string name="dialog_message_chat_notify_btn">回復</string>
|
||||
<string name="not_data_message_chat_list">No new news yet~</string>
|
||||
<string name="not_data_message_chat_list_search">There are no search results yet. Try using another word~</string>
|
||||
<string name="not_data_message_address_book_list">The current list is empty ~</string>
|
||||
<string name="not_data_message_address_book_list_search">There are no search results yet. Try using another word~</string>
|
||||
<string name="dialog_message_say_hi_age">Age:</string>
|
||||
<string name="dialog_message_say_hi_btn">Say Hi</string>
|
||||
<string name="dialog_message_chat_notify_btn">Reply</string>
|
||||
<string name="save_image_album">保存到本地相册</string>
|
||||
<string name="save_success">保存成功</string>
|
||||
<string name="done">完成</string>
|
||||
@@ -1479,9 +1481,37 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="permission_location">使用定位</string>
|
||||
<string name="permission_read_phone_state">读取手机信息</string>
|
||||
<string name="permission_storage">文件读写</string>
|
||||
|
||||
|
||||
|
||||
<string name="activity_msg_chat_top_status_online">Online</string>
|
||||
<string name="activity_msg_chat_top_status_offline">Offline</string>
|
||||
<string name="commen_user_active">个人动态</string>
|
||||
<string name="real_person">Real person</string>
|
||||
<string name="trade_union">工会</string>
|
||||
<string name="praise">Liked</string>
|
||||
<string name="set_back">已拉黑,无法查看</string>
|
||||
<string name="cancel_back">取消黑名单</string>
|
||||
<string name="user_home_img_del_dialog">確定刪除圖片?</string>
|
||||
<string name="upload_success">上传成功</string>
|
||||
<string name="upload_failed">删除成功</string>
|
||||
<string name="_9">最多添加9張圖片</string>
|
||||
<string name="not_interested">不感興趣</string>
|
||||
<string name="person_like">人觉得很赞</string>
|
||||
<string name="fan_group_name">主播守護團</string>
|
||||
<string name="user_home_anchor">主播粉絲團</string>
|
||||
<string name="main_active_type_01">美圖</string>
|
||||
<string name="main_active_type_02">新秀</string>
|
||||
<string name="main_active_type_03">身材</string>
|
||||
<string name="main_active_type_04">直播</string>
|
||||
<string name="main_active_type_05">生活</string>
|
||||
<string name="send_active_time">選擇時間</string>
|
||||
<string name="now_send">立即發表</string>
|
||||
<string name="choose_topic">選擇話題</string>
|
||||
<string name="pricture">圖文</string>
|
||||
<string name="_200">请输入200字以内的文字</string>
|
||||
<string name="time_hour">時</string>
|
||||
<string name="time_minute">分</string>
|
||||
<string name="focus_on">關注</string>
|
||||
<string name="see_more">查看更多</string>
|
||||
<string name="close">收起</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -20,7 +20,6 @@ public class Adapter extends RecyclerView.Adapter<VH> {
|
||||
context = ctx;
|
||||
}
|
||||
|
||||
|
||||
public void setSelectedCountries(ArrayList<Country> selectedCountries) {
|
||||
this.selectedCountries = selectedCountries;
|
||||
notifyDataSetChanged();
|
||||
|
||||
@@ -1470,6 +1470,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
.setAnchorId(event.getBean().getUid())
|
||||
.setAnchorName(event.getBean().getUserNiceName())
|
||||
.setAnchorAvatar(event.getBean().getAvatar())
|
||||
.setExtraData(event.getBean().getUid())
|
||||
.build()
|
||||
)
|
||||
.showDialog();
|
||||
|
||||
@@ -53,10 +53,10 @@ public class MenuPopuwWindow implements View.OnClickListener {
|
||||
public void onSuccess(RongIMClient.BlacklistStatus blacklistStatus) {
|
||||
if (blacklistStatus == RongIMClient.BlacklistStatus.IN_BLACK_LIST) {
|
||||
tvBlack.setTag("1");
|
||||
tvBlack.setText(R.string.black_ing);
|
||||
tvBlack.setText(R.string.black_more);
|
||||
} else {
|
||||
tvBlack.setTag(null);
|
||||
tvBlack.setText(R.string.black);
|
||||
tvBlack.setText(R.string.black_add);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class MenuPopuwWindow implements View.OnClickListener {
|
||||
* @return
|
||||
*/
|
||||
public void show(View view) {
|
||||
popupWindow = new PopupWindow(popupView, DpUtil.dp2px(97), ViewGroup.LayoutParams.WRAP_CONTENT, true);
|
||||
popupWindow = new PopupWindow(popupView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
|
||||
popupWindow.showAsDropDown(view);
|
||||
WindowManager.LayoutParams lp = mContext.getWindow().getAttributes();
|
||||
lp.alpha = 0.8f;
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@@ -9,14 +12,21 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.yunbao.common.message.content.MessageChatTipsContent;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.event.InputPanelViewHolderEvent;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import io.rong.common.RLog;
|
||||
import io.rong.imkit.R.string;
|
||||
import io.rong.imkit.conversation.MessageListAdapter;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imkit.utils.language.LangUtils;
|
||||
import io.rong.imkit.utils.language.RongConfigurationManager;
|
||||
import io.rong.imkit.widget.adapter.IViewProviderListener;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imlib.model.Message;
|
||||
@@ -26,6 +36,17 @@ import io.rong.imlib.model.MessageContent;
|
||||
* 会话页面更改已读未读
|
||||
*/
|
||||
public class PDLiveMessageListAdapter extends MessageListAdapter {
|
||||
private boolean isLeftLive = false;
|
||||
private boolean isRightLive = false;
|
||||
|
||||
public void setLeftLive(boolean leftLive) {
|
||||
isLeftLive = leftLive;
|
||||
}
|
||||
|
||||
public void setRightLive(boolean rightLive) {
|
||||
isRightLive = rightLive;
|
||||
}
|
||||
|
||||
public PDLiveMessageListAdapter(IViewProviderListener<UiMessage> listener) {
|
||||
super(listener);
|
||||
}
|
||||
@@ -71,6 +92,199 @@ public class PDLiveMessageListAdapter extends MessageListAdapter {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
TextView tv = holder.getView(R.id.rc_time);
|
||||
long sentTime = mDataList.get(position).getSentTime();
|
||||
boolean isSender = mDataList.get(position).getMessage().getMessageDirection().equals(Message.MessageDirection.SEND);
|
||||
tv.setText(getDateTimeString(sentTime, true, holder.getContext()));
|
||||
if (holder.getView(R.id.left_liveStatus) != null) {
|
||||
if (isLeftLive && !isSender) {
|
||||
holder.getView(R.id.left_liveStatus).setVisibility(View.VISIBLE);
|
||||
} else if (!isSender) {
|
||||
holder.getView(R.id.left_liveStatus).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
if (holder.getView(R.id.right_liveStatus)!=null) {
|
||||
if (isRightLive && isSender) {
|
||||
holder.getView(R.id.right_liveStatus).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
holder.getView(R.id.right_liveStatus).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static String getDateTimeString(long dateMillis, boolean showTime, Context context) {
|
||||
if (dateMillis <= 0L) {
|
||||
return "";
|
||||
} else {
|
||||
String formatDate = null;
|
||||
Date date = new Date(dateMillis);
|
||||
int type = judgeDate(date);
|
||||
long time = java.lang.System.currentTimeMillis();
|
||||
Calendar calendarCur = Calendar.getInstance();
|
||||
Calendar calendardate = Calendar.getInstance();
|
||||
calendardate.setTimeInMillis(dateMillis);
|
||||
calendarCur.setTimeInMillis(time);
|
||||
int month = calendardate.get(2);
|
||||
int year = calendardate.get(1);
|
||||
int weekInMonth = calendardate.get(4);
|
||||
int monthCur = calendarCur.get(2);
|
||||
int yearCur = calendarCur.get(1);
|
||||
int weekInMonthCur = calendarCur.get(4);
|
||||
switch (type) {
|
||||
case 6:
|
||||
formatDate = getTimeString(dateMillis, context);
|
||||
break;
|
||||
case 15:
|
||||
String formatString = context.getResources().getString(string.rc_date_yesterday);
|
||||
if (showTime) {
|
||||
formatDate = formatString + " " + getTimeString(dateMillis, context);
|
||||
} else {
|
||||
formatDate = formatString;
|
||||
}
|
||||
break;
|
||||
case 2014:
|
||||
if (year == yearCur) {
|
||||
if (month == monthCur && weekInMonth == weekInMonthCur) {
|
||||
formatDate = getWeekDay(context, calendardate.get(7));
|
||||
} else {
|
||||
formatDate = formatDate(date, "M/d");
|
||||
}
|
||||
} else {
|
||||
formatDate = formatDate(date, "yyyy/M/d");
|
||||
}
|
||||
|
||||
if (showTime) {
|
||||
formatDate = formatDate + " " + getTimeString(dateMillis, context);
|
||||
}
|
||||
}
|
||||
|
||||
return formatDate;
|
||||
}
|
||||
}
|
||||
|
||||
public static int judgeDate(Date date) {
|
||||
Calendar calendarToday = Calendar.getInstance();
|
||||
calendarToday.set(11, 0);
|
||||
calendarToday.set(12, 0);
|
||||
calendarToday.set(13, 0);
|
||||
calendarToday.set(14, 0);
|
||||
Calendar calendarYesterday = Calendar.getInstance();
|
||||
calendarYesterday.add(5, -1);
|
||||
calendarYesterday.set(11, 0);
|
||||
calendarYesterday.set(12, 0);
|
||||
calendarYesterday.set(13, 0);
|
||||
calendarYesterday.set(14, 0);
|
||||
Calendar calendarTomorrow = Calendar.getInstance();
|
||||
calendarTomorrow.add(5, 1);
|
||||
calendarTomorrow.set(11, 0);
|
||||
calendarTomorrow.set(12, 0);
|
||||
calendarTomorrow.set(13, 0);
|
||||
calendarTomorrow.set(14, 0);
|
||||
Calendar calendarTarget = Calendar.getInstance();
|
||||
calendarTarget.setTime(date);
|
||||
if (calendarTarget.before(calendarYesterday)) {
|
||||
return 2014;
|
||||
} else if (calendarTarget.before(calendarToday)) {
|
||||
return 15;
|
||||
} else {
|
||||
return calendarTarget.before(calendarTomorrow) ? 6 : 2014;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getWeekDay(Context context, int dayInWeek) {
|
||||
String weekDay = "";
|
||||
switch (dayInWeek) {
|
||||
case 1:
|
||||
weekDay = context.getResources().getString(string.rc_date_sunday);
|
||||
break;
|
||||
case 2:
|
||||
weekDay = context.getResources().getString(string.rc_date_monday);
|
||||
break;
|
||||
case 3:
|
||||
weekDay = context.getResources().getString(string.rc_date_tuesday);
|
||||
break;
|
||||
case 4:
|
||||
weekDay = context.getResources().getString(string.rc_date_wednesday);
|
||||
break;
|
||||
case 5:
|
||||
weekDay = context.getResources().getString(string.rc_date_thursday);
|
||||
break;
|
||||
case 6:
|
||||
weekDay = context.getResources().getString(string.rc_date_friday);
|
||||
break;
|
||||
case 7:
|
||||
weekDay = context.getResources().getString(string.rc_date_saturday);
|
||||
}
|
||||
|
||||
return weekDay;
|
||||
}
|
||||
|
||||
public static boolean isTime24Hour(Context context) {
|
||||
String timeFormat = Settings.System.getString(context.getContentResolver(), "time_12_24");
|
||||
return timeFormat != null && timeFormat.equals("24");
|
||||
}
|
||||
|
||||
private static String getTimeString(long dateMillis, Context context) {
|
||||
if (dateMillis <= 0L) {
|
||||
return "";
|
||||
} else {
|
||||
Date date = new Date(dateMillis);
|
||||
String formatTime;
|
||||
if (isTime24Hour(context) || true) {
|
||||
formatTime = formatDate(date, "HH:mm");
|
||||
} else {
|
||||
Calendar calendarTime = Calendar.getInstance();
|
||||
calendarTime.setTimeInMillis(dateMillis);
|
||||
int hour = calendarTime.get(10);
|
||||
if (calendarTime.get(9) == 0) {
|
||||
if (hour < 6) {
|
||||
if (hour == 0) {
|
||||
hour = 12;
|
||||
}
|
||||
|
||||
formatTime = context.getResources().getString(string.rc_date_morning);
|
||||
} else {
|
||||
formatTime = context.getResources().getString(string.rc_date_am);
|
||||
}
|
||||
} else if (hour == 0) {
|
||||
formatTime = context.getResources().getString(string.rc_date_noon);
|
||||
hour = 12;
|
||||
} else if (hour <= 5) {
|
||||
formatTime = context.getResources().getString(string.rc_date_pm);
|
||||
} else {
|
||||
formatTime = context.getResources().getString(string.rc_date_night);
|
||||
}
|
||||
|
||||
int minuteInt = calendarTime.get(12);
|
||||
String minuteStr = Integer.toString(minuteInt);
|
||||
if (minuteInt < 10) {
|
||||
minuteStr = "0" + minuteStr;
|
||||
}
|
||||
|
||||
String timeStr = hour + ":" + minuteStr;
|
||||
if (RongConfigurationManager.getInstance().getLanguageLocal(context) == LangUtils.RCLocale.LOCALE_CHINA) {
|
||||
formatTime = formatTime + " " + timeStr;
|
||||
} else {
|
||||
formatTime = timeStr + " " + formatTime;
|
||||
}
|
||||
}
|
||||
|
||||
return formatTime;
|
||||
}
|
||||
}
|
||||
|
||||
public static String formatDate(Date date, String fromat) {
|
||||
if (TextUtils.isEmpty(fromat)) {
|
||||
return "";
|
||||
} else {
|
||||
try {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(fromat);
|
||||
return sdf.format(date);
|
||||
} catch (IllegalArgumentException var3) {
|
||||
RLog.e("RLong", "the given pattern is invalid.");
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,15 @@ import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.yunbao.common.event.PDChatInputModeEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.live.dialog.PDLiveMessageListAdapter;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.conversation.ConversationFragment;
|
||||
import io.rong.imkit.conversation.MessageListAdapter;
|
||||
import io.rong.imkit.conversation.extension.InputMode;
|
||||
@@ -23,6 +28,16 @@ import io.rong.imkit.conversation.extension.RongExtensionViewModel;
|
||||
* 聊天详情页面
|
||||
*/
|
||||
public class PDLiveConversationFragment extends ConversationFragment {
|
||||
PDLiveMessageListAdapter adapter;
|
||||
private String targetId = "";
|
||||
|
||||
public PDLiveConversationFragment(String targetId) {
|
||||
this.targetId = targetId;
|
||||
}
|
||||
|
||||
public PDLiveConversationFragment() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
@@ -47,9 +62,36 @@ public class PDLiveConversationFragment extends ConversationFragment {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
String ids = String.format("%s,%s", targetId, IMLoginManager.get(getContext()).getUserInfo().getId());
|
||||
LiveNetManager.get(getContext())
|
||||
.getUserLiveStatus(ids, new HttpCallback<List<Integer>>() {
|
||||
@Override
|
||||
public void onSuccess(List<Integer> data) {
|
||||
if(data.isEmpty()){
|
||||
adapter.setLeftLive(false);
|
||||
adapter.setRightLive(false);
|
||||
adapter.notifyDataSetChanged();
|
||||
return;
|
||||
}
|
||||
adapter.setLeftLive(data.contains(Integer.parseInt(targetId)));
|
||||
adapter.setRightLive(data.contains((int) IMLoginManager.get(getContext()).getUserInfo().getId()));
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MessageListAdapter onResolveAdapter() {
|
||||
return new PDLiveMessageListAdapter(this);
|
||||
adapter = new PDLiveMessageListAdapter(this);
|
||||
return adapter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
android:gravity="center"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:text="注:新增備註後,僅本人可見且只有在消息中心內生效"
|
||||
android:text="@string/edit_profile_remarks_tips"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="97dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/background_d5_white"
|
||||
android:gravity="center"
|
||||
android:gravity="start"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lt_remarks"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lt_report"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lt_black"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
@@ -93,7 +93,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/black"
|
||||
android:text="@string/black_add"
|
||||
android:textColor="@color/black1"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
@@ -91,7 +91,9 @@
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="60dp"
|
||||
android:text="你好,朋友!"
|
||||
android:text="你好,朋友!11111111111111111111111111111111111111111"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/rc_secondary_color"
|
||||
android:textSize="@dimen/rc_font_text_third_size"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
android:textColor="@color/rc_white_color"
|
||||
android:textSize="@dimen/rc_font_text_third_size"
|
||||
android:visibility="gone"
|
||||
android:textAllCaps="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -32,25 +32,60 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/ll_content" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="@dimen/rc_message_portrait_size"
|
||||
android:layout_height="@dimen/rc_message_portrait_size"
|
||||
android:id="@+id/rc_left_portrait_layout"
|
||||
app:layout_constraintStart_toEndOf="@id/rc_selected"
|
||||
app:layout_constraintTop_toTopOf="@id/ll_content"
|
||||
app:layout_goneMarginStart="@dimen/rc_margin_size_12">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_left_portrait"
|
||||
android:layout_width="@dimen/rc_message_portrait_size"
|
||||
android:layout_height="@dimen/rc_message_portrait_size"
|
||||
android:layout_marginStart="@dimen/rc_margin_size_4"
|
||||
android:src="@color/rc_secondary_color"
|
||||
app:layout_constraintStart_toEndOf="@id/rc_selected"
|
||||
android:src="@color/rc_secondary_color" />
|
||||
|
||||
<pl.droidsonroids.gif.GifImageView
|
||||
android:id="@+id/left_liveStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="12dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:src="@mipmap/icon_liveing"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="@dimen/rc_message_portrait_size"
|
||||
android:layout_height="@dimen/rc_message_portrait_size"
|
||||
android:layout_marginEnd="@dimen/rc_margin_size_12"
|
||||
android:id="@+id/rc_right_portrait_layout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/ll_content"
|
||||
app:layout_goneMarginStart="@dimen/rc_margin_size_12" />
|
||||
app:layout_goneMarginTop="@dimen/rc_margin_size_20" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_right_portrait"
|
||||
android:layout_width="@dimen/rc_message_portrait_size"
|
||||
android:layout_height="@dimen/rc_message_portrait_size"
|
||||
android:layout_marginEnd="@dimen/rc_margin_size_12"
|
||||
android:src="@color/rc_secondary_color"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/ll_content"
|
||||
app:layout_goneMarginTop="@dimen/rc_margin_size_20" />
|
||||
/>
|
||||
|
||||
<pl.droidsonroids.gif.GifImageView
|
||||
android:id="@+id/right_liveStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="12dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:src="@mipmap/icon_liveing"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_content"
|
||||
@@ -59,8 +94,8 @@
|
||||
android:layout_marginStart="@dimen/rc_margin_size_8"
|
||||
android:layout_marginEnd="@dimen/rc_margin_size_8"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toStartOf="@id/rc_right_portrait"
|
||||
app:layout_constraintStart_toEndOf="@id/rc_left_portrait"
|
||||
app:layout_constraintEnd_toStartOf="@id/rc_right_portrait_layout"
|
||||
app:layout_constraintStart_toEndOf="@id/rc_left_portrait_layout"
|
||||
app:layout_constraintTop_toBottomOf="@id/rc_time">
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
android:theme="@style/noAnimationStyle"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.UserHomeActivity"
|
||||
android:name=".activity.UserHomeActivityOld"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.SettingActivity"
|
||||
@@ -171,6 +171,20 @@
|
||||
<activity android:name=".activity.CompleteUserInfoActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity android:name=".activity.EditUserHobbyActivity" android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.CommunitySendActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.CommunityDetailsActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.UserHomeActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.yunbao.common.activity;
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
@@ -11,16 +11,20 @@ import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.adapter.CommentAdapter;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.CommentBean;
|
||||
@@ -28,6 +32,7 @@ import com.yunbao.common.dialog.ImagePreviewDialog;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.OpenAdManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
@@ -36,13 +41,19 @@ import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.NineGridLayout;
|
||||
import com.yunbao.common.views.TopGradual;
|
||||
import com.yunbao.share.bean.ShareBean;
|
||||
import com.yunbao.share.ui.SharePopDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
@Route(path = RouteUtil.PATH_COMMUNITY)
|
||||
public class CommunityDetailsActivity extends AbsActivity {
|
||||
ActiveBean activeBean;
|
||||
private ActiveBean activeBean;
|
||||
private String activeId;
|
||||
private ImageView avatar;
|
||||
private TextView name;
|
||||
private TextView time;
|
||||
@@ -61,6 +72,8 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
private EditText comment;
|
||||
private ImageView send;
|
||||
private boolean isComment = false;
|
||||
private RelativeLayout videoLayout;
|
||||
private GifImageView liveStatus;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -81,13 +94,14 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
activeBean = getIntent().getParcelableExtra("active");
|
||||
activeId = getIntent().getStringExtra(Constants.TO_COMMUNITY_ID);
|
||||
initView();
|
||||
initData();
|
||||
getReply();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
liveStatus = findViewById(R.id.liveStatus);
|
||||
videoLayout = findViewById(R.id.videoLayout);
|
||||
send = findViewById(R.id.send);
|
||||
comment = findViewById(R.id.comment);
|
||||
replyCount = findViewById(R.id.replyCount);
|
||||
@@ -138,12 +152,12 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
public void callback(Integer isAttention) {
|
||||
if (isAttention == 1) {
|
||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_followed, followIcon);
|
||||
followName.setText("已关注");
|
||||
followName.setText(getResources().getString(R.string.following));
|
||||
followName.setTextColor(Color.parseColor("#777777"));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type_1));
|
||||
} else {
|
||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_follow, followIcon);
|
||||
followName.setText("关注");
|
||||
followName.setText(getResources().getString(R.string.follow));
|
||||
followName.setTextColor(getResources().getColor(R.color.white));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type));
|
||||
}
|
||||
@@ -163,11 +177,11 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
if (activeBean.getIs_love().equals("1")) {
|
||||
activeBean.setIs_love("0");
|
||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like01, like);
|
||||
likeCount.setText(Integer.parseInt(activeBean.getLove_num()) - 1 + "人觉得很赞");
|
||||
likeCount.setText(Integer.parseInt(activeBean.getLove_num()) - 1 + getResources().getString(com.yunbao.main.R.string.person_like));
|
||||
} else {
|
||||
activeBean.setIs_love("1");
|
||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like, like);
|
||||
likeCount.setText(Integer.parseInt(activeBean.getLove_num()) + 1 + "人觉得很赞");
|
||||
likeCount.setText(Integer.parseInt(activeBean.getLove_num()) + 1 + getResources().getString(com.yunbao.main.R.string.person_like));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,13 +193,13 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
SparseArray<String> array = new SparseArray<>();
|
||||
array.append(0, "举报");
|
||||
array.append(1, "不感兴趣");
|
||||
array.append(0, getResources().getString(R.string.report));
|
||||
array.append(1, getResources().getString(R.string.not_interested));
|
||||
DialogUitl.showStringArrayDialog(CommunityDetailsActivity.this, array, new DialogUitl.StringArrayDialogCallback() {
|
||||
@Override
|
||||
public void onItemClick(String text, int tag) {
|
||||
if (tag == 0) {
|
||||
RouteUtil.forwardCommentReportActivity(activeBean.getId(), activeBean.getId());
|
||||
RouteUtil.forwardCommentReportActivity(activeBean.getId(), "0");
|
||||
} else {
|
||||
CommonHttpUtil.noInterest(activeBean.getUser_id(), new HttpCallback() {
|
||||
@Override
|
||||
@@ -222,16 +236,34 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
findViewById(R.id.userLayout).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
UserHomeActivity.forwardUserHomeActivity(CommunityDetailsActivity.this, activeBean.getUser_id());
|
||||
RouteUtil.forwardUserHome(activeBean.getUser_id());
|
||||
}
|
||||
});
|
||||
videoLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
}
|
||||
});
|
||||
findViewById(R.id.share).setOnClickListener(view -> {
|
||||
String image = null;
|
||||
if (activeBean.getImg_or_video().equals("1")) {
|
||||
JSONArray jsonArray = (JSONArray) JSONArray.parse(activeBean.getImg_json());
|
||||
if (!jsonArray.isEmpty()) {
|
||||
image = jsonArray.getString(0);
|
||||
}
|
||||
} else {
|
||||
image = activeBean.getVideo() + "?vframe/jpg/offset/0";
|
||||
}
|
||||
new SharePopDialog(mContext).setShareType(SharePopDialog.TYPE_DYNAMIC).setShareData(ShareBean.ShareBuilder.create().setShareType(SharePopDialog.TYPE_DYNAMIC).setUid(CommonAppConfig.getInstance().getUid()).setCover(StringUtil.isEmpty(image) ? activeBean.getUser_avatar() : image).setTitle(StringUtil.isEmpty(activeBean.getContent()) ? activeBean.getUser_name() : JSONObject.parseObject(activeBean.getContent()).getString("msg")).setAnchorId(activeBean.getUser_id()).setAnchorName(activeBean.getUser_name()).setAnchorAvatar(activeBean.getUser_avatar()).setExtraData(activeId).build()).showDialog();
|
||||
});
|
||||
}
|
||||
|
||||
//回复评论
|
||||
CommentBean replyComment;
|
||||
|
||||
private void getReply() {
|
||||
CommonHttpUtil.getCommunityComment(activeBean.getId(), activeBean.getUser_id(), new HttpCallback() {
|
||||
CommonHttpUtil.getCommunityComment(activeBean.getId(), activeBean.getUser_id(), 1, new HttpCallback() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
@@ -256,7 +288,7 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDel(CommentBean activeBean, int position) {
|
||||
public void onDel(CommentBean activeBean) {
|
||||
//一级回复 删除
|
||||
CommonHttpUtil.delCom(activeBean.getId(), new HttpCallback() {
|
||||
@Override
|
||||
@@ -270,9 +302,9 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReport(CommentBean.ReplyComment activeBean) {
|
||||
public void onReport(CommentBean.ReplyComment commentBean) {
|
||||
//二级回复 举报
|
||||
RouteUtil.forwardCommentReportActivity(activeBean.getId(), activeBean.getId());
|
||||
RouteUtil.forwardCommentReportActivity(activeBean.getId(), commentBean.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -298,6 +330,22 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
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, activeBean.getUser_avatar(), avatar);
|
||||
name.setText(activeBean.getUser_name());
|
||||
@@ -306,14 +354,17 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
if (!StringUtil.isEmpty(activeBean.getContent())) {
|
||||
content.setText(String.valueOf(JSONObject.parseObject(activeBean.getContent()).get("msg")));
|
||||
}
|
||||
if (activeBean.getIs_live().equals("1")) {
|
||||
liveStatus.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (activeBean.getIs_attention().equals("1")) {//关注
|
||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_followed, followIcon);
|
||||
followName.setText("已关注");
|
||||
followName.setText(getResources().getString(R.string.following));
|
||||
followName.setTextColor(Color.parseColor("#777777"));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type_1));
|
||||
} else {
|
||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_follow, followIcon);
|
||||
followName.setText("关注");
|
||||
followName.setText(getResources().getString(R.string.follow));
|
||||
followName.setTextColor(getResources().getColor(R.color.white));
|
||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type));
|
||||
}
|
||||
@@ -325,7 +376,8 @@ public class CommunityDetailsActivity extends AbsActivity {
|
||||
}
|
||||
mNineGridLayout.setData(tempList);
|
||||
} else {
|
||||
ImgLoader.display(CommunityDetailsActivity.this, activeBean.getUser_avatar(), videoImage);
|
||||
ImgLoader.display(CommunityDetailsActivity.this, activeBean.getVideo() + "?vframe/jpg/offset/0", videoImage);
|
||||
videoLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (activeBean.getIs_love().equals("1")) {
|
||||
ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like, like);
|
||||
@@ -1,32 +1,28 @@
|
||||
package com.yunbao.common.activity;
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ClipData;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.MediaStore;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.VideoView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
||||
import com.bigkoo.pickerview.listener.OnDismissListener;
|
||||
@@ -34,23 +30,32 @@ import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
|
||||
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||
import com.bigkoo.pickerview.view.TimePickerView;
|
||||
import com.lzy.okgo.utils.HttpUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.NewCommunityType;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.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.DateFormatUtil;
|
||||
import com.yunbao.common.utils.FilesUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.ProcessImageUtil;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import io.rong.imkit.picture.tools.DateUtils;
|
||||
|
||||
public class CommunitySendActivity extends AbsActivity {
|
||||
public static final int PERMISSION_REQUEST_CODE_IMG = 0;
|
||||
@@ -65,7 +70,7 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
private final int CHOOSE_IMG = 100;//Android 5.0以下的
|
||||
private final int CHOOSE_VIDEO = 200;//Android 5.0以上的
|
||||
private List<Uri> uriList = new ArrayList<>();
|
||||
private Uri videoUri;
|
||||
private File videoFile;
|
||||
private ActiveImageAdapter activeImageAdapter;
|
||||
private VideoView videoView;
|
||||
private RelativeLayout videoViewLayout;
|
||||
@@ -74,6 +79,12 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
private List<String> talkList = new ArrayList<>();
|
||||
private TextView submit;
|
||||
private boolean isImage;
|
||||
UploadQnImpl mUploadStrategy;
|
||||
|
||||
private List<String> imgUrlList = new ArrayList<>();
|
||||
private String videoUrl;
|
||||
List<NewCommunityType> newCommunityTypeList = new ArrayList<>();
|
||||
int talkId;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -82,14 +93,7 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
talkList.add("热门");
|
||||
talkList.add("新秀");
|
||||
talkList.add("颜值");
|
||||
talkList.add("舞蹈");
|
||||
talkList.add("男神");
|
||||
talkList.add("音乐");
|
||||
talkList.add("英语");
|
||||
|
||||
newCommunityTypeList = CommonAppConfig.getCommunityTypeList(false, mContext);
|
||||
content = findViewById(R.id.content);
|
||||
submit = findViewById(R.id.submit);
|
||||
submit.setVisibility(View.VISIBLE);
|
||||
@@ -106,13 +110,23 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
submit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
submit();
|
||||
List<UploadBean> uploadBeanList = new ArrayList<>();
|
||||
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() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
videoUri = null;
|
||||
videoFile = null;
|
||||
videoView.stopPlayback();
|
||||
videoViewLayout.setVisibility(View.GONE);
|
||||
}
|
||||
@@ -133,6 +147,9 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
@RequiresApi(api = Build.VERSION_CODES.TIRAMISU)
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (videoFile != null) {
|
||||
return;
|
||||
}
|
||||
String permission1 = Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||
String permission2 = Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
@@ -152,6 +169,9 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
videoLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (imgUrlList.size() > 0) {
|
||||
return;
|
||||
}
|
||||
String permission1 = Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||
String permission2 = Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
@@ -180,12 +200,13 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
activeImageAdapter.setActionListener(new ActiveImageAdapter.ActionListener() {
|
||||
@Override
|
||||
public void onAddClick() {
|
||||
|
||||
openImageChooserActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(int position) {
|
||||
|
||||
activeImageAdapter.deleteItem(position);
|
||||
activeImageAdapter.notifyItemRemoved(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -195,39 +216,55 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
|
||||
@Override
|
||||
public void onDel(int position) {
|
||||
|
||||
activeImageAdapter.deleteItem(position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void submit() {
|
||||
StringBuffer files = new StringBuffer();
|
||||
if (isImage) {
|
||||
for (int i = 0; i < uriList.size(); i++) {
|
||||
if (i == 0) {
|
||||
files.append(uri2File(uriList.get(i)).getPath());
|
||||
} else {
|
||||
files.append("," + uri2File(uriList.get(i)).getPath());
|
||||
}
|
||||
if (imgUrlList.size() == 0) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
files.append(uri2File(videoUri).getPath());
|
||||
if (StringUtil.isEmpty(videoUrl)) {
|
||||
return;
|
||||
}
|
||||
CommonHttpUtil.pushCommunity(isImage, content.getText().toString(), "1", files.toString(), chooseTime.getText().toString(), new HttpCallback() {
|
||||
}
|
||||
String imgUrl = "";
|
||||
if (isImage) {
|
||||
imgUrl = new Gson().toJson(imgUrlList);
|
||||
}
|
||||
String tempTime = "";
|
||||
if (!chooseTime.getText().toString().equals("立即發表") && !chooseTime.getText().toString().equals("Now")) {
|
||||
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
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
|
||||
ToastUtil.show(msg);
|
||||
if (code == 0) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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() {
|
||||
@Override
|
||||
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||
talkId = newCommunityTypeList.get(options1).getId();
|
||||
talkContent.setText(talkList.get(options1));
|
||||
talkContent.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}).setTitleText("选择话题").setContentTextSize(16).build();
|
||||
}).setTitleText(getResources().getString(R.string.choose_topic)).setContentTextSize(16).build();
|
||||
pickerView.setPicker(talkList, null, null);
|
||||
pickerView.show();
|
||||
}
|
||||
@@ -252,6 +289,18 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
public void showTimeChooseDialog() {
|
||||
Calendar startCalendar = Calendar.getInstance();
|
||||
startCalendar.set(1990, 1, 1);
|
||||
Calendar endCalendar = Calendar.getInstance();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int year = calendar.get(Calendar.YEAR);
|
||||
int month = calendar.get(Calendar.MONTH) + 1; // Calendar.MONTH 从0开始计数
|
||||
int day = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
int hour = calendar.get(Calendar.HOUR); // 使用24小时制
|
||||
int minute = calendar.get(Calendar.MINUTE);
|
||||
int second = calendar.get(Calendar.SECOND);
|
||||
endCalendar.set(year, month, day, hour, minute, second);
|
||||
|
||||
TimePickerView timePickerView = new TimePickerBuilder(CommunitySendActivity.this, new OnTimeSelectListener() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
@@ -259,13 +308,13 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
chooseTime.setText(DateFormatUtil.getTimeStrings(date.getTime()));
|
||||
}
|
||||
}).setType(new boolean[]{true, true, true, true, true, false})// 默认全部显示
|
||||
.setCancelText("Cancel")//取消按钮文字
|
||||
.setSubmitText("Sure")//确认按钮文字
|
||||
.setCancelText(getResources().getString(R.string.cancel))//取消按钮文字
|
||||
.setSubmitText(getResources().getString(R.string.back_community_sure))//确认按钮文字
|
||||
.setTitleSize(20)//标题文字大小
|
||||
.setTitleText("Title")//标题文字
|
||||
.setOutSideCancelable(false)//点击屏幕,点在控件外部范围时,是否取消显示
|
||||
.isCyclic(true)//是否循环滚动
|
||||
.setLabel("年", "月", "日", "时", "分", "")//默认设置为年月日时分秒
|
||||
.setTitleText("")//标题文字
|
||||
.setOutSideCancelable(true)//点击屏幕,点在控件外部范围时,是否取消显示
|
||||
.isCyclic(false)//是否循环滚动
|
||||
.setDate(endCalendar).setRangDate(startCalendar, endCalendar).setLabel("", "", "", "", "", "")//默认设置为年月日时分秒
|
||||
.isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。
|
||||
.build();
|
||||
timePickerView.show();
|
||||
@@ -304,7 +353,7 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
List<String> tempList = new ArrayList<>();
|
||||
for (int i = 0; i < clipData.getItemCount(); i++) {
|
||||
imageUris[i] = clipData.getItemAt(i).getUri();
|
||||
File file = new File(uri2File(imageUris[i]).getPath());
|
||||
File file = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, imageUris[i])));
|
||||
tempList.add(file.getPath());
|
||||
L.e("imageUris:" + imageUris[i].getPath() + "_" + imageUris[i].getEncodedPath());
|
||||
}
|
||||
@@ -314,7 +363,7 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
imageUris = new Uri[]{data.getData()};
|
||||
uriList.add(imageUris[0]);
|
||||
List<String> tempList = new ArrayList<>();
|
||||
File file = new File(uri2File(imageUris[0]).getPath());
|
||||
File file = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, imageUris[0])));
|
||||
tempList.add(file.getPath());
|
||||
activeImageAdapter.insertList(tempList);
|
||||
}
|
||||
@@ -322,26 +371,34 @@ public class CommunitySendActivity extends AbsActivity {
|
||||
isImage = true;
|
||||
} else if (requestCode == CHOOSE_VIDEO && resultCode == RESULT_OK && data != null) {
|
||||
Uri uri = data.getData();
|
||||
videoUri = uri;
|
||||
videoView.setVideoURI(videoUri);
|
||||
videoFile = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, uri)));
|
||||
videoView.setVideoURI(uri);
|
||||
videoView.start();
|
||||
videoViewLayout.setVisibility(View.VISIBLE);
|
||||
isImage = false;
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
private void uploadFile(List<UploadBean> uploadBeans, boolean isImg) {
|
||||
if (mUploadStrategy == null) {
|
||||
mUploadStrategy = new UploadQnImpl(mContext);
|
||||
}
|
||||
mUploadStrategy.upload(uploadBeans, true, new UploadCallback() {
|
||||
@Override
|
||||
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 {
|
||||
int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||
actualimagecursor.moveToFirst();
|
||||
img_path = actualimagecursor.getString(actual_image_column_index);
|
||||
videoUrl = list.get(0).getRemoteAccessUrl();
|
||||
}
|
||||
File file = new File(img_path);
|
||||
return file;
|
||||
submit();
|
||||
L.e(new Gson().toJson(list));
|
||||
}
|
||||
}, isImg);
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
@@ -116,7 +117,7 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
||||
return;
|
||||
}
|
||||
if (man.getTag() == null && woman.getTag() == null) {
|
||||
ToastUtil.show("請選擇性別");
|
||||
ToastUtil.show(WordUtil.isNewZh()?"請選擇性別":"Please select gender");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -126,9 +127,13 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
||||
userName.getText().toString(),
|
||||
(String) avatar.getTag(),
|
||||
year + "-" + (month + 1) + "-" + day,
|
||||
new HttpCallback<List<BaseModel>>() {
|
||||
new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(List<BaseModel> data) {
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
if (data.getCode() == 500) {
|
||||
ToastUtil.show(data.getMsg());
|
||||
return;
|
||||
}
|
||||
String anchorId = getIntent().getStringExtra("anchor_id");
|
||||
if (StringUtil.isEmpty(anchorId)) {
|
||||
Intent intent = new Intent(CompleteUserInfoActivity.this, MainActivity.class);
|
||||
@@ -237,7 +242,7 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
||||
|
||||
|
||||
void initSexView() {
|
||||
ViewUtils.findViewById(man, R.id.sex_bg).setBackgroundResource(R.drawable.complete_user_info_sex_man);
|
||||
ViewUtils.findViewById(man, R.id.sex_bg).setBackgroundResource(R.drawable.dialog_bg_chat_status_config_unselect);
|
||||
ViewUtils.findViewById(man, R.id.sex_icon, ImageView.class).setImageTintList(ColorStateList.valueOf(Color.parseColor("#00A3FF")));
|
||||
ViewUtils.findViewById(man, R.id.sex_top_icon, ImageView.class).setImageTintList(ColorStateList.valueOf(Color.parseColor("#00A3FF")));
|
||||
ViewUtils.findViewById(woman, R.id.sex_bg).setBackgroundResource(R.drawable.dialog_bg_chat_status_config_unselect);
|
||||
@@ -246,7 +251,7 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
||||
ViewUtils.findViewById(woman, R.id.sex_text, TextView.class).setText(R.string.activity_reg_user_info_sex_woman);
|
||||
ViewUtils.findViewById(woman, R.id.sex_text, TextView.class).setTextColor(Color.parseColor("#333333"));
|
||||
ViewUtils.findViewById(man, R.id.sex_text, TextView.class).setTextColor(Color.parseColor("#00A3FF"));
|
||||
man.setTag("man");
|
||||
man.setTag(null);
|
||||
woman.setTag(null);
|
||||
man.setOnClickListener(view -> {
|
||||
ViewUtils.findViewById(man, R.id.sex_bg).setBackgroundResource(R.drawable.complete_user_info_sex_man);
|
||||
|
||||
@@ -879,7 +879,11 @@ public class EditProfileActivity extends AbsActivity {
|
||||
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");
|
||||
String height = data.getInfo().getHeight();
|
||||
if("0".equals(height)||StringUtil.isEmpty(height)){
|
||||
height="170";
|
||||
}
|
||||
((TextView) findViewById(R.id.height)).setText(height + "cm");
|
||||
List<String> tags = WordUtil.isNewZh() ? data.getInfo().getCn_label() : data.getInfo().getEn_label();
|
||||
if (tags == null || tags.isEmpty()) return;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -164,7 +164,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
private ViewPager mViewPager;
|
||||
private List<FrameLayout> mViewList;
|
||||
private MainHomeComViewHolder mainHomeComViewHolder;
|
||||
private MainHomeLiveViewHolder mainHomeLiveViewHolder;
|
||||
private MainHomeViewHolder mainHomeViewHolder;
|
||||
private MainHomeCommunityViewHolder mMainHomeCommunityViewHolder;
|
||||
private MainMessageViewHolder mainMessageViewHolder;
|
||||
private MainMeViewHolder mMeViewHolder;
|
||||
@@ -200,7 +200,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
private View floatWarOrder;//战令浮窗
|
||||
private List<AnchorStartLiveBean> startListNotifyList = new ArrayList<>();
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_main;
|
||||
@@ -544,6 +543,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
MessageSayHiNotifyManager.getInstance().start();
|
||||
showFirstLogin();
|
||||
}
|
||||
|
||||
private void showFirstLogin() {
|
||||
LiveNetManager.get(mContext)
|
||||
.isFirstLogin(new com.yunbao.common.http.base.HttpCallback<FirstLoginBean>() {
|
||||
@@ -955,10 +955,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
|
||||
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());
|
||||
|
||||
GiftCacheUtil.getFile(MainActivity.this, Constants.GIF_GIFT_PREFIX + list.get(j).getId(), list.get(j).getSwf(), "0", new CommonCallback<File>() {
|
||||
@Override
|
||||
public void callback(File bean) {
|
||||
@@ -1144,7 +1141,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void loadPageData(int position, boolean needlLoadData) {
|
||||
if (mViewHolders == null) {
|
||||
ToastUtil.showDebug("Holders为空");
|
||||
@@ -1159,13 +1155,13 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
return;
|
||||
}
|
||||
if (position == 0) {
|
||||
mainHomeComViewHolder = new MainHomeComViewHolder(mContext, parent);
|
||||
mainHomeComViewHolder = new MainHomeComViewHolder(mContext, MainActivity.this, parent);
|
||||
vh = mainHomeComViewHolder;
|
||||
} else if (position == 1) {
|
||||
/* mainHomeLiveViewHolder = new MainHomeLiveViewHolder(mContext, parent);//直播
|
||||
vh = mainHomeLiveViewHolder;*/
|
||||
mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//直播
|
||||
vh = mMainHomeCommunityViewHolder;
|
||||
mainHomeViewHolder = new MainHomeViewHolder(mContext, parent);
|
||||
vh = mainHomeViewHolder;
|
||||
/* mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//直播
|
||||
vh = mMainHomeCommunityViewHolder;*/
|
||||
} else if (position == 2) {
|
||||
mainMessageViewHolder = new MainMessageViewHolder(this, parent);
|
||||
vh = mainMessageViewHolder;
|
||||
|
||||
@@ -570,8 +570,8 @@ public class MyWebViewActivity extends AbsActivity {
|
||||
Constants.firstInto = 0;
|
||||
EventBus.getDefault().post(new MainHomeCommunityToChatEvent().setTargetId(event.getUserId()));
|
||||
} else if (TextUtils.equals(event.getMethod(), "androidPlayVideo")) {
|
||||
VideoStorge.getInstance().put(Constants.VIDEO_COMMUNITY, event.getVideoBeanList());
|
||||
VideoPlayActivity.forward(mContext, event.getPosition(), Constants.VIDEO_COMMUNITY, 1);
|
||||
/*VideoStorge.getInstance().put(Constants.VIDEO_COMMUNITY, event.getVideoBeanList());
|
||||
VideoPlayActivity.forward(mContext, event.getPosition(), Constants.VIDEO_COMMUNITY, 1);*/
|
||||
} else if (TextUtils.equals(event.getMethod(), "openUpdataName")) {
|
||||
isUpdataUser = event.isUpdataUser();
|
||||
} else if (TextUtils.equals(event.getMethod(), "openUpdataAutograph")) {
|
||||
|
||||