小菜单的展开

This commit is contained in:
18401019693 2022-11-11 09:53:10 +08:00
parent 140e5740e6
commit 9dcc23960e
10 changed files with 242 additions and 3 deletions

View File

@ -7,7 +7,9 @@ import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.DrawerPopupView;
import com.lxj.xpopup.enums.PopupPosition;
import com.yunbao.common.R;
import com.yunbao.common.adapter.CustomDrawerPopupAdapter;
import com.yunbao.common.bean.AnchorRecommendItemModel;
@ -16,6 +18,7 @@ import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
@ -80,6 +83,67 @@ public class CustomDrawerPopupView extends DrawerPopupView {
}
}
});
//连麦互动
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_link_mic), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
if (callBack != null) {
callBack.evenTheWheat();
}
}
});
//特效设置
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.effects_settings_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
if (callBack != null) {
callBack.effectsSetting();
}
}
});
//滑动设置
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.slide_settings_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
if (callBack != null) {
callBack.slideSetting();
}
}
});
//小窗设置
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.float_settings_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
if (callBack != null) {
callBack.floatSetting();
}
}
});
//画质设置
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.system_notice), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
}
});
//更多菜单
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.online), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.more_menu));
builder.hasShadowBg(false)
.isDestroyOnDismiss(true)
.isLightStatusBar(false)
.popupPosition(PopupPosition.Top)
.asCustom(new MoreMenuPopupView(mContext))
.show();
}
});
}
private void initData() {
@ -112,6 +176,15 @@ public class CustomDrawerPopupView extends DrawerPopupView {
void funGamesID(int zfunGamesID);
void showerHtml(String htmlUrl, boolean screen);
//连麦
void evenTheWheat();
void effectsSetting();
void slideSetting();
void floatSetting();
}
@Subscribe(threadMode = ThreadMode.MAIN)

View File

@ -1,5 +1,6 @@
package com.yunbao.common.views;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
@ -7,9 +8,16 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class DrawerRecommendChildViewHolder extends RecyclerView.ViewHolder {
@ -27,5 +35,27 @@ public class DrawerRecommendChildViewHolder extends RecyclerView.ViewHolder {
ImgLoader.display2(itemView.getContext(), model.getIcon(), icon);
title.setText(model.getTitle());
subtitle.setText(model.getSubtitle());
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (TextUtils.isEmpty(model.getSrc())) {
ToastUtil.show("SHOWER_ERROR");
} else {
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
StringBuffer htmlUrl = new StringBuffer();
htmlUrl.append(CommonAppConfig.HOST)
.append("/")
.append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true)
.setHtmlUrl(htmlUrl.toString())
.setScreen(TextUtils.equals(model.getShowType(), "2")));
}
}
});
}
}

View File

@ -0,0 +1,24 @@
package com.yunbao.common.views;
import android.content.Context;
import androidx.annotation.NonNull;
import com.lxj.xpopup.core.AttachPopupView;
import com.yunbao.common.R;
public class MoreMenuPopupView extends AttachPopupView {
public MoreMenuPopupView(@NonNull Context context) {
super(context);
}
@Override
protected int getImplLayoutId() {
return R.layout.view_more_menu;
}
@Override
protected void onCreate() {
}
}

View File

@ -124,7 +124,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/system_notice"
android:text="@string/image_quality_selection"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
@ -146,7 +146,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/online_service"
android:text="@string/more_settings"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
@ -162,5 +162,13 @@
android:layout_above="@id/basic_tools_layout"
android:layout_marginTop="48dp" />
<View
android:id="@+id/more_menu"
android:layout_width="20dp"
android:layout_height="1dp"
android:layout_above="@id/basic_tools_layout"
android:layout_alignParentEnd="true"
android:layout_marginEnd="14dp"
android:layout_marginBottom="4dp" />
</RelativeLayout>

View File

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="176dp"
android:layout_height="62dp"
app:cardBackgroundColor="#0F0B14"
app:cardCornerRadius="4dp"
app:cardElevation="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_system" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/system_notice"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_service" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/online_service"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_report" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/report"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -958,4 +958,6 @@
<string name="to_receive" translatable="false">領取</string>
<string name="to_complete" translatable="false">去完成</string>
<string name="already_collected" translatable="false">已領取</string>
<string name="image_quality_selection" translatable="false">畫質選擇</string>
<string name="more_settings" translatable="false">更多設置</string>
</resources>

View File

@ -751,7 +751,6 @@ public class LiveAudienceActivity extends LiveActivity {
.setType(LiveAudienceEvent.LiveAudienceType.FAN_CLUB));
}
}
@Override
public void showerHtml(String htmlUrl, boolean screen) {
if (!screen) {
@ -764,6 +763,30 @@ public class LiveAudienceActivity extends LiveActivity {
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
}
}
@Override
public void evenTheWheat() {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.LIAN_MAI));
}
@Override
public void effectsSetting() {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.EFFECTS_SETTINGS));
}
@Override
public void slideSetting() {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.SLIDE_SETTINGS));
}
@Override
public void floatSetting() {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.FLOAT_SETTING));
}
});
new XPopup.Builder(mContext)
.hasShadowBg(false)