Skip to content

Commit

Permalink
ClickListViewFinalizado
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielSirtoriCorrea committed Jul 3, 2020
1 parent 2dcfdbd commit 0ed1ca1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void onClick(View view) {
ServerConnection connection = new ServerConnection("getInteractions");

try {
sleep(3000);
sleep(4500);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -69,16 +69,17 @@ public void onClick(View view) {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
try {
System.out.println("RESPOSTA TESTE" + arrayList.get(i).get(6));
System.out.println(arrayList.toString());

intent = getActivity().getIntent();
intent.putExtra("Keyword1", arrayList.get(i).get(1).toString());
intent.putExtra("Keyword2", arrayList.get(i).get(2).toString());
intent.putExtra("Keyword3", arrayList.get(i).get(3).toString());
intent.putExtra("Response1", arrayList.get(i).get(4).toString());
intent.putExtra("Response2", arrayList.get(i).get(5).toString());
intent.putExtra("Response3", arrayList.get(i).get(6).toString());
intent.putExtra("Command", arrayList.get(i).get(7).toString());
intent.putExtra("Keyword1", arrayList.get(i).getString(1));
intent.putExtra("Keyword2", arrayList.get(i).getString(2));
intent.putExtra("Keyword3", arrayList.get(i).getString(3));
intent.putExtra("Response1", arrayList.get(i).getString(4));
intent.putExtra("Response2", arrayList.get(i).getString(5));
intent.putExtra("Response3", arrayList.get(i).getString(6));
intent.putExtra("Command", arrayList.get(i).getString(7));


try {
sleep(1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,19 @@ public class ViewInteractionFragment extends Fragment {
private EditText response3;
private EditText command;

private String KeyWord1Text;
private String KeyWord2Text;
private String KeyWord3Text;
private String Response1Text;
private String Response2Text;
private String Response3Text;
private String CommandText;


@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_viewhomework, container, false);
View view = inflater.inflate(R.layout.fragment_viewinteractions, container, false);

keyWord1 = view.findViewById(R.id.txtViewInteractionKeyword1);
keyWord2 = view.findViewById(R.id.txtViewInteractionKeyword2);
Expand All @@ -38,23 +47,22 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c

intent = getActivity().getIntent();

System.out.println(intent.getSerializableExtra("Keyword1").toString());
System.out.println(intent.getSerializableExtra("Keyword2").toString());
System.out.println(intent.getSerializableExtra("Keyword3").toString());
System.out.println(intent.getSerializableExtra("Response1").toString());
System.out.println(intent.getSerializableExtra("Response2").toString());
System.out.println(intent.getSerializableExtra("Response3").toString());
System.out.println(intent.getSerializableExtra("Command").toString());


/*keyWord1.setText(intent.getSerializableExtra("Keyword1").toString());
keyWord2.setText(intent.getSerializableExtra("Keyword2").toString());
keyWord3.setText(intent.getSerializableExtra("Keyword3").toString());
response1.setText(intent.getSerializableExtra("Response1").toString());
response2.setText(intent.getSerializableExtra("Response2").toString());
response3.setText(intent.getSerializableExtra("Response3").toString());
command.setText(intent.getSerializableExtra("Command").toString());
*/
/*KeyWord1Text = intent.getStringExtra("Keyword1");
KeyWord2Text = intent.getStringExtra("Keyword2");
KeyWord3Text = intent.getStringExtra("Keyword3");
Response1Text = intent.getStringExtra("Response1");
Response2Text = intent.getStringExtra("Response2");
Response3Text = intent.getStringExtra("Response3");
CommandText = intent.getStringExtra("Command");*/

keyWord1.setText(intent.getStringExtra("Keyword1"));
keyWord2.setText(intent.getStringExtra("Keyword2"));
keyWord3.setText(intent.getStringExtra("Keyword3"));
response1.setText(intent.getStringExtra("Response1"));
response2.setText(intent.getStringExtra("Response2"));
response3.setText(intent.getStringExtra("Response3"));
command.setText(intent.getStringExtra("Command"));


return view;
}
Expand Down

0 comments on commit 0ed1ca1

Please sign in to comment.