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
0df5f15a
Commit
0df5f15a
authored
Apr 25, 2022
by
Anuththara18
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Completion Stars to Game Maps
parent
e1ea293e
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
242 additions
and
0 deletions
+242
-0
app/src/main/java/com/anuththara18/attentionassessment/focused/FocusedAttentionGame1.java
...18/attentionassessment/focused/FocusedAttentionGame1.java
+12
-0
app/src/main/java/com/anuththara18/attentionassessment/focused/FocusedAttentionGame2.java
...18/attentionassessment/focused/FocusedAttentionGame2.java
+9
-0
app/src/main/java/com/anuththara18/attentionassessment/home/MainFragment.java
...m/anuththara18/attentionassessment/home/MainFragment.java
+1
-0
app/src/main/java/com/anuththara18/attentionassessment/home/NavigationDrawerActivity.java
...18/attentionassessment/home/NavigationDrawerActivity.java
+2
-0
app/src/main/java/com/anuththara18/attentionassessment/map/Map1Activity.java
...om/anuththara18/attentionassessment/map/Map1Activity.java
+30
-0
app/src/main/java/com/anuththara18/attentionassessment/map/Map2Activity.java
...om/anuththara18/attentionassessment/map/Map2Activity.java
+31
-0
app/src/main/java/com/anuththara18/attentionassessment/selective/SelectiveAttentionGame1.java
...ttentionassessment/selective/SelectiveAttentionGame1.java
+21
-0
app/src/main/res/drawable-nodpi/stars.png
app/src/main/res/drawable-nodpi/stars.png
+0
-0
app/src/main/res/layout/activity_map1.xml
app/src/main/res/layout/activity_map1.xml
+67
-0
app/src/main/res/layout/activity_map2.xml
app/src/main/res/layout/activity_map2.xml
+69
-0
No files found.
app/src/main/java/com/anuththara18/attentionassessment/focused/FocusedAttentionGame1.java
View file @
0df5f15a
...
...
@@ -49,6 +49,9 @@ import java.util.List;
import
java.util.Random
;
import
java.util.Set
;
import
static
com
.
anuththara18
.
attentionassessment
.
map
.
Map1Activity
.
comp1
;
import
static
com
.
anuththara18
.
attentionassessment
.
map
.
Map1Activity
.
comp2
;
public
class
FocusedAttentionGame1
extends
AppCompatActivity
{
private
static
final
int
CODE_GET_REQUEST
=
1024
;
...
...
@@ -395,6 +398,15 @@ public class FocusedAttentionGame1 extends AppCompatActivity {
saveDataToOnlineDB
();
createTable
();
saveDataToLocalDB
();
if
(
Map1Activity
.
level
==
3
){
Map1Activity
.
comp3
=
1
;
}
else
if
(
Map1Activity
.
level
==
4
){
Map1Activity
.
comp4
=
1
;
}
else
if
(
Map1Activity
.
level
==
5
){
Map1Activity
.
comp5
=
1
;
}
Intent
intent
=
new
Intent
(
getApplicationContext
(),
FACompleteScreen
.
class
);
finish
();
mp
.
pause
();
...
...
app/src/main/java/com/anuththara18/attentionassessment/focused/FocusedAttentionGame2.java
View file @
0df5f15a
...
...
@@ -37,6 +37,9 @@ import java.util.Iterator;
import
java.util.List
;
import
java.util.Random
;
import
static
com
.
anuththara18
.
attentionassessment
.
map
.
Map1Activity
.
comp1
;
import
static
com
.
anuththara18
.
attentionassessment
.
map
.
Map1Activity
.
comp2
;
public
class
FocusedAttentionGame2
extends
AppCompatActivity
{
private
static
final
int
CODE_GET_REQUEST
=
1024
;
...
...
@@ -210,6 +213,12 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
saveDataToOnlineDB
();
createTable
();
saveDataToLocalDB
();
if
(
Map1Activity
.
level
==
1
){
comp1
=
1
;
}
else
if
(
Map1Activity
.
level
==
2
){
comp2
=
1
;
}
Intent
intent
=
new
Intent
(
getApplicationContext
(),
FACompleteScreen
.
class
);
finish
();
mp
.
pause
();
...
...
app/src/main/java/com/anuththara18/attentionassessment/home/MainFragment.java
View file @
0df5f15a
...
...
@@ -10,6 +10,7 @@ import android.view.ViewGroup;
import
androidx.annotation.Nullable
;
import
androidx.cardview.widget.CardView
;
import
androidx.drawerlayout.widget.DrawerLayout
;
import
androidx.fragment.app.Fragment
;
import
com.anuththara18.attentionassessment.R
;
...
...
app/src/main/java/com/anuththara18/attentionassessment/home/NavigationDrawerActivity.java
View file @
0df5f15a
...
...
@@ -52,6 +52,8 @@ public class NavigationDrawerActivity extends AppCompatActivity implements Navig
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_navigation_drawer
);
toolbar
.
setNavigationIcon
(
null
);
// Configure all views
this
.
configureToolBar
();
this
.
configureDrawerLayout
();
...
...
app/src/main/java/com/anuththara18/attentionassessment/map/Map1Activity.java
View file @
0df5f15a
...
...
@@ -18,6 +18,9 @@ import com.anuththara18.attentionassessment.videos.IntroductoryVideoPortraitActi
public
class
Map1Activity
extends
AppCompatActivity
{
ImageButton
imageButton1
,
imageButton2
,
imageButton3
,
imageButton4
,
imageButton5
;
ImageButton
star1
,
star2
,
star3
,
star4
,
star5
;
public
static
int
comp1
,
comp2
,
comp3
,
comp4
,
comp5
=
0
;
public
static
int
level
=
1
;
...
...
@@ -31,6 +34,33 @@ public class Map1Activity extends AppCompatActivity {
imageButton3
=
findViewById
(
R
.
id
.
imageButton3
);
imageButton4
=
findViewById
(
R
.
id
.
imageButton4
);
imageButton5
=
findViewById
(
R
.
id
.
imageButton5
);
star1
=
findViewById
(
R
.
id
.
star1
);
star2
=
findViewById
(
R
.
id
.
star2
);
star3
=
findViewById
(
R
.
id
.
star3
);
star4
=
findViewById
(
R
.
id
.
star4
);
star5
=
findViewById
(
R
.
id
.
star5
);
star1
.
setVisibility
(
View
.
INVISIBLE
);
star2
.
setVisibility
(
View
.
INVISIBLE
);
star3
.
setVisibility
(
View
.
INVISIBLE
);
star4
.
setVisibility
(
View
.
INVISIBLE
);
star5
.
setVisibility
(
View
.
INVISIBLE
);
if
(
comp1
==
1
)
{
star1
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
comp2
==
1
){
star2
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
comp3
==
1
){
star3
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
comp4
==
1
){
star4
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
comp5
==
1
){
star5
.
setVisibility
(
View
.
VISIBLE
);
}
imageButton1
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
...
...
app/src/main/java/com/anuththara18/attentionassessment/map/Map2Activity.java
View file @
0df5f15a
...
...
@@ -17,6 +17,9 @@ import com.anuththara18.attentionassessment.videos.IntroductoryVideoPortraitActi
public
class
Map2Activity
extends
AppCompatActivity
{
ImageButton
imageButton1
,
imageButton2
,
imageButton3
,
imageButton4
,
imageButton5
;
ImageButton
star1
,
star2
,
star3
,
star4
,
star5
;
public
static
int
comp1
,
comp2
,
comp3
,
comp4
,
comp5
=
0
;
public
static
int
level
=
1
;
...
...
@@ -38,6 +41,34 @@ public class Map2Activity extends AppCompatActivity {
imageButton4
=
findViewById
(
R
.
id
.
imageButton4
);
imageButton5
=
findViewById
(
R
.
id
.
imageButton5
);
star1
=
findViewById
(
R
.
id
.
star1
);
star2
=
findViewById
(
R
.
id
.
star2
);
star3
=
findViewById
(
R
.
id
.
star3
);
star4
=
findViewById
(
R
.
id
.
star4
);
star5
=
findViewById
(
R
.
id
.
star5
);
star1
.
setVisibility
(
View
.
INVISIBLE
);
star2
.
setVisibility
(
View
.
INVISIBLE
);
star3
.
setVisibility
(
View
.
INVISIBLE
);
star4
.
setVisibility
(
View
.
INVISIBLE
);
star5
.
setVisibility
(
View
.
INVISIBLE
);
if
(
comp1
==
1
)
{
star1
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
comp2
==
1
){
star2
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
comp3
==
1
){
star3
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
comp4
==
1
){
star4
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
comp5
==
1
){
star5
.
setVisibility
(
View
.
VISIBLE
);
}
imageButton1
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
...
...
app/src/main/java/com/anuththara18/attentionassessment/selective/SelectiveAttentionGame1.java
View file @
0df5f15a
...
...
@@ -32,6 +32,7 @@ import com.anuththara18.attentionassessment.focused.FocusedAttentionGame1;
import
com.anuththara18.attentionassessment.gender.GenderActivity
;
import
com.anuththara18.attentionassessment.home.NavigationDrawerActivity
;
import
com.anuththara18.attentionassessment.language.LanguageSetter
;
import
com.anuththara18.attentionassessment.map.Map1Activity
;
import
com.anuththara18.attentionassessment.map.Map2Activity
;
import
org.json.JSONException
;
...
...
@@ -45,6 +46,9 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.Random
;
import
static
com
.
anuththara18
.
attentionassessment
.
map
.
Map1Activity
.
comp1
;
import
static
com
.
anuththara18
.
attentionassessment
.
map
.
Map1Activity
.
comp2
;
public
class
SelectiveAttentionGame1
extends
AppCompatActivity
{
// get reaction time - if image is clicked before 3 seconds
...
...
@@ -416,6 +420,23 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
GVAdapter2
adapter
=
new
GVAdapter2
(
getApplicationContext
(),
gridModelArrayList
);
gridView
.
setAdapter
(
adapter
);
gridView
.
setEnabled
(
false
);
if
(
Map2Activity
.
level
==
1
){
Map2Activity
.
comp1
=
1
;
}
else
if
(
Map2Activity
.
level
==
2
){
Map2Activity
.
comp2
=
1
;
}
else
if
(
Map2Activity
.
level
==
3
){
Map2Activity
.
comp3
=
1
;
}
else
if
(
Map2Activity
.
level
==
4
){
Map2Activity
.
comp4
=
1
;
}
else
if
(
Map2Activity
.
level
==
5
){
Map2Activity
.
comp5
=
1
;
}
saveDataToOnlineDB
();
createTable
();
saveDataToLocalDB
();
...
...
app/src/main/res/drawable-nodpi/stars.png
View replaced file @
e1ea293e
View file @
0df5f15a
167 KB
|
W:
|
H:
54.7 KB
|
W:
|
H:
2-up
Swipe
Onion skin
app/src/main/res/layout/activity_map1.xml
View file @
0df5f15a
...
...
@@ -19,6 +19,19 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.093"
/>
<ImageButton
android:id=
"@+id/star1"
android:layout_width=
"110dp"
android:layout_height=
"101.95dp"
android:background=
"@drawable/stars"
android:visibility=
"invisible"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.470"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.029"
/>
<ImageButton
android:id=
"@+id/imageButton2"
android:layout_width=
"78dp"
...
...
@@ -31,6 +44,19 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.371"
/>
<ImageButton
android:id=
"@+id/star2"
android:layout_width=
"110dp"
android:layout_height=
"101.95dp"
android:background=
"@drawable/stars"
android:visibility=
"invisible"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.71"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.315"
/>
<ImageButton
android:id=
"@+id/imageButton3"
android:layout_width=
"79dp"
...
...
@@ -43,6 +69,19 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.526"
/>
<ImageButton
android:id=
"@+id/star3"
android:layout_width=
"110dp"
android:layout_height=
"101.95dp"
android:background=
"@drawable/stars"
android:visibility=
"invisible"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.250"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.480"
/>
<ImageButton
android:id=
"@+id/imageButton4"
android:layout_width=
"90dp"
...
...
@@ -55,6 +94,19 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.662"
/>
<ImageButton
android:id=
"@+id/star4"
android:layout_width=
"110dp"
android:layout_height=
"101.95dp"
android:background=
"@drawable/stars"
android:visibility=
"invisible"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.782"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.615"
/>
<ImageButton
android:id=
"@+id/imageButton5"
android:layout_width=
"90dp"
...
...
@@ -69,4 +121,19 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.871"
/>
<ImageButton
android:id=
"@+id/star5"
android:layout_width=
"110dp"
android:layout_height=
"101.95dp"
android:background=
"@drawable/stars"
android:translationZ=
"5dp"
android:elevation=
"15dp"
android:visibility=
"invisible"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.472"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.830"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_map2.xml
View file @
0df5f15a
...
...
@@ -19,6 +19,20 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.038"
/>
<ImageButton
android:id=
"@+id/star1"
android:layout_width=
"110dp"
android:layout_height=
"101.95dp"
android:background=
"@drawable/stars"
android:visibility=
"invisible"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
android:layout_marginTop=
"-20dp"
app:layout_constraintHorizontal_bias=
"0.472"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.000"
/>
<ImageButton
android:id=
"@+id/imageButton2"
android:layout_width=
"78dp"
...
...
@@ -31,6 +45,20 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.262"
/>
<ImageButton
android:id=
"@+id/star2"
android:layout_width=
"110dp"
android:layout_height=
"101.95dp"
android:layout_marginTop=
"-20dp"
android:background=
"@drawable/stars"
android:visibility=
"invisible"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.764"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.225"
/>
<ImageButton
android:id=
"@+id/imageButton3"
android:layout_width=
"79dp"
...
...
@@ -43,6 +71,20 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.468"
/>
<ImageButton
android:id=
"@+id/star3"
android:layout_width=
"110dp"
android:layout_height=
"101.95dp"
android:layout_marginTop=
"-20dp"
android:background=
"@drawable/stars"
android:visibility=
"invisible"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.705"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.433"
/>
<ImageButton
android:id=
"@+id/imageButton4"
android:layout_width=
"90dp"
...
...
@@ -55,6 +97,20 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.662"
/>
<ImageButton
android:id=
"@+id/star4"
android:layout_width=
"110dp"
android:layout_height=
"101.95dp"
android:layout_marginTop=
"-20dp"
android:visibility=
"invisible"
android:background=
"@drawable/stars"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.315"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.625"
/>
<ImageButton
android:id=
"@+id/imageButton5"
android:layout_width=
"90dp"
...
...
@@ -69,4 +125,17 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.851"
/>
<ImageButton
android:id=
"@+id/star5"
android:layout_width=
"110dp"
android:layout_height=
"101.95dp"
android:background=
"@drawable/stars"
android:visibility=
"invisible"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.590"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.800"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ 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