diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d1c290e..0ded7da 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -14,10 +14,7 @@ - - - - + + diff --git a/code/src/Fitbot/.idea/deploymentTargetDropDown.xml b/code/src/Fitbot/.idea/deploymentTargetDropDown.xml deleted file mode 100644 index 24e256e..0000000 --- a/code/src/Fitbot/.idea/deploymentTargetDropDown.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/src/Fitbot/app/src/main/java/com/example/fitbot/MainActivity.java b/code/src/Fitbot/app/src/main/java/com/example/fitbot/MainActivity.java index 16f9f66..65f5e43 100644 --- a/code/src/Fitbot/app/src/main/java/com/example/fitbot/MainActivity.java +++ b/code/src/Fitbot/app/src/main/java/com/example/fitbot/MainActivity.java @@ -1,6 +1,5 @@ package com.example.fitbot; -import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.aldebaran.qi.sdk.QiContext; @@ -8,7 +7,6 @@ import com.aldebaran.qi.sdk.QiSDK; import com.aldebaran.qi.sdk.RobotLifecycleCallbacks; import com.aldebaran.qi.sdk.builder.SayBuilder; import com.aldebaran.qi.sdk.design.activity.RobotActivity; -import com.aldebaran.qi.sdk.design.activity.conversationstatus.SpeechBarDisplayStrategy; import com.aldebaran.qi.sdk.object.conversation.Say; diff --git a/code/src/Fitbot/app/src/main/java/com/example/fitbot/speech/SpeechGenerator.java b/code/src/Fitbot/app/src/main/java/com/example/fitbot/speech/SpeechGenerator.java new file mode 100644 index 0000000..61c265a --- /dev/null +++ b/code/src/Fitbot/app/src/main/java/com/example/fitbot/speech/SpeechGenerator.java @@ -0,0 +1,35 @@ +package com.example.fitbot.speech; + +import com.aldebaran.qi.sdk.QiContext; +import com.aldebaran.qi.sdk.builder.SayBuilder; +import com.aldebaran.qi.sdk.object.locale.Language; +import com.aldebaran.qi.sdk.object.locale.Locale; +import com.aldebaran.qi.sdk.object.locale.Region; + +public class SpeechGenerator { + + private static final Locale DUTCH_LOCALE = new Locale(Language.DUTCH, Region.NETHERLANDS); + private SayBuilder builder; + + /** + * Function for making the robot say something with DUTCH_LOCALE as locale + * @param phrase The phrase to make the robot say + * @param ctx The QiContext to use + */ + public static void say(String phrase, QiContext ctx) + { + say(phrase, ctx, DUTCH_LOCALE); + } + + + + public static void say(String text, QiContext ctx, Locale locale) + { + SayBuilder.with(ctx) + .withLocale(locale) + .withText(text) + .build() + .run(); + } + +}