added libraries and attempted to call class in mainactivity
This commit is contained in:
17
code/src/Fitbot/.idea/deploymentTargetDropDown.xml
generated
17
code/src/Fitbot/.idea/deploymentTargetDropDown.xml
generated
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<targetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="QUICK_BOOT_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="VIRTUAL_DEVICE_PATH" />
|
||||
<value value="C:\Users\sebas\.android\avd\Pepper_1.9_API_29.avd" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2024-04-24T09:24:05.698446800Z" />
|
||||
</component>
|
||||
</project>
|
@@ -1,14 +1,19 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.QiSDK;
|
||||
import com.aldebaran.qi.sdk.RobotLifecycleCallbacks;
|
||||
import com.aldebaran.qi.sdk.builder.AnimateBuilder;
|
||||
import com.aldebaran.qi.sdk.builder.AnimationBuilder;
|
||||
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.actuation.Animate;
|
||||
import com.aldebaran.qi.sdk.object.actuation.Animation;
|
||||
import com.aldebaran.qi.sdk.object.conversation.Phrase;
|
||||
import com.aldebaran.qi.sdk.object.conversation.Say;
|
||||
import com.aldebaran.qi.sdk.object.locale.Language;
|
||||
@@ -52,8 +57,16 @@ public class MainActivity extends RobotActivity implements RobotLifecycleCallbac
|
||||
|
||||
sayName.run();
|
||||
sayDescription.run();
|
||||
|
||||
// Create a new BicepVideo with the qiContext
|
||||
bicepvideo BicepVideo = new bicepvideo();
|
||||
|
||||
// Call the videoPlayer method
|
||||
BicepVideo.Video(qiContext);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRobotFocusLost() {
|
||||
// Nothing here.
|
||||
|
@@ -9,13 +9,24 @@ import android.widget.Button;
|
||||
import android.widget.MediaController;
|
||||
import android.widget.VideoView;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.builder.AnimateBuilder;
|
||||
import com.aldebaran.qi.sdk.builder.AnimationBuilder;
|
||||
import com.aldebaran.qi.sdk.object.actuation.Animate;
|
||||
import com.aldebaran.qi.sdk.object.actuation.Animation;
|
||||
|
||||
public class bicepvideo extends AppCompatActivity {
|
||||
|
||||
private QiContext qiContext;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_bicepvideo);
|
||||
|
||||
}
|
||||
|
||||
public void Video(QiContext qiContext) {
|
||||
VideoView videoView = findViewById(R.id.videoView);
|
||||
videoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.bicepvideo));
|
||||
|
||||
@@ -36,7 +47,18 @@ public class bicepvideo extends AppCompatActivity {
|
||||
videoView.start(); // Restart video on completion
|
||||
}
|
||||
});
|
||||
|
||||
videoView.start();
|
||||
|
||||
Animation animation = AnimationBuilder.with(qiContext)
|
||||
.withResources(R.raw.bicepcurl)
|
||||
.build();
|
||||
|
||||
Animate animate = AnimateBuilder.with(qiContext)
|
||||
.withAnimation(animation)
|
||||
.build();
|
||||
|
||||
|
||||
animate.async().run();
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user