Commit 68c7e6f9 authored by Anuththara18's avatar Anuththara18

Parents Details Screen UI Modification

parent 07b1ff40
......@@ -5,11 +5,15 @@ import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Patterns;
import android.view.View;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
......@@ -28,11 +32,12 @@ import java.util.regex.Pattern;
public class ParentDetailsActivity extends AppCompatActivity {
TextView name, email, contact, next, previous, opt1, opt2, opt3, req, diag;
TextView name, email, contact, opt1, opt2, opt3, req, diag;
EditText childName, parentEmail, parentContact;
public static String child_name, parent_email, parent_contact, diagnosis;
RadioGroup radioGroup;
RadioButton genderradioButton;
ImageButton next, previous;
public static int nav = 1;
......@@ -64,8 +69,6 @@ public class ParentDetailsActivity extends AppCompatActivity {
parentEmail = findViewById(R.id.parentEmail);
parentContact = findViewById(R.id.parentContact);
next.setText(LanguageSetter.getresources().getString(R.string.next));
previous.setText(LanguageSetter.getresources().getString(R.string.previous));
name.setText(LanguageSetter.getresources().getString(R.string.childName));
email.setText(LanguageSetter.getresources().getString(R.string.parentEmail));
contact.setText(LanguageSetter.getresources().getString(R.string.parentContact));
......@@ -75,6 +78,22 @@ public class ParentDetailsActivity extends AppCompatActivity {
req.setText(LanguageSetter.getresources().getString(R.string.req));
diag.setText(LanguageSetter.getresources().getString(R.string.diagnosis));
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
Animation animZoomOut = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.zoom_out);
next.startAnimation(animZoomOut);
handler.postDelayed(this, 750);
}
});
}
}, 0);
child_name = childName.getText().toString();
parent_email = parentEmail.getText().toString();
parent_contact = parentContact.getText().toString();
......@@ -93,23 +112,25 @@ public class ParentDetailsActivity extends AppCompatActivity {
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!");
Toast.makeText(ParentDetailsActivity.this, LanguageSetter.getresources().getString(R.string.email), Toast.LENGTH_SHORT).show();
parentEmail.setError(LanguageSetter.getresources().getString(R.string.email));
}
else if (!isPhone(parentContact)) {
Toast.makeText(ParentDetailsActivity.this, "Enter Valid Number\nEg: 0771234567", Toast.LENGTH_SHORT).show();
parentContact.setError("Enter Valid Number\nEg: 0771234567");
Toast.makeText(ParentDetailsActivity.this, LanguageSetter.getresources().getString(R.string.contact), Toast.LENGTH_SHORT).show();
parentContact.setError(LanguageSetter.getresources().getString(R.string.contact));
}
else if(selectedId == -1){
Toast.makeText(ParentDetailsActivity.this,"Nothing selected", Toast.LENGTH_SHORT).show();
Toast.makeText(ParentDetailsActivity.this,LanguageSetter.getresources().getString(R.string.empty), 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")) {
finish();
startActivity(new Intent(ParentDetailsActivity.this, ConsentFormActivity.class));
} else {
finish();
startActivity(new Intent(ParentDetailsActivity.this, SinhalaConsentFormActivity.class));
}
}
......
......@@ -37,7 +37,7 @@
android:text="@string/age"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="22dp"
android:textSize="18dp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
......
......@@ -26,7 +26,7 @@
android:text="@string/gender"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="22dp"
android:textSize="18dp"
android:textStyle="bold"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
......
......@@ -17,7 +17,7 @@
android:text="@string/language"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="22dp"
android:textSize="18dp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
......
......@@ -7,35 +7,24 @@
android:background="@drawable/bg5"
tools:context=".details.ParentDetailsActivity">
<TextView
<ImageButton
android:id="@+id/previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="25dp"
android:layout_marginTop="25dp"
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:background="@drawable/left_btn"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
<ImageButton
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginRight="25dp"
android:layout_marginTop="25dp"
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"
android:background="@drawable/right_btn"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......@@ -63,7 +52,7 @@
android:fontFamily="@font/poppins_bold"
android:text="@string/childName"
android:textColor="@color/black"
android:textSize="18dp"
android:textSize="16dp"
android:textStyle="bold" />
<TextView
......@@ -73,8 +62,9 @@
android:fontFamily="@font/poppins_bold"
android:layout_marginLeft="20dp"
android:text="@string/optional"
android:textStyle="bold"
android:textColor="@color/red"
android:textSize="15dp" />
android:textSize="14dp" />
</LinearLayout>
......@@ -86,7 +76,7 @@
android:textColorHint="#575757"
android:fontFamily="@font/poppins_medium"
android:textColor="@color/black"
android:textSize="18dp" />
android:textSize="16dp" />
<LinearLayout
android:layout_width="match_parent"
......@@ -102,7 +92,7 @@
android:text="@string/parentEmail"
android:layout_marginTop="5dp"
android:textColor="@color/black"
android:textSize="18dp"
android:textSize="16dp"
android:textStyle="bold" />
<TextView
......@@ -113,8 +103,9 @@
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:text="@string/optional"
android:textStyle="bold"
android:textColor="@color/red"
android:textSize="15dp" />
android:textSize="14dp" />
</LinearLayout>
......@@ -126,7 +117,7 @@
android:textColorHint="#575757"
android:fontFamily="@font/poppins_medium"
android:textColor="@color/black"
android:textSize="18dp" />
android:textSize="16dp" />
<LinearLayout
android:layout_width="match_parent"
......@@ -142,7 +133,7 @@
android:text="@string/parentContact"
android:layout_marginTop="5dp"
android:textColor="@color/black"
android:textSize="18dp"
android:textSize="16dp"
android:textStyle="bold" />
<TextView
......@@ -152,9 +143,10 @@
android:fontFamily="@font/poppins_bold"
android:layout_marginLeft="20dp"
android:text="@string/optional"
android:textStyle="bold"
android:layout_marginTop="5dp"
android:textColor="@color/red"
android:textSize="15dp" />
android:textSize="14dp" />
</LinearLayout>
......@@ -166,7 +158,7 @@
android:fontFamily="@font/poppins_medium"
android:textColorHint="#575757"
android:textColor="@color/black"
android:textSize="18dp" />
android:textSize="16dp" />
<LinearLayout
android:layout_width="match_parent"
......@@ -182,7 +174,7 @@
android:text="@string/diagnosis"
android:layout_marginTop="5dp"
android:textColor="@color/black"
android:textSize="18dp"
android:textSize="16dp"
android:textStyle="bold" />
<TextView
......@@ -192,9 +184,10 @@
android:fontFamily="@font/poppins_bold"
android:layout_marginLeft="20dp"
android:text="@string/req"
android:textStyle="bold"
android:layout_marginTop="5dp"
android:textColor="@color/red"
android:textSize="15dp" />
android:textSize="14dp" />
</LinearLayout>
......@@ -211,7 +204,7 @@
android:buttonTint="@color/black"
android:textColor="@color/black"
android:checked="false"
android:textSize="18dp" />
android:textSize="16dp" />
<RadioButton
android:id="@+id/no"
......@@ -221,7 +214,7 @@
android:buttonTint="@color/black"
android:textColor="@color/black"
android:checked="false"
android:textSize="18dp" />
android:textSize="16dp" />
</RadioGroup>
......
......@@ -46,7 +46,9 @@
<!-- Login Screen -->
<string name="welcome">ආයුබෝවන්!</string>
<string name="name">ඔබේ නම ඇතුළත් කරන්න</string>
<string name="email">ඔබගේ විද්‍යුත් ලිපිනය ඇතුළත් කරන්න</string>
<string name="email">වලංගු විද්යුත් - තැපැල් ලිපිනයක් ඇතුලත් කරන්න</string>
<string name="contact">වලංගු දුරකථන අංකයක් ඇතුළු කරන්න උදා: 0771234567</string>
<string name="empty">ඉදිරියට යාමට ප්‍රතිචාරයක් අවශ්‍ය වේ</string>
<string name="pwd">මුරපදය ඇතුළත් කරන්න</string>
<string name="confirmPwd">මුරපදය තහවුරු කරන්න</string>
<string name="fgtPassword">මුරපදය අමතක වුණා ද?</string>
......
......@@ -45,7 +45,9 @@
<!-- Login Screen -->
<string name="welcome">Welcome!</string>
<string name="name">Enter your name</string>
<string name="email">Enter your email</string>
<string name="email">Enter a valid email address</string>
<string name="contact">Enter a valid contact number Eg: 0771234567</string>
<string name="empty">Response Needed</string>
<string name="pwd">Enter your password</string>
<string name="confirmPwd">Confirm password</string>
<string name="fgtPassword">Forgot Password?</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