改版主播工具栏界面

This commit is contained in:
zlzw 2022-09-15 16:00:50 +08:00
parent e455f1c3a0
commit e7a8cd781b
22 changed files with 438 additions and 4 deletions

View File

@ -0,0 +1,285 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_live_tota"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="30dp"
android:text="@string/value_added_benefits"
android:textColor="@color/white"
android:textSize="14sp" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:paddingEnd="16dp">
<LinearLayout
android:id="@+id/live_tool_wish"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_xinyuandan" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_wishlist"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/live_tool_prank"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="28dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_zhenggu" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_zg"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/live_tool_wks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="28dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_weekstar" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_wks"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="30dp"
android:text="@string/basic_tools"
android:textColor="@color/white"
android:textSize="14sp" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="20dp"
android:paddingEnd="16dp">
<LinearLayout
android:id="@+id/live_tool_beauty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_beauty" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_beauty"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/live_tool_camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="23dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_live_ready_camera" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_camera"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/live_tool_leave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="23dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/live_tool_leave_img"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_leave" />
<TextView
android:id="@+id/live_tool_leave_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_zslk"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:text="@string/live_config"
android:textColor="@color/white"
android:textSize="14sp" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="20dp"
android:paddingEnd="16dp">
<LinearLayout
android:id="@+id/live_tool_one_pk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_danrenpk" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_link_pk"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/live_tool_multi_pk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="23dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_duorenpk" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_dr"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/live_tool_mic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="23dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_microphone" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_mic"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 809 B

After

Width:  |  Height:  |  Size: 809 B

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -874,4 +874,5 @@ Limited ride And limited avatar frame</string>
<string name="bonus_message">has sent you a reward, come and get it!</string>
<string name="live_class_tip_title">Pay attention to the channel that suits you.</string>
<string name="live_anchor_send">What do you say to everyone</string>
<string name="live_config">LiveConfig</string>
</resources>

View File

@ -891,4 +891,5 @@
<string name="online_service">在線客服</string>
<string name="bonus_message">向你發送了一個獎勵,快來領取吧!</string>
<string name="live_anchor_send">和大家說些什麼</string>
<string name="live_config">直播設置</string>
</resources>

View File

@ -50,6 +50,7 @@ import com.yunbao.live.dialog.LiveBeautyDialogFragment;
import com.yunbao.live.dialog.LiveFunctionDialogFragment;
import com.yunbao.live.dialog.LiveLinkMicListDialogFragment;
import com.yunbao.live.dialog.LiveMicUserDialogFragment;
import com.yunbao.live.dialog.LiveNewFunctionDialogFragment;
import com.yunbao.live.dialog.LiveNewWishListDialogFragment;
import com.yunbao.live.dialog.LiveWishListDialogFragment;
import com.yunbao.live.event.LinkMicTxMixStreamEvent;
@ -216,7 +217,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
* @param functionID
*/
int mrr = 0;
public static int leave = 0;
public int leave = 0;
@Override
public void onClick(int functionID) {
@ -532,13 +533,14 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
* 打开功能弹窗
*/
public void showFunctionDialog() {
LiveFunctionDialogFragment fragment = new LiveFunctionDialogFragment();
LiveNewFunctionDialogFragment fragment = new LiveNewFunctionDialogFragment();
Bundle bundle = new Bundle();
boolean hasGame = false;
if (CommonAppConfig.GAME_ENABLE && mGameList != null) {
hasGame = mGameList.size() > 0;
}
bundle.putBoolean(Constants.HAS_GAME, hasGame);
bundle.putInt("leave",leave);
bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen());
fragment.setArguments(bundle);
fragment.setFunctionClickListener(this);
@ -666,6 +668,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
}
mStartLive = true;
mLiveRoomViewHolder.startRefreshUserList();
mLiveRoomViewHolder.hideFloatMsg();
//守护相关
mLiveGuardInfo = new LiveGuardInfo();

View File

@ -44,7 +44,8 @@ public class LiveFunctionAdapter extends RecyclerView.Adapter<LiveFunctionAdapte
if (LiveRyAnchorActivity.mLivePushViewHolder != null) {
if (LiveRyAnchorActivity.leave == 0) {
//LiveRyAnchorActivity.leave
if (leave == 0) {
mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_ZSLK, R.mipmap.icon_leave, R.string.live_zslk));
} else {
mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_ZSLK, R.mipmap.icon_leave_p, R.string.live_zslk1));

View File

@ -0,0 +1,138 @@
package com.yunbao.live.dialog;
import static com.yunbao.common.Constants.*;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import com.yunbao.common.Constants;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.interfaces.LiveFunctionClickListener;
/**
* Created by cxf on 2018/10/9.
*/
public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements View.OnClickListener {
private View mWishView, mPrankView, mWksView, mBeautyView, mCameraView, mLeaveView, mOnePkView, mMultiPkView, mMicView;
private LiveFunctionClickListener mFunctionClickListener;
private int leave = 0;
// boolean isRy = false;
@Override
protected int getLayoutId() {
return R.layout.dialog_live_new_function;
}
@Override
protected int getDialogStyle() {
return R.style.dialog2;
}
@Override
protected boolean canCancel() {
return true;
}
@Override
protected void setWindowAttributes(Window window) {
window.setWindowAnimations(R.style.bottomToTopAnim);
WindowManager.LayoutParams params = window.getAttributes();
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
params.gravity = Gravity.BOTTOM;
window.setAttributes(params);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
boolean hasGame = false;
boolean openFlash = false;
Bundle bundle = getArguments();
if (bundle != null) {
hasGame = bundle.getBoolean(Constants.HAS_GAME, false);
openFlash = bundle.getBoolean(Constants.OPEN_FLASH, false);
leave = bundle.getInt("leave", 0);
// isRy = bundle.getBoolean("isRy", false);
}
mWishView = findViewById(R.id.live_tool_wish);
mPrankView = findViewById(R.id.live_tool_prank);
mWksView = findViewById(R.id.live_tool_wks);
mBeautyView = findViewById(R.id.live_tool_beauty);
mCameraView = findViewById(R.id.live_tool_camera);
mLeaveView = findViewById(R.id.live_tool_leave);
mOnePkView = findViewById(R.id.live_tool_one_pk);
mMultiPkView = findViewById(R.id.live_tool_multi_pk);
mMicView = findViewById(R.id.live_tool_mic);
mWishView.setOnClickListener(this);
mPrankView.setOnClickListener(this);
mWksView.setOnClickListener(this);
mBeautyView.setOnClickListener(this);
mCameraView.setOnClickListener(this);
mLeaveView.setOnClickListener(this);
mOnePkView.setOnClickListener(this);
mMultiPkView.setOnClickListener(this);
mMicView.setOnClickListener(this);
if(leave==0){
((ImageView)mLeaveView.findViewById(R.id.live_tool_leave_img)).setImageResource(R.mipmap.icon_leave);
((TextView)mLeaveView.findViewById(R.id.live_tool_leave_text)).setText(R.string.live_zslk);
}else {
((ImageView)mLeaveView.findViewById(R.id.live_tool_leave_img)).setImageResource(R.mipmap.icon_leave_p);
((TextView)mLeaveView.findViewById(R.id.live_tool_leave_text)).setText(R.string.live_zslk1);
}
}
public void setFunctionClickListener(LiveFunctionClickListener functionClickListener) {
mFunctionClickListener = functionClickListener;
}
@Override
public void onDestroy() {
// if(isRy == false) {
// ((LiveAnchorActivity) mContext).setBtnFunctionDark();
// }else{
((LiveRyAnchorActivity) mContext).setBtnFunctionDark();
// }
super.onDestroy();
}
@Override
public void onClick(View view) {
dismiss();
int id = view.getId();
if (id == R.id.live_tool_wish) {
mFunctionClickListener.onClick(LIVE_FUNC_WISHLIST);
} else if (id == R.id.live_tool_prank) {
mFunctionClickListener.onClick(LIVE_FUNC_ZG);
} else if (id == R.id.live_tool_wks) {
mFunctionClickListener.onClick(LIVE_FUNC_WKS);
} else if (id == R.id.live_tool_beauty) {
mFunctionClickListener.onClick(LIVE_FUNC_BEAUTY);
} else if (id == R.id.live_tool_camera) {
mFunctionClickListener.onClick(LIVE_FUNC_CAMERA);
} else if (id == R.id.live_tool_leave) {
mFunctionClickListener.onClick(LIVE_FUNC_ZSLK);
} else if (id == R.id.live_tool_one_pk) {
mFunctionClickListener.onClick(LIVE_FUNC_LINK_MIC);
} else if (id == R.id.live_tool_multi_pk) {
mFunctionClickListener.onClick(LIVE_FUNC_DR);
} else if (id == R.id.live_tool_mic) {
mFunctionClickListener.onClick(LIVE_FUNC_MIC);
}
}
}

View File

@ -942,7 +942,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
// findViewById(R.id.hour_rank_layout).setEnabled(false);
/* findViewById(R.id.live_wks_layout).setEnabled(false);
findViewById(R.id.wish_list_layout).setEnabled(false);*/
msg.setVisibility(View.GONE);
findViewById(R.id.open_sidebar).setVisibility(View.GONE);
findViewById(R.id.btn_follow).setVisibility(View.GONE);
}else {
@ -950,6 +949,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
reloadIM();
}
public void hideFloatMsg(){
msg.setVisibility(View.GONE);
}
private void showBanner2() {
if (mBannerList2 == null || mBannerList2.size() == 0 || mBanner2 == null) {
@ -1734,6 +1736,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* @param in 展示的view
*/
private void changeMsgView(View out, View in) {
if(mContext instanceof LiveRyAnchorActivity){
return;
}
if (in.getVisibility() == View.VISIBLE) {
return;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB