Commit f5bda134af32fe20f941a4e3ea90eab91d834cdf
Merge branch 'master' of bj.gitlab.cnlive.com:cnlive-team/NewMediaPicker
Showing
4 changed files
with
7 additions
and
9 deletions
config.gradle
lib_media/src/main/java/com/cnlive/media/frame/view/MediaView.java
| ... | ... | @@ -271,7 +271,7 @@ public class MediaView implements MvpView { |
| 271 | 271 | */ |
| 272 | 272 | public void setSelectText(Media media) { |
| 273 | 273 | if (mActivity.selects.size() > 0) { |
| 274 | - String finishText = String.format(mActivity.getResources().getString(R.string.btn_imagepicker_ok), mActivity.selects.size(),3 == mActivity.selects.get(0).mediaType ? 1 : mActivity.maxNum); | |
| 274 | + String finishText = String.format(mActivity.getResources().getString(R.string.btn_imagepicker_ok), mActivity.selects.size(), mActivity.maxNum); | |
| 275 | 275 | bDone.setText(finishText); |
| 276 | 276 | bDone.setVisibility(View.VISIBLE); |
| 277 | 277 | } else { | ... | ... |
lib_media/src/main/java/com/cnlive/media/frame/view/RecordFragmentView.java
| ... | ... | @@ -10,11 +10,8 @@ import android.view.MotionEvent; |
| 10 | 10 | import android.view.View; |
| 11 | 11 | import android.view.animation.OvershootInterpolator; |
| 12 | 12 | |
| 13 | -import androidx.activity.OnBackPressedCallback; | |
| 14 | - | |
| 15 | 13 | import com.cnlive.libs.base.util.AlertUtil; |
| 16 | 14 | import com.cnlive.media.PickerConfig; |
| 17 | -import com.cnlive.media.ui.activity.MediaActivity; | |
| 18 | 15 | import com.cnlive.media.ui.activity.RecordActivity; |
| 19 | 16 | import com.cnlive.media.ui.fragment.RecordFragment; |
| 20 | 17 | import com.cnlive.media.utils.AndroidQUtil; |
| ... | ... | @@ -71,9 +68,9 @@ public class RecordFragmentView implements MvpView, PLRecordStateListener { |
| 71 | 68 | if (cameraSetting == null) |
| 72 | 69 | cameraSetting = new PLCameraSetting(); |
| 73 | 70 | //设置摄像头 |
| 74 | - if (SamsungCamaerUtil.isSamsungAndOpenFont(mFragment.getActivity())){ | |
| 71 | + if (SamsungCamaerUtil.isSamsungAndOpenFont(mFragment.getActivity())) { | |
| 75 | 72 | cameraSetting.setCameraId(PLCameraSetting.CAMERA_FACING_ID.CAMERA_FACING_FRONT); |
| 76 | - }else { | |
| 73 | + } else { | |
| 77 | 74 | cameraSetting.setCameraId(chooseCameraFacingId()); |
| 78 | 75 | } |
| 79 | 76 | |
| ... | ... | @@ -163,6 +160,7 @@ public class RecordFragmentView implements MvpView, PLRecordStateListener { |
| 163 | 160 | } else if (PLCameraSetting.hasCameraFacing(PLCameraSetting.CAMERA_FACING_ID.CAMERA_FACING_BACK)) { |
| 164 | 161 | return PLCameraSetting.CAMERA_FACING_ID.CAMERA_FACING_BACK; |
| 165 | 162 | } else { |
| 163 | + processFlash(false); | |
| 166 | 164 | return PLCameraSetting.CAMERA_FACING_ID.CAMERA_FACING_FRONT; |
| 167 | 165 | } |
| 168 | 166 | } | ... | ... |
lib_media/src/main/java/com/cnlive/media/ui/fragment/RecordFragment.java
| ... | ... | @@ -18,7 +18,6 @@ import androidx.core.app.ActivityCompat; |
| 18 | 18 | import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; |
| 19 | 19 | import com.cnlive.libs.base.util.DoublePressed; |
| 20 | 20 | import com.cnlive.libs.util.Config; |
| 21 | -import com.cnlive.media.PickerConfig; | |
| 22 | 21 | import com.cnlive.media.R; |
| 23 | 22 | import com.cnlive.media.databinding.FragmentRecordBinding; |
| 24 | 23 | import com.cnlive.media.frame.presenter.RecordFragmentPresenter; |
| ... | ... | @@ -143,7 +142,7 @@ public class RecordFragment extends MvpBindingFragment<RecordFragmentView, Recor |
| 143 | 142 | if (plShortVideoRecorder != null) { |
| 144 | 143 | binding.rcControl.resetRecord(); |
| 145 | 144 | plShortVideoRecorder.pause(); |
| 146 | - isFlash=false; | |
| 145 | + isFlash = false; | |
| 147 | 146 | getMvpView().processFlash(isFlash); |
| 148 | 147 | } |
| 149 | 148 | } |
| ... | ... | @@ -189,6 +188,7 @@ public class RecordFragment extends MvpBindingFragment<RecordFragmentView, Recor |
| 189 | 188 | } else { |
| 190 | 189 | if (DoublePressed.onDoublePressed()) return; |
| 191 | 190 | plShortVideoRecorder.switchCamera(); |
| 191 | + getMvpView().processFlash(false); | |
| 192 | 192 | } |
| 193 | 193 | } else if (state == RecordCameraViewObservable.CLICK_FINISH) { |
| 194 | 194 | requireActivity().getOnBackPressedDispatcher().onBackPressed(); | ... | ... |