Commit 6bbb10b1 authored by Anuththara18's avatar Anuththara18

UI Modification Selective Attention

parent 74b5c2e0
...@@ -125,7 +125,9 @@ ...@@ -125,7 +125,9 @@
<activity <activity
android:name=".map.Map2Activity" android:name=".map.Map2Activity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar" /> android:theme="@style/Theme.AppCompat.NoActionBar" >
</activity>
<activity <activity
android:name=".map.Map1Activity" android:name=".map.Map1Activity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
......
...@@ -40,6 +40,22 @@ public class GVAdapter2 extends ArrayAdapter<GridModel> { ...@@ -40,6 +40,22 @@ public class GVAdapter2 extends ArrayAdapter<GridModel> {
//listitemView = LayoutInflater.from(getContext()).inflate(R.layout.card_item3, parent, false); //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++ ) { for ( int i = 0; i < SelectiveAttentionGame1.correctResponses.size(); i++ ) {
if (position == SelectiveAttentionGame1.correctResponses.get(i)) { if (position == SelectiveAttentionGame1.correctResponses.get(i)) {
if (SelectiveAttentionGame1.columns == 3) { if (SelectiveAttentionGame1.columns == 3) {
...@@ -68,12 +84,22 @@ public class GVAdapter2 extends ArrayAdapter<GridModel> { ...@@ -68,12 +84,22 @@ public class GVAdapter2 extends ArrayAdapter<GridModel> {
} }
} }
} }
GridModel gridModel = getItem(position); GridModel gridModel = getItem(position);
ImageView gridImage = listitemView.findViewById(R.id.gridImage); ImageView gridImage = listitemView.findViewById(R.id.gridImage);
gridImage.setImageResource(gridModel.getImgid()); 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++ ) { for ( int i = 0; i < SelectiveAttentionGame1.correctResponses.size(); i++ ) {
if (position == SelectiveAttentionGame1.correctResponses.get(i)) { if (position == SelectiveAttentionGame1.correctResponses.get(i)) {
gridImage.setImageResource(R.drawable.tick); gridImage.setImageResource(R.drawable.tick);
...@@ -86,6 +112,7 @@ public class GVAdapter2 extends ArrayAdapter<GridModel> { ...@@ -86,6 +112,7 @@ public class GVAdapter2 extends ArrayAdapter<GridModel> {
} }
} }
return listitemView; return listitemView;
} }
......
...@@ -69,6 +69,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity { ...@@ -69,6 +69,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
public static ArrayList<Integer> correctResponses; public static ArrayList<Integer> correctResponses;
public static ArrayList<Integer> incorrectResponses; public static ArrayList<Integer> incorrectResponses;
public static ArrayList<Integer> missedResponses;
public static int columns; public static int columns;
int rows, noOfObjects; int rows, noOfObjects;
int gridSize = 0; int gridSize = 0;
...@@ -149,6 +150,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity { ...@@ -149,6 +150,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
random = new Random(); random = new Random();
correctResponses = new ArrayList<>(); correctResponses = new ArrayList<>();
incorrectResponses = new ArrayList<>(); incorrectResponses = new ArrayList<>();
missedResponses = new ArrayList<>();
// level 1 & 2 // level 1 & 2
a = R.drawable.ladybird; a = R.drawable.ladybird;
...@@ -478,6 +480,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity { ...@@ -478,6 +480,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
GridModel data = (GridModel) gridModelArrayList.get(i); GridModel data = (GridModel) gridModelArrayList.get(i);
if ( data.getImage_name().equals(image_name)){ if ( data.getImage_name().equals(image_name)){
totalCorrectResponses++; totalCorrectResponses++;
missedResponses.add(i);
} }
} }
Log.d("@@@@@@@@@@@@@@@@@@@", String.valueOf(totalCorrectResponses)); Log.d("@@@@@@@@@@@@@@@@@@@", String.valueOf(totalCorrectResponses));
...@@ -501,7 +504,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity { ...@@ -501,7 +504,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
correctResponses.add(position); correctResponses.add(position);
sequence_of_responses.add("C"); sequence_of_responses.add("C");
Log.d("%%%%%%%%%%%%%%%%%%", String.valueOf(sequence_of_responses)); 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() + ", "; order_of_selection = order_of_selection + data.getImage_name() + ", ";
gridView.setAdapter(adapter); gridView.setAdapter(adapter);
} }
...@@ -512,7 +515,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity { ...@@ -512,7 +515,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
gridView.setAdapter(adapter); gridView.setAdapter(adapter);
sequence_of_responses.add("W"); sequence_of_responses.add("W");
Log.d("%%%%%%%%%%%%%%%%%%", String.valueOf(sequence_of_responses)); 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() + ", "; order_of_selection = order_of_selection + data.getImage_name() + ", ";
} }
} }
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
android:right="3dp" android:right="3dp"
android:top="3dp"> android:top="3dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android" > <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"/> <corners android:radius="7dp"/>
</shape> </shape>
</item> </item>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
android:right="3dp" android:right="3dp"
android:top="3dp"> android:top="3dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android" > <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"/> <corners android:radius="7dp"/>
</shape> </shape>
</item> </item>
......
<?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
<?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>
<?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>
<?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>
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