commit
0122bea8b3
18
app/app.iml
18
app/app.iml
|
@ -86,11 +86,6 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support.test.espresso/espresso-core/2.2.2/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support.test.espresso/espresso-idling-resource/2.2.2/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support.test/exposed-instrumentation-api-publish/0.5/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support.test/rules/0.5/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support.test/runner/0.5/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/25.2.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.2.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-compat/25.2.0/jars" />
|
||||
|
@ -121,24 +116,11 @@
|
|||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="espresso-core-2.2.2" level="project" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="runner-0.5" level="project" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="exposed-instrumentation-api-publish-0.5" level="project" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="espresso-idling-resource-2.2.2" level="project" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="rules-0.5" level="project" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-library-1.3" level="project" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="javax.annotation-api-1.2" level="project" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="javax.inject-1" level="project" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-integration-1.3" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-25.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-compat-25.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="javawriter-2.1.1" level="project" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-media-compat-25.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-core-ui-25.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-25.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" scope="TEST" name="jsr305-2.0.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-25.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-vector-drawable-25.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-core-utils-25.2.0" level="project" />
|
||||
|
|
|
@ -9,7 +9,6 @@ android {
|
|||
targetSdkVersion 25
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
@ -23,9 +22,5 @@ android {
|
|||
|
||||
dependencies {
|
||||
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
compile 'com.android.support:appcompat-v7:25.2.0'
|
||||
testCompile 'junit:junit:4.12'
|
||||
}
|
||||
|
|
|
@ -59,8 +59,8 @@ public class MainActivity extends AppCompatActivity {
|
|||
@Override
|
||||
public void run() {
|
||||
if (isLoop) {
|
||||
Random randomgen = new Random();
|
||||
speak(voiceLines.get(randomgen.nextInt(voiceLines.size())));
|
||||
Random randomgen = new Random();
|
||||
speak(voiceLines.get(randomgen.nextInt(voiceLines.size())));
|
||||
handler.postDelayed(this, 5000 + randomgen.nextInt(5) * 1000);
|
||||
}
|
||||
}
|
||||
|
@ -88,13 +88,13 @@ public class MainActivity extends AppCompatActivity {
|
|||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
if (!isSpeaking) {
|
||||
if(!isLoop){
|
||||
isLoop =true;
|
||||
handler.post(loop);
|
||||
}else{
|
||||
handler.removeCallbacks(loop);
|
||||
isLoop = false;
|
||||
}
|
||||
if (!isLoop) {
|
||||
isLoop = true;
|
||||
handler.post(loop);
|
||||
} else {
|
||||
handler.removeCallbacks(loop);
|
||||
isLoop = false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -102,21 +102,20 @@ public class MainActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy(){
|
||||
if(sr!=null)
|
||||
protected void onDestroy() {
|
||||
if (sr != null)
|
||||
sr.destroy();
|
||||
isLoop = false;
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop(){
|
||||
protected void onStop() {
|
||||
isLoop = false;
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause(){
|
||||
protected void onPause() {
|
||||
isLoop = false;
|
||||
super.onPause();
|
||||
}
|
||||
|
@ -147,6 +146,9 @@ public class MainActivity extends AppCompatActivity {
|
|||
m.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
isSpeaking = true;
|
||||
mp.start();
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -159,6 +161,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
m.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
isSpeaking = false;
|
||||
mp.release();
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
|
@ -166,25 +169,21 @@ public class MainActivity extends AppCompatActivity {
|
|||
public void run() {
|
||||
animation.stop();
|
||||
kurisu.setImageDrawable(animation.getFrame(0));
|
||||
isSpeaking = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
isSpeaking = true;
|
||||
m.start();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void answerSpeech(String request) {
|
||||
String[] greetingArr = new String[]{"ハロー", "おはよう", "こんにちは", "こんばんは"};
|
||||
List<String> greeting = Arrays.asList(greetingArr);
|
||||
Log.e(TAG, request);
|
||||
private void answerSpeech(String input) {
|
||||
List<String> greeting = Arrays.asList("ハロー", "おはよう", "こんにちは", "こんばんは");
|
||||
Log.e(TAG, input);
|
||||
Random randomGen = new Random();
|
||||
if (request.contains("クリスティーナ")) {
|
||||
if (input.contains("クリスティーナ")) {
|
||||
switch (randomGen.nextInt(4)) {
|
||||
case 0:
|
||||
speak(voiceLines.get(10));
|
||||
|
@ -199,17 +198,17 @@ public class MainActivity extends AppCompatActivity {
|
|||
speak(voiceLines.get(15));
|
||||
break;
|
||||
}
|
||||
} else if (request.contains("ぬるぽ")) {
|
||||
} else if (input.contains("ぬるぽ")) {
|
||||
speak(voiceLines.get(9));
|
||||
} else if (request.contains("アットチャンネル") || request.contains("栗ご飯") || request.contains("カメハメハ")) {
|
||||
} else if (input.contains("アットチャンネル") || input.contains("栗ご飯") || input.contains("カメハメハ")) {
|
||||
speak(voiceLines.get(30 + randomGen.nextInt(2)));
|
||||
} else if (request.contains("サリエリ") || request.contains("真帆") || request.contains("比屋定")) {
|
||||
} else if (input.contains("サリエリ") || input.contains("真帆") || input.contains("比屋定")) {
|
||||
speak(voiceLines.get(26 + randomGen.nextInt(4)));
|
||||
} else if (request.contains("タイムマシーン") || request.contains("cern") || request.contains("タイムトラベル")) {
|
||||
} else if (input.contains("タイムマシーン") || input.contains("cern") || input.contains("タイムトラベル")) {
|
||||
speak(voiceLines.get(32 + randomGen.nextInt(5)));
|
||||
} else if (request.contains("メモリー") || request.contains("アマデウス") || request.contains("サイエンス")) {
|
||||
} else if (input.contains("メモリー") || input.contains("アマデウス") || input.contains("サイエンス")) {
|
||||
speak(voiceLines.get(37 + randomGen.nextInt(5)));
|
||||
} else if (greeting.contains(request)) {
|
||||
} else if (greeting.contains(input)) {
|
||||
switch (randomGen.nextInt(3)) {
|
||||
case 0:
|
||||
speak(voiceLines.get(12));
|
||||
|
@ -221,7 +220,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
speak(voiceLines.get(25));
|
||||
break;
|
||||
}
|
||||
} else if (request.contains("ナイスボディ") || request.contains("ほっと") || request.contains("セクシー") || request.contains("ボビーズ")) {
|
||||
} else if (input.contains("ナイスボディ") || input.contains("ほっと") || input.contains("セクシー") || input.contains("ボビーズ")) {
|
||||
switch (randomGen.nextInt(3)) {
|
||||
case 0:
|
||||
speak(voiceLines.get(2));
|
||||
|
@ -338,7 +337,4 @@ public class MainActivity extends AppCompatActivity {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue