Commit 07b1ff40 authored by Anuththara18's avatar Anuththara18

Age Selection Screen UI Modification

parent 7365fd04
...@@ -17,6 +17,7 @@ import android.widget.Button; ...@@ -17,6 +17,7 @@ import android.widget.Button;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.anuththara18.attentionassessment.R; import com.anuththara18.attentionassessment.R;
import com.anuththara18.attentionassessment.age.AgeActivity; import com.anuththara18.attentionassessment.age.AgeActivity;
...@@ -30,7 +31,7 @@ public class GenderActivity extends AppCompatActivity { ...@@ -30,7 +31,7 @@ public class GenderActivity extends AppCompatActivity {
ImageView girl_img, boy_img; ImageView girl_img, boy_img;
TextView boy_txt, girl_txt, selectGender; TextView boy_txt, girl_txt, selectGender;
public static int gender = 2; public static int gender = 0;
int click = 1; int click = 1;
MediaPlayer mp; MediaPlayer mp;
...@@ -60,11 +61,18 @@ public class GenderActivity extends AppCompatActivity { ...@@ -60,11 +61,18 @@ public class GenderActivity extends AppCompatActivity {
boy_txt.setText(LanguageSetter.getresources().getString(R.string.boy)); boy_txt.setText(LanguageSetter.getresources().getString(R.string.boy));
selectGender.setText(LanguageSetter.getresources().getString(R.string.gender)); selectGender.setText(LanguageSetter.getresources().getString(R.string.gender));
// initially if (gender == 1) {
boy_img.setImageAlpha(127);
boy_txt.setAlpha(0.5f);
girl_img.setImageAlpha(255);
girl_txt.setAlpha(1f);
}
else if (gender == 2) {
girl_img.setImageAlpha(127); girl_img.setImageAlpha(127);
girl_txt.setAlpha(0.5f); girl_txt.setAlpha(0.5f);
boy_img.setImageAlpha(255); boy_img.setImageAlpha(255);
boy_txt.setAlpha(1f); boy_txt.setAlpha(1f);
}
final Handler handler = new Handler(); final Handler handler = new Handler();
handler.postDelayed(new Runnable() { handler.postDelayed(new Runnable() {
...@@ -173,10 +181,16 @@ public class GenderActivity extends AppCompatActivity { ...@@ -173,10 +181,16 @@ public class GenderActivity extends AppCompatActivity {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
if (gender == 0) {
Toast.makeText(getApplicationContext(), LanguageSetter.getresources().getString(R.string.gendernull), Toast.LENGTH_SHORT).show();
}
else{
finish(); finish();
Intent intent = new Intent(GenderActivity.this, AgeActivity.class); Intent intent = new Intent(GenderActivity.this, AgeActivity.class);
startActivity(intent); startActivity(intent);
} }
}
}); });
previous.setOnClickListener(new View.OnClickListener() { previous.setOnClickListener(new View.OnClickListener() {
......
...@@ -64,6 +64,19 @@ public class LanguageActivity extends AppCompatActivity { ...@@ -64,6 +64,19 @@ public class LanguageActivity extends AppCompatActivity {
int bt_notes_blink = 0; int bt_notes_blink = 0;
if (text.equals("English")){
sinhala_btn.setImageAlpha(127);
sinhala_txt_btn.setAlpha(0.5f);
english_btn.setImageAlpha(255);
english_txt.setAlpha(1f);
}
else if (text.equals("සිංහල")){
english_btn.setImageAlpha(127);
english_txt.setAlpha(0.5f);
sinhala_btn.setImageAlpha(255);
sinhala_txt_btn.setAlpha(1f);
}
final Handler handler = new Handler(); final Handler handler = new Handler();
handler.postDelayed(new Runnable() { handler.postDelayed(new Runnable() {
@Override @Override
......
...@@ -7,22 +7,26 @@ ...@@ -7,22 +7,26 @@
android:background="@drawable/bg2" android:background="@drawable/bg2"
tools:context=".age.AgeActivity"> tools:context=".age.AgeActivity">
<TextView <ImageButton
android:id="@+id/previous" android:id="@+id/previous"
android:layout_width="wrap_content" android:layout_width="50dp"
android:layout_height="wrap_content" android:layout_height="50dp"
android:layout_marginTop="30dp" android:layout_marginLeft="20dp"
android:drawableStart="@drawable/icon_left" android:layout_marginTop="20dp"
android:drawableTint="@color/black" android:background="@drawable/left_btn"
android:fontFamily="@font/poppins_medium"
android:gravity="center"
android:paddingLeft="30dp"
android:text="@string/previous"
android:textColor="@color/black"
android:textSize="16dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/next"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:background="@drawable/right_btn"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/selectAge" android:id="@+id/selectAge"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -40,76 +44,89 @@ ...@@ -40,76 +44,89 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <ImageView
android:id="@+id/next" android:id="@+id/bunny_img4"
android:layout_width="wrap_content" android:layout_width="200dp"
android:layout_height="wrap_content" android:layout_height="170dp"
android:layout_marginTop="30dp" android:layout_marginStart="10dp"
android:drawableEnd="@drawable/icon_right" android:layout_marginTop="70dp"
android:drawableTint="@color/black" android:src="@drawable/age_bunny"
android:fontFamily="@font/poppins_medium" app:layout_constraintStart_toStartOf="parent"
android:gravity="center"
android:paddingRight="30dp"
android:text="@string/next"
android:textColor="@color/black"
android:textSize="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:id="@+id/imageView" android:id="@+id/bunny_img5"
android:layout_width="match_parent" android:layout_width="200dp"
android:layout_height="125dp" android:layout_height="170dp"
android:layout_marginBottom="-8dp" android:layout_marginStart="180dp"
android:src="@drawable/stick" android:layout_marginBottom="10dp"
android:src="@drawable/age_bunny2"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
<ImageView <ImageView
android:id="@+id/bunny_img" android:id="@+id/bunny_img6"
android:layout_width="220dp" android:layout_width="200dp"
android:layout_height="190dp" android:layout_height="170dp"
android:layout_marginStart="40dp" android:layout_marginStart="350dp"
android:layout_marginBottom="108dp"
android:src="@drawable/age_bunny" android:src="@drawable/age_bunny"
app:layout_constraintBottom_toBottomOf="parent" android:layout_marginTop="75dp"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView <ImageView
android:id="@+id/age_txt" android:id="@+id/bunny_img7"
android:layout_width="54dp" android:layout_width="200dp"
android:layout_height="113dp" android:layout_height="170dp"
android:layout_marginStart="128dp" android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:fontFamily="@font/poppins_bold" android:src="@drawable/age_bunny2"
android:text="4"
android:textColor="@color/black"
android:textSize="78dp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/bunny_img"
app:layout_constraintStart_toStartOf="@+id/bunny_img" />
<ImageButton
android:id="@+id/right_btn"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginEnd="18dp"
android:layout_marginBottom="25dp"
android:background="@drawable/right_btn"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" /> app:layout_constraintEnd_toEndOf="parent" />
<ImageButton <ImageView
android:id="@+id/left_btn" android:id="@+id/icon4"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginEnd="20dp"
android:src="@drawable/icon4"
app:layout_constraintBottom_toBottomOf="@+id/bunny_img4"
app:layout_constraintEnd_toEndOf="@+id/bunny_img4"
app:layout_constraintTop_toTopOf="@+id/bunny_img4"
app:layout_constraintVertical_bias="0.811" />
<ImageView
android:id="@+id/icon5"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginStart="18dp" android:layout_marginStart="35dp"
android:layout_marginBottom="25dp" android:src="@drawable/icon5"
android:background="@drawable/left_btn" app:layout_constraintBottom_toBottomOf="@+id/bunny_img5"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="@+id/bunny_img5"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintTop_toTopOf="@+id/bunny_img5"
app:layout_constraintVertical_bias="0.741" />
<ImageView
android:id="@+id/icon6"
android:layout_width="85dp"
android:layout_height="85dp"
android:layout_marginEnd="16dp"
android:src="@drawable/icon6"
app:layout_constraintBottom_toBottomOf="@+id/bunny_img6"
app:layout_constraintEnd_toEndOf="@+id/bunny_img6"
app:layout_constraintTop_toTopOf="@+id/bunny_img6"
app:layout_constraintVertical_bias="0.847" />
<ImageView
android:id="@+id/icon7"
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="28dp"
android:src="@drawable/icon7"
app:layout_constraintBottom_toBottomOf="@+id/bunny_img7"
app:layout_constraintStart_toStartOf="@+id/bunny_img7"
app:layout_constraintTop_toTopOf="@+id/bunny_img7"
app:layout_constraintVertical_bias="0.765" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
<string name="consentForm">පර්යේෂණ අධ්‍යයනයකට සහභාගී වීමට කැමැත්ත දක්වන පෝරමය</string> <string name="consentForm">පර්යේෂණ අධ්‍යයනයකට සහභාගී වීමට කැමැත්ත දක්වන පෝරමය</string>
<string name="clear">මකා දමන්න</string> <string name="clear">මකා දමන්න</string>
<string name="save">සුරකින්න</string> <string name="save">සුරකින්න</string>
<string name="agenull">කරුණාකර වයස තෝරන්න</string>
<string name="gendernull">කරුණාකර ස්ත්‍රී පුරුෂ භාවය තෝරන්න</string>
<!-- Login Screen --> <!-- Login Screen -->
<string name="welcome">ආයුබෝවන්!</string> <string name="welcome">ආයුබෝවන්!</string>
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
<string name="consentForm">Consent Form To Participate in a Research Study</string> <string name="consentForm">Consent Form To Participate in a Research Study</string>
<string name="clear">Clear</string> <string name="clear">Clear</string>
<string name="save">Save</string> <string name="save">Save</string>
<string name="agenull">Please select the age</string>
<string name="gendernull">Please select the gender</string>
<!-- Login Screen --> <!-- Login Screen -->
<string name="welcome">Welcome!</string> <string name="welcome">Welcome!</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