When things get complicated... REFACTOR!
This commit is contained in:
parent
4800400b7c
commit
c5c517a69b
|
@ -19,19 +19,14 @@ import java.util.Calendar;
|
||||||
|
|
||||||
public class AlarmActivity extends Activity {
|
public class AlarmActivity extends Activity {
|
||||||
|
|
||||||
final String TAG = "Amadeus.Alarm";
|
private final String TAG = "Amadeus.Alarm";
|
||||||
AlarmManager alarmManager;
|
public static final int ALARM_ID = 104859;
|
||||||
PendingIntent pendingIntent;
|
|
||||||
TimePicker alarmTimePicker;
|
|
||||||
ToggleButton alarmToggle;
|
|
||||||
public static final int alarmCode = 104856;
|
|
||||||
SharedPreferences settings;
|
|
||||||
SharedPreferences.Editor editor;
|
|
||||||
|
|
||||||
@Override
|
private AlarmManager alarmManager;
|
||||||
public void onStart() {
|
private PendingIntent pendingIntent;
|
||||||
super.onStart();
|
private TimePicker alarmTimePicker;
|
||||||
}
|
private ToggleButton alarmToggle;
|
||||||
|
private SharedPreferences settings;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -42,7 +37,7 @@ public class AlarmActivity extends Activity {
|
||||||
alarmToggle = (ToggleButton) findViewById(R.id.alarmToggle);
|
alarmToggle = (ToggleButton) findViewById(R.id.alarmToggle);
|
||||||
alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
|
alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
|
||||||
Intent alarmIntent = new Intent(this, AlarmReceiver.class);
|
Intent alarmIntent = new Intent(this, AlarmReceiver.class);
|
||||||
pendingIntent = PendingIntent.getBroadcast(this, alarmCode, alarmIntent, PendingIntent.FLAG_NO_CREATE);
|
pendingIntent = PendingIntent.getBroadcast(this, ALARM_ID, alarmIntent, PendingIntent.FLAG_NO_CREATE);
|
||||||
|
|
||||||
if (settings.getBoolean("alarm_toggle", false)) {
|
if (settings.getBoolean("alarm_toggle", false)) {
|
||||||
alarmToggle.setChecked(true);
|
alarmToggle.setChecked(true);
|
||||||
|
@ -52,7 +47,7 @@ public class AlarmActivity extends Activity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onToggleClicked(View view) {
|
public void onToggleClicked(View view) {
|
||||||
editor = settings.edit();
|
SharedPreferences.Editor editor = settings.edit();
|
||||||
if (alarmToggle.isChecked()) {
|
if (alarmToggle.isChecked()) {
|
||||||
editor.putBoolean("alarm_toggle", true);
|
editor.putBoolean("alarm_toggle", true);
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
|
|
@ -11,10 +11,9 @@ import android.support.v4.content.WakefulBroadcastReceiver;
|
||||||
|
|
||||||
public class AlarmReceiver extends WakefulBroadcastReceiver {
|
public class AlarmReceiver extends WakefulBroadcastReceiver {
|
||||||
|
|
||||||
static MediaPlayer m;
|
private static MediaPlayer m;
|
||||||
static boolean isPlaying = false;
|
private static boolean isPlaying = false;
|
||||||
static SharedPreferences settings;
|
private static SharedPreferences settings;
|
||||||
static SharedPreferences.Editor editor;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
@ -46,7 +45,7 @@ public class AlarmReceiver extends WakefulBroadcastReceiver {
|
||||||
public static void stopRingtone(Context context) {
|
public static void stopRingtone(Context context) {
|
||||||
settings = PreferenceManager.getDefaultSharedPreferences(context);
|
settings = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
if (isPlaying) {
|
if (isPlaying) {
|
||||||
editor = settings.edit();
|
SharedPreferences.Editor editor = settings.edit();
|
||||||
editor.putBoolean("alarm_toggle", false);
|
editor.putBoolean("alarm_toggle", false);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
m.release();
|
m.release();
|
||||||
|
|
|
@ -8,7 +8,8 @@ import android.content.Intent;
|
||||||
import android.support.v4.app.NotificationCompat;
|
import android.support.v4.app.NotificationCompat;
|
||||||
|
|
||||||
public class AlarmService extends IntentService {
|
public class AlarmService extends IntentService {
|
||||||
NotificationManager alarmNotificationManager;
|
|
||||||
|
public static final int ALARM_NOTIFICATION_ID = 102434;
|
||||||
|
|
||||||
public AlarmService() {
|
public AlarmService() {
|
||||||
super("AlarmService");
|
super("AlarmService");
|
||||||
|
@ -23,7 +24,7 @@ public class AlarmService extends IntentService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendNotification(String msg) {
|
private void sendNotification(String msg) {
|
||||||
alarmNotificationManager = (NotificationManager) this
|
NotificationManager alarmNotificationManager = (NotificationManager) this
|
||||||
.getSystemService(Context.NOTIFICATION_SERVICE);
|
.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
|
||||||
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
|
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
|
||||||
|
@ -35,6 +36,6 @@ public class AlarmService extends IntentService {
|
||||||
.setContentText(msg);
|
.setContentText(msg);
|
||||||
|
|
||||||
alarmNotificationBuilder.setContentIntent(contentIntent);
|
alarmNotificationBuilder.setContentIntent(contentIntent);
|
||||||
alarmNotificationManager.notify(1, alarmNotificationBuilder.build());
|
alarmNotificationManager.notify(ALARM_NOTIFICATION_ID, alarmNotificationBuilder.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -19,12 +19,11 @@ public class LangContext extends ContextWrapper {
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public static ContextWrapper wrap(Context context) {
|
public static ContextWrapper wrap(Context context) {
|
||||||
SharedPreferences sharedPreferences;
|
|
||||||
Configuration config = context.getResources().getConfiguration();
|
Configuration config = context.getResources().getConfiguration();
|
||||||
|
|
||||||
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());
|
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());
|
||||||
|
|
||||||
String lang = sharedPreferences.getString("lang", "ja");
|
String lang = settings.getString("lang", "en");
|
||||||
|
|
||||||
Locale locale = new Locale(lang);
|
Locale locale = new Locale(lang);
|
||||||
Locale.setDefault(locale);
|
Locale.setDefault(locale);
|
||||||
|
|
|
@ -23,28 +23,27 @@ import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
public class LaunchActivity extends AppCompatActivity {
|
public class LaunchActivity extends AppCompatActivity {
|
||||||
ImageView connect, cancel, imageViewLogo;
|
|
||||||
TextView status;
|
|
||||||
Boolean isPressed = false;
|
|
||||||
SharedPreferences settings;
|
|
||||||
MediaPlayer m;
|
|
||||||
Handler aniHandle = new Handler();
|
|
||||||
AlarmManager alarmManager;
|
|
||||||
PendingIntent pendingIntent;
|
|
||||||
NotificationManager notificationManager;
|
|
||||||
Vibrator v;
|
|
||||||
|
|
||||||
int i = 0;
|
private ImageView connect, cancel, logo;
|
||||||
int id;
|
private TextView status;
|
||||||
int duration = 20;
|
private Boolean isPressed = false;
|
||||||
|
private MediaPlayer m;
|
||||||
|
private Handler aniHandle = new Handler();
|
||||||
|
private AlarmManager alarmManager;
|
||||||
|
private NotificationManager notificationManager;
|
||||||
|
private Vibrator v;
|
||||||
|
|
||||||
|
private int i = 0;
|
||||||
|
|
||||||
Runnable aniRunnable = new Runnable() {
|
Runnable aniRunnable = new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
final int DURATION = 20;
|
||||||
if (i < 39) {
|
if (i < 39) {
|
||||||
i += 1;
|
i += 1;
|
||||||
String imgName = "logo" + Integer.toString(i);
|
String imgName = "logo" + Integer.toString(i);
|
||||||
id = getResources().getIdentifier(imgName, "drawable", getPackageName());
|
int id = getResources().getIdentifier(imgName, "drawable", getPackageName());
|
||||||
imageViewLogo.setImageDrawable((ContextCompat.getDrawable(LaunchActivity.this, id)));
|
logo.setImageDrawable((ContextCompat.getDrawable(LaunchActivity.this, id)));
|
||||||
aniHandle.postDelayed(this, duration);
|
aniHandle.postDelayed(this, DURATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -65,18 +64,21 @@ public class LaunchActivity extends AppCompatActivity {
|
||||||
connect = (ImageView) findViewById(R.id.imageView_connect);
|
connect = (ImageView) findViewById(R.id.imageView_connect);
|
||||||
cancel = (ImageView) findViewById(R.id.imageView_cancel);
|
cancel = (ImageView) findViewById(R.id.imageView_cancel);
|
||||||
status = (TextView) findViewById(R.id.textView_call);
|
status = (TextView) findViewById(R.id.textView_call);
|
||||||
imageViewLogo = (ImageView) findViewById(R.id.imageView_logo);
|
logo = (ImageView) findViewById(R.id.imageView_logo);
|
||||||
aniHandle.post(aniRunnable);
|
|
||||||
alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
|
alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
|
||||||
v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
Intent alarmIntent = new Intent(LaunchActivity.this, AlarmReceiver.class);
|
Intent alarmIntent = new Intent(LaunchActivity.this, AlarmReceiver.class);
|
||||||
pendingIntent = PendingIntent.getBroadcast(LaunchActivity.this, AlarmActivity.alarmCode, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
final PendingIntent pendingIntent = PendingIntent.getBroadcast(LaunchActivity.this, AlarmActivity.ALARM_ID, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
notificationManager = (NotificationManager) getBaseContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
notificationManager = (NotificationManager) getBaseContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||||
final Window win = getWindow();
|
final Window win = getWindow();
|
||||||
|
|
||||||
|
aniHandle.post(aniRunnable);
|
||||||
|
|
||||||
if (!isAppInstalled(LaunchActivity.this, "com.google.android.googlequicksearchbox")) {
|
if (!isAppInstalled(LaunchActivity.this, "com.google.android.googlequicksearchbox")) {
|
||||||
status.setText(R.string.google_app_error);
|
status.setText(R.string.google_app_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AlarmReceiver.isPlaying()) {
|
if (AlarmReceiver.isPlaying()) {
|
||||||
status.setText(R.string.incoming_call);
|
status.setText(R.string.incoming_call);
|
||||||
if (settings.getBoolean("vibrate", false)) {
|
if (settings.getBoolean("vibrate", false)) {
|
||||||
|
@ -87,9 +89,6 @@ public class LaunchActivity extends AppCompatActivity {
|
||||||
win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
|
win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
|
||||||
}
|
}
|
||||||
|
|
||||||
connect.setImageResource(R.drawable.connect_unselect);
|
|
||||||
cancel.setImageResource(R.drawable.cancel_unselect);
|
|
||||||
|
|
||||||
if (settings.getBoolean("show_notification", false)) {
|
if (settings.getBoolean("show_notification", false)) {
|
||||||
showNotification();
|
showNotification();
|
||||||
}
|
}
|
||||||
|
@ -123,7 +122,7 @@ public class LaunchActivity extends AppCompatActivity {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
AlarmReceiver.stopRingtone(LaunchActivity.this);
|
AlarmReceiver.stopRingtone(LaunchActivity.this);
|
||||||
notificationManager.cancel(1);
|
notificationManager.cancel(AlarmService.ALARM_NOTIFICATION_ID);
|
||||||
alarmManager.cancel(pendingIntent);
|
alarmManager.cancel(pendingIntent);
|
||||||
v.cancel();
|
v.cancel();
|
||||||
win.clearFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
|
win.clearFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
|
||||||
|
@ -141,7 +140,7 @@ public class LaunchActivity extends AppCompatActivity {
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
cancel.setImageResource(R.drawable.cancel_select);
|
cancel.setImageResource(R.drawable.cancel_select);
|
||||||
AlarmReceiver.stopRingtone(getApplicationContext());
|
AlarmReceiver.stopRingtone(getApplicationContext());
|
||||||
notificationManager.cancel(1);
|
notificationManager.cancel(AlarmService.ALARM_NOTIFICATION_ID);
|
||||||
alarmManager.cancel(pendingIntent);
|
alarmManager.cancel(pendingIntent);
|
||||||
v.cancel();
|
v.cancel();
|
||||||
win.clearFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
|
win.clearFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
|
||||||
|
@ -154,7 +153,7 @@ public class LaunchActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
imageViewLogo.setOnClickListener(new View.OnClickListener() {
|
logo.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
Intent settingIntent = new Intent(LaunchActivity.this, SettingsActivity.class);
|
Intent settingIntent = new Intent(LaunchActivity.this, SettingsActivity.class);
|
||||||
|
@ -176,7 +175,7 @@ public class LaunchActivity extends AppCompatActivity {
|
||||||
if (m != null)
|
if (m != null)
|
||||||
m.release();
|
m.release();
|
||||||
AlarmReceiver.stopRingtone(LaunchActivity.this);
|
AlarmReceiver.stopRingtone(LaunchActivity.this);
|
||||||
notificationManager.cancel(1);
|
notificationManager.cancel(AlarmService.ALARM_NOTIFICATION_ID);
|
||||||
v.cancel();
|
v.cancel();
|
||||||
win.clearFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
|
win.clearFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
|
||||||
win.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
|
win.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
|
||||||
|
@ -185,6 +184,7 @@ public class LaunchActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
if (isPressed) {
|
if (isPressed) {
|
||||||
status.setText(R.string.disconnected);
|
status.setText(R.string.disconnected);
|
||||||
} else if (!isAppInstalled(LaunchActivity.this, "com.google.android.googlequicksearchbox")) {
|
} else if (!isAppInstalled(LaunchActivity.this, "com.google.android.googlequicksearchbox")) {
|
||||||
|
@ -197,7 +197,6 @@ public class LaunchActivity extends AppCompatActivity {
|
||||||
isPressed = false;
|
isPressed = false;
|
||||||
connect.setImageResource(R.drawable.connect_unselect);
|
connect.setImageResource(R.drawable.connect_unselect);
|
||||||
cancel.setImageResource(R.drawable.cancel_unselect);
|
cancel.setImageResource(R.drawable.cancel_unselect);
|
||||||
super.onResume();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showNotification() {
|
private void showNotification() {
|
||||||
|
@ -211,7 +210,7 @@ public class LaunchActivity extends AppCompatActivity {
|
||||||
stackBuilder.addNextIntent(resultIntent);
|
stackBuilder.addNextIntent(resultIntent);
|
||||||
PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
|
PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
builder.setContentIntent(resultPendingIntent);
|
builder.setContentIntent(resultPendingIntent);
|
||||||
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
notificationManager.notify(0, builder.build());
|
notificationManager.notify(0, builder.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -38,20 +38,21 @@ import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
final String TAG = "Amadeus";
|
|
||||||
final int REQUEST_PERMISSION_RECORD_AUDIO = 1;
|
private final String TAG = "Amadeus";
|
||||||
TextView subtitles;
|
|
||||||
ImageView kurisu;
|
private TextView subtitles;
|
||||||
Boolean isLoop = false;
|
private ImageView kurisu;
|
||||||
Boolean isSpeaking = false;
|
private Boolean isLoop = false;
|
||||||
VoiceLine[] voiceLines = VoiceLine.Line.getLines();
|
private Boolean isSpeaking = false;
|
||||||
AnimationDrawable animation;
|
private VoiceLine[] voiceLines = VoiceLine.Line.getLines();
|
||||||
int shaman_girls = -1;
|
private AnimationDrawable animation;
|
||||||
Random randomgen = new Random();
|
private int shaman_girls = -1;
|
||||||
SharedPreferences settings;
|
private Random randomgen = new Random();
|
||||||
String lang, recogLang;
|
private SharedPreferences settings;
|
||||||
MediaPlayer m;
|
private String recogLang;
|
||||||
String[] contextLang;
|
private MediaPlayer m;
|
||||||
|
private String[] contextLang;
|
||||||
private SpeechRecognizer sr;
|
private SpeechRecognizer sr;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,21 +63,22 @@ public class MainActivity extends AppCompatActivity {
|
||||||
subtitles = (TextView) findViewById(R.id.textView_subtitles);
|
subtitles = (TextView) findViewById(R.id.textView_subtitles);
|
||||||
ImageView subtitlesBackground = (ImageView) findViewById(R.id.imageView_subtitles);
|
ImageView subtitlesBackground = (ImageView) findViewById(R.id.imageView_subtitles);
|
||||||
settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||||
lang = settings.getString("lang", "ja");
|
|
||||||
recogLang = settings.getString("recognition_lang", "ja-JP");
|
recogLang = settings.getString("recognition_lang", "ja-JP");
|
||||||
contextLang = recogLang.split("-");
|
contextLang = recogLang.split("-");
|
||||||
|
sr = SpeechRecognizer.createSpeechRecognizer(this);
|
||||||
|
sr.setRecognitionListener(new listener());
|
||||||
|
final Handler handler = new Handler();
|
||||||
|
final int REQUEST_PERMISSION_RECORD_AUDIO = 11302;
|
||||||
|
|
||||||
if (!settings.getBoolean("show_subtitles", false)) {
|
if (!settings.getBoolean("show_subtitles", false)) {
|
||||||
subtitlesBackground.setVisibility(View.INVISIBLE);
|
subtitlesBackground.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
speak(voiceLines[VoiceLine.Line.HELLO]);
|
|
||||||
|
|
||||||
final Handler handler = new Handler();
|
speak(voiceLines[VoiceLine.Line.HELLO]);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.RECORD_AUDIO}, REQUEST_PERMISSION_RECORD_AUDIO);
|
ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.RECORD_AUDIO}, REQUEST_PERMISSION_RECORD_AUDIO);
|
||||||
}
|
}
|
||||||
sr = SpeechRecognizer.createSpeechRecognizer(this);
|
|
||||||
sr.setRecognitionListener(new listener());
|
|
||||||
|
|
||||||
final Runnable loop = new Runnable() {
|
final Runnable loop = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -87,6 +89,7 @@ public class MainActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
kurisu.setOnClickListener(new View.OnClickListener() {
|
kurisu.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
@ -456,7 +459,8 @@ public class MainActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private class listener implements RecognitionListener {
|
private class listener implements RecognitionListener {
|
||||||
final String TAG = "Amadeus.listener";
|
|
||||||
|
private final String TAG = "Amadeus.listener";
|
||||||
|
|
||||||
public void onReadyForSpeech(Bundle params) {
|
public void onReadyForSpeech(Bundle params) {
|
||||||
Log.d(TAG, "Speech recognition start");
|
Log.d(TAG, "Speech recognition start");
|
||||||
|
|
|
@ -4,7 +4,7 @@ package com.example.yink.amadeus;
|
||||||
* Created by Yink on 28.02.2017.
|
* Created by Yink on 28.02.2017.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class VoiceLine {
|
public class VoiceLine {
|
||||||
final private int id;
|
final private int id;
|
||||||
final private int mood;
|
final private int mood;
|
||||||
final private int subtitle;
|
final private int subtitle;
|
||||||
|
|
Loading…
Reference in New Issue