新增首页战令入口

This commit is contained in:
hch 2024-01-12 15:33:16 +08:00
parent ac6eb21e06
commit 7627219e77
13 changed files with 121 additions and 7 deletions

View File

@ -20,6 +20,12 @@ public class AnchorRecommendModel extends BaseModel {
@SerializedName("red_packet_show")
private int showRedPacket = 0;//是否显示首页红包浮窗
//是否支持换一批0=不支持 1=支持
@SerializedName("live_battle_pass_show_status")
private int showWarOrder = 0;//是否显示首页戰令
//是否支持换一批0=不支持 1=支持
@SerializedName("up_show")
private int upShow = 0;
@SerializedName("list")
@ -40,6 +46,14 @@ public class AnchorRecommendModel extends BaseModel {
return this;
}
public int getShowWarOrder() {
return showWarOrder;
}
public void setShowWarOrder(int showWarOrder) {
this.showWarOrder = showWarOrder;
}
public int getListShow() {
return listShow;
}

View File

@ -41,7 +41,7 @@ public class SamsungUtil {
public void init() {
iapHelper = IapHelper.getInstance(mContext);
//设置支付模式 OPERATION_MODE_PRODUCTION 正式模式 OPERATION_MODE_TEST 测试模式
iapHelper.setOperationMode(HelperDefine.OperationMode.OPERATION_MODE_TEST);
iapHelper.setOperationMode(HelperDefine.OperationMode.OPERATION_MODE_PRODUCTION);
}
/**

View File

@ -31,6 +31,7 @@ public class RouteUtil {
public static final String PATH_LIVEREPORT = "/live/LiveReportActivity";
public static final String PATH_MYWEBVIEWACTIVTITY = "/main/MyWebViewActivity";
public static final String PATH_ZHUANGBANACTIVITY = "/main/ZhuangBanActivity";
public static final String PATH_COMPENSATE_ACTIVITY = "/live/CompensateActivity";
public static final String PATH_LiveZHUANGBANACTIVITY = "/live/ZhuangBanActivity";
public static final String PATH_FACEBOOKACTIVITY = "/baidu/FacebookLoginActivity";
public static final String PATH_MAIN = "/main/MainActivity";
@ -46,6 +47,7 @@ public class RouteUtil {
public static final String PATH_RED_PACKET_INFO = "/main/RedPacketInfoActivity";
public static final String PATH_RED_PACKET_USER = "/main/RedPacketUsersActivity";
public static final String PATH_SELECT_AVATAR="/main/UserAvatarSelectActivity";
public static final String PATH_BattlePassActivity="/main/BattlePassActivity";
public static void forwardFansActivity(String uid) {
ARouter.getInstance().build(PATH_FANSACTIVITY)
@ -128,6 +130,23 @@ public class RouteUtil {
.navigation();
}
/**
* 跳转到
*/
public static void forwardLiveCompensateActivity(Context context, String msgid, String banner, String title, String content, String time, String link, boolean receive) {
ARouter.getInstance().build(PATH_COMPENSATE_ACTIVITY)
.withString("msgid", msgid)
.withString("banner", banner)
.withString("title", title)
.withString("content", content)
.withString("time", time)
.withString("link", link)
.withBoolean("receive", receive)
.navigation();
}
/**
* 跳转到装扮
*/

View File

@ -1439,4 +1439,6 @@ Limited ride And limited avatar frame</string>
<string name="sys_msg_year">-</string>
<string name="sys_msg_month">-</string>
<string name="sys_msg_day"></string>
<string name="main_suspension_war_order">BattlePass</string>
</resources>

View File

@ -1438,4 +1438,6 @@
<string name="sys_msg_month"></string>
<string name="sys_msg_day"></string>
<string name="main_suspension_war_order">直播通行證</string>
</resources>

View File

@ -1437,4 +1437,6 @@
<string name="sys_msg_month"></string>
<string name="sys_msg_day"></string>
<string name="main_suspension_war_order">直播通行證</string>
</resources>

View File

@ -1434,4 +1434,6 @@
<string name="sys_msg_month"></string>
<string name="sys_msg_day"></string>
<string name="main_suspension_war_order">直播通行證</string>
</resources>

View File

@ -1443,4 +1443,6 @@ Limited ride And limited avatar frame</string>
<string name="sys_msg_month">-</string>
<string name="sys_msg_day"></string>
<string name="main_suspension_war_order">BattlePass</string>
</resources>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="24dp" />
<gradient
android:angle="270"
android:endColor="#3A27CA"
android:startColor="#E79EFB" />
</shape>

View File

@ -189,6 +189,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
private boolean isfloatBannernet = true, isFirst = true;
private View floatRedPacket;
private View floatWarOrder;
private List<AnchorStartLiveBean> startListNotifyList = new ArrayList<>();
@ -244,7 +246,9 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
v_table_redpoint = findViewById(R.id.v_table_redpoint);
v_table_redpoint_me = (View) findViewById(R.id.v_table_redpoint_me);
floatRedPacket = findViewById(R.id.red_packet);
floatWarOrder = findViewById(R.id.war_order);
initRedPacket();
initWarOrder();
Display mDisplay = getWindowManager().getDefaultDisplay();
Height = mDisplay.getHeight();
@ -329,25 +333,25 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
case 0:
//点击埋点
MobclickAgent.onEvent(mContext, "home_page", "首页");
if(mMainHomeCommunityViewHolder!=null) {
if (mMainHomeCommunityViewHolder != null) {
mMainHomeCommunityViewHolder.onPauseVideo();
}
break;
case 1:
MobclickAgent.onEvent(mContext, "community", "社区");
if(mMainHomeCommunityViewHolder!=null) {
if (mMainHomeCommunityViewHolder != null) {
mMainHomeCommunityViewHolder.onResumePlay();
}
break;
case 2:
MobclickAgent.onEvent(mContext, "information", "消息");
if(mMainHomeCommunityViewHolder!=null) {
if (mMainHomeCommunityViewHolder != null) {
mMainHomeCommunityViewHolder.onPauseVideo();
}
break;
case 3:
MobclickAgent.onEvent(mContext, "my", "我的");
if(mMainHomeCommunityViewHolder!=null) {
if (mMainHomeCommunityViewHolder != null) {
mMainHomeCommunityViewHolder.onPauseVideo();
}
break;
@ -513,12 +517,14 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
} else if (index == 2) {
floatBanner.setVisibility(View.GONE);
floatRedPacket.setVisibility(View.GONE);
floatWarOrder.setVisibility(View.GONE);
findViewById(R.id.banner_click).setVisibility(View.GONE);
isfloatBannernet = false;
if (mainMessageViewHolder != null) mainMessageViewHolder.onResume();
} else {
floatBanner.setVisibility(View.GONE);
floatRedPacket.setVisibility(View.GONE);
floatWarOrder.setVisibility(View.GONE);
findViewById(R.id.banner_click).setVisibility(View.GONE);
isfloatBannernet = false;
}
@ -528,6 +534,20 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
checkVersion();
}
/**
* 展示战令
*/
private void initWarOrder() {
if (floatWarOrder != null) {
floatWarOrder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RouteUtil.forwardBattlePass();
}
});
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
@ -594,6 +614,9 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
@Override
public void onSuccess(AnchorRecommendModel data) {
if (isFinishing()) return;
if (data.getShowWarOrder() == 0) {
floatWarOrder.setVisibility(View.GONE);
}
if (data.getListShow() == 1 && data.getList().size() > 2) {
floatBanner.setVisibility(View.VISIBLE);
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
@ -610,8 +633,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
((ProgressBar) floatRedPacket.findViewById(R.id.progress)).setProgress(data.getRedPacketNum());
((TextView) floatRedPacket.findViewById(R.id.progressText)).setText(data.getRedPacketNum() + "/" + data.getRedPacketTotal());
}
}
@Override

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="140dp"
android:layout_height="41dp"
android:background="@drawable/bg_war_order"
android:gravity="center_vertical">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginLeft="15dp"
android:src="@mipmap/icon_war_order" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:gravity="center_vertical"
android:text="@string/main_suspension_war_order"
android:textColor="@color/white"
android:textSize="15dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>

View File

@ -179,6 +179,17 @@
android:layout_above="@id/rt_main_tab"
android:layout_alignParentRight="true"
android:layout_marginRight="12dp"
android:visibility="gone"
android:layout_marginBottom="10dp" />
<include
android:id="@+id/war_order"
layout="@layout/view_float_war_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/rt_main_tab"
android:layout_alignParentRight="true"
android:layout_marginRight="12dp"
android:layout_marginBottom="10dp" />
<LinearLayout

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB