Merge branch 'pandorapan_社区相关' into dev_改版主分支
@@ -197,8 +197,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;
|
||||
@@ -211,13 +209,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1, 0.4f, new DecelerateInterpolator()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
OpenAdManager.getInstance().dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
ActivityCompat.postponeEnterTransition(this);
|
||||
@@ -936,10 +932,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) {
|
||||
|
||||
@@ -569,8 +569,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")) {
|
||||
|
||||
@@ -416,8 +416,8 @@ public class MyWebViewActivity2 extends AbsActivity {
|
||||
Constants.firstInto = 0;
|
||||
SystemMessageActivity.forward(mContext, "-2", event.getUserId(), event.getName(), event.getImage());
|
||||
} 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(), "openWebView")) {
|
||||
ZhuangBanActivity.forward(mContext, event.getData(), false);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class MainHomeComAdapter extends RefreshAdapter<ActiveBean> {
|
||||
}
|
||||
isVideo.setVisibility(View.GONE);
|
||||
} else {
|
||||
ImgLoader.display(mContext, bean.getUser_avatar(), img);
|
||||
ImgLoader.display(mContext, bean.getVideo() + "?vframe/jpg/offset/0", img);
|
||||
isVideo.setVisibility(View.VISIBLE);
|
||||
}
|
||||
name.setText(bean.getUser_name());
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -10,15 +12,15 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.common.bean.VideoBean;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/12/14.
|
||||
*/
|
||||
|
||||
public class VideoHomeAdapter extends RefreshAdapter<VideoBean> {
|
||||
public class VideoHomeAdapter extends RefreshAdapter<ActiveBean> {
|
||||
|
||||
private View.OnClickListener mOnClickListener;
|
||||
|
||||
@@ -32,7 +34,7 @@ public class VideoHomeAdapter extends RefreshAdapter<VideoBean> {
|
||||
return;
|
||||
}
|
||||
int position = (int) tag;
|
||||
VideoBean bean = mList.get(position);
|
||||
ActiveBean bean = mList.get(position);
|
||||
if (bean != null && mOnItemClickListener != null) {
|
||||
mOnItemClickListener.onItemClick(bean, position);
|
||||
}
|
||||
@@ -77,11 +79,10 @@ public class VideoHomeAdapter extends RefreshAdapter<VideoBean> {
|
||||
itemView.setOnClickListener(mOnClickListener);
|
||||
}
|
||||
|
||||
void setData(VideoBean bean, int position) {
|
||||
void setData(ActiveBean bean, int position) {
|
||||
itemView.setTag(position);
|
||||
ImgLoader.display(mContext,bean.getThumb(), mImg);
|
||||
mNum.setText(bean.getViewNum());
|
||||
ImgLoader.display(mContext, bean.getVideo() + "?vframe/jpg/offset/0", mImg);
|
||||
mNum.setText(bean.getLove_num());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,8 +364,8 @@ public class MainHomeCommunityFragment extends BaseFragment {
|
||||
}
|
||||
});
|
||||
} 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(), "androidMethodLookToLive")) {
|
||||
//看直播
|
||||
gotoLive(event.getLiveId());
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.activity.CommunitySendActivity;
|
||||
@@ -26,6 +27,7 @@ public class MainHomeComViewHolder extends AbsMainHomeParentComViewHolder {
|
||||
private MainHomeRecomComViewHolder mainHomeRecomComViewHolder;
|
||||
private MainHomeGameViewHolder mainHomeGameLiveViewHolder;
|
||||
private final String mPageName = "home_page";
|
||||
private TextView tvPlay;
|
||||
private ImageView btnSend;
|
||||
private boolean floatWarOrder;
|
||||
|
||||
@@ -53,6 +55,13 @@ public class MainHomeComViewHolder extends AbsMainHomeParentComViewHolder {
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
});
|
||||
tvPlay = (TextView) findViewById(R.id.tvPlay);
|
||||
tvPlay.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
RouteUtil.forwardCommunityActivity();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setCurPosition(int position) {
|
||||
@@ -138,12 +147,12 @@ public class MainHomeComViewHolder extends AbsMainHomeParentComViewHolder {
|
||||
|
||||
@Override
|
||||
protected int getPageCount() {
|
||||
return 4;
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getTitles() {
|
||||
return new String[]{mContext.getString(R.string.follow), mContext.getString(R.string.hot), mContext.getString(R.string.main_type_find), mContext.getString(R.string.main_type_theater),};
|
||||
return new String[]{mContext.getString(R.string.follow), mContext.getString(R.string.hot), mContext.getString(R.string.main_type_find)};
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,31 +1,25 @@
|
||||
package com.yunbao.main.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.CommunityDetailsActivity;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.custom.CommonRefreshWaterfallView;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
import com.yunbao.main.activity.WeekWebViewActivity;
|
||||
import com.yunbao.main.adapter.MainHomeComAdapter;
|
||||
import com.yunbao.main.adapter.MainHomeRemFollComAdapter;
|
||||
import com.yunbao.main.http.MainHttpConsts;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
import com.yunbao.video.activity.VideoPlayActivity;
|
||||
import com.yunbao.video.utils.VideoStorge;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -38,6 +32,8 @@ import java.util.List;
|
||||
public class MainHomeFollComViewHolder extends AbsMainHomeChildViewHolder implements OnItemClickListener<ActiveBean> {
|
||||
private CommonRefreshWaterfallView mRefreshView;
|
||||
private MainHomeComAdapter mAdapter;
|
||||
private List<ActiveBean> videoList = new ArrayList<>();
|
||||
private List<ActiveBean> new_data;
|
||||
|
||||
public MainHomeFollComViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
@@ -96,7 +92,15 @@ public class MainHomeFollComViewHolder extends AbsMainHomeChildViewHolder implem
|
||||
|
||||
@Override
|
||||
public List<ActiveBean> processData(String[] info) {
|
||||
return JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
||||
new_data = new ArrayList<>();
|
||||
new_data = JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
||||
videoList = new ArrayList<>();
|
||||
for (int i = 0; i < new_data.size(); i++) {
|
||||
if (new_data.get(i).getImg_or_video().equals("2")) {
|
||||
videoList.add(new_data.get(i));
|
||||
}
|
||||
}
|
||||
return new_data;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,7 +115,16 @@ public class MainHomeFollComViewHolder extends AbsMainHomeChildViewHolder implem
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<ActiveBean> loadItemList, int loadItemCount) {
|
||||
mAdapter.insertList(loadItemList);
|
||||
new_data = new ArrayList<>();
|
||||
for (int j = 0; j < loadItemList.size(); j++) {
|
||||
new_data.add(loadItemList.get(j));
|
||||
if (loadItemList.get(j).getImg_or_video().equals("2")) {
|
||||
videoList.add(loadItemList.get(j));
|
||||
}
|
||||
}
|
||||
if (loadItemList.size() > 0) {
|
||||
mAdapter.insertList(new_data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -124,9 +137,18 @@ public class MainHomeFollComViewHolder extends AbsMainHomeChildViewHolder implem
|
||||
|
||||
@Override
|
||||
public void onItemClick(ActiveBean bean, int position) {
|
||||
Intent intent = new Intent(mContext, CommunityDetailsActivity.class);
|
||||
intent.putExtra("active", (Parcelable) bean);
|
||||
mContext.startActivity(intent);
|
||||
if (bean.getImg_or_video().equals("1")) {
|
||||
RouteUtil.forwardCommunity(bean.getId());
|
||||
} else {
|
||||
int playPosition = 0;
|
||||
for (int i = 0; i < videoList.size(); i++) {
|
||||
if (videoList.get(i).getId().equals(bean.getId())) {
|
||||
playPosition = i;
|
||||
}
|
||||
}
|
||||
VideoStorge.getInstance().put(Constants.VIDEO_HOME, videoList);
|
||||
VideoPlayActivity.forward(mContext, playPosition, Constants.VIDEO_HOME, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,9 +3,6 @@ package com.yunbao.main.views;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -16,7 +13,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.gson.Gson;
|
||||
import com.yunbao.common.activity.CommunityDetailsActivity;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.NewCommunityType;
|
||||
@@ -27,13 +24,14 @@ import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.CommunityTypeManager;
|
||||
import com.yunbao.common.manager.OpenAdManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.live.bean.RedPackBean;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.adapter.MainHomeComAdapter;
|
||||
import com.yunbao.main.adapter.MainHomeComClassAdapter;
|
||||
import com.yunbao.main.http.MainHttpConsts;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
import com.yunbao.video.interfaces.VideoScrollDataHelper;
|
||||
import com.yunbao.video.activity.VideoPlayActivity;
|
||||
import com.yunbao.video.utils.VideoStorge;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -65,6 +63,7 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
||||
private Map<String, String> gotoRoomKey = new HashMap<>();
|
||||
private Dialog mShowLoadingDialog;
|
||||
private String typeHot;
|
||||
private List<ActiveBean> videoList = new ArrayList<>();
|
||||
|
||||
public MainHomeNewViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
@@ -92,16 +91,6 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
CommonHttpUtil.getTag(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
List<NewCommunityType> list = JSON.parseArray(Arrays.toString(info), NewCommunityType.class);
|
||||
CommunityTypeManager communityTypeManager = new CommunityTypeManager(mContext);
|
||||
communityTypeManager.UpCommunityType(Arrays.toString(info));
|
||||
initCommunityTypeList(list);
|
||||
}
|
||||
});
|
||||
|
||||
List<NewCommunityType> list = new CommunityTypeManager(mContext).getCommunityTypeList();
|
||||
if (list != null && !list.isEmpty()) {
|
||||
typeHot = list.get(0).getTalk_name();
|
||||
@@ -111,8 +100,14 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
List<NewCommunityType> list = JSON.parseArray(Arrays.toString(info), NewCommunityType.class);
|
||||
NewCommunityType newCommunityType = new NewCommunityType();
|
||||
newCommunityType.setId(0);
|
||||
newCommunityType.setTalk_name(mContext.getString(R.string.recomment));
|
||||
list.add(0, newCommunityType);
|
||||
CommunityTypeManager communityTypeManager = new CommunityTypeManager(mContext);
|
||||
communityTypeManager.UpCommunityType(Arrays.toString(info));
|
||||
communityTypeManager.UpCommunityType(new Gson().toJson(list));
|
||||
typeHot = list.get(0).getTalk_name();
|
||||
select = list.get(0).getId();
|
||||
initCommunityTypeList(list);
|
||||
}
|
||||
});
|
||||
@@ -151,8 +146,7 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
||||
@Override
|
||||
public void loadData(int p, HttpCallback callback) {
|
||||
Log.i("t2", "aaa" + p);
|
||||
CommonHttpUtil.getCommunityHotList(p, callback);
|
||||
if (TextUtils.equals(typeHot, "Hot") || TextUtils.equals(typeHot, "hot") || TextUtils.equals(typeHot, "熱門")) {
|
||||
if (select == 0) {
|
||||
CommonHttpUtil.getCommunityHotList(p, callback);
|
||||
} else {
|
||||
CommonHttpUtil.getTalkHotDynamicList(select, p, callback);
|
||||
@@ -163,6 +157,12 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
||||
public List<ActiveBean> processData(String[] info) {
|
||||
new_data = new ArrayList<>();
|
||||
new_data = JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
||||
videoList = new ArrayList<>();
|
||||
for (int i = 0; i < new_data.size(); i++) {
|
||||
if (new_data.get(i).getImg_or_video().equals("2")) {
|
||||
videoList.add(new_data.get(i));
|
||||
}
|
||||
}
|
||||
return new_data;
|
||||
}
|
||||
|
||||
@@ -181,6 +181,9 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
||||
new_data = new ArrayList<>();
|
||||
for (int j = 0; j < loadItemList.size(); j++) {
|
||||
new_data.add(loadItemList.get(j));
|
||||
if (loadItemList.get(j).getImg_or_video().equals("2")) {
|
||||
videoList.add(loadItemList.get(j));
|
||||
}
|
||||
}
|
||||
if (loadItemList.size() > 0) {
|
||||
mAdapter.insertList(new_data);
|
||||
@@ -251,40 +254,20 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
|
||||
}
|
||||
}
|
||||
|
||||
private VideoScrollDataHelper mVideoScrollDataHelper;
|
||||
|
||||
@Override
|
||||
public void onItemClick(ActiveBean bean, int position) {
|
||||
Intent intent = new Intent(mContext, CommunityDetailsActivity.class);
|
||||
intent.putExtra("active", (Parcelable) bean);
|
||||
mContext.startActivity(intent);
|
||||
|
||||
/*if (bean.getImg_or_video().equals("2")) {
|
||||
if (mVideoScrollDataHelper == null) {
|
||||
mVideoScrollDataHelper = new VideoScrollDataHelper() {
|
||||
@Override
|
||||
public void loadData(int p, HttpCallback callback) {
|
||||
VideoHttpUtil.getHomeVideoList(p, callback);
|
||||
}
|
||||
};
|
||||
}
|
||||
VideoStorge.getInstance().putDataHelper(Constants.VIDEO_HOME, mVideoScrollDataHelper);
|
||||
VideoPlayActivity.forward(mContext, position, Constants.VIDEO_HOME, 1);
|
||||
}*/
|
||||
/*VideoHttpUtil.getHomeVideoList(1, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
List<VideoBean> tempList = new ArrayList<>();
|
||||
for (String s : info) {
|
||||
VideoBean videoBean = JSONObject.parseObject(s, VideoBean.class);
|
||||
tempList.add(videoBean);
|
||||
}
|
||||
VideoStorge.getInstance().put(Constants.VIDEO_HOME, tempList);
|
||||
VideoPlayActivity.forward(mContext, position, Constants.VIDEO_HOME, 1);
|
||||
if (bean.getImg_or_video().equals("1")) {
|
||||
RouteUtil.forwardCommunity(bean.getId());
|
||||
} else {
|
||||
int playPosition = 0;
|
||||
for (int i = 0; i < videoList.size(); i++) {
|
||||
if (videoList.get(i).getId().equals(bean.getId())) {
|
||||
playPosition = i;
|
||||
}
|
||||
}
|
||||
});*/
|
||||
VideoStorge.getInstance().put(Constants.VIDEO_HOME, videoList);
|
||||
VideoPlayActivity.forward(mContext, playPosition, Constants.VIDEO_HOME, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,40 +1,31 @@
|
||||
package com.yunbao.main.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Parcelable;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.CommunityDetailsActivity;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.custom.CommonRefreshWaterfallView;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
import com.yunbao.main.activity.WeekWebViewActivity;
|
||||
import com.yunbao.main.adapter.MainHomeComAdapter;
|
||||
import com.yunbao.main.adapter.MainHomeRemFindComAdapter;
|
||||
import com.yunbao.main.adapter.MainHomeRemFollLiveAdapter;
|
||||
import com.yunbao.main.http.MainHttpConsts;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
import com.yunbao.video.activity.VideoPlayActivity;
|
||||
import com.yunbao.video.utils.VideoStorge;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -44,6 +35,8 @@ import java.util.List;
|
||||
public class MainHomeRecomComViewHolder extends AbsMainHomeChildViewHolder implements OnItemClickListener<ActiveBean> {
|
||||
private CommonRefreshWaterfallView mRefreshView;
|
||||
private MainHomeComAdapter mAdapter;
|
||||
private List<ActiveBean> videoList = new ArrayList<>();
|
||||
private List<ActiveBean> new_data = new ArrayList<>();
|
||||
|
||||
public MainHomeRecomComViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
@@ -97,7 +90,15 @@ public class MainHomeRecomComViewHolder extends AbsMainHomeChildViewHolder imple
|
||||
@Override
|
||||
public List<ActiveBean> processData(String[] info) {
|
||||
if (pp == 1) {
|
||||
return JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
||||
new_data = new ArrayList<>();
|
||||
new_data = JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
||||
videoList = new ArrayList<>();
|
||||
for (int i = 0; i < new_data.size(); i++) {
|
||||
if (new_data.get(i).getImg_or_video().equals("2")) {
|
||||
videoList.add(new_data.get(i));
|
||||
}
|
||||
}
|
||||
return new_data;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@@ -131,9 +132,18 @@ public class MainHomeRecomComViewHolder extends AbsMainHomeChildViewHolder imple
|
||||
|
||||
@Override
|
||||
public void onItemClick(ActiveBean bean, int position) {
|
||||
Intent intent = new Intent(mContext, CommunityDetailsActivity.class);
|
||||
intent.putExtra("active", (Parcelable) bean);
|
||||
mContext.startActivity(intent);
|
||||
if (bean.getImg_or_video().equals("1")) {
|
||||
RouteUtil.forwardCommunity(bean.getId());
|
||||
} else {
|
||||
int playPosition = 0;
|
||||
for (int i = 0; i < videoList.size(); i++) {
|
||||
if (videoList.get(i).getId().equals(bean.getId())) {
|
||||
playPosition = i;
|
||||
}
|
||||
}
|
||||
VideoStorge.getInstance().put(Constants.VIDEO_HOME, videoList);
|
||||
VideoPlayActivity.forward(mContext, playPosition, Constants.VIDEO_HOME, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -83,7 +83,7 @@ public class MainHomeVideoViewHolder extends AbsMainHomeChildViewHolder implemen
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<VideoBean> list, int listCount) {
|
||||
VideoStorge.getInstance().put(Constants.VIDEO_HOME, list);
|
||||
//VideoStorge.getInstance().put(Constants.VIDEO_HOME, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.HtmlConfig;
|
||||
import com.yunbao.common.activity.UserHomeActivity;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.GoogleBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
@@ -134,7 +135,8 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
MobclickAgent.onEvent(mContext, "my_avatar", "个人头像按钮");
|
||||
RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2);
|
||||
RouteUtil.forwardUserHome(CommonAppConfig.getInstance().getUid());
|
||||
//RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -145,7 +147,8 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
MobclickAgent.onEvent(mContext, "my_avatar", "个人头像按钮");
|
||||
RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2);
|
||||
RouteUtil.forwardUserHome(CommonAppConfig.getInstance().getUid());
|
||||
//RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2);
|
||||
}
|
||||
});
|
||||
user_noble_ico = (ImageView) findViewById(R.id.user_noble_ico);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.yunbao.main.views;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
@@ -9,6 +11,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
@@ -37,7 +40,7 @@ import java.util.List;
|
||||
* 用户个人中心发布的视频列表
|
||||
*/
|
||||
|
||||
public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItemClickListener<VideoBean> {
|
||||
public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItemClickListener<ActiveBean> {
|
||||
|
||||
private CommonRefreshView mRefreshView;
|
||||
private VideoHomeAdapter mAdapter;
|
||||
@@ -76,9 +79,9 @@ public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItem
|
||||
ItemDecoration decoration = new ItemDecoration(mContext, 0x00000000, 2, 0);
|
||||
decoration.setOnlySetItemOffsetsButNoDraw(true);
|
||||
mRefreshView.setItemDecoration(decoration);
|
||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<VideoBean>() {
|
||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<ActiveBean>() {
|
||||
@Override
|
||||
public RefreshAdapter<VideoBean> getAdapter() {
|
||||
public RefreshAdapter<ActiveBean> getAdapter() {
|
||||
if (mAdapter == null) {
|
||||
mAdapter = new VideoHomeAdapter(mContext);
|
||||
mAdapter.setOnItemClickListener(VideoHomeViewHolder.this);
|
||||
@@ -92,12 +95,12 @@ public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VideoBean> processData(String[] info) {
|
||||
return JSON.parseArray(Arrays.toString(info), VideoBean.class);
|
||||
public List<ActiveBean> processData(String[] info) {
|
||||
return JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<VideoBean> list, int listCount) {
|
||||
public void onRefreshSuccess(List<ActiveBean> list, int listCount) {
|
||||
VideoStorge.getInstance().put(mKey, list);
|
||||
}
|
||||
|
||||
@@ -107,7 +110,7 @@ public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<VideoBean> loadItemList, int loadItemCount) {
|
||||
public void onLoadMoreSuccess(List<ActiveBean> loadItemList, int loadItemCount) {
|
||||
|
||||
}
|
||||
|
||||
@@ -127,10 +130,9 @@ public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItem
|
||||
EventBus.getDefault().register(VideoHomeViewHolder.this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void loadData() {
|
||||
if(isFirstLoadData()){
|
||||
if (isFirstLoadData()) {
|
||||
mRefreshView.initData();
|
||||
}
|
||||
}
|
||||
@@ -142,7 +144,6 @@ public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItem
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onVideoScrollPageEvent(VideoScrollPageEvent e) {
|
||||
if (!TextUtils.isEmpty(mKey) && mKey.equals(e.getKey()) && mRefreshView != null) {
|
||||
@@ -164,7 +165,7 @@ public class VideoHomeViewHolder extends AbsUserHomeViewHolder implements OnItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(VideoBean bean, int position) {
|
||||
public void onItemClick(ActiveBean bean, int position) {
|
||||
int page = 1;
|
||||
if (mRefreshView != null) {
|
||||
page = mRefreshView.getPageCount();
|
||||
|
||||
@@ -2,21 +2,20 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_class_name"
|
||||
android:layout_width="65dp"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/bg_main_com_type"
|
||||
android:gravity="center"
|
||||
android:text="音乐"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="13sp" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -15,8 +15,10 @@
|
||||
<RelativeLayout
|
||||
android:id="@+id/rt_main_tab"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="71dp"
|
||||
android:layout_alignParentBottom="true">
|
||||
android:layout_height="55dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/white"
|
||||
android:paddingTop="5dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_main_bg_tab"
|
||||
@@ -28,8 +30,9 @@
|
||||
<RelativeLayout
|
||||
android:id="@+id/bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentBottom="true">
|
||||
android:layout_height="55dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true">
|
||||
|
||||
<com.yunbao.common.custom.TabButtonGroup
|
||||
android:id="@+id/tab_group"
|
||||
@@ -46,7 +49,8 @@
|
||||
app:tbn_icon_size="28dp"
|
||||
app:tbn_text_color_checked="@color/colorAccent"
|
||||
app:tbn_text_color_unchecked="@color/gray1"
|
||||
app:tbn_text_size="11sp" />
|
||||
app:tbn_text_size="11sp"
|
||||
app:tbn_tip="@string/main_home" />
|
||||
|
||||
<com.yunbao.common.custom.TabButton
|
||||
android:layout_width="0dp"
|
||||
@@ -57,7 +61,8 @@
|
||||
app:tbn_icon_size="28dp"
|
||||
app:tbn_text_color_checked="@color/colorAccent"
|
||||
app:tbn_text_color_unchecked="@color/gray1"
|
||||
app:tbn_text_size="11sp" />
|
||||
app:tbn_text_size="11sp"
|
||||
app:tbn_tip="@string/live" />
|
||||
|
||||
<com.yunbao.common.custom.TabButton
|
||||
android:layout_width="0dp"
|
||||
@@ -67,7 +72,8 @@
|
||||
app:tbn_icon_size="28dp"
|
||||
app:tbn_text_color_checked="@color/colorAccent"
|
||||
app:tbn_text_color_unchecked="@color/gray1"
|
||||
app:tbn_text_size="11sp" />
|
||||
app:tbn_text_size="11sp"
|
||||
app:tbn_tip="@string/chat" />
|
||||
|
||||
<com.yunbao.common.custom.TabButton
|
||||
android:layout_width="0dp"
|
||||
@@ -77,7 +83,8 @@
|
||||
app:tbn_icon_size="28dp"
|
||||
app:tbn_text_color_checked="@color/colorAccent"
|
||||
app:tbn_text_color_unchecked="@color/gray1"
|
||||
app:tbn_text_size="11sp" />
|
||||
app:tbn_text_size="11sp"
|
||||
app:tbn_tip="@string/main_me" />
|
||||
|
||||
</com.yunbao.common.custom.TabButtonGroup>
|
||||
|
||||
@@ -139,14 +146,13 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_start"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:onClick="mainClick"
|
||||
android:src="@mipmap/icon_middle" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<com.yunbao.main.views.FloatBannerView
|
||||
android:id="@+id/float_banner_home"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -179,8 +185,8 @@
|
||||
android:layout_above="@id/rt_main_tab"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="12dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginBottom="10dp" />
|
||||
android:layout_marginBottom="10dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<include
|
||||
android:id="@+id/war_order"
|
||||
@@ -189,8 +195,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/rt_main_tab"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="25dp"
|
||||
/>
|
||||
android:layout_marginRight="25dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
app:layout_scrollFlags="scroll|enterAlways">
|
||||
|
||||
|
||||
<FrameLayout
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
@@ -35,10 +35,24 @@
|
||||
|
||||
<net.lucode.hackware.magicindicator.MagicIndicator
|
||||
android:id="@+id/indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
<TextView
|
||||
android:id="@+id/tvPlay"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@+id/indicator"
|
||||
android:gravity="center"
|
||||
android:paddingTop="1dp"
|
||||
android:text="@string/main_type_theater"
|
||||
android:textColor="@color/black1"
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_send"
|
||||
|
||||
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 14 KiB |
@@ -10,6 +10,14 @@
|
||||
<item>@mipmap/icon_dynamic_selected</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="main_tab_list">
|
||||
<item>@mipmap/icon_live_uncheck</item>
|
||||
<item>@mipmap/icon_live_selected</item>
|
||||
</string-array>
|
||||
<string-array name="main_tab_chat">
|
||||
<item>@mipmap/icon_me_uncheck</item>
|
||||
<item>@mipmap/icon_me_selected</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="main_tab_near">
|
||||
<!-- <item>@mipmap/icon_main_tab_near_00</item>-->
|
||||
@@ -22,12 +30,4 @@
|
||||
<!-- <item>@mipmap/icon_main_tab_near_07</item>-->
|
||||
<!-- <item>@mipmap/icon_main_tab_near_08</item>-->
|
||||
</string-array>
|
||||
<string-array name="main_tab_list">
|
||||
<item>@mipmap/icon_live_uncheck</item>
|
||||
<item>@mipmap/icon_live_selected</item>
|
||||
</string-array>
|
||||
<string-array name="main_tab_chat">
|
||||
<item>@mipmap/icon_me_uncheck</item>
|
||||
<item>@mipmap/icon_me_selected</item>
|
||||
</string-array>
|
||||
</resources>
|
||||