55import android .view .View ;
66import android .widget .Button ;
77
8+ import cn .jiguang .imui .chatinput .R ;
89import cn .jiguang .imui .chatinput .listener .RecordVoiceListener ;
910
1011/**
@@ -36,13 +37,13 @@ void updateStatus(UpdateStatus status) {
3637
3738 private void onStartAudioRecord () {
3839 button .setText (text [1 ]);
39- button .setSelected ( true );
40+ button .setBackgroundResource ( R . drawable . voice_bg_pressed );
4041 recordHelper .startRecording ();
4142 }
4243
4344 private void onEndAudioRecord (boolean cancel ) {
4445 button .setText (text [0 ]);
45- button .setSelected ( false );
46+ button .setBackgroundResource ( R . drawable . voice_bg_default );
4647
4748 if (cancel ) {
4849 recordHelper .cancelRecord ();
@@ -59,7 +60,7 @@ private void onEndAudioRecord(boolean cancel) {
5960 * @param cancel
6061 */
6162 private void cancelAudioRecord (boolean cancel ) {
62- button .setSelected ( true );
63+ button .setBackgroundResource ( R . drawable . voice_bg_selected );
6364 updateTimerTip (cancel );
6465 recordHelper .setCancelAble (cancel );
6566 }
@@ -70,7 +71,7 @@ private void updateTimerTip(boolean cancel) {
7071
7172 public void reset (){
7273 button .setText (text [0 ]);
73- button .setSelected ( false );
74+ button .setBackgroundResource ( R . drawable . voice_bg_default );
7475 }
7576 private boolean isCancelled (View view , MotionEvent event ) {
7677 int [] location = new int [2 ];
0 commit comments