修改首頁直播UI
This commit is contained in:
parent
25a926e507
commit
08bc59f80e
@ -2,7 +2,7 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#33cbd5e0" />
|
||||
<solid android:color="@color/transparent" />
|
||||
<corners android:topLeftRadius="13dp" android:topRightRadius="13dp" android:bottomLeftRadius="13dp" android:bottomRightRadius="13dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#33FFC621" />
|
||||
<solid android:color="@color/white" />
|
||||
<corners android:topLeftRadius="13dp" android:topRightRadius="13dp" android:bottomLeftRadius="13dp" android:bottomRightRadius="13dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
@ -11,7 +11,6 @@ import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
@ -28,11 +27,11 @@ import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.pay.hw.HwBuilder;
|
||||
import com.yunbao.common.pay.samsung.SamsungUtil;
|
||||
import com.yunbao.common.utils.GoogleUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
import com.yunbao.main.utils.ColorTransitionPagerTitleView;
|
||||
import com.yunbao.main.utils.HXLinePagerIndicator;
|
||||
|
||||
import net.lucode.hackware.magicindicator.MagicIndicator;
|
||||
@ -43,14 +42,11 @@ import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNav
|
||||
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.ColorTransitionPagerTitleView;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@Route(path = RouteUtil.PATH_COIN)
|
||||
|
@ -67,10 +67,10 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if (position == 0) {
|
||||
if (position == 4) {
|
||||
return HEAD;
|
||||
} else if (position > 0) {
|
||||
LiveBean mode = mList.get(position - 1);
|
||||
} else{
|
||||
LiveBean mode = mList.get(position>4?position-1:position);
|
||||
if (TextUtils.equals(mode.getIs_week(), "1")) {
|
||||
return WEEKLAYOUT;
|
||||
} else {
|
||||
@ -114,8 +114,9 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) {
|
||||
int nowPosition = position>4?position-1:position;
|
||||
if (vh instanceof MainHomeLiveWeekItemViewHolder) {
|
||||
((MainHomeLiveWeekItemViewHolder) vh).loadViewDate(mList.get(position - 1), position - 1, Height, new MainHomeLiveWeekItemViewHolder.OnItemClickListener() {
|
||||
((MainHomeLiveWeekItemViewHolder) vh).loadViewDate(mList.get(nowPosition), nowPosition, Height, new MainHomeLiveWeekItemViewHolder.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(LiveBean bean, int position) {
|
||||
if (mOnItemClickListener != null) {
|
||||
@ -124,7 +125,7 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
|
||||
}
|
||||
});
|
||||
} else if (vh instanceof MainHomeLiveItemViewHolder) {
|
||||
((MainHomeLiveItemViewHolder) vh).loadViewDate(mList.get(position - 1), position - 1, Height, new MainHomeLiveItemViewHolder.OnItemClickListener() {
|
||||
((MainHomeLiveItemViewHolder) vh).loadViewDate(mList.get(nowPosition), nowPosition, Height, new MainHomeLiveItemViewHolder.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(LiveBean bean, int position) {
|
||||
if (mOnItemClickListener != null) {
|
||||
@ -137,7 +138,7 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return super.getItemCount() + 1;
|
||||
return super.getItemCount();
|
||||
}
|
||||
|
||||
class HeadVh extends RecyclerView.ViewHolder {
|
||||
|
@ -97,10 +97,10 @@ public class MainHomeLivesClassAdapter extends RecyclerView.Adapter<MainHomeLive
|
||||
|
||||
if (position == choice) {
|
||||
mName.setBackgroundResource(R.drawable.button_ffc621);
|
||||
mName.setTextColor(Color.parseColor("#FFC621"));
|
||||
mName.setTextColor(Color.parseColor("#FFFF4598"));
|
||||
} else {
|
||||
mName.setBackgroundResource(R.drawable.button_cbd5e0);
|
||||
mName.setTextColor(Color.parseColor("#484D68"));
|
||||
mName.setTextColor(Color.parseColor("#FF222222"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,51 @@
|
||||
package com.yunbao.main.utils;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import net.lucode.hackware.magicindicator.buildins.ArgbEvaluatorHolder;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.CommonPagerTitleView;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.SimplePagerTitleView;
|
||||
|
||||
|
||||
/**
|
||||
* 两种颜色过渡的指示器标题
|
||||
* 博客: http://hackware.lucode.net
|
||||
* Created by hackware on 2016/6/26.
|
||||
*/
|
||||
public class ColorTransitionPagerTitleView extends SimplePagerTitleView {
|
||||
private CommonPagerTitleView.OnPagerTitleChangeListener mOnPagerTitleChangeListener;
|
||||
|
||||
public void setmOnPagerTitleChangeListener(CommonPagerTitleView.OnPagerTitleChangeListener mOnPagerTitleChangeListener) {
|
||||
this.mOnPagerTitleChangeListener = mOnPagerTitleChangeListener;
|
||||
}
|
||||
|
||||
public ColorTransitionPagerTitleView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLeave(int index, int totalCount, float leavePercent, boolean leftToRight) {
|
||||
int color = ArgbEvaluatorHolder.eval(leavePercent, mSelectedColor, mNormalColor);
|
||||
setTextColor(color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnter(int index, int totalCount, float enterPercent, boolean leftToRight) {
|
||||
int color = ArgbEvaluatorHolder.eval(enterPercent, mNormalColor, mSelectedColor);
|
||||
setTextColor(color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelected(int index, int totalCount) {
|
||||
if (mOnPagerTitleChangeListener != null) {
|
||||
mOnPagerTitleChangeListener.onSelected(index, totalCount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeselected(int index, int totalCount) {
|
||||
if (mOnPagerTitleChangeListener != null) {
|
||||
mOnPagerTitleChangeListener.onDeselected(index, totalCount);
|
||||
}
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@ 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;
|
||||
@ -18,6 +18,7 @@ import com.yunbao.main.R;
|
||||
import com.yunbao.main.interfaces.AppBarStateListener;
|
||||
import com.yunbao.main.interfaces.MainAppBarExpandListener;
|
||||
import com.yunbao.main.interfaces.MainAppBarLayoutListener;
|
||||
import com.yunbao.main.utils.ColorTransitionPagerTitleView;
|
||||
|
||||
import net.lucode.hackware.magicindicator.MagicIndicator;
|
||||
import net.lucode.hackware.magicindicator.ViewPagerHelper;
|
||||
@ -26,8 +27,7 @@ import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNav
|
||||
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.ColorTransitionPagerTitleView;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.SimplePagerTitleView;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.CommonPagerTitleView;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@ -135,11 +135,11 @@ public abstract class AbsMainHomeParentViewHolder extends AbsMainViewHolder {
|
||||
|
||||
@Override
|
||||
public IPagerTitleView getTitleView(Context context, final int index) {
|
||||
SimplePagerTitleView simplePagerTitleView = new ColorTransitionPagerTitleView(context);
|
||||
simplePagerTitleView.setNormalColor(Color.parseColor("#B1B1B1"));
|
||||
simplePagerTitleView.setSelectedColor(Color.parseColor("#FFC621"));
|
||||
ColorTransitionPagerTitleView simplePagerTitleView = new ColorTransitionPagerTitleView(context);
|
||||
simplePagerTitleView.setNormalColor(Color.parseColor("#FF777777"));
|
||||
simplePagerTitleView.setSelectedColor(Color.parseColor("#FF111111"));
|
||||
simplePagerTitleView.setText(titles[index]);
|
||||
simplePagerTitleView.setTextSize(18);
|
||||
simplePagerTitleView.setTextSize(22);
|
||||
simplePagerTitleView.getPaint().setFakeBoldText(true);
|
||||
simplePagerTitleView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -149,16 +149,39 @@ public abstract class AbsMainHomeParentViewHolder extends AbsMainViewHolder {
|
||||
}
|
||||
}
|
||||
});
|
||||
simplePagerTitleView.setmOnPagerTitleChangeListener(new CommonPagerTitleView.OnPagerTitleChangeListener() {
|
||||
@Override
|
||||
public void onSelected(int index, int totalCount) {
|
||||
simplePagerTitleView.setTextSize(22);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeselected(int index, int totalCount) {
|
||||
simplePagerTitleView.setTextSize(16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLeave(int index, int totalCount, float leavePercent, boolean leftToRight) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnter(int index, int totalCount, float enterPercent, boolean leftToRight) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return simplePagerTitleView;
|
||||
}
|
||||
|
||||
@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("#FFC621"));
|
||||
linePagerIndicator.setMode(LinePagerIndicator.MODE_EXACTLY);
|
||||
linePagerIndicator.setLineWidth(40);
|
||||
linePagerIndicator.setLineHeight(10);
|
||||
linePagerIndicator.setRoundRadius(DpUtil.dp2px(16));
|
||||
linePagerIndicator.setColors(Color.parseColor("#FF111111"));
|
||||
return linePagerIndicator;
|
||||
}
|
||||
});
|
||||
|
@ -1,107 +1,42 @@
|
||||
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.yunbao.common.utils.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;
|
||||
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.ColorTransitionPagerTitleView;
|
||||
import com.yunbao.main.utils.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.
|
||||
|
@ -163,7 +163,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
|
||||
@Override
|
||||
public int getSpanSize(int position) {
|
||||
if (position == 0) {
|
||||
if (position == 4) {
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
|
@ -1,9 +1,12 @@
|
||||
package com.yunbao.main.views;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
@ -15,22 +18,35 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.dialog.GiftWallDialog;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.RandomSudGameManager;
|
||||
import com.yunbao.common.utils.AesUtils;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.event.FloatWarOrderEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.PluginManager;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.LiveConfig;
|
||||
import com.yunbao.live.activity.LiveAnchorActivity;
|
||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||
import com.yunbao.live.activity.LiveSwAnchorActivity;
|
||||
import com.yunbao.live.bean.LiveKsyConfigBean;
|
||||
import com.yunbao.live.dialog.LivePrankDialogFragment;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
@ -69,11 +85,33 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
findViewById(R.id.btn_start_live).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
|
||||
if (isAnchor) {
|
||||
String[] permissions;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
permissions = new String[]{
|
||||
//Manifest.permission.READ_MEDIA_IMAGES, 去掉选择图片的权限,到里面选择封面的时候再去申请
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
};
|
||||
} else {
|
||||
permissions = new String[]{
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
};
|
||||
}
|
||||
mProcessResultUtil.requestPermissions(permissions, mStartLiveRunnable);
|
||||
} else {
|
||||
ToastUtil.show(mContext.getString(R.string.only_open_anchor));
|
||||
}
|
||||
}
|
||||
});
|
||||
img_trophy = (ImageView) findViewById(R.id.img_trophy);
|
||||
|
||||
ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy);
|
||||
|
||||
img_trophy.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
@ -91,14 +129,76 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
findViewById(R.id.tvPlay).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
MobclickAgent.onEvent(mContext, "home_page_short_drama", "首页短剧按钮");
|
||||
RouteUtil.forwardCommunityActivity();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private Runnable mStartLiveRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (CommonAppConfig.LIVE_SDK_CHANGED) {
|
||||
if (mGetLiveSdkCallback == null) {
|
||||
mGetLiveSdkCallback = new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, final String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveHttpUtil.getisRong(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info1) {
|
||||
try {
|
||||
LiveHttpUtil.getIsSw(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] infos) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
JSONObject obj1 = JSON.parseObject(info1[0]);
|
||||
try {
|
||||
if(code==201){ //声网
|
||||
LiveSwAnchorActivity.forward(mContext, Constants.LIVE_SDK_SW, JSON.parseObject(obj.getString("android"), LiveKsyConfigBean.class));
|
||||
}else if(code==200){//融云
|
||||
LiveRyAnchorActivity.forward(mContext, obj.getIntValue("live_sdk"), JSON.parseObject(obj.getString("android"), LiveKsyConfigBean.class));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
if (!CommonAppConfig.IS_PLUGIN_MODEL || PluginManager.getInstance().isDownloadApk()) {
|
||||
PluginManager.getInstance().loadAnchorPlugin(it -> {
|
||||
LiveHttpUtil.getLiveSdk(mGetLiveSdkCallback);
|
||||
});
|
||||
} else {
|
||||
String tips = "需要下載開播插件,是否下載";
|
||||
if (!WordUtil.isNewZh()) {
|
||||
tips = "You need to download the plug-in, whether to download";
|
||||
}
|
||||
DialogUitl.showSimpleDialog(mContext, tips, new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Dialog downloadDialog = DialogUitl.loadingDialog(mContext, "Downloading...");
|
||||
downloadDialog.show();
|
||||
PluginManager.getInstance().loadAnchorPlugin(it -> {
|
||||
LiveHttpUtil.getLiveSdk(mGetLiveSdkCallback);
|
||||
downloadDialog.dismiss();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
LiveAnchorActivity.forward(mContext, CommonAppConfig.LIVE_SDK_USED, LiveConfig.getDefaultKsyConfig());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private HttpCallback mGetLiveSdkCallback;
|
||||
private ProcessResultUtil mProcessResultUtil;
|
||||
|
||||
private void testAes() {
|
||||
String aesStr ="yvNHDY/jYopEYMnjYKzm5p0WfeP/IqahmtN/zY8kH5OyAUcmqc4igt/6eSslvgSKA0fX8/imr+yHfLb2DZNKI7bikEAuagiKvJdRZ9GIvw9mix5Ap0E/BGVe3DrirxKf3XrmJL8mONw4OTn7JmDStB/SMt3tgWP9bvjVwa66BcRcIaRSxbMDm/6dN7QsLtBMjx+XzpRocH2ISTLhEhuxbjz9ovIDwETx4IgPj4LuHcPERDSeNE9TC9UWHqIo+hWoUiGc8MhSh3uO7ptOzno6Dg9Zk4uxnKZdLYeR+M9JLaja6NMloza5IjI15CIcGVT9o4HLeUVodShZjFGsw7JfMcoUBhnQEOHPSh2S8q6Py0Z0ofiTsJWUj2+XwYwyvjxx";
|
||||
//byte[] msg = AesUtils.decrypt(aesStr.getBytes(), "LhHBfcsN2VmBpHCn".getBytes());
|
||||
|
@ -10,7 +10,6 @@ import android.widget.FrameLayout;
|
||||
import com.yunbao.common.adapter.ViewPagerAdapter;
|
||||
import com.yunbao.common.event.FollowEvent;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.AbsMainViewHolder;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
|
@ -33,7 +33,6 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.adapter.ViewPagerAdapter;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.event.FollowEvent;
|
||||
@ -71,6 +70,7 @@ import com.yunbao.main.activity.FollowActivity;
|
||||
import com.yunbao.main.activity.UserHomeActivity;
|
||||
import com.yunbao.main.http.MainHttpConsts;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
import com.yunbao.main.utils.ColorTransitionPagerTitleView;
|
||||
|
||||
import net.lucode.hackware.magicindicator.MagicIndicator;
|
||||
import net.lucode.hackware.magicindicator.ViewPagerHelper;
|
||||
@ -79,7 +79,6 @@ import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNav
|
||||
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.WrapPagerIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.SimplePagerTitleView;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
@ -3,7 +3,7 @@
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:paddingRight="5dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
@ -12,7 +12,7 @@
|
||||
<TextView
|
||||
android:id="@+id/tv_class_name"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="26dp"
|
||||
android:layout_height="28dp"
|
||||
android:text="音乐"
|
||||
android:textSize="16sp"
|
||||
android:gravity="center"
|
||||
|
@ -1,17 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:src="@mipmap/entry_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBarLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_height="75dp"
|
||||
android:paddingTop="15dp"
|
||||
android:background="@color/transparent"
|
||||
android:fadingEdge="none"
|
||||
app:elevation="0dp"
|
||||
@ -19,7 +24,7 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="37dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="20dp"
|
||||
app:layout_scrollFlags="scroll|enterAlways">
|
||||
|
||||
@ -41,20 +46,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPlay"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:gravity="center"
|
||||
android:paddingTop="1dp"
|
||||
android:text="@string/main_type_theater"
|
||||
android:textColor="#B1B1B1"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:textSize="17dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
||||
|
||||
@ -65,10 +56,22 @@
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_trophy"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:src="@mipmap/icon_main_bangdan"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:contentDescription="TODO"
|
||||
android:onClick="mainClick"
|
||||
android:padding="9dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_search"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:contentDescription="TODO"
|
||||
android:onClick="mainClick"
|
||||
@ -76,15 +79,15 @@
|
||||
android:src="@mipmap/icon_main_search" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_trophy"
|
||||
android:id="@+id/btn_start_live"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:contentDescription="TODO"
|
||||
android:onClick="mainClick"
|
||||
android:padding="6dp" />
|
||||
|
||||
android:padding="6dp"
|
||||
android:src="@mipmap/icon_main_start_live_new" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@ -95,7 +98,8 @@
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/viewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="80dp"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
BIN
main/src/main/res/mipmap-mdpi/icon_main_bangdan.png
Normal file
BIN
main/src/main/res/mipmap-mdpi/icon_main_bangdan.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.4 KiB |
BIN
main/src/main/res/mipmap-mdpi/icon_main_start_live_new.png
Normal file
BIN
main/src/main/res/mipmap-mdpi/icon_main_start_live_new.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
Loading…
Reference in New Issue
Block a user