Commit 7f04f41a authored by Anuththara18's avatar Anuththara18

Consent Form Access from Navigation Activity

parent 30d18236
......@@ -13,6 +13,8 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.anuththara18.attentionassessment.R;
import com.anuththara18.attentionassessment.details.ParentDetailsActivity;
import com.anuththara18.attentionassessment.home.NavigationDrawerActivity;
import com.anuththara18.attentionassessment.language.LanguageSetter;
import java.util.ArrayList;
......@@ -41,13 +43,21 @@ public class ConsentFormActivity extends AppCompatActivity {
textView = findViewById(R.id.textView);
next = findViewById(R.id.next);
if (ParentDetailsActivity.nav == 0) {
next.setVisibility(View.INVISIBLE);
next.setEnabled(false);
}
else {
next.setVisibility(View.VISIBLE);
next.setEnabled(true);
}
textView.setText(LanguageSetter.getresources().getString(R.string.consentForm));
next.setText(LanguageSetter.getresources().getString(R.string.proceed));
initData();
initRecyclerView();
TextView next = findViewById(R.id.next);
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
......
......@@ -30,6 +30,8 @@ public class ParentDetailsActivity extends AppCompatActivity {
EditText childName, parentEmail, parentContact, diagnosis;
public static String child_name, parent_email, parent_contact;
public static int nav = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -93,6 +95,7 @@ public class ParentDetailsActivity extends AppCompatActivity {
parentContact.setError("Enter Valid Number\nEg: 0771234567");
}
else {
nav = 1;
if (LanguageActivity.text.equals("English")) {
startActivity(new Intent(ParentDetailsActivity.this, ConsentFormActivity.class));
} else {
......
......@@ -19,7 +19,10 @@ import android.widget.Toast;
import com.anuththara18.attentionassessment.R;
import com.anuththara18.attentionassessment.consentform.ConsentFormActivity;
import com.anuththara18.attentionassessment.consentform.SinhalaConsentFormActivity;
import com.anuththara18.attentionassessment.details.ParentDetailsActivity;
import com.anuththara18.attentionassessment.emailfiles.EmailDataFilesActivity;
import com.anuththara18.attentionassessment.language.LanguageActivity;
import com.google.android.material.navigation.NavigationView;
import static android.Manifest.permission.MANAGE_EXTERNAL_STORAGE;
......@@ -109,8 +112,12 @@ public class NavigationDrawerActivity extends AppCompatActivity implements Navig
//startActivity(intent6);
break;
case R.id.consentForm:
Intent intent7 = new Intent(getApplicationContext(), ConsentFormActivity.class);
startActivity(intent7);
ParentDetailsActivity.nav = 0;
if (LanguageActivity.text.equals("English")) {
startActivity(new Intent(getApplicationContext(), ConsentFormActivity.class));
} else {
startActivity(new Intent(getApplicationContext(), SinhalaConsentFormActivity.class));
}
break;
case R.id.sendData:
Intent intent9 = new Intent(getApplicationContext(), EmailDataFilesActivity.class);
......
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