Commit 9610bf97e176f1e1a26cc281f4deecfc3e5576da
1 parent
5412eba4
处理默认
Showing
7 changed files
with
9 additions
and
6 deletions
config.gradle
lib_media/src/main/java/com/cnlive/media/PickerConfig.java
| @@ -9,6 +9,7 @@ public class PickerConfig { | @@ -9,6 +9,7 @@ public class PickerConfig { | ||
| 9 | 9 | ||
| 10 | //视频文件最大时长 | 10 | //视频文件最大时长 |
| 11 | public static final String MAX_TIME = "max_time"; | 11 | public static final String MAX_TIME = "max_time"; |
| 12 | + public static final int RECODE_MAX_TIME = 60*1000; | ||
| 12 | // 默认视频时长 | 13 | // 默认视频时长 |
| 13 | public static final int DEFAULT_MAX_TIME = Integer.MAX_VALUE; | 14 | public static final int DEFAULT_MAX_TIME = Integer.MAX_VALUE; |
| 14 | //最大选择个数 | 15 | //最大选择个数 |
lib_media/src/main/java/com/cnlive/media/frame/presenter/MediaPresenter.java
| @@ -88,7 +88,7 @@ public class MediaPresenter extends MvpBasePresenter<MediaView> { | @@ -88,7 +88,7 @@ public class MediaPresenter extends MvpBasePresenter<MediaView> { | ||
| 88 | mediaPickerActivity.mOptions.setJumpCameraMode(PickerConfig.CAMERA_MODE_ALL); | 88 | mediaPickerActivity.mOptions.setJumpCameraMode(PickerConfig.CAMERA_MODE_ALL); |
| 89 | } | 89 | } |
| 90 | } | 90 | } |
| 91 | - | 91 | + mediaPickerActivity.maxTime = mediaPickerActivity.mOptions.getMaxTime(); |
| 92 | mediaPickerActivity.showTime = mediaPickerActivity.mOptions.isShowTime(); | 92 | mediaPickerActivity.showTime = mediaPickerActivity.mOptions.isShowTime(); |
| 93 | mediaPickerActivity.selectGift = mediaPickerActivity.mOptions.isSelectGift(); | 93 | mediaPickerActivity.selectGift = mediaPickerActivity.mOptions.isSelectGift(); |
| 94 | mediaPickerActivity.singlePick = mediaPickerActivity.mOptions.isSinglePick(); | 94 | mediaPickerActivity.singlePick = mediaPickerActivity.mOptions.isSinglePick(); |
lib_media/src/main/java/com/cnlive/media/frame/view/RecordFragmentView.java
| @@ -90,7 +90,7 @@ public class RecordFragmentView implements MvpView, PLRecordStateListener { | @@ -90,7 +90,7 @@ public class RecordFragmentView implements MvpView, PLRecordStateListener { | ||
| 90 | if (getActivity().mOptions != null && getActivity().mOptions.getMaxTime() > 0) { | 90 | if (getActivity().mOptions != null && getActivity().mOptions.getMaxTime() > 0) { |
| 91 | recordSetting.setMaxRecordDuration(getActivity().mOptions.getMaxTime()); | 91 | recordSetting.setMaxRecordDuration(getActivity().mOptions.getMaxTime()); |
| 92 | } else { | 92 | } else { |
| 93 | - recordSetting.setMaxRecordDuration(60 * 1000); | 93 | + recordSetting.setMaxRecordDuration(PickerConfig.RECODE_MAX_TIME); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | recordSetting.setRecordSpeedVariable(true); | 96 | recordSetting.setRecordSpeedVariable(true); |
lib_media/src/main/java/com/cnlive/media/model/ImagePickerOptions.java
| @@ -42,7 +42,7 @@ public class ImagePickerOptions implements Parcelable { | @@ -42,7 +42,7 @@ public class ImagePickerOptions implements Parcelable { | ||
| 42 | public boolean singlePick = false; | 42 | public boolean singlePick = false; |
| 43 | //展示时长 | 43 | //展示时长 |
| 44 | public boolean showTime = false; | 44 | public boolean showTime = false; |
| 45 | - public int maxTime = PickerConfig.DEFAULT_MAX_TIME; | 45 | + public int maxTime = PickerConfig.RECODE_MAX_TIME; |
| 46 | //是否选择Gif | 46 | //是否选择Gif |
| 47 | public boolean selectGift = true; | 47 | public boolean selectGift = true; |
| 48 | //处理返回uri地址 | 48 | //处理返回uri地址 |
lib_media/src/main/java/com/cnlive/media/ui/activity/MediaActivity.java
| @@ -63,6 +63,8 @@ public class MediaActivity extends MvpBindingActivity<MediaView, MediaPresenter, | @@ -63,6 +63,8 @@ public class MediaActivity extends MvpBindingActivity<MediaView, MediaPresenter, | ||
| 63 | public String MEDIA_HOME = "tag_media_home"; | 63 | public String MEDIA_HOME = "tag_media_home"; |
| 64 | public String MEDIA_PRE = "tag_media_pre"; | 64 | public String MEDIA_PRE = "tag_media_pre"; |
| 65 | 65 | ||
| 66 | + public int maxTime = PickerConfig.RECODE_MAX_TIME; | ||
| 67 | + | ||
| 66 | //配置 | 68 | //配置 |
| 67 | public ImagePickerOptions mOptions; | 69 | public ImagePickerOptions mOptions; |
| 68 | //加载器 | 70 | //加载器 |
lib_media/src/main/java/com/cnlive/media/ui/widget/record/ShootView.java
| @@ -54,7 +54,7 @@ public class ShootView extends View implements Runnable { | @@ -54,7 +54,7 @@ public class ShootView extends View implements Runnable { | ||
| 54 | //当前进度 | 54 | //当前进度 |
| 55 | int curProgress = 0; | 55 | int curProgress = 0; |
| 56 | //最大进度 | 56 | //最大进度 |
| 57 | - int maxTime = 10000; | 57 | + int maxTime = PickerConfig.RECODE_MAX_TIME; |
| 58 | //倒计时时间 | 58 | //倒计时时间 |
| 59 | 59 | ||
| 60 | Paint innerPaint; | 60 | Paint innerPaint; |
| @@ -93,7 +93,7 @@ public class ShootView extends View implements Runnable { | @@ -93,7 +93,7 @@ public class ShootView extends View implements Runnable { | ||
| 93 | progressWidth = typedArray.getDimensionPixelSize(R.styleable.MediaShootViewStyle_mediaProgressWidth, 10); | 93 | progressWidth = typedArray.getDimensionPixelSize(R.styleable.MediaShootViewStyle_mediaProgressWidth, 10); |
| 94 | 94 | ||
| 95 | curProgress = typedArray.getInt(R.styleable.MediaShootViewStyle_curProgress, 0); | 95 | curProgress = typedArray.getInt(R.styleable.MediaShootViewStyle_curProgress, 0); |
| 96 | - maxTime = typedArray.getInt(R.styleable.MediaShootViewStyle_maxProgress, PickerConfig.DEFAULT_MAX_TIME); | 96 | + maxTime = typedArray.getInt(R.styleable.MediaShootViewStyle_maxProgress, PickerConfig.RECODE_MAX_TIME); |
| 97 | 97 | ||
| 98 | typedArray.recycle(); | 98 | typedArray.recycle(); |
| 99 | 99 |