Commit 07b1ff40 authored by Anuththara18's avatar Anuththara18

Age Selection Screen UI Modification

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