Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
Research-Project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jayakody J.A.D.K.A - IT19114040
Research-Project
Commits
b240f4a0
Commit
b240f4a0
authored
Apr 19, 2022
by
Anuththara18
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Introductory Videos
parent
24d61155
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
208 additions
and
0 deletions
+208
-0
app/src/main/java/com/anuththara18/attentionassessment/videos/IntroductoryVideoLandscapeActivity.java
...assessment/videos/IntroductoryVideoLandscapeActivity.java
+91
-0
app/src/main/java/com/anuththara18/attentionassessment/videos/IntroductoryVideoPortraitActivity.java
...nassessment/videos/IntroductoryVideoPortraitActivity.java
+100
-0
app/src/main/res/layout/activity_introductory_video.xml
app/src/main/res/layout/activity_introductory_video.xml
+17
-0
No files found.
app/src/main/java/com/anuththara18/attentionassessment/videos/IntroductoryVideoLandscapeActivity.java
0 → 100644
View file @
b240f4a0
package
com.anuththara18.attentionassessment.videos
;
import
android.content.Intent
;
import
android.media.MediaPlayer
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.widget.MediaController
;
import
android.widget.Toast
;
import
android.widget.VideoView
;
import
androidx.appcompat.app.AppCompatActivity
;
import
com.anuththara18.attentionassessment.R
;
import
com.anuththara18.attentionassessment.alternating.AlternatingAttentionGame1
;
import
com.anuththara18.attentionassessment.dividedattention.DividedAttentionGame1
;
import
com.anuththara18.attentionassessment.focused.AnimalChoosingActivity
;
import
com.anuththara18.attentionassessment.focused.FocusedAttentionGame1
;
import
com.anuththara18.attentionassessment.focused.FocusedAttentionGame2
;
import
com.anuththara18.attentionassessment.home.MainFragment
;
import
com.anuththara18.attentionassessment.map.Map1Activity
;
import
com.anuththara18.attentionassessment.map.Map2Activity
;
import
com.anuththara18.attentionassessment.sustained.BirdChoosingActivity
;
public
class
IntroductoryVideoLandscapeActivity
extends
AppCompatActivity
{
String
videoUrl
=
"https://media.geeksforgeeks.org/wp-content/uploads/20201217192146/Screenrecorder-2020-12-17-19-17-36-828.mp4?_=1"
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_introductory_video
);
// finding videoview by its id
VideoView
videoView
=
findViewById
(
R
.
id
.
videoView
);
if
(
MainFragment
.
game
.
equals
(
"focused"
))
{
videoUrl
=
""
;
}
else
if
(
MainFragment
.
game
.
equals
(
"alternating"
))
{
videoUrl
=
""
;
}
// Uri object to refer the
// resource from the videoUrl
Uri
uri
=
Uri
.
parse
(
videoUrl
);
// sets the resource from the
// videoUrl to the videoView
videoView
.
setVideoURI
(
uri
);
// creating object of
// media controller class
MediaController
mediaController
=
new
MediaController
(
this
);
// sets the anchor view
// anchor view for the videoView
mediaController
.
setAnchorView
(
videoView
);
// sets the media player to the videoView
mediaController
.
setMediaPlayer
(
videoView
);
// sets the media controller to the videoView
videoView
.
setMediaController
(
mediaController
);
// starts the video
videoView
.
start
();
videoView
.
setOnCompletionListener
(
new
MediaPlayer
.
OnCompletionListener
()
{
@Override
public
void
onCompletion
(
MediaPlayer
mp
)
{
//Toast.makeText(getApplicationContext(), "Video completed", Toast.LENGTH_LONG).show();
if
(
MainFragment
.
game
.
equals
(
"focused"
))
{
if
(
Map1Activity
.
level
==
1
){
startActivity
(
new
Intent
(
getApplicationContext
(),
FocusedAttentionGame2
.
class
));
}
else
if
(
Map1Activity
.
level
==
2
){
startActivity
(
new
Intent
(
getApplicationContext
(),
FocusedAttentionGame2
.
class
));
}
else
if
(
Map1Activity
.
level
==
5
){
startActivity
(
new
Intent
(
getApplicationContext
(),
FocusedAttentionGame1
.
class
));
}
}
else
if
(
MainFragment
.
game
.
equals
(
"alternating"
))
{
startActivity
(
new
Intent
(
getApplicationContext
(),
AlternatingAttentionGame1
.
class
));
}
}
});
}
}
\ No newline at end of file
app/src/main/java/com/anuththara18/attentionassessment/videos/IntroductoryVideoPortraitActivity.java
0 → 100644
View file @
b240f4a0
package
com.anuththara18.attentionassessment.videos
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.Intent
;
import
android.media.MediaPlayer
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.widget.MediaController
;
import
android.widget.Toast
;
import
android.widget.VideoView
;
import
com.anuththara18.attentionassessment.R
;
import
com.anuththara18.attentionassessment.dividedattention.DividedAttentionGame1
;
import
com.anuththara18.attentionassessment.focused.AnimalChoosingActivity
;
import
com.anuththara18.attentionassessment.focused.FocusedAttentionGame1
;
import
com.anuththara18.attentionassessment.home.MainFragment
;
import
com.anuththara18.attentionassessment.map.Map1Activity
;
import
com.anuththara18.attentionassessment.map.Map2Activity
;
import
com.anuththara18.attentionassessment.selective.SelectiveAttentionGame1
;
import
com.anuththara18.attentionassessment.sustained.BirdChoosingActivity
;
public
class
IntroductoryVideoPortraitActivity
extends
AppCompatActivity
{
//String videoUrl;
String
videoUrl
=
"https://1drv.ms/v/s!AvtsEIqJweWzmFqPURb36VGZZJpp"
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_introductory_video
);
// finding videoview by its id
VideoView
videoView
=
findViewById
(
R
.
id
.
videoView
);
if
(
MainFragment
.
game
.
equals
(
"focused"
))
{
videoUrl
=
"https://media.geeksforgeeks.org/wp-content/uploads/20201217192146/Screenrecorder-2020-12-17-19-17-36-828.mp4?_=1"
;
}
else
if
(
MainFragment
.
game
.
equals
(
"divided"
))
{
videoUrl
=
"https://1drv.ms/v/s!AvtsEIqJweWzmFqPURb36VGZZJpp"
;
}
else
if
(
MainFragment
.
game
.
equals
(
"selective"
))
{
videoUrl
=
""
;
}
else
if
(
MainFragment
.
game
.
equals
(
"sustained"
))
{
videoUrl
=
""
;
}
// Uri object to refer the
// resource from the videoUrl
Uri
uri
=
Uri
.
parse
(
videoUrl
);
// sets the resource from the
// videoUrl to the videoView
videoView
.
setVideoURI
(
uri
);
// creating object of
// media controller class
MediaController
mediaController
=
new
MediaController
(
this
);
// sets the anchor view
// anchor view for the videoView
mediaController
.
setAnchorView
(
videoView
);
// sets the media player to the videoView
mediaController
.
setMediaPlayer
(
videoView
);
// sets the media controller to the videoView
videoView
.
setMediaController
(
mediaController
);
// starts the video
videoView
.
start
();
videoView
.
setOnCompletionListener
(
new
MediaPlayer
.
OnCompletionListener
()
{
@Override
public
void
onCompletion
(
MediaPlayer
mp
)
{
//Toast.makeText(getApplicationContext(), "Video completed", Toast.LENGTH_LONG).show();
if
(
MainFragment
.
game
.
equals
(
"focused"
))
{
if
(
Map1Activity
.
level
==
3
){
startActivity
(
new
Intent
(
getApplicationContext
(),
AnimalChoosingActivity
.
class
));
}
else
if
(
Map1Activity
.
level
==
4
){
startActivity
(
new
Intent
(
getApplicationContext
(),
AnimalChoosingActivity
.
class
));
}
}
else
if
(
MainFragment
.
game
.
equals
(
"divided"
))
{
startActivity
(
new
Intent
(
getApplicationContext
(),
DividedAttentionGame1
.
class
));
}
else
if
(
MainFragment
.
game
.
equals
(
"selective"
))
{
startActivity
(
new
Intent
(
getApplicationContext
(),
SelectiveAttentionGame1
.
class
));
}
else
if
(
MainFragment
.
game
.
equals
(
"sustained"
))
{
startActivity
(
new
Intent
(
getApplicationContext
(),
BirdChoosingActivity
.
class
));
}
}
});
}
}
\ No newline at end of file
app/src/main/res/layout/activity_introductory_video.xml
0 → 100644
View file @
b240f4a0
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
tools:context=
".videos.IntroductoryVideoPortraitActivity"
>
<VideoView
android:id=
"@+id/videoView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_centerVertical=
"true"
android:layout_centerHorizontal=
"true"
>
</VideoView>
</LinearLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment