直播关闭

This commit is contained in:
18401019693 2022-08-09 16:54:30 +08:00
parent 6ce970df07
commit 2db6115534
46 changed files with 1484 additions and 309 deletions

View File

@ -1,4 +1,4 @@
package com.yunbao.main.views;
package com.yunbao.common.views.weight;
import android.content.Context;
import android.graphics.Canvas;

View File

@ -0,0 +1,143 @@
package com.yunbao.common.views.weight;
import android.animation.Animator;
import android.content.Context;
import android.graphics.Canvas;
import android.os.Handler;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.TranslateAnimation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.ViewFlipper;
import com.yunbao.common.R;
import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.glide.ImgLoader;
import java.util.List;
/**
* 首页精彩推荐banner自定义组件
*/
public class FloatBannerView extends RelativeLayout {
private View rootView;
private LinearLayout rootLayout;
private ViewFlipper homeBanner;
private FrameLayout bannerLayout, bannerLayout2, bannerLayoutC;
private ClipPathCircleImage clipImage, bigclipImage;
private List<AnchorRecommendItemModel> list;
//默认定时器时间
private int delayMillis = 800;
//Handler定时加载下一张的数据
private Handler bannerHandler = new Handler();
private int index = 0;
public FloatBannerView(Context context) {
super(context);
}
public FloatBannerView(Context context, AttributeSet attrs) {
super(context, attrs);
rootView = View.inflate(context, R.layout.view_home_float_banner, this);
homeBanner = rootView.findViewById(R.id.banner);
// bigclipImage = rootView.findViewById(R.id.banner_layout_image);
// bannerLayout = rootView.findViewById(R.id.banner_layout);
// bannerLayout2 = rootView.findViewById(R.id.banner_layout2);
// bannerLayoutC = rootView.findViewById(R.id.banner_layout_c);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
}
/**
* 设置轮播数据
*
* @param list
*/
public void showBanner(List<AnchorRecommendItemModel> list) {
for (int i = 0; i < list.size(); i++) {
View contextView = View.inflate(getContext(), R.layout.view_home_float_banner_item, null);
ImageView imageView = contextView.findViewById(R.id.clip_image);
ImgLoader.display2(getContext(), list.get(i).getAvatar(), imageView);
homeBanner.addView(contextView);
}
TranslateAnimation translateAnimation = new TranslateAnimation(homeBanner.getX(), homeBanner.getY(), homeBanner.getX() / 3 * 2, homeBanner.getY() / 3 * 2);
homeBanner.setOutAnimation(translateAnimation);
post(new Runnable() {
@Override
public void run() {
bannerHandler.removeCallbacks(mFlipRunnable);
bannerHandler.postDelayed(mFlipRunnable, delayMillis);
}
});
}
//轮播动起来
private void carouselMoving() {
if (null == list || list.size() <= 0) return;
//获取轮播展示的下标
//如果轮播展示的是最后一张底图展示第一张
if (index == (list.size() - 1)) {
ImgLoader.display2(getContext(), list.get(0).getAvatar(), clipImage);
} else {
ImgLoader.display2(getContext(), list.get(index + 1).getAvatar(), clipImage);
}
}
private final Runnable mFlipRunnable = new Runnable() {
@Override
public void run() {
homeBanner.showNext();
bannerHandler.postDelayed(mFlipRunnable, delayMillis);
}
};
/**/
private void moveViewToTargetView(View view, View targetView) {
final float x = view.getX() / 3 * 2;
final float y = view.getY() / 2;
final float targetX = targetView.getX() / 3 * 2;
final float targetY = targetView.getY() / 2;
view.animate()
.translationX(-(x - targetX))
.translationY(-(y - targetY))
.scaleX(1.2f)
.scaleY(1.2f)
.setDuration(700)
.setInterpolator(new DecelerateInterpolator())
.withLayer()
.setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
view.animate().cancel();
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
})
.start();
}
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:duration="700"
android:fromXDelta="100%p"
android:toXDelta="0%p" />
</set>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:duration="1500"
android:fromAlpha="1.0"
android:toAlpha="0.0" />
</set>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="20dp" />
<gradient android:angle="360" android:endColor="#f249A6FC" android:startColor="#f2D480FF" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="60dp" />
<solid android:color="@color/white" />
</shape>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="123dp"
android:layout_height="35.33dp"
android:gravity="center_vertical">
<RelativeLayout
android:layout_width="123dp"
android:layout_height="35.33dp"
android:layout_alignParentEnd="true"
android:background="@drawable/background_new_home_folat_banner"
android:gravity="center_vertical"
android:paddingStart="7dp"
android:paddingTop="5dp"
android:paddingEnd="7dp"
android:paddingBottom="5dp" />
<ViewFlipper
android:id="@+id/banner"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_centerVertical="true"
android:layout_marginStart="25dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_marginEnd="15dp"
android:text="@string/wonderful_live"
android:textColor="@color/white"
android:textSize="9sp" />
</RelativeLayout>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/banner_layout2"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center_vertical"
android:background="@drawable/bg_white_clip">
<com.yunbao.common.views.weight.ClipPathCircleImage
android:id="@+id/clip_image"
android:layout_width="23.5dp"
android:layout_height="23.5dp"
android:layout_gravity="center" />
</FrameLayout>
<!-- <FrameLayout-->
<!-- android:id="@+id/banner_layout"-->
<!-- android:layout_width="30dp"-->
<!-- android:layout_height="30dp"-->
<!-- android:background="@drawable/bg_white_clip">-->
<!-- <com.yunbao.common.views.weight.ClipPathCircleImage-->
<!-- android:id="@+id/banner_layout_image"-->
<!-- android:layout_width="29dp"-->
<!-- android:layout_height="29dp"-->
<!-- android:layout_gravity="center" />-->
<!-- </FrameLayout>-->
</FrameLayout>

View File

@ -870,4 +870,5 @@
<string name="you_may_also_like">猜你喜歡</string>
<string name="anchor">主播</string>
<string name="anchor_more">更多</string>
<string name="wonderful_live">精彩直播</string>
</resources>

View File

@ -141,17 +141,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
mLiveBean.setGoodNum(u.getGoodName());
mLiveBean.setCity(u.getCity());
mBeautySdkType = CommonAppConfig.getInstance().getBeautySdkType();
//添加推流预览控件
// if (mLiveSDK == Constants.LIVE_SDK_TX) {
// if ("3".equals(mBeautySdkType)){
// mLivePushViewHolder = new LivePushTxViewHolder360Beauty(mContext, (ViewGroup) findViewById(R.id.preview_container));
// }
// else {
mLivePushViewHolder = new LivePushTxViewHolder(mContext, (ViewGroup) findViewById(R.id.preview_container));
// }
// } else {
// mLivePushViewHolder = new LivePushKsyViewHolder(mContext, (ViewGroup) findViewById(R.id.preview_container), mLiveKsyConfigBean);
// }
mLivePushViewHolder.setLivePushListener(new LivePushListener() {
@Override
public void onPreviewStart() {
@ -208,70 +198,6 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
break;
case Constants.LIVE_FUNC_DR://多人PK
ToastUtil.show("敬請期待");
//
// DialogUitl.showSimpleDialog(mContext, "是否確認進行多人PK確認後扣除1點次數當日剩餘次數3", false,
// new DialogUitl.SimpleCallback2() {
// @Override
// public void onConfirmClick(Dialog dialog, String content) {
// HttpClient.getInstance().get("live.createDRPKroom", "live.createDRPKroom")
// .params("uid", CommonAppConfig.getInstance().getUid())
// .params("type", "1")
// .params("sign", "1")
// .execute(new HttpCallback() {
// @Override
// public void onSuccess(int code, String msg, String[] info) {
//
// if (code == 0) {
// ToastUtil.show("多人房间ok");
// btn_start_dr_pk.setVisibility(View.VISIBLE);
// dr_pk_view.setVisibility(View.VISIBLE);
// final SocketSendBean msg1 = new SocketSendBean()
// .param("_method_", Constants.SOCKET_LIVE_DRPK)
// .param("action", 9)
// .param("msgtype", 1)
// .param("ct", "直播关闭");
// msg1.create();
// V2TIMManager.getInstance().sendGroupTextMessage(msg1.mResult.toString(), "g" + mLiveUid, V2TIMMessage.V2TIM_PRIORITY_NORMAL, new V2TIMSendCallback<V2TIMMessage>() {
// @Override
// public void onProgress(int progress) {
// Log.i("tx", "发送中" + progress);
//
// }
//
// @Override
// public void onSuccess(V2TIMMessage v2TIMMessage) {
// Log.i("tx", "发送成功");
// isDRPK = 1;
// btn_start_dr_pk_view.setVisibility(View.VISIBLE);
// dr_pk_view.setVisibility(View.VISIBLE);
// LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) mPreView.getLayoutParams();
// params.width = mPreView.getWidth() / 2;
// params.height = DpUtil.dp2px(250);
// params.topMargin = DpUtil.dp2px(130);
// mPreView.setLayoutParams(params);
//
// }
//
// @Override
// public void onError(int code, String desc) {
// Log.i("tx", code + "发送失败" + desc);
//
// }
// });
// } else {
// ToastUtil.show("多人房间不ok");
// ToastUtil.show(msg);
// }
// }
// });
//
// }
//
// @Override
// public void onCancelClick() {
//
// }
// });
break;
case Constants.LIVE_FUNC_BEAUTY://美颜
@ -417,41 +343,6 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
* 设置美颜
*/
public void beauty() {
// Log.d("设置美颜","type="+mBeautySdkType);
// if (mLiveBeautyViewHolder == null) {
//// if (CommonAppConfig.getInstance().isTiBeautyEnable()) {
//// mLiveBeautyViewHolder = new TiBeautyViewHolder(mContext, mContainer);
//// } else {
//// mLiveBeautyViewHolder = new DefaultBeautyViewHolder(mContext, mContainer);
//// }
//// String mBeautySdkType= CommonAppConfig.getInstance().getBeautySdkType();
// if ("2".equals(mBeautySdkType)) {
// mLiveBeautyViewHolder = new TiBeautyViewHolder(mContext, mContainer);
// } else if ("3".equals(mBeautySdkType)){
//// mLiveBeautyViewHolder = new Beauty360ViewHolder(mContext, mContainer);
// mLiveBeautyViewHolder = new Beauty360ViewHolder(this, mContainer);
// }else {
// mLiveBeautyViewHolder = new DefaultBeautyViewHolder(mContext, mContainer);
// }
//
//
// mLiveBeautyViewHolder.setVisibleListener(new BeautyViewHolder.VisibleListener() {
// @Override
// public void onVisibleChanged(boolean visible) {
// if (mLiveReadyViewHolder != null) {
// if (visible) {
// mLiveReadyViewHolder.hide();
// } else {
// mLiveReadyViewHolder.show();
// }
// }
// }
// });
// if (mLivePushViewHolder != null) {
// mLiveBeautyViewHolder.setEffectListener(mLivePushViewHolder.getEffectListener());
// }
// }
// mLiveBeautyViewHolder.show();
if (mLiveReadyViewHolder != null) {
mLiveReadyViewHolder.hide();
}
@ -466,7 +357,6 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
*/
public void light() {
if (mLiveRoomViewHolder != null) {
// mLiveRoomViewHolder.playLightAnim();
}
}
@ -550,21 +440,8 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
ToastUtil.show(R.string.live_link_mic_cannot_game);
return;
}
// if (mGamePresenter != null) {
// GameDialogFragment fragment = new GameDialogFragment();
// fragment.setGamePresenter(mGamePresenter);
// fragment.show(getSupportFragmentManager(), "GameDialogFragment");
// }
}
/**
* 关闭游戏
*/
// public void closeGame() {
// if (mGamePresenter != null) {
// mGamePresenter.closeGame();
// }
// }
/**
* 开播成功
@ -665,23 +542,6 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
}
}
//游戏相关
// if (CommonAppConfig.GAME_ENABLE) {
// mGameList = JSON.parseArray(obj.getString("game_switch"), Integer.class);
// GameParam param = new GameParam();
// param.setContext(mContext);
// param.setParentView(mContainerWrap);
// param.setTopView(mContainer);
// param.setInnerContainer(mLiveRoomViewHolder.getInnerContainer());
// param.setGameActionListener(new GameActionListenerImpl(LiveAnchorActivity.this, mSocketClient));
// param.setLiveUid(mLiveUid);
// param.setStream(mStream);
// param.setAnchor(true);
// param.setCoinName(mCoinName);
// param.setObj(obj);
// mGamePresenter = new GamePresenter(param);
// mGamePresenter.setGameList(mGameList);
// }
}
/**
@ -768,7 +628,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
}
}
if (mLiveEndViewHolder == null) {
mLiveEndViewHolder = new LiveEndViewHolder(mContext, mRoot);
mLiveEndViewHolder = new LiveEndViewHolder(mContext, mRoot,mLiveBean.getUid());
mLiveEndViewHolder.subscribeActivityLifeCycle();
mLiveEndViewHolder.addToParent();
mLiveEndViewHolder.showData(mLiveBean, mStream);

View File

@ -8,13 +8,6 @@ import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Looper;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.viewpager.widget.PagerAdapter;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
@ -24,9 +17,14 @@ import android.view.ViewParent;
import android.widget.FrameLayout;
import android.widget.ImageView;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.PagerAdapter;
import com.adjust.sdk.Adjust;
import com.adjust.sdk.AdjustEvent;
import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.opensource.svgaplayer.SVGAImageView;
@ -39,7 +37,6 @@ import com.yunbao.common.HtmlConfig;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.custom.MyViewPager;
import com.yunbao.common.dialog.LiveChargeDialogFragment;
import com.yunbao.common.event.UpdateTablePoint;
import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback;
@ -106,11 +103,8 @@ import io.rong.imlib.model.Conversation;
import io.rong.message.TextMessage;
import pl.droidsonroids.gif.GifImageView;
import static com.yunbao.common.CommonAppContext.logger;
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
import static com.yunbao.common.utils.RouteUtil.PATH_GOOGLE;
import static com.yunbao.common.utils.RouteUtil.PATH_MAIN;
import static com.yunbao.live.presenter.LiveLinkMicPresenter.mBannerList2;
import static com.yunbao.live.views.LivePlayKsyViewHolder.setViewUP;
import static com.yunbao.live.views.LivePlayRyViewHolder.Micing;
@ -164,6 +158,7 @@ public class LiveAudienceActivity extends LiveActivity {
public static int backIndex = 0;//0=未判断1=已判断
public static ProcessResultUtil mProcessResultUtil;
private LiveImDeletUtil liveImDeletUtil;
public static int isattention;
@Override
public <T extends View> T findViewById(@IdRes int id) {
@ -391,19 +386,15 @@ public class LiveAudienceActivity extends LiveActivity {
}
private void clearRoomData() {
// if (isRy == false) {
if (mSocketClient != null) {
mSocketClient.disConnect();
mSocketClient = null;
}
// } else {
if (mSocketRyClient != null) {
mSocketRyClient.disConnect();
mSocketRyClient = null;
}
// }
if (mLivePlayViewHolder != null) {
mLivePlayViewHolder.stopPlay();
}
@ -415,9 +406,6 @@ public class LiveAudienceActivity extends LiveActivity {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.clearData();
}
// if (mGamePresenter != null) {
// mGamePresenter.clearGame();
// }
if (mLiveEndViewHolder != null) {
mLiveEndViewHolder.removeFromParent();
}
@ -532,7 +520,7 @@ public class LiveAudienceActivity extends LiveActivity {
mLiveRoomViewHolder.setVotes(obj.getString("votestotal"));
//真爱排行 数量
mLiveRoomViewHolder.setMedaRankNum(obj.getString("medalRankNum"));
int isattention = obj.getIntValue("isattention");
isattention =obj.getIntValue("isattention");
if (isattention == 0) {
if (countDownTimer != null) {
countDownTimer.cancel();
@ -803,10 +791,11 @@ public class LiveAudienceActivity extends LiveActivity {
}
}
if (mLiveEndViewHolder == null) {
mLiveEndViewHolder = new LiveEndViewHolder(mContext, mSecondPage);
mLiveEndViewHolder = new LiveEndViewHolder(mContext, mSecondPage, mLiveBean.getUid());
mLiveEndViewHolder.subscribeActivityLifeCycle();
mLiveEndViewHolder.addToParent();
}
mLiveBean.setIsattention(isattention + "");
mLiveEndViewHolder.showData(mLiveBean, mStream);
}

View File

@ -4,13 +4,14 @@ import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.DialogFragment;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.fragment.app.DialogFragment;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.lzy.okgo.callback.Callback;
@ -77,7 +78,6 @@ import java.util.List;
import cn.rongcloud.rtc.api.RCRTCEngine;
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
import cn.rongcloud.rtc.base.RTCErrorCode;
//import cn.rongcloud.rtc.jni.video.RCRect;
import io.rong.imlib.IRongCallback;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation;
@ -90,15 +90,16 @@ import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_DISABLE;
import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_ENABLE;
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK;
import static com.yunbao.live.views.AbsRyLivePushViewHolder.mPreView;
import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
import static com.yunbao.live.views.LivePushRyViewHolder.dr_pk_view;
import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_dr_pk_nub;
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_start_dr_pk;
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_start_dr_pk_view;
//import cn.rongcloud.rtc.jni.video.RCRect;
//import cn.rongcloud.rtc.jni.video.RCRect;
/**
* Created by cxf on 2018/10/7.
* 主播直播间
@ -792,7 +793,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
});
if (mLivePushViewHolder != null) {
mLivePushViewHolder.release();
}
@ -850,7 +850,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
}
if (mLiveEndViewHolder == null) {
mLiveEndViewHolder = new LiveEndViewHolder(mContext, mRoot);
mLiveEndViewHolder = new LiveEndViewHolder(mContext, mRoot,mLiveBean.getUid());
mLiveEndViewHolder.subscribeActivityLifeCycle();
mLiveEndViewHolder.addToParent();
mLiveEndViewHolder.showData(mLiveBean, mStream);

View File

@ -0,0 +1,59 @@
package com.yunbao.live.adapter;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.live.R;
import com.yunbao.live.views.SearchRecommendBodyItemViewHolder;
import java.util.ArrayList;
import java.util.List;
/**
* 猜你喜欢适配器
*/
public class SearchRecommendBodyAdapter extends RecyclerView.Adapter {
List<AnchorRecommendItemModel> itemModelList = new ArrayList<>();
private Activity activity;
public SearchRecommendBodyAdapter(Activity activity) {
this.activity = activity;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_main_home_lives, parent, false);
return new SearchRecommendBodyItemViewHolder(herdView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
int height = DeviceUtils.getScreenHeight(activity);
if (holder instanceof SearchRecommendBodyItemViewHolder) {
SearchRecommendBodyItemViewHolder bodyItemViewHolder = (SearchRecommendBodyItemViewHolder) holder;
bodyItemViewHolder.showData(itemModelList.get(position), height);
}
}
@Override
public int getItemCount() {
return itemModelList.size();
}
/**
* 设置数据源
*/
public void showData(List<AnchorRecommendItemModel> list) {
itemModelList.clear();
itemModelList.addAll(list);
notifyDataSetChanged();
}
}

View File

@ -5,6 +5,7 @@ import android.os.Parcelable;
import android.text.TextUtils;
import com.alibaba.fastjson.annotation.JSONField;
import com.google.gson.annotations.SerializedName;
import com.yunbao.common.bean.WeekListBean;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
@ -48,6 +49,18 @@ public class LiveBean implements Parcelable {
private String url;
private String drpk_status;
private int is_rong;
//是否關注 1關注 2未關注
private String isattention = "";
public String getIsattention() {
return isattention;
}
public LiveBean setIsattention(String isattention) {
this.isattention = isattention;
return this;
}
private List<WeekListBean> mWeekList = new ArrayList<>();
public List<WeekListBean> getmWeekList() {

View File

@ -0,0 +1,22 @@
package com.yunbao.live.event;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.SearchModel;
public class JumpUserHomeEvent extends BaseModel {
//携带用户信息
private SearchModel model = new SearchModel();
public JumpUserHomeEvent(SearchModel model) {
this.model = model;
}
public SearchModel getModel() {
return model;
}
public JumpUserHomeEvent setModel(SearchModel model) {
this.model = model;
return this;
}
}

View File

@ -309,9 +309,7 @@ public class SocketRyClient {
int action = map.getIntValue("action");
if (action == 18) {
mListener.onLiveEnd();
if (LiveEndViewHolder.mDuration != null) {
LiveEndViewHolder.upData(map.getString("votes"), map.getString("length"), map.getIntValue("nums"));
}
LiveEndViewHolder.upData(map.getString("votes"), map.getString("length"), map.getIntValue("nums"),map.getString("uname"));
} else if (action == 19) {
mListener.onAnchorInvalid();
}

View File

@ -0,0 +1,41 @@
package com.yunbao.live.utils;
import android.util.SparseIntArray;
import com.yunbao.common.Constants;
import com.yunbao.live.R;
/**
* Created by cxf on 2018/10/11.
*/
public class MainIconUtil {
private static SparseIntArray sLiveTypeMap;//直播间类型图标
private static SparseIntArray sCashTypeMap;//提现图片
static {
sLiveTypeMap = new SparseIntArray();
// sLiveTypeMap.put(Constants.LIVE_TYPE_NORMAL, R.mipmap.icon_main_live_type_0);
sLiveTypeMap.put(Constants.LIVE_TYPE_PWD, R.mipmap.icon_main_live_type_1);
sLiveTypeMap.put(Constants.LIVE_TYPE_PAY, R.mipmap.icon_main_live_type_2);
sLiveTypeMap.put(Constants.LIVE_TYPE_TIME, R.mipmap.icon_main_live_type_3);
sLiveTypeMap.put(Constants.LIVE_TYPE_RESTING, R.mipmap.icon_main_live_type_4);
sCashTypeMap = new SparseIntArray();
sCashTypeMap.put(Constants.CASH_ACCOUNT_ALI, R.mipmap.icon_cash_ali);
sCashTypeMap.put(Constants.CASH_ACCOUNT_WX, R.mipmap.icon_cash_wx);
sCashTypeMap.put(Constants.CASH_ACCOUNT_BANK, R.mipmap.icon_cash_bank);
}
public static int getLiveTypeIcon(int key) {
return sLiveTypeMap.get(key);
}
public static int getCashTypeIcon(int key) {
return sCashTypeMap.get(key);
}
}

View File

@ -1,30 +1,50 @@
package com.yunbao.live.views;
import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.CommonAppConfig;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.blankj.utilcode.util.GsonUtils;
import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LiveInfoModel;
import com.yunbao.common.bean.SetAttentsModel;
import com.yunbao.common.dialog.LoadingDialog;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.http.main.MainNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.AbsViewHolder;
import com.yunbao.common.views.weight.ClipPathCircleImage;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAnchorActivity;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.adapter.SearchRecommendBodyAdapter;
import com.yunbao.live.bean.LiveBean;
import com.yunbao.live.event.JumpUserHomeEvent;
import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
/**
* Created by cxf on 2018/10/9.
@ -38,9 +58,27 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList
public static TextView mDuration;//直播时长
public static TextView mVotes;//收获映票
public static TextView mWatchNum;//观看人数
//直播类型
private static LiveOfType type;
public LiveEndViewHolder(Context context, ViewGroup parentView) {
private static TextView liveDurationUser, liveNameUser,
goHomeUser, anchorName, liveDurationAnchor, liveVotes, liveWatchNum;
private RelativeLayout userLiveEnd, anchorLiveEnd;
private ClipPathCircleImage clipImageUser, clipImageanchor;
private LinearLayout followUser;
private ImageView changeBatchUser;
private RecyclerView likeList;
private SearchRecommendBodyAdapter adapter;
private IMLoginModel model = null;
public LiveEndViewHolder(Context context, ViewGroup parentView,String uid) {
super(context, parentView);
model = IMLoginManager.get(mContext).getUserInfo();
if (TextUtils.equals(model.getId()+"",uid)){
type = LiveOfType.ANCHOR;
}else {
type = LiveOfType.USER;
}
}
@Override
@ -50,49 +88,176 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList
@Override
public void init() {
Bus.getOn(this);
mAvatar1 = (ImageView) findViewById(R.id.avatar_1);
mAvatar2 = (ImageView) findViewById(R.id.avatar_2);
mName = (TextView) findViewById(R.id.name);
mDuration = (TextView) findViewById(R.id.duration);
mVotes = (TextView) findViewById(R.id.votes);
mWatchNum = (TextView) findViewById(R.id.watch_num);
findViewById(R.id.btn_back).setOnClickListener(this);
TextView votesName = (TextView) findViewById(R.id.votes_name);
votesName.setText(WordUtil.getString(R.string.live_votes) + CommonAppConfig.getInstance().getVotesName());
userLiveEnd = (RelativeLayout) findViewById(R.id.user_live_end);
anchorLiveEnd = (RelativeLayout) findViewById(R.id.anchor_live_end);
// mAvatar2 = (ImageView) findViewById(R.id.avatar_2);
// mName = (TextView) findViewById(R.id.name);
// mDuration = (TextView) findViewById(R.id.duration);
// mVotes = (TextView) findViewById(R.id.votes);
// mWatchNum = (TextView) findViewById(R.id.watch_num);
// findViewById(R.id.btn_back).setOnClickListener(this);
// TextView votesName = (TextView) findViewById(R.id.votes_name);
// votesName.setText(WordUtil.getString(R.string.live_votes) + CommonAppConfig.getInstance().getVotesName());
if (type == LiveOfType.USER) {
initViewOfUser();
initDataOfUser();
anchorLiveEnd.setVisibility(View.GONE);
} else {
userLiveEnd.setVisibility(View.GONE);
initViewOfAnchor();
}
public static void upData(String votes,String length,int nums){
}
/**
* 加载用户猜你喜欢数据
*/
private void initDataOfUser() {
//展示网络请求弹窗
LoadingDialog fragment = new LoadingDialog();
fragment.show(((FragmentActivity) mContext).getSupportFragmentManager(), "LoadingDialog");
MainNetManager.get((Activity) mContext)
.anchorRecommend("3", new HttpCallback<AnchorRecommendModel>() {
@Override
public void onSuccess(AnchorRecommendModel data) {
fragment.dismiss();
//组装搜索历史数据
adapter.showData(data.getList());
}
@Override
public void onError(String error) {
fragment.dismiss();
}
});
}
/**
* 用户界面控件初始化
*/
private void initViewOfUser() {
liveDurationUser = (TextView) findViewById(R.id.live_duration_user);
liveNameUser = (TextView) findViewById(R.id.live_name_user);
goHomeUser = (TextView) findViewById(R.id.go_home_user);
clipImageUser = (ClipPathCircleImage) findViewById(R.id.clip_image_user);
followUser = (LinearLayout) findViewById(R.id.follow_user);
changeBatchUser = (ImageView) findViewById(R.id.change_batch_user);
likeList = (RecyclerView) findViewById(R.id.like_list);
goHomeUser.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mContext instanceof LiveAnchorActivity) {
((LiveAnchorActivity) mContext).superBackPressed();
} else if (mContext instanceof LiveAudienceActivity) {
((LiveAudienceActivity) mContext).exitLiveRoom();
} else if (mContext instanceof LiveRyAnchorActivity) {
((LiveRyAnchorActivity) mContext).superBackPressed();
}
}
});
GridLayoutManager gridLayoutManager = new GridLayoutManager(mContext, 3);
likeList.setLayoutManager(gridLayoutManager);
adapter = new SearchRecommendBodyAdapter((Activity) mContext);
likeList.setAdapter(adapter);
changeBatchUser.setOnClickListener(v -> initDataOfUser());
}
/**
* 主播界面控件初始化
*/
private void initViewOfAnchor() {
clipImageanchor = (ClipPathCircleImage) findViewById(R.id.clip_image_anchor);
anchorName = (TextView) findViewById(R.id.anchor_name);
liveDurationAnchor = (TextView) findViewById(R.id.live_duration_anchor);
liveVotes = (TextView) findViewById(R.id.live_votes);
liveWatchNum = (TextView) findViewById(R.id.live_watch_num);
findViewById(R.id.go_home_anchor)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mContext instanceof LiveAnchorActivity) {
((LiveAnchorActivity) mContext).superBackPressed();
} else if (mContext instanceof LiveAudienceActivity) {
((LiveAudienceActivity) mContext).exitLiveRoom();
} else if (mContext instanceof LiveRyAnchorActivity) {
((LiveRyAnchorActivity) mContext).superBackPressed();
}
}
});
}
public static void upData(String votes, String length, int nums,String uname) {
Log.e("", votes + "votes" + length + "length" + nums + "nums");
mVotes.setText(votes);
mDuration.setText(length);
mWatchNum.setText(StringUtil.toWan(nums));
// mVotes.setText(votes);
// mDuration.setText(length);
// mWatchNum.setText(StringUtil.toWan(nums));
if (type == LiveOfType.USER) {
liveDurationUser.setText(length);
liveNameUser.setText(uname);
} else {
liveDurationAnchor.setText(length);
liveVotes.setText(votes);
liveWatchNum.setText(StringUtil.toWan(nums));
}
}
public void showData(LiveBean liveBean, final String stream) {
if (liveBean != null) {
mName.setText(liveBean.getUserNiceName());
ImgLoader.displayBlur(mContext, liveBean.getAvatar(), mAvatar1);
ImgLoader.displayAvatar(mContext, liveBean.getAvatar(), mAvatar2);
if (TextUtils.equals(model.getId()+"",liveBean.getUid())){
type = LiveOfType.ANCHOR;
}else {
type = LiveOfType.USER;
}
// mParentView.postDelayed(new Runnable() {
// @Override
// public void run() {
//
// LiveHttpUtil.getLiveEndInfo(stream, new HttpCallback() {
// @Override
// public void onSuccess(int code, String msg, String[] info) {
// if (code == 0 && info.length > 0) {
// JSONObject obj = JSON.parseObject(info[0]);
// mVotes.setText(obj.getString("votes"));
// mDuration.setText(obj.getString("length"));
// mWatchNum.setText(StringUtil.toWan(obj.getLongValue("nums")));
// }
// }
// });
// }
// }, 500);
if (type == LiveOfType.USER) {
initViewOfUser();
initDataOfUser();
anchorLiveEnd.setVisibility(View.GONE);
userLiveEnd.setVisibility(View.VISIBLE);
} else {
anchorLiveEnd.setVisibility(View.VISIBLE);
userLiveEnd.setVisibility(View.GONE);
initViewOfAnchor();
}
if (liveBean != null && type == LiveOfType.USER) {
model = IMLoginManager.get(mContext).getUserInfo();
ImgLoader.displayAvatar(mContext, liveBean.getAvatar(), clipImageUser);
followUser.setVisibility(TextUtils.equals(liveBean.getIsattention(), "1") ? View.GONE : View.VISIBLE);
followUser.setOnClickListener(v -> {
LoadingDialog fragment = new LoadingDialog();
fragment.show(((FragmentActivity) mContext).getSupportFragmentManager(), "LoadingDialog");
LiveNetManager.get(mContext)
.setAttents(String.valueOf(liveBean.getUid()), new HttpCallback<SetAttentsModel>() {
@Override
public void onSuccess(SetAttentsModel data) {
followUser.setVisibility(View.GONE);
fragment.dismiss();
}
@Override
public void onError(String error) {
ToastUtil.show(error);
fragment.dismiss();
}
});
});
} else {
anchorName.setText(liveBean.getUserNiceName());
ImgLoader.displayAvatar(mContext, liveBean.getAvatar(), clipImageanchor);
}
ImgLoader.displayBlur(mContext, liveBean.getAvatar(), mAvatar1);
}
@Override
@ -110,6 +275,77 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList
@Override
public void onDestroy() {
LiveHttpUtil.cancel(LiveHttpConsts.GET_LIVE_END_INFO);
Bus.getOff(this);
}
/**
* 结束的类型
*/
public enum LiveOfType {
USER(0, "用户"),
ANCHOR(1, "主播");
private int type = 0;
private String name = "";
LiveOfType(int type, String name) {
this.type = type;
this.name = name;
}
public int getType() {
return type;
}
public LiveOfType setType(int type) {
this.type = type;
return this;
}
public String getName() {
return name;
}
public LiveOfType setName(String name) {
this.name = name;
return this;
}
}
/**
* 跳转用户首页
*/
@Subscribe(threadMode = ThreadMode.MAIN)
public void onJumpUserHome(JumpUserHomeEvent event) {
//展示网络请求弹窗
LoadingDialog fragment = new LoadingDialog();
fragment.show(((FragmentActivity) mContext).getSupportFragmentManager(), "LoadingDialog");
LiveNetManager.get(mContext)
.getLiveInfo(String.valueOf(event.getModel().getId()), new HttpCallback<LiveInfoModel>() {
@Override
public void onSuccess(LiveInfoModel data) {
fragment.dismiss();
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean, liveType, liveTypeVal, liveSdk) -> {
if (liveBean == null) {
return;
}
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
});
//讲数据转成json
String json = GsonUtils.toJson(data);
LiveBean liveBean = GsonUtils.fromJson(json, LiveBean.class);
mCheckLivePresenter.checkLive(liveBean);
}
@Override
public void onError(String error) {
fragment.dismiss();
RouteUtil.forwardUserHome(mContext, String.valueOf(event.getModel().getId()), 0);
}
});
}
}

View File

@ -359,53 +359,6 @@ public class LivePushTxViewHolder extends AbsLivePushViewHolder implements ITXLi
Log.i("uid", "" + s);
}
// @Override
// public void onConnectOtherRoom(String s, int i, String s1) {
// Log.d(TAG, "onConnectOtherRoom111: s = " + s + " , i = " + i + " , s1 = " + s1 + getLiveStream());
// TRTCCloudDef.TRTCTranscodingConfig config = new TRTCCloudDef.TRTCTranscodingConfig();
// config.videoWidth = 960;
// config.videoHeight = 540;
// config.videoBitrate = 1500;
// config.videoFramerate = 20;
// config.videoGOP = 2;
// config.audioSampleRate = 48000;
// config.audioBitrate = 64;
// config.audioChannels = 2;
// config.streamId = getLiveStream();
//
// config.mode = TRTCCloudDef.TRTC_TranscodingConfigMode_Manual;
// config.mixUsers = new ArrayList<>();
//
//// 主播自己
// TRTCCloudDef.TRTCMixUser mixUser = new TRTCCloudDef.TRTCMixUser();
// mixUser.userId = CommonAppConfig.getInstance().getUid();
// mixUser.zOrder = 0;
// mixUser.x = 0;
// mixUser.y = 0;
//
// mixUser.width = 480;
// mixUser.height = 540;
//// mixUser.roomId = CommonAppConfig.getInstance().getUid();
// config.mixUsers.add(mixUser);
//
//
// //连麦者画面位置
// TRTCCloudDef.TRTCMixUser remote = new TRTCCloudDef.TRTCMixUser();
// remote.userId = s;
// remote.streamType = TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_BIG;
//
// remote.zOrder = 1;
// remote.x = 480;
// remote.y = 0;
// remote.width = 480;
// remote.height = 540;
// remote.roomId = s;
// config.mixUsers.add(remote);
//
// mTRTCCloud.setMixTranscodingConfig(config);
//
// }
@Override
public void onDisConnectOtherRoom(int i, String s) {
Log.d(TAG, "onConnectOtherRoom0: s = " + s + " , i = " + i);
@ -527,20 +480,6 @@ public class LivePushTxViewHolder extends AbsLivePushViewHolder implements ITXLi
super.release();
LiveHttpUtil.cancel(LiveHttpConsts.LINK_MIC_TX_MIX_STREAM);
mTRTCCloud = null;
// if (mLivePusher != null) {
// mLivePusher.stopBGM();
// mLivePusher.stopPusher();
// mLivePusher.stopScreenCapture();
// mLivePusher.stopCameraPreview(false);
// mLivePusher.setVideoProcessListener(null);
// mLivePusher.setBGMNofify(null);
// mLivePusher.setPushListener(null);
// }
// mLivePusher = null;
// if (mLivePushConfig != null) {
// mLivePushConfig.setPauseImg(null);
// }
// mLivePushConfig = null;
}
@Override

View File

@ -8,7 +8,6 @@ import android.os.Message;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
@ -17,7 +16,6 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
@ -1000,6 +998,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
*/
public void setAttention(int attention) {
Log.i("tssx", attention + "");
LiveAudienceActivity.isattention = attention;
isAttention = attention;
if (mBtnFollow != null) {
if (attention == 0) {

View File

@ -0,0 +1,118 @@
package com.yunbao.live.views;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.squareup.picasso.Picasso;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.bean.SearchModel;
import com.yunbao.common.custom.RatioRoundImageView;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.formatBigNum;
import com.yunbao.live.R;
import com.yunbao.live.event.JumpUserHomeEvent;
import com.yunbao.live.utils.MainIconUtil;
public class SearchRecommendBodyItemViewHolder extends RecyclerView.ViewHolder {
private ImageView mCover, liveType, mLiveIco, mType, pkico, drPkIco, pkAvatar;
private RatioRoundImageView bgs;
private View views;
private TextView mLiveState, mTitle, mName, mNum;
public SearchRecommendBodyItemViewHolder(@NonNull View itemView) {
super(itemView);
//展示普通布局隐藏周星榜布局
itemView.findViewById(R.id.live_info_view).setVisibility(View.VISIBLE);
itemView.findViewById(R.id.lt_week_list).setVisibility(View.GONE);
mCover = itemView.findViewById(R.id.cover);
bgs = itemView.findViewById(R.id.bgs);
liveType = itemView.findViewById(R.id.live_type);
views = itemView.findViewById(R.id.views);
mLiveIco = (ImageView) itemView.findViewById(R.id.tv_live_ico);
mLiveState = (TextView) itemView.findViewById(R.id.tv_live_state);
mType = (ImageView) itemView.findViewById(R.id.type);
mTitle = (TextView) itemView.findViewById(R.id.title);
mName = (TextView) itemView.findViewById(R.id.name);
mNum = (TextView) itemView.findViewById(R.id.num);
pkico = (ImageView) itemView.findViewById(R.id.pk_ico);
drPkIco = (ImageView) itemView.findViewById(R.id.dr_pk_ico);
pkAvatar = (ImageView) itemView.findViewById(R.id.pk_avatar);
}
public void showData(AnchorRecommendItemModel model, int height) {
Context mContext = itemView.getContext();
liveType.setImageDrawable(null);
if (model.getContentPicSizeTwo() != null && !model.getContentPicSizeTwo().equals("") && height <= 1920) {
Picasso.with(mContext)
.load(model.getContentPicSizeTwo())
.into(liveType);
} else if (model.getContentPicSizeThree() != null && !model.getContentPicSizeThree().equals("") && height > 1920) {
Picasso.with(mContext)
.load(model.getContentPicSizeThree())
.into(liveType);
}
ImgLoader.display(itemView.getContext(), model.getThumb(), mCover);
bgs.setVisibility(View.VISIBLE);
pkico.setVisibility(View.GONE);
pkAvatar.setVisibility(View.GONE);
drPkIco.setVisibility(View.GONE);
if (model.getDrpkStatus() != null && model.getDrpkStatus().equals("1")) {
drPkIco.setVisibility(View.VISIBLE);
}
if (model.getPkAvatarThumb() != null && !model.getPkAvatarThumb().equals("")) {
ImgLoader.display(mContext, model.getPkAvatarThumb(), pkAvatar);
pkico.setVisibility(View.VISIBLE);
pkAvatar.setVisibility(View.VISIBLE);
}
mName.setText(model.getUserNicename());
if (TextUtils.isEmpty(model.getTitle())) {
if (mTitle.getVisibility() == View.VISIBLE) {
mTitle.setVisibility(View.GONE);
}
} else {
if (mTitle.getVisibility() != View.VISIBLE) {
mTitle.setVisibility(View.VISIBLE);
}
mTitle.setText(model.getTitle());
}
mNum.setText(formatBigNum.formatBigNum(String.valueOf(model.getHotNum())));
views.setVisibility(View.GONE);
if (model.getIslive() == 1) {
views.setVisibility(View.VISIBLE);
//直播中
mType.setImageResource(MainIconUtil.getLiveTypeIcon(model.getType()));
mType.setVisibility(View.VISIBLE);
mLiveIco.setImageResource(R.mipmap.icon_main_rest_work);
mNum.setVisibility(View.VISIBLE);
liveType.setVisibility(View.VISIBLE);
mLiveState.setText(R.string.lives_state);
} else {
views.setVisibility(View.VISIBLE);
//休息中
mType.setImageResource(MainIconUtil.getLiveTypeIcon(Constants.LIVE_TYPE_RESTING));
mType.setVisibility(View.GONE);
mLiveIco.setImageResource(R.mipmap.icon_main_rest_spot);
mLiveState.setText(R.string.rest_state);
liveType.setVisibility(View.GONE);
mNum.setVisibility(View.GONE);
}
mCover.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SearchModel searchModel = new SearchModel();
searchModel.setId(model.getUid());
Bus.get().post(new JumpUserHomeEvent(searchModel));
}
});
}
}

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="14dp" />
<solid android:color="#10ffffff" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="17dp" />
<solid android:color="#FFFD6052" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="23.33dp" />
<solid android:color="#FFFFC621" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,273 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<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/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="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
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" />
</LinearLayout>

View File

@ -14,7 +14,8 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#b3000000">
android:background="#b3000000"
android:visibility="gone">
<TextView
android:id="@+id/text_1"
@ -163,4 +164,332 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/user_live_end"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#b3000000"
android:visibility="gone">
<View
android:id="@+id/view_xian"
android:layout_width="match_parent"
android:layout_height="5dp"
android:layout_centerVertical="true"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:background="@mipmap/img_xian" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/view_xian"
android:layout_marginTop="54dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/live_end"
android:textColor="@color/white"
android:textSize="24sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
android:text="@string/live_duration"
android:textColor="@color/white"
android:textSize="13.33sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:layout_marginTop="17dp"
android:text=":"
android:textColor="@color/white"
android:textSize="13.33sp" />
<TextView
android:id="@+id/live_duration_user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="7dp"
android:layout_marginTop="17dp"
android:textColor="@color/white"
android:textSize="13.33sp" />
</LinearLayout>
<FrameLayout
android:layout_width="88.13dp"
android:layout_height="88.13dp"
android:layout_marginTop="22dp"
android:background="@drawable/bg_white_clip">
<com.yunbao.common.views.weight.ClipPathCircleImage
android:id="@+id/clip_image_user"
android:layout_width="87dp"
android:layout_height="87dp"
android:layout_gravity="center" />
</FrameLayout>
<TextView
android:id="@+id/live_name_user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/bind_phone_text2"
android:textColor="@color/white"
android:textSize="13.33sp" />
<LinearLayout
android:id="@+id/follow_user"
android:layout_width="65.33dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/background_live_end"
android:gravity="center_vertical"
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+ "
android:textColor="@color/white"
android:textSize="13.33sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/follow"
android:textColor="@color/white"
android:textSize="13.33sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/view_xian"
android:gravity="center_horizontal"
android:orientation="vertical">
<FrameLayout
android:id="@+id/type_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="11dp"
android:layout_marginTop="33.67dp"
android:layout_marginEnd="11dp">
<ImageView
android:id="@+id/change_batch_user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
android:background="@mipmap/icon_cange" />
<TextView
android:id="@+id/anchor_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:text="@string/you_may_also_like"
android:textColor="@color/white"
android:textSize="16sp" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/like_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20.67dp"
android:layout_marginStart="11dp"
android:layout_marginEnd="11dp" />
<TextView
android:id="@+id/go_home_user"
android:layout_width="206.33dp"
android:layout_height="46.67dp"
android:layout_marginStart="71dp"
android:layout_marginTop="60dp"
android:layout_marginEnd="71dp"
android:background="@drawable/background_live_end_btn"
android:gravity="center"
android:text="@string/live_back"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/anchor_live_end"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#b3000000">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="54dp"
android:text="@string/live_end"
android:textColor="@color/white"
android:textSize="24sp"
android:textStyle="bold" />
<RelativeLayout
android:id="@+id/anchor_data_show"
android:layout_width="match_parent"
android:layout_height="195.33dp"
android:layout_below="@id/title"
android:layout_marginStart="14.67dp"
android:layout_marginTop="95dp"
android:layout_marginEnd="14.67dp"
android:background="@drawable/background_anchor_live_end">
<TextView
android:id="@+id/anchor_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="58dp"
android:text="@string/follow"
android:textColor="@color/white"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/anchor_name"
android:layout_marginTop="42.67dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/live_duration_anchor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/live_duration"
android:textColor="@color/white"
android:textSize="13.33sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/live_votes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/live_votes"
android:textColor="@color/white"
android:textSize="13.33sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/live_watch_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/live_watch_num"
android:textColor="@color/white"
android:textSize="13.33sp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<FrameLayout
android:layout_width="88.13dp"
android:layout_height="88.13dp"
android:layout_above="@id/anchor_data_show"
android:layout_centerHorizontal="true"
android:layout_marginBottom="-140dp"
android:background="@drawable/bg_white_clip">
<com.yunbao.common.views.weight.ClipPathCircleImage
android:id="@+id/clip_image_anchor"
android:layout_width="87dp"
android:layout_height="87dp"
android:layout_gravity="center" />
</FrameLayout>
<TextView
android:id="@+id/go_home_anchor"
android:layout_width="206.33dp"
android:layout_height="46.67dp"
android:layout_alignParentBottom="true"
android:layout_marginStart="71dp"
android:layout_marginTop="60dp"
android:layout_marginEnd="71dp"
android:layout_marginBottom="52dp"
android:background="@drawable/background_live_end_btn"
android:gravity="center"
android:layout_centerHorizontal="true"
android:text="@string/live_back"
android:textColor="@color/white"
android:textSize="16sp" />
</RelativeLayout>
</RelativeLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

View File

@ -31,9 +31,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.android.billingclient.api.Purchase;
import com.android.billingclient.api.SkuDetails;
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
import com.google.android.gms.common.GooglePlayServicesRepairableException;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.tencent.imsdk.v2.V2TIMCallback;
@ -45,14 +42,15 @@ import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.adapter.ViewPagerAdapter;
import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.ChatRemarksBean;
import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LiveSvgGiftBean;
import com.yunbao.common.bean.NoviceInstructorModel;
import com.yunbao.common.bean.UpdataListBean;
import com.yunbao.common.custom.TabButtonGroup;
import com.yunbao.common.dialog.InstructorOperationDialog;
import com.yunbao.common.dialog.LoadingDialog;
import com.yunbao.common.event.InstructorOperationEvent;
import com.yunbao.common.event.MessageIMEvent;
import com.yunbao.common.event.NoviceInstructorEvent;
@ -60,6 +58,7 @@ import com.yunbao.common.event.RongIMConnectionStatusEvent;
import com.yunbao.common.event.UpdateTablePointMe;
import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.main.MainNetManager;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.NoviceInstructorManager;
@ -77,6 +76,7 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.VersionUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.AbsMainViewHolder;
import com.yunbao.common.views.weight.FloatBannerView;
import com.yunbao.live.bean.LiveBean;
import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil;
@ -106,7 +106,6 @@ import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
@ -161,6 +160,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
private boolean isFirstOpen = true;
private int messageNumber = 0, numberMe = 1;
private ImageView waitingTip;
private FloatBannerView floatBanner;
@Override
protected int getLayoutId() {
@ -268,6 +269,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
boolean showInvite = getIntent().getBooleanExtra(Constants.SHOW_INVITE, false);
mRootView = (ViewGroup) findViewById(R.id.rootView);
floatBanner = findViewById(R.id.float_banner_home);
mTabButtonGroup = (TabButtonGroup) findViewById(R.id.tab_group);
mViewPager = (ViewPager) findViewById(R.id.viewPager);
waitingTip = findViewById(R.id.waiting_tip);
@ -361,8 +363,31 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
mViewPager.setCurrentItem(0);
mTabButtonGroup.setCurPosition(0);
isInstructor();
//测试代码要删除
NoviceInstructorManager.get(this).setNoviceInstructor(new NoviceInstructorModel());
initAnchorRecommendBanner();
}
/**
* 首页推荐位
*/
private void initAnchorRecommendBanner() {
//展示网络请求弹窗
LoadingDialog fragment = new LoadingDialog();
fragment.show(getSupportFragmentManager(), "LoadingDialog");
MainNetManager.get(mContext)
.anchorRecommend("10", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
@Override
public void onSuccess(AnchorRecommendModel data) {
fragment.dismiss();
floatBanner.showBanner(data.getList());
}
@Override
public void onError(String error) {
fragment.dismiss();
}
});
}

View File

@ -69,9 +69,7 @@ public class SearchResultsItemFragment extends BaseFragment {
* @param type 類型
*/
public void setSearchKey(String searchKey, int type) {
//展示网络请求弹窗
LoadingDialog fragment = new LoadingDialog();
fragment.show(getChildFragmentManager(), "LoadingDialog");
this.searchKey = searchKey;
this.type = type;
if (type == 1) {
@ -86,12 +84,10 @@ public class SearchResultsItemFragment extends BaseFragment {
} else {
itemAdapter.showData(data, type);
}
fragment.dismiss();
}
@Override
public void onError(String error) {
fragment.dismiss();
ToastUtil.show(error);
}
});
@ -114,12 +110,10 @@ public class SearchResultsItemFragment extends BaseFragment {
}
}
fragment.dismiss();
}
@Override
public void onError(String error) {
fragment.dismiss();
ToastUtil.show(error);
}
});

View File

@ -160,12 +160,12 @@
android:id="@+id/waiting_tip"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="57dp"
android:layout_weight="1"
android:clickable="true"
android:visibility="gone"
android:layout_marginStart="57dp"
android:focusable="true"
android:src="@mipmap/waiting_tip"
android:focusable="true" />
android:visibility="gone" />
<View
android:layout_width="0dp"
@ -173,5 +173,14 @@
android:layout_weight="1" />
</LinearLayout>
<com.yunbao.common.views.weight.FloatBannerView
android:id="@+id/float_banner_home"
android:layout_above="@id/rt_main_tab"
android:layout_width="wrap_content"
android:layout_alignParentRight="true"
android:visibility="gone"
android:layout_marginBottom="10dp"
android:layout_height="wrap_content" />
</RelativeLayout>

View File

@ -10,7 +10,7 @@
android:layout_width="60dp"
android:layout_height="60dp">
<com.yunbao.main.views.ClipPathCircleImage
<com.yunbao.common.views.weight.ClipPathCircleImage
android:id="@+id/avatar"
android:layout_width="55dp"
android:layout_height="55dp" />