This commit is contained in:
18142669586
2022-07-20 15:18:42 +08:00
parent c7e03f576c
commit d150d8d599
20 changed files with 23 additions and 3181 deletions

View File

@@ -61,9 +61,7 @@ dependencies {
implementation rootProject.ext.dependencies["recyclerview-androidx"]
//common
implementation project(path: ':common')
//萌颜
implementation project(path: ':beauty')
//萌颜
implementation project(path: ':live')
}

View File

@@ -1,7 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yunbao.video"
>
<application
android:allowBackup="true"
android:theme="@style/AppTheme"
@@ -11,11 +10,7 @@
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing|stateAlwaysHidden"
/>
<activity
android:name="com.yunbao.video.activity.VideoRecordActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing|stateAlwaysHidden"
/>
<activity
android:name="com.yunbao.video.activity.VideoChooseActivity"
android:screenOrientation="portrait"
@@ -33,11 +28,6 @@
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateAlwaysHidden"
/>
<activity
android:name="com.yunbao.video.activity.VideoRecord360BeautyActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateAlwaysHidden"
/>
</application>
</manifest>

View File

@@ -7,10 +7,8 @@ import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import com.yunbao.beauty.bean.FilterBean;
import com.yunbao.common.views.AbsViewHolder;
import com.yunbao.video.R;
import com.yunbao.beauty.adapter.FilterAdapter;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.BitmapUtil;
@@ -19,7 +17,7 @@ import com.yunbao.common.utils.BitmapUtil;
* 视频编辑 滤镜
*/
public class VideoEditFilterViewHolder extends AbsViewHolder implements OnItemClickListener<FilterBean>, View.OnClickListener {
public class VideoEditFilterViewHolder extends AbsViewHolder {
private ActionListener mActionListener;
private boolean mShowed;
@@ -37,35 +35,12 @@ public class VideoEditFilterViewHolder extends AbsViewHolder implements OnItemCl
@Override
public void init() {
findViewById(R.id.root).setOnClickListener(this);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
FilterAdapter adapter = new FilterAdapter(mContext);
adapter.setOnItemClickListener(this);
recyclerView.setAdapter(adapter);
}
@Override
public void onItemClick(FilterBean bean, int position) {
if (mBitmap != null) {
mBitmap.recycle();
}
if (mActionListener != null) {
int filterSrc = bean.getFilterSrc();
if (filterSrc != 0) {
Bitmap bitmap = BitmapUtil.getInstance().decodeBitmap(filterSrc);
if (bitmap != null) {
mBitmap = bitmap;
mActionListener.onFilterChanged(bitmap);
} else {
mActionListener.onFilterChanged(null);
}
} else {
mActionListener.onFilterChanged(null);
}
}
}
public void show() {
mShowed = true;
@@ -84,10 +59,6 @@ public class VideoEditFilterViewHolder extends AbsViewHolder implements OnItemCl
}
}
@Override
public void onClick(View v) {
hide();
}
public interface ActionListener {
void onHide();

View File

@@ -5,7 +5,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.yunbao.beauty.custom.TextSeekBar;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.views.AbsViewHolder;
import com.yunbao.video.R;
@@ -23,8 +22,6 @@ public class VideoEditMusicViewHolder extends AbsViewHolder implements View.OnCl
private TextView mStartTime;//起始时间
private TextView mEndTime;//结束时间
private RangeSlider mRangeSlider;
private TextSeekBar mOriginSeekBar;//原声
private TextSeekBar mBgmSeekBar;//背景音
private TextView mMusicName;//音乐名称
private ActionListener mActionListener;
private boolean mShowed;
@@ -78,28 +75,7 @@ public class VideoEditMusicViewHolder extends AbsViewHolder implements View.OnCl
});
findViewById(R.id.root).setOnClickListener(this);
findViewById(R.id.btn_cancel).setOnClickListener(this);
mOriginSeekBar = (TextSeekBar) findViewById(R.id.btn_origin);
mBgmSeekBar = (TextSeekBar) findViewById(R.id.seek_bgm);
TextSeekBar.OnSeekChangeListener seekChangeListener = new TextSeekBar.OnSeekChangeListener() {
@Override
public void onProgressChanged(View v, int progress) {
if (mActionListener != null) {
int i = v.getId();
if (i == R.id.btn_origin) {
mActionListener.onOriginalVolumeChanged(progress / 100f);
} else if (i == R.id.seek_bgm) {
mActionListener.onBgmVolumeChanged(progress / 100f);
}
}
}
};
mOriginSeekBar.setOnSeekChangeListener(seekChangeListener);
mBgmSeekBar.setOnSeekChangeListener(seekChangeListener);
if (mBgmSeekBar != null) {
mBgmSeekBar.setProgress(0);
mBgmSeekBar.setEnabled(false);
}
if (mCurMusicBean != null) {
setMusicBean(mCurMusicBean);
@@ -120,16 +96,7 @@ public class VideoEditMusicViewHolder extends AbsViewHolder implements View.OnCl
mMusicName.setText(bean.getTitle());
}
//如果在录制的时候有背景音,则要把原声禁用
if (mHasOriginBgm) {
if (mOriginSeekBar != null) {
mOriginSeekBar.setEnabled(false);
mOriginSeekBar.setProgress(0);
}
}
if (mBgmSeekBar != null) {
mBgmSeekBar.setProgress(80);
mBgmSeekBar.setEnabled(true);
}
if (mRangeSlider != null) {
mRangeSlider.resetRangePos();
}
@@ -144,14 +111,7 @@ public class VideoEditMusicViewHolder extends AbsViewHolder implements View.OnCl
if (mCutGroup != null && mCutGroup.getVisibility() == View.VISIBLE) {
mCutGroup.setVisibility(View.GONE);
}
if (mOriginSeekBar != null) {
mOriginSeekBar.setProgress(80);
mOriginSeekBar.setEnabled(true);
}
if (mBgmSeekBar != null) {
mBgmSeekBar.setProgress(0);
mBgmSeekBar.setEnabled(false);
}
if (mActionListener != null) {
mActionListener.onBgmCancelClick();
}

View File

@@ -1,324 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000"
>
<com.tencent.rtmp.ui.TXCloudVideoView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<RelativeLayout
android:id="@+id/group_1"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/btn_start_record"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:onClick="recordClick"
>
<com.yunbao.video.custom.VideoRecordBtnView
android:id="@+id/record_btn_view"
android:layout_width="70dp"
android:layout_height="70dp"
app:vrb_color="#80ff6131"
app:vrb_max_width="10dp"
app:vrb_min_width="2dp"
app:vrb_start_width="7dp"
/>
<View
android:id="@+id/record_view"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_gravity="center"
android:background="@drawable/bg_btn_record_1"
/>
</FrameLayout>
<com.yunbao.common.custom.DrawableTextView
android:id="@+id/btn_next"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="35dp"
android:onClick="recordClick"
android:paddingTop="4dp"
android:translationX="120dp"
android:visibility="invisible"
app:dt_top_drawable="@mipmap/icon_video_next"
app:dt_top_height="30dp"
app:dt_top_width="30dp"
/>
<com.yunbao.video.custom.RecordProgressView
android:id="@+id/record_progress_view"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_alignParentBottom="true"
/>
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/record_progress_view"
android:layout_alignParentRight="true"
android:layout_marginBottom="8dp"
android:layout_marginRight="10dp"
android:text="0.00s"
android:textColor="@color/white"
android:textSize="13sp"
/>
<RelativeLayout
android:id="@+id/group_2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="30dp"
>
<ImageView
android:id="@+id/btn_back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="8dp"
android:onClick="backClick"
android:padding="10dp"
android:src="@mipmap/icon_video_close"
android:translationY="-2dp"
/>
<com.yunbao.common.custom.DrawableTextView
android:id="@+id/btn_camera"
android:layout_width="40dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:layout_marginTop="7dp"
android:drawablePadding="2dp"
android:gravity="center_horizontal"
android:onClick="recordClick"
android:paddingTop="3dp"
android:text="@string/video_record_camera"
android:textColor="@color/white"
android:textSize="11sp"
app:dt_top_drawable="@mipmap/icon_video_camera"
app:dt_top_height="26dp"
app:dt_top_width="26dp"
/>
<com.yunbao.common.custom.DrawableRadioButton2
android:id="@+id/btn_flash"
android:layout_width="40dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_below="@id/btn_camera"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:button="@null"
android:drawablePadding="2dp"
android:gravity="center_horizontal"
android:onClick="recordClick"
android:paddingTop="3dp"
android:text="@string/video_record_flash"
android:textColor="@color/white"
android:textSize="11sp"
app:dt_top_drawable="@drawable/bg_video_record_flash"
app:dt_top_height="26dp"
app:dt_top_width="26dp"
/>
<com.yunbao.common.custom.DrawableTextView
android:id="@+id/btn_beauty"
android:layout_width="40dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_below="@id/btn_flash"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:drawablePadding="2dp"
android:gravity="center_horizontal"
android:onClick="recordClick"
android:paddingTop="3dp"
android:text="@string/beauty"
android:textColor="@color/white"
android:textSize="11sp"
app:dt_top_drawable="@mipmap/icon_video_beauty"
app:dt_top_height="26dp"
app:dt_top_width="26dp"
/>
<com.yunbao.common.custom.DrawableTextView
android:id="@+id/btn_music"
android:layout_width="40dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_below="@id/btn_beauty"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:drawablePadding="2dp"
android:gravity="center_horizontal"
android:onClick="recordClick"
android:paddingTop="3dp"
android:text="@string/music"
android:textColor="@color/white"
android:textSize="11sp"
app:dt_top_drawable="@mipmap/icon_video_music"
app:dt_top_height="26dp"
app:dt_top_width="26dp"
/>
<RadioGroup
android:layout_width="280dp"
android:layout_height="30dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="110dp"
android:background="@drawable/bg_video_record_speed"
android:orientation="horizontal"
>
<RadioButton
android:id="@+id/btn_speed_1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_btn_video_record_speed"
android:button="@null"
android:gravity="center"
android:onClick="recordClick"
android:text="@string/video_record_speed_1"
android:textColor="@color/white"
android:textSize="12sp"
/>
<RadioButton
android:id="@+id/btn_speed_2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_btn_video_record_speed"
android:button="@null"
android:gravity="center"
android:onClick="recordClick"
android:text="@string/video_record_speed_2"
android:textColor="@color/white"
android:textSize="12sp"
/>
<RadioButton
android:id="@+id/btn_speed_3"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_btn_video_record_speed"
android:button="@null"
android:checked="true"
android:gravity="center"
android:onClick="recordClick"
android:text="@string/video_record_speed_3"
android:textColor="@color/white"
android:textSize="12sp"
/>
<RadioButton
android:id="@+id/btn_speed_4"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_btn_video_record_speed"
android:button="@null"
android:gravity="center"
android:onClick="recordClick"
android:text="@string/video_record_speed_4"
android:textColor="@color/white"
android:textSize="12sp"
/>
<RadioButton
android:id="@+id/btn_speed_5"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_btn_video_record_speed"
android:button="@null"
android:gravity="center"
android:onClick="recordClick"
android:text="@string/video_record_speed_5"
android:textColor="@color/white"
android:textSize="12sp"
/>
</RadioGroup>
<RelativeLayout
android:id="@+id/group_3"
android:layout_width="wrap_content"
android:layout_height="70dp"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_marginBottom="15dp"
android:translationX="100dp"
>
<com.yunbao.common.custom.DrawableTextView
android:id="@+id/btn_upload"
android:layout_width="40dp"
android:layout_height="50dp"
android:layout_centerInParent="true"
android:layout_marginRight="10dp"
android:drawablePadding="2dp"
android:gravity="center_horizontal"
android:onClick="recordClick"
android:paddingTop="3dp"
android:text="@string/upload"
android:textColor="@color/white"
android:textSize="11sp"
app:dt_top_drawable="@mipmap/icon_video_upload"
app:dt_top_height="26dp"
app:dt_top_width="26dp"
/>
</RelativeLayout>
<LinearLayout
android:id="@+id/group_4"
android:layout_width="wrap_content"
android:layout_height="70dp"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_marginBottom="20dp"
android:gravity="center_vertical"
android:translationX="60dp"
android:visibility="invisible"
>
<ImageView
android:id="@+id/btn_delete"
android:layout_width="40dp"
android:layout_height="40dp"
android:onClick="recordClick"
android:padding="4dp"
android:src="@mipmap/icon_video_delete"
/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>

View File

@@ -115,24 +115,6 @@
/>
</RelativeLayout>
<com.yunbao.beauty.custom.TextSeekBar
android:id="@+id/btn_origin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
app:progressVal="80"
app:text2="@string/video_edit_origin"
/>
<com.yunbao.beauty.custom.TextSeekBar
android:id="@+id/seek_bgm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
app:progressVal="80"
app:text2="@string/music"
/>
</LinearLayout>
</FrameLayout>