Skip to content

Commit 50a844f

Browse files
committed
fix a bug
1 parent fc327d1 commit 50a844f

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

keyboard/src/main/java/cn/hadcn/keyboard/ChatKeyboardLayout.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -518,15 +518,17 @@ private class RecordingTouchListener implements OnTouchListener {
518518

519519
@Override
520520
public boolean onTouch(View view, MotionEvent motionEvent) {
521-
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
522-
if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission
523-
.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
524-
if (mOnChatKeyBoardListener != null) {
525-
mOnChatKeyBoardListener.onRecordingAction(RecordingAction
526-
.PERMISSION_NOT_GRANTED);
527-
}
528-
return true;
521+
if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission.RECORD_AUDIO)
522+
!= PackageManager.PERMISSION_GRANTED
523+
|| ActivityCompat.checkSelfPermission(mContext, Manifest.permission
524+
.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
525+
if (mOnChatKeyBoardListener != null) {
526+
mOnChatKeyBoardListener.onRecordingAction(RecordingAction
527+
.PERMISSION_NOT_GRANTED);
529528
}
529+
return true;
530+
}
531+
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
530532
startY = motionEvent.getRawY();
531533
btnRecording.setText(getResources().getString(R.string.recording_end));
532534
btnRecording.setBackgroundResource(R.drawable.recording_p);

0 commit comments

Comments
 (0)