删除不必要文件,修改设置页面
@@ -64,31 +64,31 @@ public class Recognizer extends RelativeLayout {
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
setClickable(true);
|
||||
setBackgroundColor(getResources().getColor(R.color.white));
|
||||
RelativeLayout recognizerContainer =
|
||||
(RelativeLayout)
|
||||
LayoutInflater.from(getContext())
|
||||
.inflate(R.layout.rc_view_recognizer, null);
|
||||
View rlMic = recognizerContainer.findViewById(R.id.rl_mic);
|
||||
rlMic.setOnClickListener(
|
||||
new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (mIat == null || !mIat.isListening()) {
|
||||
startRecognize();
|
||||
} else {
|
||||
reset();
|
||||
}
|
||||
}
|
||||
});
|
||||
imgMic = (ImageView) recognizerContainer.findViewById(R.id.img_mic);
|
||||
|
||||
|
||||
addView(recognizerContainer);
|
||||
random = new Random();
|
||||
String params = SpeechConstant.APPID + "=" + mAppId;
|
||||
SpeechUtility.createUtility(getContext().getApplicationContext(), params);
|
||||
// setClickable(true);
|
||||
// setBackgroundColor(getResources().getColor(R.color.white));
|
||||
// RelativeLayout recognizerContainer =
|
||||
// (RelativeLayout)
|
||||
// LayoutInflater.from(getContext())
|
||||
// .inflate(R.layout.rc_view_recognizer, null);
|
||||
// View rlMic = recognizerContainer.findViewById(R.id.rl_mic);
|
||||
// rlMic.setOnClickListener(
|
||||
// new OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// if (mIat == null || !mIat.isListening()) {
|
||||
// startRecognize();
|
||||
// } else {
|
||||
// reset();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// imgMic = (ImageView) recognizerContainer.findViewById(R.id.img_mic);
|
||||
//
|
||||
//
|
||||
// addView(recognizerContainer);
|
||||
// random = new Random();
|
||||
// String params = SpeechConstant.APPID + "=" + mAppId;
|
||||
// SpeechUtility.createUtility(getContext().getApplicationContext(), params);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,83 +148,83 @@ public class Recognizer extends RelativeLayout {
|
||||
}
|
||||
|
||||
private void setRandomImageResource() {
|
||||
int num = random.nextInt(3) + 1;
|
||||
switch (num) {
|
||||
case 1:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_01);
|
||||
break;
|
||||
case 2:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_02);
|
||||
break;
|
||||
default:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_03);
|
||||
break;
|
||||
}
|
||||
// int num = random.nextInt(3) + 1;
|
||||
// switch (num) {
|
||||
// case 1:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_01);
|
||||
// break;
|
||||
// case 2:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_02);
|
||||
// break;
|
||||
// default:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_03);
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
|
||||
private void changeVolume(int volume) {
|
||||
if (null != imgMic) {
|
||||
switch (volume / 2) {
|
||||
case 0:
|
||||
setRandomImageResource();
|
||||
break;
|
||||
case 1:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_02);
|
||||
break;
|
||||
case 2:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_03);
|
||||
break;
|
||||
case 3:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_04);
|
||||
break;
|
||||
case 4:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_05);
|
||||
break;
|
||||
case 5:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_06);
|
||||
break;
|
||||
case 6:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_07);
|
||||
break;
|
||||
case 7:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_08);
|
||||
break;
|
||||
case 8:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_09);
|
||||
break;
|
||||
case 9:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_10);
|
||||
break;
|
||||
case 10:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_11);
|
||||
break;
|
||||
case 11:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_12);
|
||||
break;
|
||||
case 12:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_13);
|
||||
break;
|
||||
default:
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_volume_14);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if (null != imgMic) {
|
||||
// switch (volume / 2) {
|
||||
// case 0:
|
||||
// setRandomImageResource();
|
||||
// break;
|
||||
// case 1:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_02);
|
||||
// break;
|
||||
// case 2:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_03);
|
||||
// break;
|
||||
// case 3:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_04);
|
||||
// break;
|
||||
// case 4:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_05);
|
||||
// break;
|
||||
// case 5:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_06);
|
||||
// break;
|
||||
// case 6:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_07);
|
||||
// break;
|
||||
// case 7:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_08);
|
||||
// break;
|
||||
// case 8:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_09);
|
||||
// break;
|
||||
// case 9:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_10);
|
||||
// break;
|
||||
// case 10:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_11);
|
||||
// break;
|
||||
// case 11:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_12);
|
||||
// break;
|
||||
// case 12:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_13);
|
||||
// break;
|
||||
// default:
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_volume_14);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private void endOfSpeech() {
|
||||
if (null == imgMic) return;
|
||||
imgMic.setImageResource(R.drawable.rc_anim_speech_end);
|
||||
animEnd = (AnimationDrawable) imgMic.getDrawable();
|
||||
imgMic.clearAnimation();
|
||||
animEnd.start();
|
||||
// if (null == imgMic) return;
|
||||
// imgMic.setImageResource(R.drawable.rc_anim_speech_end);
|
||||
// animEnd = (AnimationDrawable) imgMic.getDrawable();
|
||||
// imgMic.clearAnimation();
|
||||
// animEnd.start();
|
||||
}
|
||||
|
||||
private void beginOfSpeech() {
|
||||
if (null == imgMic) return;
|
||||
imgMic.setImageResource(R.drawable.rc_anim_speech_start);
|
||||
animStart = (AnimationDrawable) imgMic.getDrawable();
|
||||
imgMic.clearAnimation();
|
||||
animStart.start();
|
||||
// if (null == imgMic) return;
|
||||
// imgMic.setImageResource(R.drawable.rc_anim_speech_start);
|
||||
// animStart = (AnimationDrawable) imgMic.getDrawable();
|
||||
// imgMic.clearAnimation();
|
||||
// animStart.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -331,7 +331,7 @@ public class Recognizer extends RelativeLayout {
|
||||
animStart = null;
|
||||
}
|
||||
if (imgMic != null) {
|
||||
imgMic.setImageResource(R.mipmap.rc_recognize_disable);
|
||||
// imgMic.setImageResource(R.mipmap.rc_recognize_disable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:oneshot="true">
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_01"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_02"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_03"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_04"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_05"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_06"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_07"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_08"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_09"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_10"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_11"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_12"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_13"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_14"
|
||||
android:duration="50"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_blue"
|
||||
android:duration="100"/>
|
||||
|
||||
</animation-list>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:oneshot="true">
|
||||
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_10"
|
||||
android:duration="100"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_11"
|
||||
android:duration="100"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_12"
|
||||
android:duration="100"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_13"
|
||||
android:duration="100"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_14"
|
||||
android:duration="100"/>
|
||||
<item android:drawable="@mipmap/rc_recognize_volume_blue"
|
||||
android:duration="100"/>
|
||||
</animation-list>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@mipmap/rc_recognizer_voice_hover" android:state_pressed="true"/>
|
||||
<item android:drawable="@mipmap/rc_recognizer_voice"/>
|
||||
</selector>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_mic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@mipmap/rc_recognize_bg_mic">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_mic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/rc_recognize_volume_grey" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 559 B |
|
Before Width: | Height: | Size: 5.0 KiB |
@@ -944,4 +944,5 @@
|
||||
<string name="studio_gift_effects">屏蔽直播間禮物特效</string>
|
||||
<string name="studio_ride_effects">屏蔽直播間座駕特效</string>
|
||||
<string name="in_batch">換一批</string>
|
||||
<string name="chat_chat">聊聊天</string>
|
||||
</resources>
|
||||
|
||||