Commit 24d61155 authored by Anuththara18's avatar Anuththara18

Change Complete Screens, Added new animations

parent 7f04f41a
......@@ -34,24 +34,31 @@
android:resource="@xml/provider_paths" />
</provider>
<activity android:name=".emailfiles.EmailDataFilesActivity"
<activity android:name=".videos.IntroductoryVideoPortraitActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar">
</activity>
<activity android:name=".videos.IntroductoryVideoLandscapeActivity"
android:screenOrientation="landscape"
android:theme="@style/Theme.AppCompat.NoActionBar">
</activity>
<activity
android:name=".emailfiles.EmailDataFilesActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
<activity
android:name=".details.ParentDetailsActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".consentform.ConsentFormActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".consentform.SinhalaConsentFormActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".consentform.GetParentsConsentActivity"
android:screenOrientation="portrait"
......@@ -63,15 +70,15 @@
<activity
android:name=".alternating.AlternatingAttentionGame1"
android:screenOrientation="landscape"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".sustained.BirdChoosingActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".focused.AnimalChoosingActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".dividedattention.DACompleteScreen"
android:screenOrientation="portrait"
......@@ -103,27 +110,27 @@
<activity
android:name=".CompleteScreen2"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".CompleteScreen"
android:screenOrientation="landscape"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".dividedattention.DividedAttentionGame1"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".sustained.SustainedAttentionGame1"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".focused.FocusedAttentionGame2"
android:screenOrientation="landscape"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".map.Map2Activity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".map.Map1Activity"
android:screenOrientation="portrait"
......@@ -136,7 +143,7 @@
<activity
android:name=".focused.FocusedAttentionGame1"
android:screenOrientation="landscape"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".loginregistration.RegistrationActivity"
android:screenOrientation="portrait"
......@@ -160,7 +167,7 @@
<activity
android:name=".selective.SelectiveAttentionGame1"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar"></activity>
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".splashscreen.SplashActivity"
android:screenOrientation="landscape"
......
......@@ -13,9 +13,15 @@ import android.widget.ImageView;
import com.anuththara18.attentionassessment.focused.FACompleteScreen;
import com.anuththara18.attentionassessment.home.NavigationDrawerActivity;
import java.util.Random;
public class CompleteScreen extends AppCompatActivity {
Random random;
ImageView complete, gifImageView;
int gifs[] = {R.drawable.complete_gif, R.drawable.complete_gif2, R.drawable.complete_gif3,
R.drawable.complete_gif4, R.drawable.complete_gif5, R.drawable.complete_gif6,
R.drawable.complete_gif7, R.drawable.complete_gif8};
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -32,6 +38,9 @@ public class CompleteScreen extends AppCompatActivity {
complete = findViewById(R.id.complete);
gifImageView = findViewById(R.id.gifImageView);
random = new Random();
gifImageView.setImageResource(gifs[random.nextInt(8)]);
/*
new Runnable() {
@Override
......
......@@ -11,9 +11,15 @@ import android.widget.ImageView;
import com.anuththara18.attentionassessment.home.NavigationDrawerActivity;
import java.util.Random;
public class CompleteScreen2 extends AppCompatActivity {
ImageView complete;
Random random;
ImageView complete, gifImageView;
int gifs[] = {R.drawable.complete_gif, R.drawable.complete_gif2, R.drawable.complete_gif3,
R.drawable.complete_gif4, R.drawable.complete_gif5, R.drawable.complete_gif6,
R.drawable.complete_gif7, R.drawable.complete_gif8};
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -28,6 +34,10 @@ public class CompleteScreen2 extends AppCompatActivity {
setContentView(R.layout.activity_complete_screen2);
complete = findViewById(R.id.complete);
gifImageView = findViewById(R.id.gifImageView);
random = new Random();
gifImageView.setImageResource(gifs[random.nextInt(8)]);
complete.setOnClickListener(new View.OnClickListener() {
@Override
......
......@@ -10,6 +10,8 @@ import android.util.Patterns;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
......@@ -27,8 +29,10 @@ import java.util.regex.Pattern;
public class ParentDetailsActivity extends AppCompatActivity {
TextView name, email, contact, next, previous, opt1, opt2, opt3, req, diag;
EditText childName, parentEmail, parentContact, diagnosis;
public static String child_name, parent_email, parent_contact;
EditText childName, parentEmail, parentContact;
public static String child_name, parent_email, parent_contact, diagnosis;
RadioGroup radioGroup;
RadioButton genderradioButton;
public static int nav = 1;
......@@ -53,8 +57,8 @@ public class ParentDetailsActivity extends AppCompatActivity {
opt2 = findViewById(R.id.opt2);
opt3 = findViewById(R.id.opt3);
req = findViewById(R.id.req);
diagnosis = findViewById(R.id.diagnosis);
diag = findViewById(R.id.diag);
radioGroup=(RadioGroup)findViewById(R.id.radioGroup);
childName = findViewById(R.id.childName);
parentEmail = findViewById(R.id.parentEmail);
......@@ -86,6 +90,8 @@ public class ParentDetailsActivity extends AppCompatActivity {
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
int selectedId = radioGroup.getCheckedRadioButtonId();
genderradioButton = (RadioButton) findViewById(selectedId);
if (!isEmail(parentEmail)) {
Toast.makeText(ParentDetailsActivity.this, "Enter valid email", Toast.LENGTH_SHORT).show();
parentEmail.setError("Enter valid email!");
......@@ -94,7 +100,12 @@ public class ParentDetailsActivity extends AppCompatActivity {
Toast.makeText(ParentDetailsActivity.this, "Enter Valid Number\nEg: 0771234567", Toast.LENGTH_SHORT).show();
parentContact.setError("Enter Valid Number\nEg: 0771234567");
}
else {
else if(selectedId == -1){
Toast.makeText(ParentDetailsActivity.this,"Nothing selected", Toast.LENGTH_SHORT).show();
}
else{
diagnosis = (String) genderradioButton.getText();
//Toast.makeText(ParentDetailsActivity.this,genderradioButton.getText(), Toast.LENGTH_SHORT).show();
nav = 1;
if (LanguageActivity.text.equals("English")) {
startActivity(new Intent(ParentDetailsActivity.this, ConsentFormActivity.class));
......
......@@ -144,14 +144,14 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
bear4.setVisibility(View.INVISIBLE);
}
else if ( i == 4 || i == 16 || i == 28 || i == 40 ) {
bear2.setVisibility(View.VISIBLE);
bear3.setVisibility(View.VISIBLE);
bear1.setVisibility(View.INVISIBLE);
bear3.setVisibility(View.INVISIBLE);
bear2.setVisibility(View.INVISIBLE);
bear4.setVisibility(View.INVISIBLE);
}
else if ( i == 6 || i == 18 || i == 30 ) {
bear3.setVisibility(View.VISIBLE);
bear2.setVisibility(View.INVISIBLE);
bear2.setVisibility(View.VISIBLE);
bear3.setVisibility(View.INVISIBLE);
bear1.setVisibility(View.INVISIBLE);
bear4.setVisibility(View.INVISIBLE);
}
......@@ -168,10 +168,10 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
bear4.setVisibility(View.INVISIBLE);
}
else if ( i == 12 || i == 24 || i == 36 ) {
bear3.setVisibility(View.VISIBLE);
bear4.setVisibility(View.VISIBLE);
bear1.setVisibility(View.INVISIBLE);
bear2.setVisibility(View.INVISIBLE);
bear4.setVisibility(View.INVISIBLE);
bear1.setVisibility(View.INVISIBLE);
}
}
......@@ -249,7 +249,7 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
clickedTime = System.currentTimeMillis();
reactionTime = (clickedTime - startTime);
//if (clicked.equals("monkey")) {
if ( i - 1 == 4 || i - 1 == 16 || i - 1 == 28 || i - 1 == 40 ) {
if ( i - 1 == 6 || i - 1 == 18 || i - 1 == 30 || i - 1 == 42 ) {
totalReactionTime = totalReactionTime + reactionTime;
Log.d("correct ", startTime + " " + clickedTime + " " + reactionTime);
noOfCorrectResponses++;
......@@ -270,7 +270,7 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
// Your action here on button click
clickedTime = System.currentTimeMillis();
reactionTime = (clickedTime - startTime);
if ( i - 1 == 6 || i - 1 == 18 || i - 1 == 30 || i - 1 == 12 || i - 1 == 24 || i - 1 == 36) {
if ( i - 1 == 4 || i - 1 == 16 || i - 1 == 28 || i - 1 == 40 ) {
totalReactionTime = totalReactionTime + reactionTime;
Log.d("correct ", startTime + " " + clickedTime + " " + reactionTime);
noOfCorrectResponses++;
......@@ -292,7 +292,7 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
// Your action here on button click
clickedTime = System.currentTimeMillis();
reactionTime = (clickedTime - startTime);
if ( i - 1 == 8 || i - 1 == 20 || i - 1 == 32 ) {
if ( i - 1 == 8 || i - 1 == 20 || i - 1 == 32 || i - 1 == 12 || i - 1 == 24 || i - 1 == 36 ) {
totalReactionTime = totalReactionTime + reactionTime;
Log.d("correct ", startTime + " " + clickedTime + " " + reactionTime);
noOfCorrectResponses++;
......
......@@ -19,11 +19,15 @@ import com.anuththara18.attentionassessment.focused.FocusedAttentionGame1;
import com.anuththara18.attentionassessment.map.Map1Activity;
import com.anuththara18.attentionassessment.map.Map2Activity;
import com.anuththara18.attentionassessment.sustained.BirdChoosingActivity;
import com.anuththara18.attentionassessment.videos.IntroductoryVideoLandscapeActivity;
import com.anuththara18.attentionassessment.videos.IntroductoryVideoPortraitActivity;
@SuppressLint("ValidFragment")
public class MainFragment extends Fragment {
public static String game = " ";
CardView focusedAttention, selectiveAttention, dividedAttention, sustainedAttention, alternatingAttention, alternatingAttention2;
public static com.anuththara18.attentionassessment.home.MainFragment newInstance() {
......@@ -53,6 +57,7 @@ public class MainFragment extends Fragment {
@Override
public void onClick(View view) {
mp.start();
game = "focused";
Intent intent = new Intent(getContext(), Map1Activity.class);
startActivity(intent);
}
......@@ -62,7 +67,8 @@ public class MainFragment extends Fragment {
@Override
public void onClick(View view) {
mp.start();
Intent intent = new Intent(getContext(), BirdChoosingActivity.class);
game = "sustained";
Intent intent = new Intent(getContext(), IntroductoryVideoPortraitActivity.class);
startActivity(intent);
}
});
......@@ -71,6 +77,7 @@ public class MainFragment extends Fragment {
@Override
public void onClick(View view) {
mp.start();
game = "selective";
Intent intent = new Intent(getContext(), Map2Activity.class);
startActivity(intent);
}
......@@ -80,17 +87,18 @@ public class MainFragment extends Fragment {
@Override
public void onClick(View view) {
mp.start();
Intent intent = new Intent(getContext(), DividedAttentionGame1.class);
game = "divided";
Intent intent = new Intent(getContext(), IntroductoryVideoPortraitActivity.class);
startActivity(intent);
}
});
alternatingAttention2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mp.start();
Intent intent = new Intent(getContext(), AlternatingAttentionGame1.class);
game = "alternating";
Intent intent = new Intent(getContext(), IntroductoryVideoLandscapeActivity.class);
startActivity(intent);
}
});
......
......@@ -12,6 +12,8 @@ import com.anuththara18.attentionassessment.focused.AnimalChoosingActivity;
import com.anuththara18.attentionassessment.focused.FocusedAttentionGame1;
import com.anuththara18.attentionassessment.focused.FocusedAttentionGame2;
import com.anuththara18.attentionassessment.selective.SelectiveAttentionGame1;
import com.anuththara18.attentionassessment.videos.IntroductoryVideoLandscapeActivity;
import com.anuththara18.attentionassessment.videos.IntroductoryVideoPortraitActivity;
public class Map1Activity extends AppCompatActivity {
......@@ -34,7 +36,7 @@ public class Map1Activity extends AppCompatActivity {
@Override
public void onClick(View view) {
level = 1;
Intent intent = new Intent(getApplicationContext(), FocusedAttentionGame2.class);
Intent intent = new Intent(getApplicationContext(), IntroductoryVideoLandscapeActivity.class);
finish();
startActivity(intent);
}
......@@ -44,7 +46,7 @@ public class Map1Activity extends AppCompatActivity {
@Override
public void onClick(View view) {
level = 2;
Intent intent = new Intent(getApplicationContext(), FocusedAttentionGame2.class);
Intent intent = new Intent(getApplicationContext(), IntroductoryVideoLandscapeActivity.class);
finish();
startActivity(intent);
}
......@@ -54,7 +56,7 @@ public class Map1Activity extends AppCompatActivity {
@Override
public void onClick(View view) {
level = 3;
Intent intent = new Intent(getApplicationContext(), AnimalChoosingActivity.class);
Intent intent = new Intent(getApplicationContext(), IntroductoryVideoPortraitActivity.class);
finish();
startActivity(intent);
}
......@@ -64,7 +66,7 @@ public class Map1Activity extends AppCompatActivity {
@Override
public void onClick(View view) {
level = 4;
Intent intent = new Intent(getApplicationContext(), AnimalChoosingActivity.class);
Intent intent = new Intent(getApplicationContext(), IntroductoryVideoPortraitActivity.class);
finish();
startActivity(intent);
}
......@@ -74,7 +76,7 @@ public class Map1Activity extends AppCompatActivity {
@Override
public void onClick(View view) {
level = 5;
Intent intent = new Intent(getApplicationContext(), AnimalChoosingActivity.class);
Intent intent = new Intent(getApplicationContext(), IntroductoryVideoLandscapeActivity.class);
finish();
startActivity(intent);
}
......
......@@ -12,6 +12,7 @@ import android.widget.ImageButton;
import com.anuththara18.attentionassessment.R;
import com.anuththara18.attentionassessment.home.NavigationDrawerActivity;
import com.anuththara18.attentionassessment.selective.SelectiveAttentionGame1;
import com.anuththara18.attentionassessment.videos.IntroductoryVideoPortraitActivity;
public class Map2Activity extends AppCompatActivity {
......@@ -41,7 +42,7 @@ public class Map2Activity extends AppCompatActivity {
@Override
public void onClick(View view) {
level = 1;
Intent intent = new Intent(getApplicationContext(), SelectiveAttentionGame1.class);
Intent intent = new Intent(getApplicationContext(), IntroductoryVideoPortraitActivity.class);
finish();
startActivity(intent);
}
......@@ -51,7 +52,7 @@ public class Map2Activity extends AppCompatActivity {
@Override
public void onClick(View view) {
level = 2;
Intent intent = new Intent(getApplicationContext(), SelectiveAttentionGame1.class);
Intent intent = new Intent(getApplicationContext(), IntroductoryVideoPortraitActivity.class);
finish();
startActivity(intent);
}
......@@ -61,7 +62,7 @@ public class Map2Activity extends AppCompatActivity {
@Override
public void onClick(View view) {
level = 3;
Intent intent = new Intent(getApplicationContext(), SelectiveAttentionGame1.class);
Intent intent = new Intent(getApplicationContext(), IntroductoryVideoPortraitActivity.class);
finish();
startActivity(intent);
}
......@@ -71,7 +72,7 @@ public class Map2Activity extends AppCompatActivity {
@Override
public void onClick(View view) {
level = 4;
Intent intent = new Intent(getApplicationContext(), SelectiveAttentionGame1.class);
Intent intent = new Intent(getApplicationContext(), IntroductoryVideoPortraitActivity.class);
finish();
startActivity(intent);
}
......@@ -81,7 +82,7 @@ public class Map2Activity extends AppCompatActivity {
@Override
public void onClick(View view) {
level = 5;
Intent intent = new Intent(getApplicationContext(), SelectiveAttentionGame1.class);
Intent intent = new Intent(getApplicationContext(), IntroductoryVideoPortraitActivity.class);
finish();
startActivity(intent);
}
......
......@@ -48,12 +48,12 @@ public class SustainedAttentionGame1 extends AppCompatActivity {
// isi = 10 - 60 secs
Integer[] isi = { 10000, 45000, 25000, 50000, 20000, 35000, 60000, 15000, 30000, 55000, 40000,
/*Integer[] isi = { 10000, 45000, 25000, 50000, 20000, 35000, 60000, 15000, 30000, 55000, 40000,
10000, 45000, 25000, 50000, 20000, 35000, 60000, 15000, 30000, 55000, 40000,
10000, 15000, 10000, 15000 };
/*Integer[] isi = { 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000,
10000, 15000, 10000, 15000 };*/
Integer[] isi = { 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000,
1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000,
1000, 1500, 1000, 1500 }; */
1000, 1500, 1000, 1500 };
Integer[] image = { R.drawable.red_bird_gif,
R.drawable.blue_bird_gif,
......
......@@ -198,15 +198,34 @@
</LinearLayout>
<EditText
android:id="@+id/diagnosis"
android:layout_width="match_parent"
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Yes / No"
android:fontFamily="@font/poppins_medium"
android:textColorHint="#575757"
android:textColor="@color/black"
android:textSize="18sp" />
android:id="@+id/radioGroup">
<RadioButton
android:id="@+id/yes"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=" Yes"
android:buttonTint="@color/black"
android:textColor="@color/black"
android:layout_marginTop="10dp"
android:checked="false"
android:textSize="18sp" />
<RadioButton
android:id="@+id/no"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=" No"
android:buttonTint="@color/black"
android:textColor="@color/black"
android:layout_marginTop="20dp"
android:checked="false"
android:textSize="18sp" />
</RadioGroup>
</LinearLayout>
......
......@@ -4,7 +4,7 @@
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
......
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