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
6bbb10b1
Commit
6bbb10b1
authored
May 08, 2022
by
Anuththara18
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UI Modification Selective Attention
parent
74b5c2e0
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
146 additions
and
5 deletions
+146
-5
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+3
-1
app/src/main/java/com/anuththara18/attentionassessment/selective/GVAdapter2.java
...nuththara18/attentionassessment/selective/GVAdapter2.java
+27
-0
app/src/main/java/com/anuththara18/attentionassessment/selective/SelectiveAttentionGame1.java
...ttentionassessment/selective/SelectiveAttentionGame1.java
+5
-2
app/src/main/res/drawable-nodpi/exclamation.png
app/src/main/res/drawable-nodpi/exclamation.png
+0
-0
app/src/main/res/drawable/green_gridview_background.xml
app/src/main/res/drawable/green_gridview_background.xml
+1
-1
app/src/main/res/drawable/red_gridview_background.xml
app/src/main/res/drawable/red_gridview_background.xml
+1
-1
app/src/main/res/drawable/yellow_gridview_background.xml
app/src/main/res/drawable/yellow_gridview_background.xml
+25
-0
app/src/main/res/layout/yellow_card.xml
app/src/main/res/layout/yellow_card.xml
+28
-0
app/src/main/res/layout/yellow_card1.xml
app/src/main/res/layout/yellow_card1.xml
+28
-0
app/src/main/res/layout/yellow_card2.xml
app/src/main/res/layout/yellow_card2.xml
+28
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
6bbb10b1
...
...
@@ -125,7 +125,9 @@
<activity
android:name=
".map.Map2Activity"
android:screenOrientation=
"portrait"
android:theme=
"@style/Theme.AppCompat.NoActionBar"
/>
android:theme=
"@style/Theme.AppCompat.NoActionBar"
>
</activity>
<activity
android:name=
".map.Map1Activity"
android:screenOrientation=
"portrait"
...
...
app/src/main/java/com/anuththara18/attentionassessment/selective/GVAdapter2.java
View file @
6bbb10b1
...
...
@@ -40,6 +40,22 @@ public class GVAdapter2 extends ArrayAdapter<GridModel> {
//listitemView = LayoutInflater.from(getContext()).inflate(R.layout.card_item3, parent, false);
/*
for ( int i = 0; i < SelectiveAttentionGame1.missedResponses.size(); i++ ) {
if (position == SelectiveAttentionGame1.missedResponses.get(i)) {
if (SelectiveAttentionGame1.columns == 3) {
listitemView = LayoutInflater.from(getContext()).inflate(R.layout.yellow_card1, parent, false);
}
else if (SelectiveAttentionGame1.columns == 4) {
listitemView = LayoutInflater.from(getContext()).inflate(R.layout.yellow_card2, parent, false);
}
else if (SelectiveAttentionGame1.columns == 5) {
listitemView = LayoutInflater.from(getContext()).inflate(R.layout.yellow_card, parent, false);
}
}
}
*/
for
(
int
i
=
0
;
i
<
SelectiveAttentionGame1
.
correctResponses
.
size
();
i
++
)
{
if
(
position
==
SelectiveAttentionGame1
.
correctResponses
.
get
(
i
))
{
if
(
SelectiveAttentionGame1
.
columns
==
3
)
{
...
...
@@ -68,12 +84,22 @@ public class GVAdapter2 extends ArrayAdapter<GridModel> {
}
}
}
GridModel
gridModel
=
getItem
(
position
);
ImageView
gridImage
=
listitemView
.
findViewById
(
R
.
id
.
gridImage
);
gridImage
.
setImageResource
(
gridModel
.
getImgid
());
/*
for ( int i = 0; i < SelectiveAttentionGame1.missedResponses.size(); i++ ) {
if (position == SelectiveAttentionGame1.missedResponses.get(i)) {
gridImage.setImageResource(R.drawable.exclamation);
}
}
*/
for
(
int
i
=
0
;
i
<
SelectiveAttentionGame1
.
correctResponses
.
size
();
i
++
)
{
if
(
position
==
SelectiveAttentionGame1
.
correctResponses
.
get
(
i
))
{
gridImage
.
setImageResource
(
R
.
drawable
.
tick
);
...
...
@@ -86,6 +112,7 @@ public class GVAdapter2 extends ArrayAdapter<GridModel> {
}
}
return
listitemView
;
}
...
...
app/src/main/java/com/anuththara18/attentionassessment/selective/SelectiveAttentionGame1.java
View file @
6bbb10b1
...
...
@@ -69,6 +69,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
public
static
ArrayList
<
Integer
>
correctResponses
;
public
static
ArrayList
<
Integer
>
incorrectResponses
;
public
static
ArrayList
<
Integer
>
missedResponses
;
public
static
int
columns
;
int
rows
,
noOfObjects
;
int
gridSize
=
0
;
...
...
@@ -149,6 +150,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
random
=
new
Random
();
correctResponses
=
new
ArrayList
<>();
incorrectResponses
=
new
ArrayList
<>();
missedResponses
=
new
ArrayList
<>();
// level 1 & 2
a
=
R
.
drawable
.
ladybird
;
...
...
@@ -478,6 +480,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
GridModel
data
=
(
GridModel
)
gridModelArrayList
.
get
(
i
);
if
(
data
.
getImage_name
().
equals
(
image_name
)){
totalCorrectResponses
++;
missedResponses
.
add
(
i
);
}
}
Log
.
d
(
"@@@@@@@@@@@@@@@@@@@"
,
String
.
valueOf
(
totalCorrectResponses
));
...
...
@@ -501,7 +504,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
correctResponses
.
add
(
position
);
sequence_of_responses
.
add
(
"C"
);
Log
.
d
(
"%%%%%%%%%%%%%%%%%%"
,
String
.
valueOf
(
sequence_of_responses
));
//Toast.makeText(getApplicationContext(), data.getImage_name()
, Toast.LENGTH_SHORT).show();
Toast
.
makeText
(
getApplicationContext
(),
data
.
getImage_name
()
+
image_name
,
Toast
.
LENGTH_SHORT
).
show
();
order_of_selection
=
order_of_selection
+
data
.
getImage_name
()
+
", "
;
gridView
.
setAdapter
(
adapter
);
}
...
...
@@ -512,7 +515,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
gridView
.
setAdapter
(
adapter
);
sequence_of_responses
.
add
(
"W"
);
Log
.
d
(
"%%%%%%%%%%%%%%%%%%"
,
String
.
valueOf
(
sequence_of_responses
));
//Toast.makeText(getApplicationContext(), data.getImage_name()
, Toast.LENGTH_SHORT).show();
Toast
.
makeText
(
getApplicationContext
(),
data
.
getImage_name
()
+
image_name
,
Toast
.
LENGTH_SHORT
).
show
();
order_of_selection
=
order_of_selection
+
data
.
getImage_name
()
+
", "
;
}
}
...
...
app/src/main/res/drawable-nodpi/exclamation.png
0 → 100644
View file @
6bbb10b1
9.58 KB
app/src/main/res/drawable/green_gridview_background.xml
View file @
6bbb10b1
...
...
@@ -17,7 +17,7 @@
android:right=
"3dp"
android:top=
"3dp"
>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"
@android:color/holo_green_light
"
/>
<solid
android:color=
"
#CEFF96
"
/>
<corners
android:radius=
"7dp"
/>
</shape>
</item>
...
...
app/src/main/res/drawable/red_gridview_background.xml
View file @
6bbb10b1
...
...
@@ -17,7 +17,7 @@
android:right=
"3dp"
android:top=
"3dp"
>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"
@android:color/holo_red_light
"
/>
<solid
android:color=
"
#FF9D9D
"
/>
<corners
android:radius=
"7dp"
/>
</shape>
</item>
...
...
app/src/main/res/drawable/yellow_gridview_background.xml
0 → 100644
View file @
6bbb10b1
<?xml version="1.0" encoding="UTF-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<gradient
android:angle=
"360"
android:startColor=
"#FFC107"
android:endColor=
"#FF9800"
android:type=
"linear"
/>
<corners
android:radius=
"7dp"
/>
</shape>
</item>
<item
android:bottom=
"3dp"
android:left=
"3dp"
android:right=
"3dp"
android:top=
"3dp"
>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#FFF38E"
/>
<corners
android:radius=
"7dp"
/>
</shape>
</item>
</layer-list>
\ No newline at end of file
app/src/main/res/layout/yellow_card.xml
0 → 100644
View file @
6bbb10b1
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
android:id=
"@+id/card_item"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_gravity=
"center"
android:background=
"@drawable/yellow_gridview_background"
app:cardCornerRadius=
"7dp"
app:cardElevation=
"5dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"center"
android:gravity=
"center"
android:background=
"@drawable/yellow_gridview_background"
>
<ImageView
android:id=
"@+id/gridImage"
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:layout_gravity=
"center"
/>
</LinearLayout>
</androidx.cardview.widget.CardView>
app/src/main/res/layout/yellow_card1.xml
0 → 100644
View file @
6bbb10b1
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
android:id=
"@+id/card_item"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"90dp"
android:layout_height=
"90dp"
android:layout_gravity=
"center"
android:background=
"@drawable/yellow_gridview_background"
app:cardCornerRadius=
"7dp"
app:cardElevation=
"5dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"center"
android:gravity=
"center"
android:background=
"@drawable/yellow_gridview_background"
>
<ImageView
android:id=
"@+id/gridImage"
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:layout_gravity=
"center"
/>
</LinearLayout>
</androidx.cardview.widget.CardView>
app/src/main/res/layout/yellow_card2.xml
0 → 100644
View file @
6bbb10b1
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
android:id=
"@+id/card_item"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"70dp"
android:layout_height=
"70dp"
android:layout_gravity=
"center"
android:background=
"@drawable/yellow_gridview_background"
app:cardCornerRadius=
"7dp"
app:cardElevation=
"5dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"center"
android:gravity=
"center"
android:background=
"@drawable/yellow_gridview_background"
>
<ImageView
android:id=
"@+id/gridImage"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_gravity=
"center"
/>
</LinearLayout>
</androidx.cardview.widget.CardView>
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