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
7890ab2b
Commit
7890ab2b
authored
Mar 21, 2022
by
Anuththara18
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug Fixing
parent
56117cd3
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
12 deletions
+46
-12
app/src/main/java/com/anuththara18/attentionassessment/focused/FocusedAttentionGame1.java
...18/attentionassessment/focused/FocusedAttentionGame1.java
+22
-1
app/src/main/java/com/anuththara18/attentionassessment/language/LanguageActivity.java
...hara18/attentionassessment/language/LanguageActivity.java
+12
-0
app/src/main/java/com/anuththara18/attentionassessment/splashscreen/SplashActivity.java
...ra18/attentionassessment/splashscreen/SplashActivity.java
+8
-5
app/src/main/res/layout/activity_bird_choosing.xml
app/src/main/res/layout/activity_bird_choosing.xml
+2
-4
app/src/main/res/values-si/strings(si).xml
app/src/main/res/values-si/strings(si).xml
+1
-1
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+1
-1
No files found.
app/src/main/java/com/anuththara18/attentionassessment/focused/FocusedAttentionGame1.java
View file @
7890ab2b
...
...
@@ -63,6 +63,7 @@ public class FocusedAttentionGame1 extends AppCompatActivity {
int
i
=
1
;
private
long
startTime
,
clickedTime
=
0
;
long
reactionTime
;
int
count
;
int
totalCorrectResponses
=
0
;
int
noOfCorrectResponses
=
0
;
...
...
@@ -129,13 +130,16 @@ public class FocusedAttentionGame1 extends AppCompatActivity {
unpickedNumbers
.
add
(
8
);
unpickedNumbers
.
add
(
9
);
getCount
();
new
Runnable
()
{
int
updateInterval
;
@Override
public
void
run
()
{
if
(
i
<=
41
)
{
// 41 times
if
(
i
<=
count
)
{
// 41 times
if
(
i
%
2
!=
0
)
{
imageView
.
setVisibility
(
View
.
INVISIBLE
);
...
...
@@ -326,6 +330,23 @@ public class FocusedAttentionGame1 extends AppCompatActivity {
}
private
void
getCount
()
{
if
(
AgeActivity
.
age
==
4
)
{
count
=
17
;
}
else
if
(
AgeActivity
.
age
==
5
)
{
count
=
21
;
}
else
if
(
AgeActivity
.
age
==
6
)
{
count
=
25
;
}
else
{
count
=
29
;
}
}
// Function select an element base on index
// and return an element
public
int
getRandomElement
(
List
<
Integer
>
list
)
{
...
...
app/src/main/java/com/anuththara18/attentionassessment/language/LanguageActivity.java
View file @
7890ab2b
...
...
@@ -47,6 +47,18 @@ public class LanguageActivity extends AppCompatActivity {
next
=
(
TextView
)
findViewById
(
R
.
id
.
next
);
sharedPref
=
getSharedPreferences
(
sharedKey
,
MODE_PRIVATE
);
sinhala_btn
.
getLayoutParams
().
height
=
656
;
sinhala_btn
.
getLayoutParams
().
width
=
656
;
sinhala_btn
.
requestLayout
();
sinhala_txt_btn
.
getLayoutParams
().
height
=
184
;
sinhala_txt_btn
.
getLayoutParams
().
width
=
394
;
sinhala_txt_btn
.
requestLayout
();
english_btn
.
getLayoutParams
().
height
=
656
;
english_btn
.
getLayoutParams
().
width
=
656
;
english_btn
.
requestLayout
();
english_txt
.
setPadding
(
0
,
10
,
0
,
0
);
english_txt
.
setTextSize
(
40
);
english_btn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
...
...
app/src/main/java/com/anuththara18/attentionassessment/splashscreen/SplashActivity.java
View file @
7890ab2b
...
...
@@ -17,15 +17,15 @@ import com.anuththara18.attentionassessment.language.LanguageSetter;
public
class
SplashActivity
extends
AppCompatActivity
{
SharedPreferences
sharedPreferences
;
//
SharedPreferences sharedPreferences;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
sharedPreferences
=
getSharedPreferences
(
"Language"
,
MODE_PRIVATE
);
SharedPreferences
.
Editor
ed
=
sharedPreferences
.
edit
();
String
lang
=
sharedPreferences
.
getString
(
"Lang"
,
""
);
//
sharedPreferences = getSharedPreferences("Language", MODE_PRIVATE);
//
SharedPreferences.Editor ed = sharedPreferences.edit();
//
String lang = sharedPreferences.getString("Lang", "");
//int check = sharedPreferences.getInt("ImageCheck", 5);
if
(
Build
.
VERSION
.
SDK_INT
<
16
)
{
...
...
@@ -42,7 +42,9 @@ public class SplashActivity extends AppCompatActivity {
handler
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
lang
.
isEmpty
()){
Intent
langAct
=
new
Intent
(
SplashActivity
.
this
,
LanguageActivity
.
class
);
startActivity
(
langAct
);
/*if(lang.isEmpty()){
Intent langAct = new Intent(SplashActivity.this, LanguageActivity.class);
startActivity(langAct);
}
...
...
@@ -52,6 +54,7 @@ public class SplashActivity extends AppCompatActivity {
LanguageSetter.setLanguage(lang);
LanguageSetter.changeLanguage(lang, SplashActivity.this);
}
*/
finish
();
}
},
2000
);
...
...
app/src/main/res/layout/activity_bird_choosing.xml
View file @
7890ab2b
...
...
@@ -50,8 +50,7 @@
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:layout_marginTop=
"40dp"
android:layout_marginLeft=
"15dp"
android:layout_marginRight=
"15dp"
android:gravity=
"center"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/textview8"
>
...
...
@@ -115,8 +114,7 @@
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:layout_marginTop=
"15dp"
android:layout_marginLeft=
"15dp"
android:layout_marginRight=
"15dp"
android:gravity=
"center"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/linearLayout1"
>
...
...
app/src/main/res/values-si/strings(si).xml
View file @
7890ab2b
...
...
@@ -23,7 +23,7 @@
<string
name=
"select"
>
තෝරන්න
</string>
<string
name=
"birdselect"
>
ඔබ වඩාත්ම කැමති චරිතය තෝරන්න
</string>
<string
name=
"focg1"
>
වඳුරු පැටව
ා දිස්වන විට රතු බොත්තම ඔබන්න
</string>
<string
name=
"focg1"
>
සත්වය
ා දිස්වන විට රතු බොත්තම ඔබන්න
</string>
<string
name=
"divg1"
>
වර්ණ ගැලපෙන විට රතු බොත්තම ඔබන්න
</string>
<string
name=
"divg2"
>
සතුන් ගැලපෙන විට රතු බොත්තම ඔබන්න
</string>
<string
name=
"susg1"
>
කුරුල්ලා අත්ත මත වාඩි වූ විට රතු බොත්තම ඔබන්න
</string>
...
...
app/src/main/res/values/strings.xml
View file @
7890ab2b
...
...
@@ -22,7 +22,7 @@
<string
name=
"select"
>
Select the
</string>
<string
name=
"birdselect"
>
Pick your favourite character
</string>
<string
name=
"focg1"
>
Press the red button when the
monkey
appears
</string>
<string
name=
"focg1"
>
Press the red button when the
animal
appears
</string>
<string
name=
"divg1"
>
Press the red button when the colours match
</string>
<string
name=
"divg2"
>
Press the red button when the animals match
</string>
<string
name=
"susg1"
>
Press the red button when the bird sits on the branch
</string>
...
...
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