瀏覽代碼

修改老师端直播,添加美颜

Pq 3 年之前
父節點
當前提交
33f808dd73
共有 28 個文件被更改,包括 615 次插入1 次删除
  1. 15 0
      BaseLibrary/src/main/res/drawable/custom_indicator_drawable_white.xml
  2. 1 0
      BaseLibrary/src/main/res/values/colors.xml
  3. 7 0
      rong_im/live/src/main/java/com/rong/io/live/helper/LiveRTCEngineInitHelper.java
  4. 4 1
      teacher/build.gradle
  5. 36 0
      teacher/src/main/java/com/cooleshow/teacher/adapter/LiveBeautyPagerAdapter.java
  6. 59 0
      teacher/src/main/java/com/cooleshow/teacher/ui/live/LiveBeautyOptionsFragment.java
  7. 29 0
      teacher/src/main/java/com/cooleshow/teacher/ui/live/LiveRoomActivity.java
  8. 140 0
      teacher/src/main/java/com/cooleshow/teacher/widgets/dialog/LiveBeautyOptionsDialog.java
  9. 96 0
      teacher/src/main/java/com/cooleshow/teacher/widgets/helper/LiveRoomBeautyHelper.java
  10. 二進制
      teacher/src/main/res/drawable-xhdpi/icon_live_beauty_off.png
  11. 二進制
      teacher/src/main/res/drawable-xhdpi/icon_live_beauty_options1.png
  12. 二進制
      teacher/src/main/res/drawable-xhdpi/icon_live_beauty_options2.png
  13. 二進制
      teacher/src/main/res/drawable-xhdpi/icon_live_beauty_options3.png
  14. 二進制
      teacher/src/main/res/drawable-xhdpi/icon_live_beauty_options4.png
  15. 二進制
      teacher/src/main/res/drawable-xhdpi/icon_reset_live_beauty_options.png
  16. 二進制
      teacher/src/main/res/drawable-xxhdpi/icon_live_beauty_off.png
  17. 二進制
      teacher/src/main/res/drawable-xxhdpi/icon_live_beauty_options1.png
  18. 二進制
      teacher/src/main/res/drawable-xxhdpi/icon_live_beauty_options2.png
  19. 二進制
      teacher/src/main/res/drawable-xxhdpi/icon_live_beauty_options3.png
  20. 二進制
      teacher/src/main/res/drawable-xxhdpi/icon_live_beauty_options4.png
  21. 二進制
      teacher/src/main/res/drawable-xxhdpi/icon_reset_live_beauty_options.png
  22. 5 0
      teacher/src/main/res/drawable/selector_live_beauty_options_text_color.xml
  23. 6 0
      teacher/src/main/res/drawable/shape_live_beauty_dialog_bg.xml
  24. 64 0
      teacher/src/main/res/layout/dialog_live_beauty_layout.xml
  25. 107 0
      teacher/src/main/res/layout/fragment_live_beauty_layout.xml
  26. 14 0
      teacher/src/main/res/layout/view_live_beauty_tab_layout.xml
  27. 1 0
      teacher/src/main/res/values/strings.xml
  28. 31 0
      teacher/src/main/res/values/styles.xml

+ 15 - 0
BaseLibrary/src/main/res/drawable/custom_indicator_drawable_white.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:opacity="opaque"
+    tools:targetApi="23">
+
+    <item
+        android:width="16dp"
+        android:gravity="center_horizontal">
+        <shape android:shape="rectangle">
+            <corners android:radius="2dp"/>
+            <solid android:color="@color/white" />
+        </shape>
+    </item>
+</layer-list>

+ 1 - 0
BaseLibrary/src/main/res/values/colors.xml

@@ -110,4 +110,5 @@
     <color name="color_e2e2e2">#e2e2e2</color>
     <color name="gray_ff80">#ff808080</color>
     <color name="gray_F2F4F8">#F2F4F8</color>
+    <color name="gray_32FFD8">#32FFD8</color>
 </resources>

+ 7 - 0
rong_im/live/src/main/java/com/rong/io/live/helper/LiveRTCEngineInitHelper.java

@@ -18,6 +18,13 @@ public class LiveRTCEngineInitHelper {
         LiveConfig.isNeedReInitRTC = false;
     }
 
+    /**
+     * 设置生效美颜功能
+     */
+    public static void openBeauty(){
+        RCRTCEngine.getInstance().init(Utils.getApp().getApplicationContext(), RCRTCConfig.Builder.create().enableEncoderTexture(true).build());
+    }
+
     public static void setRTCSpeakerMode(boolean enable){
         RCRTCEngine.getInstance().enableSpeaker(enable);
     }

+ 4 - 1
teacher/build.gradle

@@ -100,5 +100,8 @@ dependencies {
     implementation project(path: ':live_teaching')
     implementation "com.alibaba:arouter-api:$rootProject.ext.android.arouter_api_version"
     kapt "com.alibaba:arouter-compiler:$rootProject.ext.android.arouter_api_version"
-
+    //融云美颜库 //cn.rongcloud.sdk:rtc_lib:5.2.1
+    implementation('cn.rongcloud.sdk:face_beautifier:5.2.1') {
+        exclude(group: 'cn.rongcloud.sdk', module: 'rtc_lib')
+    }
 }

+ 36 - 0
teacher/src/main/java/com/cooleshow/teacher/adapter/LiveBeautyPagerAdapter.java

@@ -0,0 +1,36 @@
+package com.cooleshow.teacher.adapter;
+
+import java.util.ArrayList;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
+import androidx.viewpager2.adapter.FragmentStateAdapter;
+
+/**
+ * Author by pq, Date on 2022/5/6.
+ */
+public class LiveBeautyPagerAdapter extends FragmentStateAdapter {
+    private ArrayList<Fragment> mFragments;
+
+    public LiveBeautyPagerAdapter(@NonNull FragmentActivity fragmentActivity) {
+        super(fragmentActivity);
+    }
+
+
+    public void setData(ArrayList<Fragment> fragments) {
+        this.mFragments = fragments;
+        notifyDataSetChanged();
+    }
+
+    @NonNull
+    @Override
+    public Fragment createFragment(int position) {
+        return mFragments.get(position);
+    }
+
+    @Override
+    public int getItemCount() {
+        return mFragments != null ? mFragments.size() : 0;
+    }
+}

+ 59 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/live/LiveBeautyOptionsFragment.java

@@ -0,0 +1,59 @@
+package com.cooleshow.teacher.ui.live;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.RadioGroup;
+
+import com.cooleshow.base.ui.fragment.BaseFragment;
+import com.cooleshow.teacher.R;
+import com.cooleshow.teacher.databinding.FragmentLiveBeautyLayoutBinding;
+import com.cooleshow.teacher.widgets.helper.LiveRoomBeautyHelper;
+
+/**
+ * Author by pq, Date on 2022/6/13.
+ */
+public class LiveBeautyOptionsFragment extends BaseFragment<FragmentLiveBeautyLayoutBinding> {
+    private OnEventListener mEventListener;
+
+    @Override
+    protected void initView(View rootView) {
+        mViewBinding.rgOptions.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(RadioGroup group, int checkedId) {
+                int type = LiveRoomBeautyHelper.OPTIONS_TYPE1;
+                if (checkedId == R.id.rb_options1) {
+                    type = LiveRoomBeautyHelper.OPTIONS_TYPE1;
+                } else if (checkedId == R.id.rb_options2) {
+                    type = LiveRoomBeautyHelper.OPTIONS_TYPE2;
+                } else if (checkedId == R.id.rb_options3) {
+                    type = LiveRoomBeautyHelper.OPTIONS_TYPE3;
+                } else if (checkedId == R.id.rb_options4) {
+                    type = LiveRoomBeautyHelper.OPTIONS_TYPE4;
+                }
+                if (mEventListener != null) {
+                    mEventListener.onChangeOptions(type);
+                }
+            }
+        });
+
+    }
+
+    @Override
+    protected void initData() {
+
+    }
+
+
+    @Override
+    protected FragmentLiveBeautyLayoutBinding getLayoutView() {
+        return FragmentLiveBeautyLayoutBinding.inflate(getLayoutInflater());
+    }
+
+    public void setOnEventListener(OnEventListener listener) {
+        this.mEventListener = listener;
+    }
+
+    public interface OnEventListener {
+        void onChangeOptions(int type);
+    }
+}

+ 29 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/live/LiveRoomActivity.java

@@ -1,6 +1,7 @@
 package com.cooleshow.teacher.ui.live;
 
 import android.content.Context;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.text.TextUtils;
 import android.util.Log;
@@ -23,6 +24,7 @@ import com.cooleshow.teacher.bean.LiveRoomInfoBean;
 import com.cooleshow.teacher.contract.LiveRoomContract;
 import com.cooleshow.teacher.databinding.ActivityTeacherLiveRoomLayoutBinding;
 import com.cooleshow.teacher.presenter.live.LiveRoomPresenter;
+import com.cooleshow.teacher.widgets.dialog.LiveBeautyOptionsDialog;
 import com.cooleshow.teacher.widgets.helper.VideoViewManager;
 import com.cooleshow.usercenter.helper.UserHelper;
 import com.rong.io.live.config.LiveConfig;
@@ -85,6 +87,7 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityTeacherLiveRoomLay
     };
     private MessageAdapter mMessageAdapter;
     private LinearLayoutManager mLinearLayoutManager;
+    private LiveBeautyOptionsDialog mOptionsDialog;
 
     public static void start(Context context, String roomId) {
         Intent intent = new Intent(context, LiveRoomActivity.class);
@@ -123,6 +126,8 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityTeacherLiveRoomLay
             //检查是否需要重新初始化RTC
             LiveRTCEngineInitHelper.initRTC();
         }
+        //开启美颜
+        LiveRTCEngineInitHelper.openBeauty();
 
         // 初始化音频路由管理类
         RCRTCAudioRouteManager.getInstance().init(Utils.getApp());
@@ -244,6 +249,7 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityTeacherLiveRoomLay
         }
         if (id == R.id.iv_live_beauty) {
             //美颜
+            showBeautyOptionsDialog();
             return;
         }
 
@@ -440,6 +446,29 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityTeacherLiveRoomLay
         });
     }
 
+    private void showBeautyOptionsDialog() {
+        if (mOptionsDialog == null) {
+            mOptionsDialog = new LiveBeautyOptionsDialog(this);
+            mOptionsDialog.setFragmentActivity(this);
+            mOptionsDialog.setOnShowListener(new DialogInterface.OnShowListener() {
+                @Override
+                public void onShow(DialogInterface dialog) {
+                    viewBinding.viewCreateOptions.getRoot().setVisibility(View.GONE);
+                }
+            });
+
+            mOptionsDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
+                @Override
+                public void onDismiss(DialogInterface dialog) {
+                    viewBinding.viewCreateOptions.getRoot().setVisibility(View.VISIBLE);
+                }
+            });
+        }
+        if (!mOptionsDialog.isShowing()) {
+            mOptionsDialog.show();
+        }
+    }
+
 
     @Override
     public void onDestroy() {

+ 140 - 0
teacher/src/main/java/com/cooleshow/teacher/widgets/dialog/LiveBeautyOptionsDialog.java

@@ -0,0 +1,140 @@
+package com.cooleshow.teacher.widgets.dialog;
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.content.Context;
+import android.os.Bundle;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.SeekBar;
+import android.widget.TextView;
+
+import com.cooleshow.teacher.R;
+import com.cooleshow.teacher.adapter.LiveBeautyPagerAdapter;
+import com.cooleshow.teacher.ui.live.LiveBeautyOptionsFragment;
+import com.cooleshow.teacher.widgets.helper.LiveRoomBeautyHelper;
+import com.google.android.material.tabs.TabLayout;
+import com.google.android.material.tabs.TabLayoutMediator;
+
+import java.util.ArrayList;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
+import androidx.viewpager2.widget.ViewPager2;
+
+/**
+ * Author by pq, Date on 2022/6/11.
+ */
+public class LiveBeautyOptionsDialog extends Dialog implements LiveBeautyOptionsFragment.OnEventListener, View.OnClickListener {
+    public static final String[] titles = new String[]{"美颜", "滤镜"};
+    private TabLayout mTabLayout;
+    private ViewPager2 mViewPager;
+    private SeekBar mSeekBar;
+    private FragmentActivity mActivity;
+
+    public LiveBeautyOptionsDialog(@NonNull Context context) {
+        super(context, R.style.liveBeautyDialogStyle);
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.dialog_live_beauty_layout);
+        Window window = getWindow();
+        //设置dialog在屏幕底部
+        window.setGravity(Gravity.BOTTOM);
+        //设置dialog弹出时的动画效果,从屏幕底部向上弹出
+        window.setWindowAnimations(com.cooleshow.base.R.style.BottomAnimation);
+        window.getDecorView().setPadding(0, 0, 0, 0);
+        //获得window窗口的属性
+        WindowManager.LayoutParams lp = window.getAttributes();
+        //设置窗口宽度为充满全屏
+        lp.width = WindowManager.LayoutParams.MATCH_PARENT;
+        //设置窗口高度为包裹内容
+        lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
+        lp.horizontalMargin = 0;
+        lp.verticalMargin = 0;
+        //将设置好的属性set回去
+        window.setAttributes(lp);
+        mTabLayout = findViewById(R.id.tab_layout);
+        mViewPager = findViewById(R.id.viewPager);
+        mSeekBar = findViewById(R.id.seek_bar);
+        findViewById(R.id.tv_reset).setOnClickListener(this);
+        TabLayoutMediator tabLayoutMediator = new TabLayoutMediator(mTabLayout, mViewPager, new TabLayoutMediator.TabConfigurationStrategy() {
+            @Override
+            public void onConfigureTab(@NonNull TabLayout.Tab tab, int position) {
+                createTab(tab, titles[position]);
+            }
+        });
+
+        LiveBeautyPagerAdapter beautyPagerAdapter = new LiveBeautyPagerAdapter(mActivity);
+        LiveBeautyOptionsFragment optionsFragment = new LiveBeautyOptionsFragment();
+        LiveBeautyOptionsFragment optionsFragment2 = new LiveBeautyOptionsFragment();
+        optionsFragment.setOnEventListener(this);
+        ArrayList<Fragment> fragments = new ArrayList();
+        fragments.add(optionsFragment);
+        fragments.add(optionsFragment2);
+        beautyPagerAdapter.setData(fragments);
+        mViewPager.setAdapter(beautyPagerAdapter);
+        tabLayoutMediator.attach();
+
+        initListener();
+    }
+
+    public void setFragmentActivity(FragmentActivity fragmentActivity) {
+        mActivity = fragmentActivity;
+    }
+
+    private void initListener() {
+        mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
+            @Override
+            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
+                LiveRoomBeautyHelper.getInstance().update(progress);
+            }
+
+            @Override
+            public void onStartTrackingTouch(SeekBar seekBar) {
+
+            }
+
+            @Override
+            public void onStopTrackingTouch(SeekBar seekBar) {
+
+            }
+        });
+    }
+
+    private TabLayout.Tab createTab(TabLayout.Tab tab, String text) {
+        View view = LayoutInflater.from(getContext()).inflate(R.layout.view_live_beauty_tab_layout, null);
+        TextView tv_text = view.findViewById(R.id.tv_text);
+        tv_text.setText(text);
+        tab.setCustomView(view);
+        return tab;
+    }
+
+    @Override
+    public void onChangeOptions(int type) {
+        if (mSeekBar != null && mSeekBar.getVisibility() != View.VISIBLE) {
+            mSeekBar.setVisibility(View.VISIBLE);
+        }
+        int currentProgress = LiveRoomBeautyHelper.getInstance().getCurrentProgress(type);
+        mSeekBar.setProgress(currentProgress);
+    }
+
+    @Override
+    public void onClick(View v) {
+        int id = v.getId();
+        if (id == R.id.tv_reset) {
+            //重置
+            if (mSeekBar != null) {
+                mSeekBar.setProgress(0);
+            }
+            LiveRoomBeautyHelper.getInstance().reset();
+            return;
+        }
+    }
+}

+ 96 - 0
teacher/src/main/java/com/cooleshow/teacher/widgets/helper/LiveRoomBeautyHelper.java

@@ -0,0 +1,96 @@
+package com.cooleshow.teacher.widgets.helper;
+
+import cn.rongcloud.beauty.RCRTCBeautyEngine;
+import cn.rongcloud.beauty.RCRTCBeautyOption;
+
+/**
+ * Author by pq, Date on 2022/6/11.
+ */
+public class LiveRoomBeautyHelper {
+    private volatile static LiveRoomBeautyHelper mHelper;
+    public static final int OPTIONS_TYPE1 = 0;//美白
+    public static final int OPTIONS_TYPE2 = 1;//磨皮
+    public static final int OPTIONS_TYPE3 = 2;//红润
+    public static final int OPTIONS_TYPE4 = 3;//亮度
+    private int currentType = OPTIONS_TYPE1;//默认选择
+
+    private int beauty_whiteness_progress = 0;//美白参数
+    private int beauty_smooth_progress = 0;//磨皮参数
+    private int beauty_ruddy_progress = 0;//红润参数
+    private int beauty_bright_progress = 0;//亮度参数
+
+    private boolean isOpenBeauty = true;//是否开启美颜
+
+    private LiveRoomBeautyHelper() {
+    }
+
+
+    public static LiveRoomBeautyHelper getInstance() {
+        if (mHelper == null) {
+            synchronized (LiveRoomBeautyHelper.class) {
+                if (mHelper == null) {
+                    mHelper = new LiveRoomBeautyHelper();
+                }
+            }
+        }
+        return mHelper;
+    }
+
+    public void update(int progress) {
+        RCRTCBeautyOption beautyOption = RCRTCBeautyEngine.getInstance().getCurrentBeautyOption();
+        if (currentType == OPTIONS_TYPE1) {
+            beauty_whiteness_progress = progress;
+            beautyOption.setWhitenessLevel(beauty_whiteness_progress);
+        } else if (currentType == OPTIONS_TYPE2) {
+            beauty_smooth_progress = progress;
+            beautyOption.setSmoothLevel(beauty_smooth_progress);
+        } else if (currentType == OPTIONS_TYPE3) {
+            beauty_ruddy_progress = progress;
+            beautyOption.setRuddyLevel(beauty_ruddy_progress);
+        } else if (currentType == OPTIONS_TYPE4) {
+            beauty_bright_progress = progress;
+            beautyOption.setBrightLevel(beauty_bright_progress);
+        }
+        RCRTCBeautyEngine.getInstance().setBeautyOption(isOpenBeauty, beautyOption);  // true 是使用美颜,false 不使用美颜
+    }
+
+    /**
+     * 重置
+     */
+    public void reset() {
+        beauty_whiteness_progress = 0;
+        beauty_smooth_progress = 0;
+        beauty_ruddy_progress = 0;
+        beauty_bright_progress = 0;
+        RCRTCBeautyOption beautyOption = RCRTCBeautyEngine.getInstance().getCurrentBeautyOption();
+        beautyOption.setWhitenessLevel(beauty_whiteness_progress);
+        beautyOption.setSmoothLevel(beauty_smooth_progress);
+        beautyOption.setRuddyLevel(beauty_ruddy_progress);
+        beautyOption.setBrightLevel(beauty_bright_progress);
+        RCRTCBeautyEngine.getInstance().setBeautyOption(isOpenBeauty, beautyOption);  // true 是使用美颜,false 不使用美颜
+    }
+
+
+    public void switchBeauty(boolean isOpen) {
+        this.isOpenBeauty = isOpen;
+        RCRTCBeautyOption beautyOption = RCRTCBeautyEngine.getInstance().getCurrentBeautyOption();
+        RCRTCBeautyEngine.getInstance().setBeautyOption(isOpenBeauty, beautyOption);  // true 是使用美颜,false 不使用美颜
+    }
+
+    public int getCurrentProgress(int type) {
+        this.currentType = type;
+        if (type == OPTIONS_TYPE1) {
+            return beauty_whiteness_progress;
+        }
+        if (type == OPTIONS_TYPE2) {
+            return beauty_smooth_progress;
+        }
+        if (type == OPTIONS_TYPE3) {
+            return beauty_ruddy_progress;
+        }
+        if (type == OPTIONS_TYPE4) {
+            return beauty_bright_progress;
+        }
+        return 0;
+    }
+}

二進制
teacher/src/main/res/drawable-xhdpi/icon_live_beauty_off.png


二進制
teacher/src/main/res/drawable-xhdpi/icon_live_beauty_options1.png


二進制
teacher/src/main/res/drawable-xhdpi/icon_live_beauty_options2.png


二進制
teacher/src/main/res/drawable-xhdpi/icon_live_beauty_options3.png


二進制
teacher/src/main/res/drawable-xhdpi/icon_live_beauty_options4.png


二進制
teacher/src/main/res/drawable-xhdpi/icon_reset_live_beauty_options.png


二進制
teacher/src/main/res/drawable-xxhdpi/icon_live_beauty_off.png


二進制
teacher/src/main/res/drawable-xxhdpi/icon_live_beauty_options1.png


二進制
teacher/src/main/res/drawable-xxhdpi/icon_live_beauty_options2.png


二進制
teacher/src/main/res/drawable-xxhdpi/icon_live_beauty_options3.png


二進制
teacher/src/main/res/drawable-xxhdpi/icon_live_beauty_options4.png


二進制
teacher/src/main/res/drawable-xxhdpi/icon_reset_live_beauty_options.png


+ 5 - 0
teacher/src/main/res/drawable/selector_live_beauty_options_text_color.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@color/white" android:state_checked="false"/>
+    <item android:color="@color/gray_32FFD8" android:state_checked="true"/>
+</selector>

+ 6 - 0
teacher/src/main/res/drawable/shape_live_beauty_dialog_bg.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#E61A1A1A"/>
+    <corners android:topLeftRadius="14dp"
+        android:topRightRadius="14dp"/>
+</shape>

+ 64 - 0
teacher/src/main/res/layout/dialog_live_beauty_layout.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout 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_height="wrap_content"
+    android:orientation="vertical">
+
+    <androidx.appcompat.widget.AppCompatSeekBar
+        android:id="@+id/seek_bar"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:max="10"
+        android:visibility="invisible" />
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="235dp"
+        android:layout_marginTop="5dp"
+        android:background="@drawable/shape_live_beauty_dialog_bg">
+
+
+        <com.google.android.material.tabs.TabLayout
+            android:id="@+id/tab_layout"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="20dp"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:tabBackground="@color/transparent"
+            app:tabGravity="fill"
+            app:tabIndicator="@drawable/custom_indicator_drawable_white"
+            app:tabIndicatorColor="@color/white"
+            app:tabIndicatorFullWidth="false"
+            app:tabIndicatorHeight="3dp"
+            app:tabMaxWidth="0dp"
+            app:tabMode="scrollable"
+            app:tabRippleColor="@color/transparent"
+            app:tabSelectedTextColor="@color/color_333333"
+            app:tabTextColor="@color/color_666666" />
+
+        <androidx.viewpager2.widget.ViewPager2
+            android:id="@+id/viewPager"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:overScrollMode="never"
+            android:scrollbars="none"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/tab_layout" />
+
+        <TextView
+            android:id="@+id/tv_reset"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:drawableLeft="@drawable/icon_reset_live_beauty_options"
+            android:drawablePadding="7dp"
+            android:paddingTop="16dp"
+            android:paddingEnd="20dp"
+            android:text="@string/reset_str"
+            android:textColor="@color/white"
+            android:textSize="@dimen/sp_14"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+    </androidx.constraintlayout.widget.ConstraintLayout>
+</LinearLayout>

+ 107 - 0
teacher/src/main/res/layout/fragment_live_beauty_layout.xml

@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:background="#E61A1A1A">
+
+    <ImageView
+        android:id="@+id/iv_switch_live_beauty"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="27dp"
+        android:layout_marginTop="40dp"
+        android:src="@drawable/icon_live_beauty_off"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:paddingTop="23dp"
+        android:text="已关闭"
+        android:textColor="@color/white"
+        android:textSize="@dimen/sp_11"
+        app:layout_constraintLeft_toLeftOf="@+id/iv_switch_live_beauty"
+        app:layout_constraintRight_toRightOf="@+id/iv_switch_live_beauty"
+        app:layout_constraintTop_toBottomOf="@+id/iv_switch_live_beauty"
+        tools:text="已开启" />
+
+    <View
+        android:id="@+id/view_line"
+        android:layout_width="0.5dp"
+        android:layout_height="26dp"
+        android:layout_marginStart="30dp"
+        app:layout_constraintBottom_toBottomOf="@+id/iv_switch_live_beauty"
+        app:layout_constraintLeft_toRightOf="@+id/iv_switch_live_beauty"
+        app:layout_constraintTop_toTopOf="@+id/iv_switch_live_beauty" />
+
+    <RadioGroup
+        android:id="@+id/rg_options"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="25dp"
+        android:orientation="horizontal"
+        app:layout_constraintLeft_toRightOf="@+id/view_line"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <RadioButton
+            android:id="@+id/rb_options1"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:background="@color/transparent"
+            android:button="@null"
+            android:drawableTop="@drawable/icon_live_beauty_options1"
+            android:drawablePadding="9dp"
+            android:gravity="center"
+            android:text="美白"
+            android:textColor="@drawable/selector_live_beauty_options_text_color"
+            android:textSize="@dimen/sp_11" />
+
+        <RadioButton
+            android:id="@+id/rb_options2"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:background="@color/transparent"
+            android:button="@null"
+            android:drawableTop="@drawable/icon_live_beauty_options2"
+            android:drawablePadding="9dp"
+            android:gravity="center"
+            android:text="磨皮"
+            android:textColor="@drawable/selector_live_beauty_options_text_color"
+            android:textSize="@dimen/sp_11" />
+
+        <RadioButton
+            android:id="@+id/rb_options3"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:background="@color/transparent"
+            android:button="@null"
+            android:drawableTop="@drawable/icon_live_beauty_options3"
+            android:drawablePadding="9dp"
+            android:gravity="center"
+            android:text="红润"
+            android:textColor="@drawable/selector_live_beauty_options_text_color"
+            android:textSize="@dimen/sp_11" />
+
+        <RadioButton
+            android:id="@+id/rb_options4"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:background="@color/transparent"
+            android:button="@null"
+            android:drawableTop="@drawable/icon_live_beauty_options4"
+            android:drawablePadding="9dp"
+            android:gravity="center"
+            android:text="亮度"
+            android:textColor="@drawable/selector_live_beauty_options_text_color"
+            android:textSize="@dimen/sp_11" />
+
+    </RadioGroup>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 14 - 0
teacher/src/main/res/layout/view_live_beauty_tab_layout.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    <TextView
+        android:gravity="center"
+        android:includeFontPadding="false"
+        android:textSize="@dimen/sp_16"
+        android:textColor="@color/white"
+        android:id="@+id/tv_text"
+        android:minWidth="60dp"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"/>
+</FrameLayout>

+ 1 - 0
teacher/src/main/res/values/strings.xml

@@ -28,4 +28,5 @@
     <string name="share_str">分享</string>
     <string name="live_msg_text_nickname">%1$s:</string>
     <string name="live_room_add_like_count_text_str">给主讲人点了%1$d个赞</string>
+    <string name="reset_str">重置</string>
 </resources>

+ 31 - 0
teacher/src/main/res/values/styles.xml

@@ -44,5 +44,36 @@
         <!-- <item name="android:background">@drawable/nav_page</item> -->
         <item name="android:background">#FFE1E8EB</item>
     </style>
+    <style name="MyBottomDialogStyle" parent="@android:style/Theme.Holo.Dialog">
+        <!-- 是否有边框 -->
+        <item name="android:windowFrame">@null</item>
+        <!--是否在悬浮Activity之上  -->
+        <item name="android:windowIsFloating">true</item>
+        <!-- 标题 -->
+        <item name="android:windowNoTitle">true</item>
+        <!--阴影  -->
+        <item name="android:windowIsTranslucent">true</item><!--半透明-->
+        <!--背景透明-->
+        <item name="android:windowBackground">@android:color/transparent</item>
+        <item name="android:backgroundDimAmount">0.6</item>
+        <!-- 还可以加入一些弹出和退出的动画 (lan)-->
+        <item name="android:windowAnimationStyle">@style/BottomAnimation</item>
+    </style>
+
 
+    <style name="liveBeautyDialogStyle" parent="@android:style/Theme.Holo.Dialog">
+        <!-- 是否有边框 -->
+        <item name="android:windowFrame">@null</item>
+        <!--是否在悬浮Activity之上  -->
+        <item name="android:windowIsFloating">true</item>
+        <!-- 标题 -->
+        <item name="android:windowNoTitle">true</item>
+        <!--阴影  -->
+        <item name="android:windowIsTranslucent">true</item><!--半透明-->
+        <!--背景透明-->
+        <item name="android:windowBackground">@android:color/transparent</item>
+        <item name="android:backgroundDimAmount">0.0</item>
+        <!-- 还可以加入一些弹出和退出的动画 (lan)-->
+        <item name="android:windowAnimationStyle">@style/BottomAnimation</item>
+    </style>
 </resources>