diff --git a/live/src/main/res/drawable/button_cbd5e0.xml b/live/src/main/res/drawable/button_cbd5e0.xml index 5cb18fe0d..966b06feb 100644 --- a/live/src/main/res/drawable/button_cbd5e0.xml +++ b/live/src/main/res/drawable/button_cbd5e0.xml @@ -2,7 +2,7 @@ - + diff --git a/live/src/main/res/drawable/button_ffc621.xml b/live/src/main/res/drawable/button_ffc621.xml index e4b6e8c04..5aed3c708 100644 --- a/live/src/main/res/drawable/button_ffc621.xml +++ b/live/src/main/res/drawable/button_ffc621.xml @@ -2,7 +2,7 @@ - + diff --git a/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java b/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java index 9afd0de94..8ce3b1caf 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java @@ -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) diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java index 4f58b217e..c54acd668 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java @@ -67,10 +67,10 @@ public class MainHomeLiveAdapter extends RefreshAdapter { @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 { @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 { } }); } 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 { @Override public int getItemCount() { - return super.getItemCount() + 1; + return super.getItemCount(); } class HeadVh extends RecyclerView.ViewHolder { diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeLivesClassAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeLivesClassAdapter.java index 582bf1b5c..5e82e5b90 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeLivesClassAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeLivesClassAdapter.java @@ -97,10 +97,10 @@ public class MainHomeLivesClassAdapter extends RecyclerView.Adapter= 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()); diff --git a/main/src/main/java/com/yunbao/main/views/MainListViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainListViewHolder.java index 789a6595e..cc4308f02 100644 --- a/main/src/main/java/com/yunbao/main/views/MainListViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainListViewHolder.java @@ -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; diff --git a/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder2.java b/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder2.java index e4a566c88..c0b718a0d 100644 --- a/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder2.java +++ b/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder2.java @@ -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; diff --git a/main/src/main/res/layout/item_main_home_lives_class.xml b/main/src/main/res/layout/item_main_home_lives_class.xml index c17159264..e60ed1c2b 100644 --- a/main/src/main/res/layout/item_main_home_lives_class.xml +++ b/main/src/main/res/layout/item_main_home_lives_class.xml @@ -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 @@ - + + @@ -41,20 +46,6 @@ android:layout_width="wrap_content" android:layout_height="match_parent" /> - - @@ -65,10 +56,22 @@ android:layout_alignParentRight="true" android:layout_alignParentBottom="true"> + + - + android:padding="6dp" + android:src="@mipmap/icon_main_start_live_new" /> @@ -95,7 +98,8 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/main/src/main/res/mipmap-mdpi/icon_main_bangdan.png b/main/src/main/res/mipmap-mdpi/icon_main_bangdan.png new file mode 100644 index 000000000..6a81663ab Binary files /dev/null and b/main/src/main/res/mipmap-mdpi/icon_main_bangdan.png differ diff --git a/main/src/main/res/mipmap-mdpi/icon_main_search.png b/main/src/main/res/mipmap-mdpi/icon_main_search.png index 258b32ca5..b4ddb09a1 100644 Binary files a/main/src/main/res/mipmap-mdpi/icon_main_search.png and b/main/src/main/res/mipmap-mdpi/icon_main_search.png differ diff --git a/main/src/main/res/mipmap-mdpi/icon_main_start_live_new.png b/main/src/main/res/mipmap-mdpi/icon_main_start_live_new.png new file mode 100644 index 000000000..5abbaf82f Binary files /dev/null and b/main/src/main/res/mipmap-mdpi/icon_main_start_live_new.png differ