Commit 7890ab2b authored by Anuththara18's avatar Anuththara18

Bug Fixing

parent 56117cd3
......@@ -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) {
......
......@@ -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) {
......
......@@ -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);
......
......@@ -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">
......
......@@ -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>
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment