|
@@ -157,12 +157,15 @@ public class MineStylePageActivity extends BaseMVPActivity<ActivityMineStylePage
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void delete(String url) {
|
|
public void delete(String url) {
|
|
- if(videoBeanList.size() == 2){
|
|
|
|
- ToastUtil.getInstance().showShort("至少保留一个风采视频哦");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
for (TeacherSelfStyleInfoBean.StyleVideoBean styleVideoBean : videoBeanList) {
|
|
for (TeacherSelfStyleInfoBean.StyleVideoBean styleVideoBean : videoBeanList) {
|
|
if (styleVideoBean.type == 0 && styleVideoBean.videoUrl.equals(url)) {
|
|
if (styleVideoBean.type == 0 && styleVideoBean.videoUrl.equals(url)) {
|
|
|
|
+ if (TextUtils.equals(MineStyleVideoAdapter.VIDEO_AUDIT_STATUS_PASS, styleVideoBean.authStatus)) {
|
|
|
|
+ int passVideoCount = getPassVideoCount();
|
|
|
|
+ if (passVideoCount == 1) {
|
|
|
|
+ ToastUtil.getInstance().showShort("需至少保留一个通过审核风采视频");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
videoBeanList.remove(styleVideoBean);
|
|
videoBeanList.remove(styleVideoBean);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -197,6 +200,25 @@ public class MineStylePageActivity extends BaseMVPActivity<ActivityMineStylePage
|
|
addETListener();
|
|
addETListener();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取已过审视频
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private int getPassVideoCount() {
|
|
|
|
+ if (videoBeanList == null || videoBeanList.size() == 0) {
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ int count = 0;
|
|
|
|
+ for (int i = 0; i < videoBeanList.size(); i++) {
|
|
|
|
+ TeacherSelfStyleInfoBean.StyleVideoBean styleVideoBean = videoBeanList.get(i);
|
|
|
|
+ if (TextUtils.equals(MineStyleVideoAdapter.VIDEO_AUDIT_STATUS_PASS, styleVideoBean.authStatus)) {
|
|
|
|
+ count++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return count;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
private void toAlbum() {
|
|
private void toAlbum() {
|
|
new RxPermissions(this)
|
|
new RxPermissions(this)
|
|
@@ -219,7 +241,7 @@ public class MineStylePageActivity extends BaseMVPActivity<ActivityMineStylePage
|
|
.theme(com.cooleshow.base.R.style.picture_daya_style)// 主题样式设置 具体参考 values/styles 用法:R .style.picture.white.style
|
|
.theme(com.cooleshow.base.R.style.picture_daya_style)// 主题样式设置 具体参考 values/styles 用法:R .style.picture.white.style
|
|
.selectionMode(PictureConfig.SINGLE)// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE
|
|
.selectionMode(PictureConfig.SINGLE)// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE
|
|
.enableCrop(true)// 是否裁剪 true or false
|
|
.enableCrop(true)// 是否裁剪 true or false
|
|
- .cropImageWideHigh(SizeUtils.dp2px(157),SizeUtils.dp2px(106))
|
|
|
|
|
|
+ .cropImageWideHigh(SizeUtils.dp2px(157), SizeUtils.dp2px(106))
|
|
.showCropGrid(false)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false true or false
|
|
.showCropGrid(false)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false true or false
|
|
.compress(true)// 是否压缩 true or false
|
|
.compress(true)// 是否压缩 true or false
|
|
.circleDimmedLayer(false)// 是否圆形裁剪 true or false
|
|
.circleDimmedLayer(false)// 是否圆形裁剪 true or false
|