@Touch boolean voiceRecordButton(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL) { //long nowTime = System.currentTimeMillis(); float nowY = event.getRawY(); if (nowY - touchY <= -100) { //上滑取消录音发送 cancelRecord(); showToast(R.string.record_has_canceled); } else { sendVoice(); } return false; } else if (event.getAction() == MotionEvent.ACTION_DOWN) { touchY = event.getRawY(); return false; } else if (event.getAction() == MotionEvent.ACTION_MOVE) { if (out != null) { if (!isTouchInside((int) event.getX(), (int) event.getY())) { if (isRecoding) { tips_hold_to_talk.setVisibility(View.VISIBLE); tips_hold_to_talk.setText(R.string.loosen_to_cancel); soundWaveLayout.setVisibility(View.GONE); pause(); } } else { if (!isRecoding) { touchY = event.getRawY(); tips_hold_to_talk.setVisibility(View.GONE); tips_hold_to_talk.setText(R.string.hold_to_talk); soundWaveLayout.setVisibility(View.VISIBLE); reset(); } } } } return false; }
@Touch void edt_start_date(MotionEvent motionEvent){ layout_start_date(motionEvent); }
@Touch void edt_end_date(MotionEvent motionEvent){ layout_end_date(motionEvent); }
@Touch void layout_start_date(MotionEvent motionEvent){ showCaldroidDialog(edt_start_date,motionEvent); }
@Touch void layout_end_date(MotionEvent motionEvent){ showCaldroidDialog(edt_end_date,motionEvent); }
@Touch(R.id.hipster_button_yes) void onYesTouched(MotionEvent event) { handleTouch(event, yes, "hipster"); }
@Touch(R.id.hipster_button_no) void onNoTouched(MotionEvent event) { handleTouch(event, no, "nothipster"); }
@Touch(R.id.hipster_button_dont_know) void onDunnoTouched(MotionEvent event) { handleTouch(event, dunno, "unknown"); }