Skip to content

Commit

Permalink
Merge pull request #313 from jpush/dev
Browse files Browse the repository at this point in the history
fix bug
  • Loading branch information
KenChoi1992 committed Mar 22, 2018
2 parents 8ff14a6 + b3138d4 commit 2da3fee
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Android/chatinput/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'cn.jiguang.imui'
PUBLISH_ARTIFACT_ID = 'chatinput'
PUBLISH_VERSION = '0.7.3'
PUBLISH_VERSION = '0.7.4'
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,9 @@ public void onClick(View view) {
} else if (view.getId() == R.id.aurora_ib_camera_record_video) {
// click record video button
// if it is not record video mode
mCameraControllerListener.onSwitchCameraModeClick(!mIsRecordVideoMode);
if (mCameraControllerListener != null) {
mCameraControllerListener.onSwitchCameraModeClick(!mIsRecordVideoMode);
}
if (!mIsRecordVideoMode) {
mIsRecordVideoMode = true;
mCaptureBtn.setBackgroundResource(R.drawable.aurora_preview_record_video_start);
Expand Down Expand Up @@ -621,15 +623,15 @@ public void run() {
}
// if finished recording video, send it
} else if (mFinishRecordingVideo) {
if (mListener != null) {
if (mListener != null && mVideoFilePath != null) {
File file = new File(mVideoFilePath);
VideoItem video = new VideoItem(mVideoFilePath, file.getName(), file.length() + "", System.currentTimeMillis() + "", mMediaPlayer.getDuration() / 1000);
List<FileItem> list = new ArrayList<>();
list.add(video);
mListener.onSendFiles(list);
mFinishRecordingVideo = false;
mVideoFilePath = null;
}
mFinishRecordingVideo = false;
mMediaPlayer.stop();
mMediaPlayer.release();
recoverScreen();
Expand All @@ -640,7 +642,9 @@ public void run() {
}
} else if (view.getId() == R.id.aurora_ib_camera_close) {
try {
mCameraControllerListener.onCloseCameraClick();
if (mCameraControllerListener != null) {
mCameraControllerListener.onCloseCameraClick();
}
mMediaPlayer.stop();
mMediaPlayer.release();
if (mCameraSupport != null) {
Expand Down
2 changes: 1 addition & 1 deletion ReactNative/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'cn.jiguang.imui:messagelist:0.6.8'
compile 'cn.jiguang.imui:chatinput:0.7.3'
compile 'cn.jiguang.imui:chatinput:0.7.4'
compile 'pub.devrel:easypermissions:0.4.0'
compile 'org.greenrobot:eventbus:3.0.0'
implementation 'com.android.support:appcompat-v7:27.1.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,15 @@ public boolean switchToMicrophoneMode() {
mShowMenu = true;
mChatInput.setPendingShowMenu(true);
EmoticonsKeyboardUtils.closeSoftKeyboard(editText);
mChatInput.showMenuLayout();
mChatInput.showRecordVoiceLayout();
sendSizeChangedEvent(calculateMenuHeight());
mChatInput.requestLayout();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mChatInput.showMenuLayout();
mChatInput.showRecordVoiceLayout();
sendSizeChangedEvent(calculateMenuHeight());
}
}, 100);

}
mLastClickId = 0;
return false;
Expand Down Expand Up @@ -293,10 +298,16 @@ public boolean switchToGalleryMode() {
mShowMenu = true;
mChatInput.setPendingShowMenu(true);
EmoticonsKeyboardUtils.closeSoftKeyboard(editText);
sendSizeChangedEvent(calculateMenuHeight());
mChatInput.showMenuLayout();
mChatInput.showSelectPhotoLayout();
mChatInput.requestLayout();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
sendSizeChangedEvent(calculateMenuHeight());
mChatInput.showMenuLayout();
mChatInput.showSelectPhotoLayout();
mChatInput.requestLayout();
}
}, 100);

}
mLastClickId = 1;
return false;
Expand Down Expand Up @@ -327,10 +338,16 @@ public boolean switchToCameraMode() {
mChatInput.setPendingShowMenu(true);
mChatInput.initCamera();
EmoticonsKeyboardUtils.closeSoftKeyboard(editText);
mChatInput.showMenuLayout();
mChatInput.showCameraLayout();
sendSizeChangedEvent(calculateMenuHeight());
mChatInput.requestLayout();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mChatInput.showMenuLayout();
mChatInput.showCameraLayout();
sendSizeChangedEvent(calculateMenuHeight());
mChatInput.requestLayout();
}
}, 100);

}
mLastClickId = 2;
return false;
Expand All @@ -349,10 +366,15 @@ public boolean switchToEmojiMode() {
mShowMenu = true;
mChatInput.setPendingShowMenu(true);
EmoticonsKeyboardUtils.closeSoftKeyboard(editText);
mChatInput.showMenuLayout();
mChatInput.showEmojiLayout();
sendSizeChangedEvent(calculateMenuHeight());
mChatInput.requestLayout();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mChatInput.showMenuLayout();
mChatInput.showEmojiLayout();
sendSizeChangedEvent(calculateMenuHeight());
mChatInput.requestLayout();
}
}, 100);
}
mLastClickId = 3;
return false;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurora-imui-react-native",
"version": "0.9.25",
"version": "0.9.26",
"description": "aurora imui plugin for react native application",
"main": "index.js",

Expand Down

0 comments on commit 2da3fee

Please sign in to comment.