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