Merge branch 'pandorapan_社区相关' into dev_改版主分支
# Conflicts: # common/build.gradle # common/src/main/java/com/yunbao/common/bean/MessageUserInfoBean.java # common/src/main/java/com/yunbao/common/http/PDLiveApi.java # common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java # common/src/main/java/com/yunbao/common/utils/RouteUtil.java # common/src/main/res/values/strings.xml # main/src/main/java/com/yunbao/main/activity/MainActivity.java
This commit is contained in:
@@ -122,6 +122,7 @@ import com.yunbao.main.manager.imrongcloud.ConversationIMListManager;
|
||||
import com.yunbao.main.utils.GenerateTestUserSig;
|
||||
import com.yunbao.main.utils.UserInfoManager;
|
||||
import com.yunbao.main.views.FloatBannerView;
|
||||
import com.yunbao.main.views.MainHomeComViewHolder;
|
||||
import com.yunbao.main.views.MainHomeCommunityViewHolder;
|
||||
import com.yunbao.main.views.MainHomeLiveViewHolder;
|
||||
import com.yunbao.main.views.MainHomeViewHolder;
|
||||
@@ -160,8 +161,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
private TabButtonGroup mTabButtonGroup;
|
||||
private ViewPager mViewPager;
|
||||
private List<FrameLayout> mViewList;
|
||||
private MainHomeLiveViewHolder mHomeLiveViewHolder;
|
||||
private MainHomeViewHolder mainHomeViewHolder;
|
||||
private MainHomeComViewHolder mainHomeComViewHolder;
|
||||
private MainHomeLiveViewHolder mainHomeLiveViewHolder;
|
||||
private MainHomeCommunityViewHolder mMainHomeCommunityViewHolder;
|
||||
private MainMessageViewHolder mainMessageViewHolder;
|
||||
private MainMeViewHolder mMeViewHolder;
|
||||
@@ -643,9 +644,9 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
floatBanner.setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
if (mainHomeViewHolder != null && mainHomeViewHolder.isFloatWarOrder()) {
|
||||
if (mainHomeComViewHolder != null && mainHomeComViewHolder.isFloatWarOrder()) {
|
||||
floatWarOrder.setVisibility(View.GONE);
|
||||
} else {
|
||||
}else {
|
||||
floatWarOrder.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@@ -900,9 +901,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
mFristLoad = false;
|
||||
// getLocation();
|
||||
loadPageData(0, false);
|
||||
if (mHomeLiveViewHolder != null) {
|
||||
mHomeLiveViewHolder.setShowed(true);
|
||||
}
|
||||
}
|
||||
if (Constants.isShowPage != -1) {
|
||||
mTabButtonGroup.setCurPosition(Constants.isShowPage);
|
||||
@@ -1142,18 +1140,17 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
return;
|
||||
}
|
||||
if (position == 0) {
|
||||
mainHomeViewHolder = new MainHomeViewHolder(mContext, parent);
|
||||
vh = mainHomeViewHolder;
|
||||
|
||||
mainHomeComViewHolder = new MainHomeComViewHolder(mContext, parent);
|
||||
vh = mainHomeComViewHolder;
|
||||
} else if (position == 1) {
|
||||
mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//社区
|
||||
/* mainHomeLiveViewHolder = new MainHomeLiveViewHolder(mContext, parent);//直播
|
||||
vh = mainHomeLiveViewHolder;*/
|
||||
mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//直播
|
||||
vh = mMainHomeCommunityViewHolder;
|
||||
|
||||
} else if (position == 2) {
|
||||
mainMessageViewHolder = new MainMessageViewHolder(this, parent);
|
||||
vh = mainMessageViewHolder;
|
||||
|
||||
|
||||
} else if (position == 3) {
|
||||
mMeViewHolder = new MainMeViewHolder(mContext, parent);
|
||||
vh = mMeViewHolder;
|
||||
@@ -1505,7 +1502,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
}
|
||||
floatRedPacket.setOnClickListener(v -> {
|
||||
MobclickAgent.onEvent(mContext, "home_page_to_redpk", "首页点击右下角去红包专区");
|
||||
mainHomeViewHolder.setCurPosition(3);
|
||||
mainHomeComViewHolder.setCurPosition(3);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.yunbao.main.activity;
|
||||
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
@@ -10,7 +9,6 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.views.floatingview.APPEasyFloat;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.yunbao.main.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
@@ -20,7 +19,7 @@ import com.yunbao.main.views.UserHomeViewHolder2;
|
||||
/**
|
||||
* Created by cxf on 2018/9/25.
|
||||
*/
|
||||
@Route(path = RouteUtil.PATH_USER_HOME)
|
||||
//@Route(path = RouteUtil.PATH_USER_HOME)
|
||||
public class UserHomeActivity extends AbsActivity {
|
||||
|
||||
private UserHomeViewHolder2 mUserHomeViewHolder;
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/26.
|
||||
* 首页 社区
|
||||
*/
|
||||
|
||||
public class MainHomeComAdapter extends RefreshAdapter<ActiveBean> {
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private View.OnClickListener mOnClickListener;
|
||||
|
||||
public MainHomeComAdapter(Context context) {
|
||||
super(context);
|
||||
this.mContext = context;
|
||||
mOnClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Object tag = v.getTag();
|
||||
if (tag != null && mOnItemClickListener != null) {
|
||||
mOnItemClickListener.onItemClick((ActiveBean) tag, 0);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new Vh(mInflater.inflate(com.yunbao.live.R.layout.item_main_com, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) {
|
||||
((Vh) vh).setData(mList.get(position), position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return super.getItemCount();
|
||||
}
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
TextView name;
|
||||
TextView title;
|
||||
TextView likeCount;
|
||||
ImageView img;
|
||||
ImageView author;
|
||||
LinearLayout heightLayout;
|
||||
ImageView isVideo;
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
name = itemView.findViewById(R.id.name);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
img = itemView.findViewById(R.id.img);
|
||||
author = itemView.findViewById(R.id.author);
|
||||
likeCount = itemView.findViewById(R.id.like_count);
|
||||
heightLayout = itemView.findViewById(R.id.imgLayout);
|
||||
isVideo = itemView.findViewById(R.id.isVideo);
|
||||
itemView.setOnClickListener(mOnClickListener);
|
||||
}
|
||||
|
||||
void setData(ActiveBean bean, int position) {
|
||||
itemView.setTag(bean);
|
||||
if (bean != null) {
|
||||
if (bean.getImg_or_video().equals("1")) {
|
||||
JSONArray jsonArray = (JSONArray) JSONArray.parse(bean.getImg_json());
|
||||
if (jsonArray.size() != 0) {
|
||||
ImgLoader.display(mContext, String.valueOf(jsonArray.get(0)), img);
|
||||
}
|
||||
isVideo.setVisibility(View.GONE);
|
||||
} else {
|
||||
ImgLoader.display(mContext, bean.getUser_avatar(), img);
|
||||
isVideo.setVisibility(View.VISIBLE);
|
||||
}
|
||||
name.setText(bean.getUser_name());
|
||||
JSONObject json = JSONObject.parseObject(bean.getContent());
|
||||
if (json != null) {
|
||||
String content = (String) json.get("msg");
|
||||
title.setText(content);
|
||||
}
|
||||
likeCount.setText(bean.getLove_num());
|
||||
ImgLoader.display(mContext, bean.getUser_avatar(), author);
|
||||
|
||||
if (position == 0) {
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) heightLayout.getLayoutParams();
|
||||
params.height = 550;
|
||||
heightLayout.setLayoutParams(params);
|
||||
|
||||
FrameLayout.LayoutParams imgPa = (FrameLayout.LayoutParams) img.getLayoutParams();
|
||||
imgPa.height = 550;
|
||||
img.setLayoutParams(imgPa);
|
||||
|
||||
} else {
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) heightLayout.getLayoutParams();
|
||||
params.height = 750;
|
||||
heightLayout.setLayoutParams(params);
|
||||
|
||||
FrameLayout.LayoutParams imgPa = (FrameLayout.LayoutParams) img.getLayoutParams();
|
||||
imgPa.height = 750;
|
||||
img.setLayoutParams(imgPa);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.bean.NewCommunityType;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class MainHomeComClassAdapter extends RecyclerView.Adapter<MainHomeComClassAdapter.Vh> {
|
||||
|
||||
private Context mContext;
|
||||
private List<NewCommunityType> mList;
|
||||
private LayoutInflater mInflater;
|
||||
private View.OnClickListener mOnClickListener;
|
||||
private OnItemClickListener<NewCommunityType> mOnItemClickListener;
|
||||
|
||||
//选中的
|
||||
public static int choice = 0;
|
||||
|
||||
public MainHomeComClassAdapter(Context context, List<NewCommunityType> list, boolean dialog) {
|
||||
mContext = context;
|
||||
mList = list;
|
||||
mInflater = LayoutInflater.from(context);
|
||||
mOnClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Object tag = v.getTag();
|
||||
if (tag != null) {
|
||||
int position = (int) tag;
|
||||
NewCommunityType bean = mList.get(position);
|
||||
if (mOnItemClickListener != null) {
|
||||
mOnItemClickListener.onItemClick(bean, position);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<NewCommunityType> onItemClickListener) {
|
||||
mOnItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public MainHomeComClassAdapter.Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
int res = R.layout.item_main_home_com_class;
|
||||
return new MainHomeComClassAdapter.Vh(mInflater.inflate(res, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MainHomeComClassAdapter.Vh vh, int position) {
|
||||
vh.setData(mList.get(position), position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
TextView mName;
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
mName = (TextView) itemView.findViewById(R.id.tv_class_name);
|
||||
itemView.setOnClickListener(mOnClickListener);
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
void setData(NewCommunityType bean, int position) {
|
||||
itemView.setTag(position);
|
||||
Locale locale;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
locale = mContext.getResources().getConfiguration().getLocales().get(0);
|
||||
} else {
|
||||
locale = mContext.getResources().getConfiguration().locale;
|
||||
}
|
||||
if (locale.getLanguage().equals("zh")) {
|
||||
mName.setText(bean.getTalk_name());
|
||||
} else {
|
||||
mName.setText(bean.getTalk_name());
|
||||
}
|
||||
|
||||
if (position == choice) {
|
||||
mName.setBackgroundResource(R.drawable.bg_main_community_type_01);
|
||||
mName.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
} else {
|
||||
mName.setBackgroundResource(R.drawable.bg_main_community_type_02);
|
||||
mName.setTextColor(Color.parseColor("#777777"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
/**
|
||||
* 关注和推荐的适配器
|
||||
*/
|
||||
public class MainHomeRemFindComAdapter extends RefreshAdapter<LiveBean> {
|
||||
|
||||
|
||||
private Context context;
|
||||
private int Height;
|
||||
private View.OnClickListener mOnClickListener;
|
||||
|
||||
public MainHomeRemFindComAdapter(Context context, int h) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
Log.e("t1", h + "屏1");
|
||||
this.Height = h;
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new Vh(mInflater.inflate(R.layout.item_main_com, parent, false));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) {
|
||||
if (vh instanceof Vh) {
|
||||
((Vh) vh).setData(mList.get(position), position);
|
||||
}
|
||||
}
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
|
||||
TextView name;
|
||||
TextView title;
|
||||
TextView likeCount;
|
||||
ImageView img;
|
||||
ImageView author;
|
||||
LinearLayout heightLayout;
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
name = itemView.findViewById(R.id.name);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
img = itemView.findViewById(R.id.img);
|
||||
author = itemView.findViewById(R.id.author);
|
||||
likeCount = itemView.findViewById(R.id.like_count);
|
||||
heightLayout = itemView.findViewById(R.id.imgLayout);
|
||||
itemView.setOnClickListener(mOnClickListener);
|
||||
}
|
||||
|
||||
void setData(LiveBean bean, int position) {
|
||||
itemView.setTag(bean);
|
||||
//name.setText(bean.getCity());
|
||||
//title.setText(bean.getCity());
|
||||
likeCount.setText(bean.getNums());
|
||||
ImgLoader.display(mContext, "https://img2.baidu.com/it/u=1540900496,2036305732&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", img);
|
||||
ImgLoader.display(mContext, bean.getAvatar(), author);
|
||||
|
||||
if (position == 0) {
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) heightLayout.getLayoutParams();
|
||||
params.height = 450;
|
||||
heightLayout.setLayoutParams(params);
|
||||
|
||||
FrameLayout.LayoutParams imgPa = (FrameLayout.LayoutParams) img.getLayoutParams();
|
||||
imgPa.height = 450;
|
||||
img.setLayoutParams(imgPa);
|
||||
|
||||
} else {
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) heightLayout.getLayoutParams();
|
||||
params.height = 700;
|
||||
heightLayout.setLayoutParams(params);
|
||||
|
||||
FrameLayout.LayoutParams imgPa = (FrameLayout.LayoutParams) img.getLayoutParams();
|
||||
imgPa.height = 700;
|
||||
img.setLayoutParams(imgPa);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.jakewharton.rxbinding3.view.RxView;
|
||||
import com.squareup.picasso.Picasso;
|
||||
import com.xj.marqueeview.MarqueeView;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.formatBigNum;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.utils.MainIconUtil;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import kotlin.Unit;
|
||||
|
||||
/**
|
||||
* 关注和推荐的适配器
|
||||
*/
|
||||
public class MainHomeRemFollComAdapter extends RefreshAdapter<LiveBean> {
|
||||
|
||||
|
||||
private Context context;
|
||||
private int Height;
|
||||
private View.OnClickListener mOnClickListener;
|
||||
|
||||
public MainHomeRemFollComAdapter(Context context, int h) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
Log.e("t1", h + "屏1");
|
||||
this.Height = h;
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new Vh(mInflater.inflate(R.layout.item_main_com, parent, false));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) {
|
||||
if (vh instanceof Vh) {
|
||||
((Vh) vh).setData(mList.get(position), position);
|
||||
}
|
||||
}
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
|
||||
TextView name;
|
||||
TextView title;
|
||||
TextView likeCount;
|
||||
ImageView img;
|
||||
ImageView author;
|
||||
LinearLayout heightLayout;
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
name = itemView.findViewById(R.id.name);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
img = itemView.findViewById(R.id.img);
|
||||
author = itemView.findViewById(R.id.author);
|
||||
likeCount = itemView.findViewById(R.id.like_count);
|
||||
heightLayout = itemView.findViewById(R.id.imgLayout);
|
||||
itemView.setOnClickListener(mOnClickListener);
|
||||
}
|
||||
|
||||
void setData(LiveBean bean, int position) {
|
||||
itemView.setTag(bean);
|
||||
//name.setText(bean.getCity());
|
||||
//title.setText(bean.getCity());
|
||||
likeCount.setText(bean.getNums());
|
||||
ImgLoader.display(mContext, "https://img2.baidu.com/it/u=1540900496,2036305732&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", img);
|
||||
ImgLoader.display(mContext, bean.getAvatar(), author);
|
||||
|
||||
if (position == 0) {
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) heightLayout.getLayoutParams();
|
||||
params.height = 450;
|
||||
heightLayout.setLayoutParams(params);
|
||||
|
||||
FrameLayout.LayoutParams imgPa = (FrameLayout.LayoutParams) img.getLayoutParams();
|
||||
imgPa.height = 450;
|
||||
img.setLayoutParams(imgPa);
|
||||
|
||||
} else {
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) heightLayout.getLayoutParams();
|
||||
params.height = 700;
|
||||
heightLayout.setLayoutParams(params);
|
||||
|
||||
FrameLayout.LayoutParams imgPa = (FrameLayout.LayoutParams) img.getLayoutParams();
|
||||
imgPa.height = 700;
|
||||
img.setLayoutParams(imgPa);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,340 @@
|
||||
package com.yunbao.main.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.yunbao.common.adapter.ViewPagerAdapter;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.views.AbsMainViewHolder;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.interfaces.AppBarStateListener;
|
||||
import com.yunbao.main.interfaces.MainAppBarExpandListener;
|
||||
import com.yunbao.main.interfaces.MainAppBarLayoutListener;
|
||||
|
||||
import net.lucode.hackware.magicindicator.MagicIndicator;
|
||||
import net.lucode.hackware.magicindicator.ViewPagerHelper;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.CommonPagerTitleView;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.w3c.dom.Text;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2019/2/20.
|
||||
*/
|
||||
|
||||
public abstract class AbsMainHomeParentComViewHolder extends AbsMainViewHolder {
|
||||
|
||||
private AppBarLayout mAppBarLayout;
|
||||
protected ViewPager mViewPager;
|
||||
public MagicIndicator mIndicator;
|
||||
private TextView mRedPoint;//显示未读消息数量的红点
|
||||
protected AbsMainHomeChildViewHolder[] mViewHolders;
|
||||
private MainAppBarLayoutListener mAppBarLayoutListener;
|
||||
private MainAppBarExpandListener mAppBarExpandListener;
|
||||
private boolean mPaused;
|
||||
protected List<FrameLayout> mViewList;
|
||||
private int mAppLayoutOffestY;
|
||||
private List<ImageView> simplePagerTitleViewList;
|
||||
private List<TextView> textViewList;
|
||||
|
||||
public AbsMainHomeParentComViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
}
|
||||
|
||||
public void refreshIndex(int index) {
|
||||
for (int i = 0; i < simplePagerTitleViewList.size(); i++) {
|
||||
if (index == i) {
|
||||
simplePagerTitleViewList.get(i).setVisibility(View.VISIBLE);
|
||||
textViewList.get(i).setTextSize(20);
|
||||
} else {
|
||||
simplePagerTitleViewList.get(i).setVisibility(View.INVISIBLE);
|
||||
textViewList.get(i).setTextSize(18);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
mAppBarLayout = (AppBarLayout) findViewById(R.id.appBarLayout);
|
||||
simplePagerTitleViewList = new ArrayList<>();
|
||||
textViewList = new ArrayList<>();
|
||||
View mAppBarChildAt = mAppBarLayout.getChildAt(0);
|
||||
AppBarLayout.LayoutParams mAppBarParams = (AppBarLayout.LayoutParams) mAppBarChildAt.getLayoutParams();
|
||||
mAppBarParams.setScrollFlags(0);
|
||||
mAppBarLayout.addOnOffsetChangedListener(new AppBarStateListener() {
|
||||
@Override
|
||||
public void onStateChanged(AppBarLayout appBarLayout, int state) {
|
||||
switch (state) {
|
||||
case AppBarStateListener.EXPANDED:
|
||||
if (mAppBarExpandListener != null) {
|
||||
mAppBarExpandListener.onExpand(true);
|
||||
}
|
||||
break;
|
||||
case AppBarStateListener.MIDDLE:
|
||||
case AppBarStateListener.COLLAPSED:
|
||||
if (mAppBarExpandListener != null) {
|
||||
mAppBarExpandListener.onExpand(false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
mAppBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
|
||||
@Override
|
||||
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
|
||||
if (mAppBarLayoutListener != null) {
|
||||
if (verticalOffset > mAppLayoutOffestY) {
|
||||
mAppBarLayoutListener.onOffsetChanged(false);
|
||||
} else if (verticalOffset < mAppLayoutOffestY) {
|
||||
mAppBarLayoutListener.onOffsetChanged(true);
|
||||
}
|
||||
mAppLayoutOffestY = verticalOffset;
|
||||
}
|
||||
}
|
||||
});
|
||||
mViewList = new ArrayList<>();
|
||||
int pageCount = getPageCount();
|
||||
for (int i = 0; i < pageCount; i++) {
|
||||
FrameLayout frameLayout = new FrameLayout(mContext);
|
||||
frameLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
mViewList.add(frameLayout);
|
||||
}
|
||||
mViewHolders = new AbsMainHomeChildViewHolder[pageCount];
|
||||
mViewPager = (ViewPager) findViewById(R.id.viewPager);
|
||||
if (pageCount > 1) {
|
||||
mViewPager.setOffscreenPageLimit(pageCount - 1);
|
||||
}
|
||||
mViewPager.setAdapter(new ViewPagerAdapter(mViewList));
|
||||
mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
//切换ViewPager时给主页面发消息隐藏底部(只针对商城)
|
||||
EventBus.getDefault().post("DownAnimaiton");
|
||||
mAppBarLayout.setExpanded(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
loadPageData(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
mIndicator = (MagicIndicator) findViewById(R.id.indicator);
|
||||
final String[] titles = getTitles();
|
||||
CommonNavigator commonNavigator = new CommonNavigator(mContext);
|
||||
commonNavigator.setAdapter(new CommonNavigatorAdapter() {
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return titles.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPagerTitleView getTitleView(Context context, final int index) {
|
||||
CommonPagerTitleView commonPagerTitleView = new CommonPagerTitleView(mContext);
|
||||
commonPagerTitleView.setContentView(R.layout.simple_pager_title_layout);
|
||||
// 初始化
|
||||
final ImageView titleImg = (ImageView) commonPagerTitleView.findViewById(R.id.index);
|
||||
final TextView titleText = (TextView) commonPagerTitleView.findViewById(R.id.title);
|
||||
titleText.setText(titles[index]);
|
||||
|
||||
commonPagerTitleView.setOnPagerTitleChangeListener(new CommonPagerTitleView.OnPagerTitleChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onSelected(int index, int totalCount) {
|
||||
if (index == 3) {
|
||||
return;
|
||||
}
|
||||
titleText.setTextSize(20);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeselected(int index, int totalCount) {
|
||||
if (index == 3) {
|
||||
return;
|
||||
}
|
||||
titleText.setTextSize(18);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLeave(int index, int totalCount, float leavePercent, boolean leftToRight) {
|
||||
if (index == 3) {
|
||||
return;
|
||||
}
|
||||
titleImg.setScaleX(1.1f + (0.8f - 1.1f) * leavePercent);
|
||||
titleImg.setScaleY(1.1f + (0.8f - 1.1f) * leavePercent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnter(int index, int totalCount, float enterPercent, boolean leftToRight) {
|
||||
if (index == 3) {
|
||||
return;
|
||||
}
|
||||
titleImg.setScaleX(0.8f + (1.1f - 0.8f) * enterPercent);
|
||||
titleImg.setScaleY(0.8f + (1.1f - 0.8f) * enterPercent);
|
||||
}
|
||||
});
|
||||
commonPagerTitleView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mViewPager != null) {
|
||||
mViewPager.setCurrentItem(index);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
simplePagerTitleViewList.add(titleImg);
|
||||
textViewList.add(titleText);
|
||||
return commonPagerTitleView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPagerIndicator getIndicator(Context context) {
|
||||
LinePagerIndicator linePagerIndicator = new LinePagerIndicator(context);
|
||||
linePagerIndicator.setMode(LinePagerIndicator.MODE_WRAP_CONTENT);
|
||||
linePagerIndicator.setXOffset(DpUtil.dp2px(5));
|
||||
linePagerIndicator.setRoundRadius(DpUtil.dp2px(2));
|
||||
linePagerIndicator.setColors(Color.parseColor("#7d77fc"));
|
||||
return null;
|
||||
}
|
||||
});
|
||||
mIndicator.setNavigator(commonNavigator);
|
||||
ViewPagerHelper.bind(mIndicator, mViewPager);
|
||||
mRedPoint = (TextView) findViewById(R.id.red_point);
|
||||
|
||||
mIndicator.setNavigator(commonNavigator);
|
||||
ViewPagerHelper.bind(mIndicator, mViewPager);
|
||||
//默认选择第几个
|
||||
mIndicator.onPageSelected(1);
|
||||
mViewPager.setCurrentItem(1);
|
||||
unReadMsgHandle();
|
||||
}
|
||||
|
||||
private void unReadMsgHandle() {
|
||||
String unReadCount = "0";
|
||||
if (SpUtil.getInstance().getBooleanValue(SpUtil.HAS_SYSTEM_MSG)) {
|
||||
unReadCount = "1";
|
||||
}
|
||||
// String unReadCountIM = ImMessageUtil.getInstance().getAllUnReadMsgCount();
|
||||
|
||||
// try {
|
||||
// int num1=Integer.parseInt(unReadCount);
|
||||
// int num2=Integer.parseInt(unReadCountIM);
|
||||
// int num3=num1+num2;
|
||||
// setUnReadCount(""+num3);
|
||||
// }catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置AppBarLayout滑动监听
|
||||
*/
|
||||
public void setAppBarLayoutListener(MainAppBarLayoutListener appBarLayoutListener) {
|
||||
mAppBarLayoutListener = appBarLayoutListener;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置AppBarLayout展开监听
|
||||
*/
|
||||
public void setAppBarExpandListener(MainAppBarExpandListener appBarExpandListener) {
|
||||
mAppBarExpandListener = appBarExpandListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData() {
|
||||
if (mViewPager != null) {
|
||||
loadPageData(mViewPager.getCurrentItem());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (isShowed() && mPaused) {
|
||||
loadData();
|
||||
}
|
||||
mPaused = false;
|
||||
unReadMsgHandle();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mPaused = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
mAppBarLayoutListener = null;
|
||||
mAppBarExpandListener = null;
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
public int getCurrentPage() {
|
||||
return mViewPager.getCurrentItem();
|
||||
}
|
||||
|
||||
public void setCurrentPage(int position) {
|
||||
if (mViewPager == null) {
|
||||
return;
|
||||
}
|
||||
if (mViewPager.getCurrentItem() == position) {
|
||||
loadPageData(position);
|
||||
} else {
|
||||
mViewPager.setCurrentItem(position, false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示未读消息
|
||||
*/
|
||||
public void setUnReadCount(String unReadCount) {
|
||||
if (mRedPoint != null) {
|
||||
if ("0".equals(unReadCount)) {
|
||||
if (mRedPoint.getVisibility() == View.VISIBLE) {
|
||||
mRedPoint.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
} else {
|
||||
if (mRedPoint.getVisibility() != View.VISIBLE) {
|
||||
mRedPoint.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mRedPoint.setText(unReadCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void loadPageData(int position);
|
||||
|
||||
protected abstract int getPageCount();
|
||||
|
||||
protected abstract String[] getTitles();
|
||||
|
||||
|
||||
}
|
||||
@@ -2,9 +2,11 @@ package com.yunbao.main.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -59,7 +61,7 @@ public abstract class AbsMainHomeParentViewHolder extends AbsMainViewHolder {
|
||||
public void init() {
|
||||
mAppBarLayout = (AppBarLayout) findViewById(R.id.appBarLayout);
|
||||
View mAppBarChildAt = mAppBarLayout.getChildAt(0);
|
||||
AppBarLayout.LayoutParams mAppBarParams = (AppBarLayout.LayoutParams) mAppBarChildAt.getLayoutParams();
|
||||
AppBarLayout.LayoutParams mAppBarParams = (AppBarLayout.LayoutParams) mAppBarChildAt.getLayoutParams();
|
||||
mAppBarParams.setScrollFlags(0);
|
||||
mAppBarLayout.addOnOffsetChangedListener(new AppBarStateListener() {
|
||||
@Override
|
||||
@@ -137,7 +139,7 @@ public abstract class AbsMainHomeParentViewHolder extends AbsMainViewHolder {
|
||||
public IPagerTitleView getTitleView(Context context, final int index) {
|
||||
SimplePagerTitleView simplePagerTitleView = new ColorTransitionPagerTitleView(context);
|
||||
simplePagerTitleView.setNormalColor(Color.parseColor("#B1B1B1"));
|
||||
simplePagerTitleView.setSelectedColor(Color.parseColor("#7d77fc"));
|
||||
simplePagerTitleView.setSelectedColor(Color.parseColor("#FFC621"));
|
||||
simplePagerTitleView.setText(titles[index]);
|
||||
simplePagerTitleView.setTextSize(18);
|
||||
simplePagerTitleView.getPaint().setFakeBoldText(true);
|
||||
@@ -158,7 +160,7 @@ public abstract class AbsMainHomeParentViewHolder extends AbsMainViewHolder {
|
||||
linePagerIndicator.setMode(LinePagerIndicator.MODE_WRAP_CONTENT);
|
||||
linePagerIndicator.setXOffset(DpUtil.dp2px(5));
|
||||
linePagerIndicator.setRoundRadius(DpUtil.dp2px(2));
|
||||
linePagerIndicator.setColors(Color.parseColor("#7d77fc"));
|
||||
linePagerIndicator.setColors(Color.parseColor("#FFC621"));
|
||||
return linePagerIndicator;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.yunbao.main.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.activity.CommunitySendActivity;
|
||||
import com.yunbao.common.event.FloatWarOrderEvent;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
* Created by Martin on 2024/3/6.
|
||||
* MainActivity 首页-社区
|
||||
*/
|
||||
|
||||
public class MainHomeComViewHolder extends AbsMainHomeParentComViewHolder {
|
||||
private MainHomeFollComViewHolder mainHomeFollLiveViewHolder;
|
||||
private MainHomeNewViewHolder mainHomeLiveViewHolder;
|
||||
private MainHomeRecomComViewHolder mainHomeRecomComViewHolder;
|
||||
private MainHomeGameViewHolder mainHomeGameLiveViewHolder;
|
||||
private final String mPageName = "home_page";
|
||||
private ImageView btnSend;
|
||||
private boolean floatWarOrder;
|
||||
|
||||
public boolean isFloatWarOrder() {
|
||||
return floatWarOrder;
|
||||
}
|
||||
|
||||
public MainHomeComViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.view_main_home_com;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
btnSend = (ImageView) findViewById(R.id.btn_send);
|
||||
btnSend.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(mContext, CommunitySendActivity.class);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setCurPosition(int position) {
|
||||
mViewPager.setCurrentItem(position);
|
||||
}
|
||||
|
||||
int selected = 1;
|
||||
|
||||
@Override
|
||||
protected void loadPageData(int position) {
|
||||
if (position == 3) {
|
||||
RouteUtil.forwardCommunityActivity();
|
||||
mIndicator.onPageSelected(selected);
|
||||
setCurPosition(selected);
|
||||
refreshIndex(selected);
|
||||
return;
|
||||
}
|
||||
selected = position;
|
||||
refreshIndex(position);
|
||||
switch (position) {
|
||||
case 0:
|
||||
floatWarOrder = false;
|
||||
MobclickAgent.onEvent(mContext, "home_page_follow", "首页关注列表按钮");
|
||||
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
|
||||
break;
|
||||
case 1:
|
||||
floatWarOrder = false;
|
||||
MobclickAgent.onEvent(mContext, "home_page_hot", "首页热门列表按钮");
|
||||
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
|
||||
break;
|
||||
case 2:
|
||||
floatWarOrder = false;
|
||||
MobclickAgent.onEvent(mContext, "home_page_recommend", "首页推荐列表按钮");
|
||||
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
|
||||
break;
|
||||
case 3:
|
||||
floatWarOrder = true;
|
||||
MobclickAgent.onEvent(mContext, "home_page_redpk", "首页红包列表按钮");
|
||||
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(true));
|
||||
break;
|
||||
}
|
||||
if (mViewHolders == null) {
|
||||
return;
|
||||
}
|
||||
AbsMainHomeChildViewHolder vh = mViewHolders[position];
|
||||
if (vh == null) {
|
||||
if (mViewList != null && position < mViewList.size()) {
|
||||
FrameLayout parent = mViewList.get(position);
|
||||
if (parent == null) {
|
||||
return;
|
||||
}
|
||||
if (position == -1) {
|
||||
} else if (position == 0) {
|
||||
mainHomeFollLiveViewHolder = new MainHomeFollComViewHolder(mContext, parent);
|
||||
vh = mainHomeFollLiveViewHolder;
|
||||
|
||||
} else if (position == 1) {
|
||||
mainHomeLiveViewHolder = new MainHomeNewViewHolder(mContext, parent);
|
||||
vh = mainHomeLiveViewHolder;
|
||||
|
||||
} else if (position == 2) {
|
||||
mainHomeRecomComViewHolder = new MainHomeRecomComViewHolder(mContext, parent);
|
||||
vh = mainHomeRecomComViewHolder;
|
||||
}
|
||||
|
||||
if (vh == null) {
|
||||
return;
|
||||
}
|
||||
mViewHolders[position] = vh;
|
||||
vh.addToParent();
|
||||
vh.subscribeActivityLifeCycle();
|
||||
}
|
||||
}
|
||||
if (vh != null) {
|
||||
vh.loadData();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPageCount() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@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),};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,92 +1,33 @@
|
||||
package com.yunbao.main.views;
|
||||
|
||||
import static android.content.Context.CLIPBOARD_SERVICE;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.momo.mcamera.util.JsonUtil;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.HtmlConfig;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.LiveClassBean;
|
||||
import com.yunbao.common.bean.NativeCallbackModel;
|
||||
import com.yunbao.common.dialog.CinemaTicketPopupWindow;
|
||||
import com.yunbao.common.dialog.WarOrderExchangeDetailsPopupWindow;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.JavascriptInterfacePlayLetUtils;
|
||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.views.LoadingView;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
import com.yunbao.main.activity.MyWalletActivity;
|
||||
import com.yunbao.main.adapter.MainHomeLivesClassAdapter;
|
||||
import com.yunbao.main.dialog.EncourageDialog;
|
||||
import com.yunbao.main.fragment.BattlePassRewardFragment;
|
||||
import com.yunbao.main.fragment.MainHomeCommunityFragment;
|
||||
import com.yunbao.main.fragment.MainHomeCommunityVideoFragment;
|
||||
import com.yunbao.main.fragment.SearchResultsFragment;
|
||||
import com.yunbao.main.utils.BottomBarUtil;
|
||||
import com.yunbao.share.ui.SharePopDialog;
|
||||
import com.yunbao.video.activity.VideoPlayActivity;
|
||||
import com.yunbao.video.utils.VideoStorge;
|
||||
|
||||
import net.lucode.hackware.magicindicator.MagicIndicator;
|
||||
import net.lucode.hackware.magicindicator.ViewPagerHelper;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||
@@ -95,13 +36,8 @@ import net.lucode.hackware.magicindicator.buildins.commonnavigator.indicators.Li
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.SimplePagerTitleView;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Created by Chen Haoxuan on 2022/3/25.
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
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 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;
|
||||
|
||||
public class MainHomeFollComViewHolder extends AbsMainHomeChildViewHolder implements OnItemClickListener<ActiveBean> {
|
||||
private CommonRefreshWaterfallView mRefreshView;
|
||||
private MainHomeComAdapter mAdapter;
|
||||
|
||||
public MainHomeFollComViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.view_main_home_com_recom;
|
||||
}
|
||||
|
||||
public static int pp;
|
||||
|
||||
//显示顶部商城tab时,显示底部tabGroup
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onUpdata(String str) {
|
||||
if ("Updata".equals(str)) {
|
||||
if (mRefreshView != null) {
|
||||
mRefreshView.showRefreshBar();
|
||||
mRefreshView.mRecyclerView.scrollToPosition(0);
|
||||
}
|
||||
} else if ("blacklist".equals(str)) {
|
||||
if (mRefreshView != null) {
|
||||
mRefreshView.showRefreshBar();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
|
||||
mRefreshView = (CommonRefreshWaterfallView) findViewById(R.id.refreshView);
|
||||
mRefreshView.setEmptyLayoutId(R.layout.view_no_data_foll_live);
|
||||
EventBus.getDefault().register(this);
|
||||
|
||||
/*ItemDecoration decoration = new ItemDecoration(mContext, 0x00000000, 5, 0);
|
||||
decoration.setOnlySetItemOffsetsButNoDraw(true);
|
||||
mRefreshView.setItemDecoration(decoration);
|
||||
*/
|
||||
mRefreshView.setRecyclerViewAdapter(mAdapter);
|
||||
mRefreshView.setDataHelper(new CommonRefreshWaterfallView.DataHelper<ActiveBean>() {
|
||||
@Override
|
||||
public RefreshAdapter<ActiveBean> getAdapter() {
|
||||
if (mAdapter == null) {
|
||||
mAdapter = new MainHomeComAdapter(mContext);
|
||||
mAdapter.setOnItemClickListener(MainHomeFollComViewHolder.this);
|
||||
}
|
||||
return mAdapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData(int p, HttpCallback callback) {
|
||||
Log.i("t2", "aaa" + p);
|
||||
pp = 1;
|
||||
CommonHttpUtil.getCommunityFollow(p, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ActiveBean> processData(String[] info) {
|
||||
return JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<ActiveBean> list, int count) {
|
||||
EventBus.getDefault().post(new AnchorRecommendModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<ActiveBean> loadItemList, int loadItemCount) {
|
||||
mAdapter.insertList(loadItemList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreFailure() {
|
||||
|
||||
}
|
||||
});
|
||||
mRefreshView.initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(ActiveBean bean, int position) {
|
||||
Intent intent = new Intent(mContext, CommunityDetailsActivity.class);
|
||||
intent.putExtra("active", (Parcelable) bean);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData() {
|
||||
// if (mRefreshView != null) {
|
||||
// mRefreshView.initData();
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
MainHttpUtil.cancel(MainHttpConsts.GET_HOME_FOLLOW);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
release();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,336 @@
|
||||
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;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
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.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.ActiveBean;
|
||||
import com.yunbao.common.bean.NewCommunityType;
|
||||
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.manager.CommunityTypeManager;
|
||||
import com.yunbao.common.manager.OpenAdManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.live.bean.RedPackBean;
|
||||
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 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.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by Martin on 2024/3/6.
|
||||
* MainActivity 社区-热门
|
||||
*/
|
||||
|
||||
public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements OnItemClickListener<ActiveBean> {
|
||||
private View mBtnDismiss;
|
||||
public static CommonRefreshWaterfallView mRefreshView;
|
||||
private RecyclerView mClassRecyclerViewTop;
|
||||
private MainHomeComAdapter mAdapter;
|
||||
private ObjectAnimator mShowAnimator;
|
||||
private ObjectAnimator mHideAnimator;
|
||||
public static ImageView btnUseIco;
|
||||
private int select = 0;
|
||||
//是否是首頁
|
||||
private int intoIndex = 0;
|
||||
private List<ActiveBean> new_data;
|
||||
private Map<String, String> gotoRoomKey = new HashMap<>();
|
||||
private Dialog mShowLoadingDialog;
|
||||
private String typeHot;
|
||||
|
||||
public MainHomeNewViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.view_main_home_com_hot;
|
||||
}
|
||||
|
||||
//显示顶部商城tab时,显示底部tabGroup
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onUpdata(String str) {
|
||||
if ("Updata".equals(str)) {
|
||||
if (mRefreshView != null) {
|
||||
mRefreshView.showRefreshBar();
|
||||
mRefreshView.mRecyclerView.scrollToPosition(0);
|
||||
}
|
||||
} else if ("blacklist".equals(str)) {
|
||||
if (mRefreshView != null) {
|
||||
mRefreshView.showRefreshBar();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@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();
|
||||
select = list.get(0).getId();
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
mBtnDismiss = findViewById(R.id.btn_dismiss);
|
||||
mBtnDismiss.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (canClick()) {
|
||||
if (mShowAnimator != null) {
|
||||
mShowAnimator.cancel();
|
||||
}
|
||||
if (mHideAnimator != null) {
|
||||
mHideAnimator.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
mRefreshView = (CommonRefreshWaterfallView) findViewById(R.id.refreshView);
|
||||
btnUseIco = (ImageView) findViewById(R.id.btn_use_ico);
|
||||
mRefreshView.setEmptyLayoutId(R.layout.view_no_data_live);
|
||||
EventBus.getDefault().register(this);
|
||||
|
||||
mRefreshView.setLoadMoreEnable(true);
|
||||
mRefreshView.setRecyclerViewAdapter(mAdapter);
|
||||
mRefreshView.setDataHelper(new CommonRefreshWaterfallView.DataHelper<ActiveBean>() {
|
||||
@Override
|
||||
public RefreshAdapter<ActiveBean> getAdapter() {
|
||||
if (mAdapter == null) {
|
||||
mAdapter = new MainHomeComAdapter(mContext);
|
||||
mAdapter.setOnItemClickListener(MainHomeNewViewHolder.this);
|
||||
}
|
||||
return mAdapter;
|
||||
}
|
||||
|
||||
@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, "熱門")) {
|
||||
CommonHttpUtil.getCommunityHotList(p, callback);
|
||||
} else {
|
||||
CommonHttpUtil.getTalkHotDynamicList(select, p, callback);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ActiveBean> processData(String[] info) {
|
||||
new_data = new ArrayList<>();
|
||||
new_data = JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
||||
return new_data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<ActiveBean> list, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<ActiveBean> loadItemList, int loadItemCount) {
|
||||
new_data = new ArrayList<>();
|
||||
for (int j = 0; j < loadItemList.size(); j++) {
|
||||
new_data.add(loadItemList.get(j));
|
||||
}
|
||||
if (loadItemList.size() > 0) {
|
||||
mAdapter.insertList(new_data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreFailure() {
|
||||
|
||||
}
|
||||
});
|
||||
mClassRecyclerViewTop = (RecyclerView) findViewById(R.id.classRecyclerView_top);
|
||||
mClassRecyclerViewTop.setHasFixedSize(true);
|
||||
mClassRecyclerViewTop.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||
mRefreshView.initData();
|
||||
initCommunityTypeList(list);
|
||||
}
|
||||
|
||||
|
||||
public void initCommunityTypeList(List<NewCommunityType> list) {
|
||||
if (list != null && list.size() > 0) {
|
||||
List<NewCommunityType> targetList = new ArrayList<>();
|
||||
if (list.size() <= 6) {
|
||||
targetList.addAll(list);
|
||||
} else {
|
||||
targetList.addAll(list);
|
||||
}
|
||||
final MainHomeComClassAdapter topAdapter = new MainHomeComClassAdapter(mContext, targetList, false);
|
||||
topAdapter.setOnItemClickListener(new OnItemClickListener<NewCommunityType>() {
|
||||
@Override
|
||||
public void onItemClick(NewCommunityType bean, int position) {
|
||||
/*switch (bean.getEnglish()) {
|
||||
case "Hot":
|
||||
MobclickAgent.onEvent(mContext, "home_page_recommend_hot", "热门");
|
||||
break;
|
||||
case "New":
|
||||
MobclickAgent.onEvent(mContext, "home_page_recommend_new", "新秀");
|
||||
break;
|
||||
case "Pretty":
|
||||
MobclickAgent.onEvent(mContext, "home_page_recommend_pretty", "颜值");
|
||||
break;
|
||||
case "Dance":
|
||||
MobclickAgent.onEvent(mContext, "home_page_recommend_dance", "舞蹈");
|
||||
break;
|
||||
case "Mr.Right":
|
||||
MobclickAgent.onEvent(mContext, "home_page_recommend_mr.right", "男神");
|
||||
break;
|
||||
case "Music":
|
||||
MobclickAgent.onEvent(mContext, "home_page_recommend_music", "音乐");
|
||||
break;
|
||||
default:
|
||||
MobclickAgent.onEvent(mContext, "home_page_recommend_other", "其他");
|
||||
break;
|
||||
}*/
|
||||
if (!canClick()) {
|
||||
return;
|
||||
}
|
||||
select = bean.getId();
|
||||
typeHot = bean.getTalk_name();
|
||||
mRefreshView.initData();
|
||||
topAdapter.choice = position;
|
||||
topAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
if (mClassRecyclerViewTop != null) {
|
||||
mClassRecyclerViewTop.setAdapter(topAdapter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
});*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Banner双击可能会导致进入两次直播间,点击Banner后需要展示加载中动画
|
||||
*/
|
||||
private void showLoadingDialog() {
|
||||
mShowLoadingDialog = DialogUitl.loadingDialog(mContext);
|
||||
mShowLoadingDialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
MainHttpUtil.cancel(MainHttpConsts.GET_HOT);
|
||||
if (mHideAnimator != null) {
|
||||
mHideAnimator.cancel();
|
||||
}
|
||||
if (mShowAnimator != null) {
|
||||
mShowAnimator.cancel();
|
||||
}
|
||||
mShowAnimator = null;
|
||||
mHideAnimator = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
release();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
if (mShowLoadingDialog != null) {
|
||||
mShowLoadingDialog.dismiss();
|
||||
mShowLoadingDialog = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
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 org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 社区-发现
|
||||
*/
|
||||
public class MainHomeRecomComViewHolder extends AbsMainHomeChildViewHolder implements OnItemClickListener<ActiveBean> {
|
||||
private CommonRefreshWaterfallView mRefreshView;
|
||||
private MainHomeComAdapter mAdapter;
|
||||
|
||||
public MainHomeRecomComViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.view_main_home_com_recom;
|
||||
}
|
||||
|
||||
public static int pp;
|
||||
|
||||
//显示顶部商城tab时,显示底部tabGroup
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onUpdata(String str) {
|
||||
if ("Updata".equals(str)) {
|
||||
if (mRefreshView != null) {
|
||||
mRefreshView.showRefreshBar();
|
||||
mRefreshView.mRecyclerView.scrollToPosition(0);
|
||||
}
|
||||
} else if ("blacklist".equals(str)) {
|
||||
if (mRefreshView != null) {
|
||||
mRefreshView.showRefreshBar();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
|
||||
mRefreshView = (CommonRefreshWaterfallView) findViewById(R.id.refreshView);
|
||||
mRefreshView.setEmptyLayoutId(R.layout.view_no_data_live);
|
||||
EventBus.getDefault().register(this);
|
||||
mRefreshView.setRecyclerViewAdapter(mAdapter);
|
||||
mRefreshView.setDataHelper(new CommonRefreshWaterfallView.DataHelper<ActiveBean>() {
|
||||
@Override
|
||||
public RefreshAdapter<ActiveBean> getAdapter() {
|
||||
if (mAdapter == null) {
|
||||
mAdapter = new MainHomeComAdapter(mContext);
|
||||
mAdapter.setOnItemClickListener(MainHomeRecomComViewHolder.this);
|
||||
}
|
||||
return mAdapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData(int p, HttpCallback callback) {
|
||||
pp = p;
|
||||
CommonHttpUtil.getCommunityFind(p, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ActiveBean> processData(String[] info) {
|
||||
if (pp == 1) {
|
||||
return JSON.parseArray(Arrays.toString(info), ActiveBean.class);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<ActiveBean> list, int count) {
|
||||
EventBus.getDefault().post(new AnchorRecommendModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<ActiveBean> loadItemList, int loadItemCount) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreFailure() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mRefreshView.initData();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(ActiveBean bean, int position) {
|
||||
Intent intent = new Intent(mContext, CommunityDetailsActivity.class);
|
||||
intent.putExtra("active", (Parcelable) bean);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData() {
|
||||
// if (mRefreshView != null) {
|
||||
// mRefreshView.initData();
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
MainHttpUtil.cancel(MainHttpConsts.GET_RANDOM);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
release();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -464,7 +464,7 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh
|
||||
avatar = userBean.getAvatar();
|
||||
ImgLoader.displayBlur(mContext, avatar, mAvatarBg);
|
||||
ImgLoader.displayAvatar(mContext, avatar, mAvatar);
|
||||
if (userBean.getDress().getAvatar_frame() != null) {
|
||||
/*if (userBean.getDress().getAvatar_frame() != null) {
|
||||
if (userBean.getDress().getAvatar_frame().contains("svga")) {
|
||||
try {
|
||||
new SVGAParser(mContext).parse(new URL(userBean.getDress().getAvatar_frame()), new SVGAParser.ParseCompletion() {
|
||||
@@ -485,7 +485,7 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh
|
||||
} else {
|
||||
ImgLoader.display(mContext, userBean.getDress().getAvatar_frame(), gift_svga);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
if (userBean.getDress().getMedal() != null) {
|
||||
|
||||
12
main/src/main/res/drawable/bg_main_community_type.xml
Normal file
12
main/src/main/res/drawable/bg_main_community_type.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="45"
|
||||
android:endColor="#FF83C6"
|
||||
android:startColor="#EB6FFF" />
|
||||
<corners
|
||||
android:bottomLeftRadius="15dp"
|
||||
android:bottomRightRadius="15dp"
|
||||
android:topLeftRadius="15dp"
|
||||
android:topRightRadius="15dp" />
|
||||
</shape>
|
||||
12
main/src/main/res/drawable/bg_main_community_type_01.xml
Normal file
12
main/src/main/res/drawable/bg_main_community_type_01.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="45"
|
||||
android:endColor="#FF83C6"
|
||||
android:startColor="#EB6FFF" />
|
||||
<corners
|
||||
android:bottomLeftRadius="15dp"
|
||||
android:bottomRightRadius="15dp"
|
||||
android:topLeftRadius="15dp"
|
||||
android:topRightRadius="15dp" />
|
||||
</shape>
|
||||
12
main/src/main/res/drawable/bg_main_community_type_02.xml
Normal file
12
main/src/main/res/drawable/bg_main_community_type_02.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="45"
|
||||
android:endColor="@color/white"
|
||||
android:startColor="@color/white" />
|
||||
<corners
|
||||
android:bottomLeftRadius="15dp"
|
||||
android:bottomRightRadius="15dp"
|
||||
android:topLeftRadius="15dp"
|
||||
android:topRightRadius="15dp" />
|
||||
</shape>
|
||||
302
main/src/main/res/layout/item_main_home_com.xml
Normal file
302
main/src/main/res/layout/item_main_home_com.xml
Normal file
@@ -0,0 +1,302 @@
|
||||
<?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:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/live_info_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<com.yunbao.common.custom.MyRelativeLayout5
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="9dp"
|
||||
android:paddingLeft="5dp">
|
||||
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_corner_radius="10dp" />
|
||||
|
||||
<com.yunbao.common.custom.RatioRoundImageView
|
||||
android:id="@+id/bgs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:src="@mipmap/bg_main_item_bottom"
|
||||
app:ri_ratio="0.5"
|
||||
app:riv_corner_radius="10dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/view_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/live_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/views"
|
||||
android:layout_width="46dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:background="@mipmap/live_zt">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_live_ico"
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="5dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="5dp"
|
||||
android:src="@mipmap/icon_main_rest_work" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_live_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingLeft="8dp"
|
||||
android:text="休息"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/type"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="16dp"
|
||||
android:scaleType="fitXY" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:textColor="#fff"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="#fff"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<com.yunbao.common.custom.DrawableTextView
|
||||
android:id="@+id/num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:textColor="#B3ffffff"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold"
|
||||
app:dt_left_drawable="@mipmap/icon_main_live_num"
|
||||
app:dt_left_height="14dp"
|
||||
app:dt_left_width="14dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/pk_avatar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_border_color="@color/color_white"
|
||||
app:riv_border_width="0.8dp"
|
||||
app:riv_corner_radius="2dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pk_ico"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="33dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:src="@mipmap/live_pk" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dr_pk_ico"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:src="@mipmap/multiplayerpk" />
|
||||
|
||||
|
||||
</com.yunbao.common.custom.MyRelativeLayout5>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lt_week_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<com.yunbao.common.custom.MyRelativeLayout5
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="9dp"
|
||||
android:paddingLeft="5dp">
|
||||
|
||||
<ViewFlipper
|
||||
android:id="@+id/viewflipper_banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="3dp"
|
||||
android:flipInterval="1000"
|
||||
android:inAnimation="@anim/vice_screen_come_in"
|
||||
android:outAnimation="@anim/vice_screen_come_out"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_week_head"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="3dp"
|
||||
android:background="@color/transparent"
|
||||
android:src="@mipmap/chat_head_mo"
|
||||
android:visibility="visible" />
|
||||
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/week_svga"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
app:autoPlay="true" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_marginBottom="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="#fff"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<com.yunbao.common.custom.DrawableTextView
|
||||
android:id="@+id/num2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:textColor="#B3ffffff"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold"
|
||||
app:dt_left_drawable="@mipmap/icon_main_live_num"
|
||||
app:dt_left_height="14dp"
|
||||
app:dt_left_width="14dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</com.yunbao.common.custom.MyRelativeLayout5>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.xj.marqueeview.MarqueeView
|
||||
android:id="@+id/rv_ranking_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="65dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginBottom="9dp"
|
||||
android:background="@drawable/border_f1f1f1"
|
||||
android:visibility="gone"
|
||||
app:mvDirection="bottom_to_top"
|
||||
app:mvInterval="3000">
|
||||
|
||||
</com.xj.marqueeview.MarqueeView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/red_packet"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:visibility="gone"
|
||||
app:srcCompat="@mipmap/icon_red_packet"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
22
main/src/main/res/layout/item_main_home_com_class.xml
Normal file
22
main/src/main/res/layout/item_main_home_com_class.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
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_height="30dp"
|
||||
android:background="@drawable/bg_main_com_type"
|
||||
android:gravity="center"
|
||||
android:text="音乐"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
27
main/src/main/res/layout/simple_pager_title_layout.xml
Normal file
27
main/src/main/res/layout/simple_pager_title_layout.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/root"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
android:gravity="center|bottom"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:gravity="center"
|
||||
android:text="關注"
|
||||
android:textColor="@color/black1"
|
||||
android:textSize="22dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/index"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@mipmap/icon_index" />
|
||||
|
||||
</LinearLayout>
|
||||
66
main/src/main/res/layout/view_main_home_com.xml
Normal file
66
main/src/main/res/layout/view_main_home_com.xml
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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="match_parent"
|
||||
android:background="@mipmap/bg_main"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBarLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:fadingEdge="none"
|
||||
app:elevation="0dp"
|
||||
app:layout_behavior="com.yunbao.common.custom.FixAppBarLayoutBehavior">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_scrollFlags="scroll|enterAlways">
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_toLeftOf="@id/btn_search"
|
||||
tools:ignore="NotSibling">
|
||||
|
||||
<net.lucode.hackware.magicindicator.MagicIndicator
|
||||
android:id="@+id/indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_send"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="10dp"
|
||||
android:contentDescription="TODO"
|
||||
android:onClick="mainClick"
|
||||
android:padding="9dp"
|
||||
android:src="@mipmap/icon_main_add" />
|
||||
</RelativeLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/viewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent"
|
||||
android:overScrollMode="never"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
</LinearLayout>
|
||||
45
main/src/main/res/layout/view_main_home_com_hot.xml
Normal file
45
main/src/main/res/layout/view_main_home_com_hot.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/classRecyclerView_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
<com.yunbao.common.custom.CommonRefreshWaterfallView
|
||||
android:id="@+id/refreshView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="55dp" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/btn_dismiss"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:visibility="invisible">
|
||||
|
||||
<View
|
||||
android:id="@+id/shadow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0"
|
||||
android:background="#80000000" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/classRecyclerView_dialog"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:overScrollMode="never"
|
||||
android:paddingBottom="10dp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
19
main/src/main/res/layout/view_main_home_com_recom.xml
Normal file
19
main/src/main/res/layout/view_main_home_com_recom.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
|
||||
<com.yunbao.common.custom.CommonRefreshWaterfallView
|
||||
android:id="@+id/refreshView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginBottom="55dp"
|
||||
android:layout_marginRight="10dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
BIN
main/src/main/res/mipmap-mdpi/icon_main_add.png
Normal file
BIN
main/src/main/res/mipmap-mdpi/icon_main_add.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
Reference in New Issue
Block a user