Skip to content

Commit

Permalink
Update RN chatinput
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLipan committed Sep 11, 2018
1 parent dda08bb commit 97b2543
Showing 1 changed file with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
import cn.jiguang.imui.messagelist.event.OnTouchMsgListEvent;
import cn.jiguang.imui.messagelist.event.ScrollEvent;
import cn.jiguang.imui.messagelist.event.StopPlayVoiceEvent;
import pub.devrel.easypermissions.AfterPermissionGranted;
import pub.devrel.easypermissions.AppSettingsDialog;
import pub.devrel.easypermissions.EasyPermissions;

Expand Down Expand Up @@ -406,7 +405,7 @@ public void run() {
@Override
public void onTakePictureCompleted(String photoPath) {

if(mLastPhotoPath.equals(photoPath)){
if (mLastPhotoPath.equals(photoPath)) {
return;
}
mLastPhotoPath = photoPath;
Expand Down Expand Up @@ -684,10 +683,10 @@ public void showSelectAlbumBtn(ChatInputView chatInputView, boolean flag) {

@ReactProp(name = "showRecordVideoBtn")
public void showRecordVideoBtn(ChatInputView chatInputView, boolean flag) {
if(flag){
if (flag) {
chatInputView.getRecordVideoBtn().setVisibility(View.VISIBLE);
chatInputView.getRecordVideoBtn().setTag("VISIBLE");
}else{
} else {
chatInputView.getRecordVideoBtn().setVisibility(View.GONE);
chatInputView.getRecordVideoBtn().setTag("GONE");
}
Expand Down Expand Up @@ -746,39 +745,40 @@ public void hidePhotoButton(ChatInputView chatInputView, boolean hide) {

@ReactProp(name = "customLayoutItems")
public void setCustomItems(ChatInputView chatInputView, ReadableMap map) {
ReadableArray left = map.hasKey("left")?map.getArray("left"):null;
ReadableArray right = map.hasKey("right")?map.getArray("right"):null;
ReadableArray bottom = map.hasKey("bottom")?map.getArray("bottom"):null;
String[] bottomTags = new String[0];
if(bottom!=null){
bottomTags = new String[bottom.size()];
for(int i =0;i<bottom.size();i++){
bottomTags[i] = bottom.getString(i);
}

ReadableArray left = map.hasKey("left") ? map.getArray("left") : null;
ReadableArray right = map.hasKey("right") ? map.getArray("right") : null;
ReadableArray bottom = map.hasKey("bottom") ? map.getArray("bottom") : null;
String[] bottomTags = new String[0];
if (bottom != null) {
bottomTags = new String[bottom.size()];
for (int i = 0; i < bottom.size(); i++) {
bottomTags[i] = bottom.getString(i);
}
}

String[] leftTags = new String[0];
if(left!=null){
leftTags = new String[left.size()];
for(int i =0;i<left.size();i++){
leftTags[i] = left.getString(i);
}
String[] leftTags = new String[0];
if (left != null) {
leftTags = new String[left.size()];
for (int i = 0; i < left.size(); i++) {
leftTags[i] = left.getString(i);
}
}

String[] rightTags = new String[0];
if(right!=null){
rightTags = new String[right.size()];
for(int i =0;i<right.size();i++){
rightTags[i] = right.getString(i);
}
String[] rightTags = new String[0];
if (right != null) {
rightTags = new String[right.size()];
for (int i = 0; i < right.size(); i++) {
rightTags[i] = right.getString(i);
}
mChatInput.getMenuManager()
.setMenu(Menu.newBuilder()
.customize(true)
.setLeft(leftTags)
.setRight(rightTags)
.setBottom(bottomTags)
.build());
}
mChatInput.getMenuManager()
.setMenu(Menu.newBuilder()
.customize(true)
.setLeft(leftTags)
.setRight(rightTags)
.setBottom(bottomTags)
.build());

}

Expand Down

0 comments on commit 97b2543

Please sign in to comment.