测试修改

This commit is contained in:
18401019693 2022-10-27 14:48:07 +08:00
parent fb0e35196c
commit 8b180ce664
14 changed files with 181 additions and 43 deletions

View File

@ -10,6 +10,7 @@
android:id="@+id/fun_game_pic" android:id="@+id/fun_game_pic"
android:padding="3dp" android:padding="3dp"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_marginTop="10dp"
android:layout_height="40dp" android:layout_height="40dp"
android:src="@mipmap/live_more_icon_guard" /> android:src="@mipmap/live_more_icon_guard" />

View File

@ -19,9 +19,8 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/fun_games_list" android:id="@+id/fun_games_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="62dp" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:visibility="gone" /> android:visibility="gone" />
<TextView <TextView

View File

@ -726,12 +726,22 @@ public class LiveAudienceActivity extends LiveActivity {
liveGiftDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); liveGiftDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
break; break;
case CURRENT_ACTIVITY: case CURRENT_ACTIVITY:
bundle.putString("url", event.getModel().activityUrl(mContext, mLiveBean.getUid())); int type = 0;
int show = TextUtils.isEmpty(event.getModel().getShowType()) ? 0 : Integer.parseInt(event.getModel().getShowType()); if (TextUtils.equals(event.getModel().getActiveName(), "闖關熱戀")) {
bundle.putInt("show_type", show); type = 0;
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment(); } else if (TextUtils.equals(event.getModel().getActiveName(), "甜蜜約會")) {
liveHDDialogFragment.setArguments(bundle); type = 1;
liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); } else if (TextUtils.equals(event.getModel().getActiveName(), "娛樂整蠱")) {
type = 3;
} else if (TextUtils.equals(event.getModel().getActiveName(), "怪物大作戰")) {
type = 4;
} else if (TextUtils.equals(event.getModel().getActiveName(), "動感零鉆購")) {
type = 2;
}
LiveGameDialogFragment currentFragment = new LiveGameDialogFragment();
currentFragment.selectIndex(type);
currentFragment.setRoomId(mLiveUid);
currentFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGameDialogFragment");
break; break;
case WE_CHEAT: case WE_CHEAT:
LiveGameDialogFragment fragment = new LiveGameDialogFragment(); LiveGameDialogFragment fragment = new LiveGameDialogFragment();
@ -874,7 +884,7 @@ public class LiveAudienceActivity extends LiveActivity {
+ "&stream=" + mStream + "&stream=" + mStream
+ "&uid=" + CommonAppConfig.getInstance().getUid() + "&uid=" + CommonAppConfig.getInstance().getUid()
+ "&token=" + CommonAppConfig.getInstance().getToken(); + "&token=" + CommonAppConfig.getInstance().getToken();
liveHDDialogFragment = new LiveHDDialogFragment(); LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
bundle.putString("url", url); bundle.putString("url", url);
bundle.putInt("show_type", 0); bundle.putInt("show_type", 0);
liveHDDialogFragment.setArguments(bundle); liveHDDialogFragment.setArguments(bundle);

View File

@ -80,6 +80,7 @@ public class SidebarAdapter extends RefreshAdapter<AnchorRecommendItemModel> {
* @param list * @param list
*/ */
public void addData(List<AnchorRecommendItemModel> list) { public void addData(List<AnchorRecommendItemModel> list) {
refreshData(list); refreshData(list);
} }

View File

@ -151,19 +151,7 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
title.setVisibility(View.GONE); title.setVisibility(View.GONE);
title1.setVisibility(View.GONE); title1.setVisibility(View.GONE);
Log.i("tag", "" + num); Log.i("tag", "" + num);
// if (position == 0 && type.equals("1")) {
// title1.setText(R.string.noble);
// title1.setVisibility(View.VISIBLE);
// }
if (!noble && position == num && type.equals("1")) {
title.setText(R.string.live_audience);
title.setVisibility(View.VISIBLE);
}
ivIcon.setVisibility(View.GONE);
if (noble) {
ivIcon.setVisibility(View.VISIBLE); ivIcon.setVisibility(View.VISIBLE);
}
mIcon.setImageBitmap(null); mIcon.setImageBitmap(null);
tvName.setVisibility(View.GONE); tvName.setVisibility(View.GONE);

View File

@ -8,6 +8,7 @@ import android.view.WindowManager;
import android.widget.HorizontalScrollView; import android.widget.HorizontalScrollView;
import android.widget.TextView; import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -72,7 +73,7 @@ public class LiveTotalDialog extends AbsDialogFragment {
benefits = (HorizontalScrollView) findViewById(R.id.benefits); benefits = (HorizontalScrollView) findViewById(R.id.benefits);
basicToolsLayout = (HorizontalScrollView) findViewById(R.id.basic_tools_layout); basicToolsLayout = (HorizontalScrollView) findViewById(R.id.basic_tools_layout);
gamesAdapter = new FunGamesAdapter(); gamesAdapter = new FunGamesAdapter();
funGamesList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); funGamesList.setLayoutManager(new GridLayoutManager(mContext, 4));
funGamesList.setAdapter(gamesAdapter); funGamesList.setAdapter(gamesAdapter);
if (isActivity) { if (isActivity) {
funGames.setVisibility(View.VISIBLE); funGames.setVisibility(View.VISIBLE);

View File

@ -275,10 +275,8 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
data.add(model); data.add(model);
} }
} else { } else {
if (TextUtils.equals(model.getNoble_id(), "0")) {
data.add(model); data.add(model);
} }
}
} }
Log.i("tag222", "ssss"); Log.i("tag222", "ssss");

View File

@ -10,14 +10,19 @@ import android.view.View;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.blankj.utilcode.util.GsonUtils; import com.blankj.utilcode.util.GsonUtils;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.ms.banner.Banner;
import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.bean.AnchorRecommendItemModel; import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.SlideInfoModel; import com.yunbao.common.bean.SlideInfoModel;
import com.yunbao.common.custom.CommonRefreshView; import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.custom.ItemDecoration; import com.yunbao.common.custom.ItemDecoration;
@ -28,9 +33,10 @@ import com.yunbao.common.http.main.MainNetManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DeviceUtils; import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.views.SlideInBannerViewHolder;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.adapter.SidebarAdapter; import com.yunbao.live.adapter.SidebarAdapter;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.event.LiveRoomChangeEvent;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
@ -59,6 +65,9 @@ public class SidebarLiveAudience extends AbsDialogFragment {
private List<AnchorRecommendItemModel> list = new ArrayList<>(); private List<AnchorRecommendItemModel> list = new ArrayList<>();
private int index = 0; private int index = 0;
private LinearLayout haveData, noDataLive;
private Banner mBanner;
private TextView inBatch;
@Override @Override
protected int getLayoutId() { protected int getLayoutId() {
@ -76,6 +85,11 @@ public class SidebarLiveAudience extends AbsDialogFragment {
Bundle bundle = getArguments(); Bundle bundle = getArguments();
sidebarBack = (ImageView) findViewById(R.id.sidebar_back); sidebarBack = (ImageView) findViewById(R.id.sidebar_back);
haveData = (LinearLayout) findViewById(R.id.have_data);
noDataLive = (LinearLayout) findViewById(R.id.view_no_data_live);
//侧边栏轮播
mBanner = (Banner) findViewById(R.id.banner);
inBatch = (TextView) findViewById(R.id.in_batch);
mask = findViewById(R.id.mask); mask = findViewById(R.id.mask);
if (bundle != null) { if (bundle != null) {
String avatar = bundle.getString("Avatar"); String avatar = bundle.getString("Avatar");
@ -117,10 +131,46 @@ public class SidebarLiveAudience extends AbsDialogFragment {
sidebarAdapter = new SidebarAdapter(mContext, mDisplay.getHeight()); sidebarAdapter = new SidebarAdapter(mContext, mDisplay.getHeight());
sidebarAdapter.setHasStableIds(true); sidebarAdapter.setHasStableIds(true);
sidebarList.setRecyclerViewAdapter(sidebarAdapter); sidebarList.setRecyclerViewAdapter(sidebarAdapter);
ViewClicksAntiShake.clicksAntiShake(inBatch, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
sidebarList.initData();
}
});
if (sidebarAdapter != null) { if (sidebarAdapter != null) {
if (list.size() == 1) {
haveData.setVisibility(View.GONE);
noDataLive.setVisibility(View.VISIBLE);
if (mBanner.isStart()) {
mBanner.update(slideInfoModels);
} else {
mBanner.setAutoPlay(true)
.setPages(slideInfoModels, new SlideInBannerViewHolder())
.setDelayTime(3000)
.setOnBannerClickListener((datas, p) -> {
if (p >= 0 && p < slideInfoModels.size()) {
SlideInfoModel bean = slideInfoModels.get(p);
if (bean != null) {
String link = bean.getSlideUrl();
if (link.contains("http")) {
WebViewActivity.forward(getContext(), link, true);
} else {
gotoLive(link);
}
}
}
}).start();
}
} else {
haveData.setVisibility(View.VISIBLE);
noDataLive.setVisibility(View.GONE);
sidebarAdapter.addData(list); sidebarAdapter.addData(list);
sidebarAdapter.setData(slideInfoModels); sidebarAdapter.setData(slideInfoModels);
} }
}
sidebarList.setDataHelperNew(new CommonRefreshView.DataHelperNew() { sidebarList.setDataHelperNew(new CommonRefreshView.DataHelperNew() {
@Override @Override
public void loadData(int p) { public void loadData(int p) {
@ -147,9 +197,38 @@ public class SidebarLiveAudience extends AbsDialogFragment {
} }
list.add(0, new AnchorRecommendItemModel()); list.add(0, new AnchorRecommendItemModel());
if (list.size() == 1) {
haveData.setVisibility(View.GONE);
noDataLive.setVisibility(View.VISIBLE);
if (mBanner.isStart()) {
mBanner.update(slideInfoModels);
} else {
mBanner.setAutoPlay(true)
.setPages(slideInfoModels, new SlideInBannerViewHolder())
.setDelayTime(3000)
.setOnBannerClickListener((datas, p) -> {
if (p >= 0 && p < slideInfoModels.size()) {
SlideInfoModel bean = slideInfoModels.get(p);
if (bean != null) {
String link = bean.getSlideUrl();
if (link.contains("http")) {
WebViewActivity.forward(getContext(), link, true);
} else {
gotoLive(link);
}
}
}
}).start();
}
} else {
haveData.setVisibility(View.VISIBLE);
noDataLive.setVisibility(View.GONE);
sidebarAdapter.addData(list); sidebarAdapter.addData(list);
sidebarAdapter.setData(anchorRecommendModel.getSlide()); sidebarAdapter.setData(anchorRecommendModel.getSlide());
}
sidebarList.onFinish(); sidebarList.onFinish();
} }

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout 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_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -16,6 +17,7 @@
android:background="#90000000" /> android:background="#90000000" />
<LinearLayout <LinearLayout
android:id="@+id/have_data"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
@ -40,4 +42,69 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/view_no_data_live"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingStart="8dp"
android:paddingTop="26dp"
android:paddingEnd="8dp">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="4dp"
app:cardElevation="4dp">
<com.ms.banner.Banner
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="77dp"
app:delay_time="3000"
app:indicator_drawable_selected="@drawable/bg_home_indicator_selected"
app:indicator_drawable_unselected="@drawable/bg_home_indicator_unselected"
app:indicator_height="8dp"
app:indicator_margin="6dp"
app:indicator_width="8dp" />
</androidx.cardview.widget.CardView>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/recommended_for_you"
android:textColor="#FFF6F7FB"
android:textSize="14sp" />
<TextView
android:id="@+id/in_batch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="8dp"
android:drawableStart="@mipmap/icon_change"
android:drawablePadding="2dp"
android:text="@string/in_batch"
android:textColor="#FFF6F7FB"
android:textSize="10sp" />
</FrameLayout>
<ImageView
android:layout_width="130dp"
android:layout_height="130dp"
android:layout_marginTop="194dp"
android:src="@mipmap/img_no_anchor" />
</LinearLayout>
</FrameLayout> </FrameLayout>

View File

@ -52,6 +52,8 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:text="@string/fingers_slide" android:text="@string/fingers_slide"
android:textColor="#9A9A9A" /> android:textColor="#9A9A9A" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

View File

@ -21,9 +21,5 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:src="@mipmap/icon_arrow_right" /> android:src="@mipmap/icon_arrow_right" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:background="@color/gray2" />
</RelativeLayout> </RelativeLayout>

View File

@ -23,9 +23,5 @@
android:textColor="@color/global" android:textColor="@color/global"
android:textSize="16sp" /> android:textSize="16sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:background="@color/gray2" />
</RelativeLayout> </RelativeLayout>