diff --git a/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/DevicesFragments/ViewDevicesFragment.java b/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/DevicesFragments/ViewDevicesFragment.java index 903d4f9..55aa23f 100644 --- a/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/DevicesFragments/ViewDevicesFragment.java +++ b/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/DevicesFragments/ViewDevicesFragment.java @@ -103,10 +103,25 @@ public void onClick(View view) { btnDeleteCancel.setCompoundDrawablesWithIntrinsicBounds(cancelIcon, null, null, null); }else{ - connection.sendRequest(connection.prepareUpdateDevice("updateDevice", ID, txtDevice.getText().toString(), txtDescription.getText().toString(), "json")); + txtDevice.setEnabled(false); + txtDescription.setEnabled(false); + + btnDeleteCancel.setText("Excluir"); + btnEditSend.setText("Editar"); + + editIcon = getResources().getDrawable(R.drawable.ic_edit_black_24dp); + removeIcon = getResources().getDrawable(R.drawable.ic_delete_black_24dp); + + btnEditSend.setCompoundDrawablesWithIntrinsicBounds(editIcon, null, null, null); + btnDeleteCancel.setCompoundDrawablesWithIntrinsicBounds(removeIcon, null, null, null); + + intent.putExtra("ID", ID); + intent.putExtra("Device", txtDevice.getText().toString()); + intent.putExtra("Description", txtDescription.getText().toString()); + if(connection.getMsgStatus()){ Toast.makeText(getContext(), "Salvo", Toast.LENGTH_SHORT).show(); }else{ diff --git a/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/InteractionsFragments/ViewInteractionFragment.java b/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/InteractionsFragments/ViewInteractionFragment.java index 1764593..e463138 100644 --- a/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/InteractionsFragments/ViewInteractionFragment.java +++ b/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/InteractionsFragments/ViewInteractionFragment.java @@ -124,12 +124,39 @@ public void onClick(View view) { btnEditSend.setCompoundDrawablesWithIntrinsicBounds(saveIcon, null, null, null); btnDeleteCancel.setCompoundDrawablesWithIntrinsicBounds(cancelIcon, null, null, null); + }else{ connection.sendRequest(connection.prepareUpdateInteraction("updateInteraction", ID, keyWord1.getText().toString(), keyWord2.getText().toString(), keyWord3.getText().toString(), response1.getText().toString(), response2.getText().toString(), response3.getText().toString(), command.getText().toString())); + keyWord1.setEnabled(false); + keyWord2.setEnabled(false); + keyWord3.setEnabled(false); + response1.setEnabled(false); + response2.setEnabled(false); + response3.setEnabled(false); + command.setEnabled(false); + + btnDeleteCancel.setText("Excluir"); + btnEditSend.setText("Editar"); + + editIcon = getResources().getDrawable(R.drawable.ic_edit_black_24dp); + removeIcon = getResources().getDrawable(R.drawable.ic_delete_black_24dp); + + btnEditSend.setCompoundDrawablesWithIntrinsicBounds(editIcon, null, null, null); + btnDeleteCancel.setCompoundDrawablesWithIntrinsicBounds(removeIcon, null, null, null); + + intent.putExtra("ID", ID); + intent.putExtra("Keyword1", keyWord1.getText().toString()); + intent.putExtra("Keyword2", keyWord2.getText().toString()); + intent.putExtra("Keyword3", keyWord3.getText().toString()); + intent.putExtra("Response1", response1.getText().toString()); + intent.putExtra("Response2", response2.getText().toString()); + intent.putExtra("Response3", response3.getText().toString()); + intent.putExtra("Command", command.getText().toString()); + if(connection.getMsgStatus()){ Toast.makeText(getContext(), "Salvo", Toast.LENGTH_SHORT).show(); }else{ diff --git a/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/SkillsFragments/HomeworkFragments/ViewHomeWorkFragment.java b/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/SkillsFragments/HomeworkFragments/ViewHomeWorkFragment.java index 3525bd5..8c47197 100644 --- a/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/SkillsFragments/HomeworkFragments/ViewHomeWorkFragment.java +++ b/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/SkillsFragments/HomeworkFragments/ViewHomeWorkFragment.java @@ -146,6 +146,12 @@ public void onClick(View view) { btnEditSend.setCompoundDrawablesWithIntrinsicBounds(editIcon, null, null, null); btnDeleteCancel.setCompoundDrawablesWithIntrinsicBounds(removeIcon, null, null, null); + intent.putExtra("ID", ID); + intent.putExtra("Type", txtType.getText().toString()); + intent.putExtra("Subject", txtSubject.getText().toString()); + intent.putExtra("HomeWork", txtHomeWork.getText().toString()); + intent.putExtra("Delivery", txtDelivery.getText().toString()); + intent.putExtra("Description", txtDescription.getText().toString()); } catch (ParseException e ) { Toast.makeText(view.getContext(), "Insira um formato vĂ¡lido", Toast.LENGTH_SHORT).show(); @@ -176,6 +182,17 @@ public void onClick(View view) { txtDelivery.setText(intent.getStringExtra("Delivery")); txtDescription.setText(intent.getStringExtra("Description")); + txtType.setEnabled(false); + txtSubject.setEnabled(false); + txtHomeWork.setEnabled(false); + txtDelivery.setEnabled(false); + txtDescription.setEnabled(false); + + btnEditSend.setCompoundDrawablesWithIntrinsicBounds(editIcon, null, null, null); + btnDeleteCancel.setCompoundDrawablesWithIntrinsicBounds(removeIcon, null, null, null); + + btnDeleteCancel.setText("Excluir"); + btnEditSend.setText("Editar"); } } }); diff --git a/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/SkillsFragments/ProjectsFragments/ViewProjectsFragment.java b/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/SkillsFragments/ProjectsFragments/ViewProjectsFragment.java index 3c35370..1baeea1 100644 --- a/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/SkillsFragments/ProjectsFragments/ViewProjectsFragment.java +++ b/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/Fragments/SkillsFragments/ProjectsFragments/ViewProjectsFragment.java @@ -104,6 +104,22 @@ public void onClick(View view) { }else{ connection.sendRequest(connection.prepareUpdateProject("updateProject", ID, txtProject.getText().toString(), txtRepository.getText().toString())); + txtProject.setEnabled(false); + txtRepository.setEnabled(false); + + btnDeleteCancel.setText("Excluir"); + btnEditSend.setText("Editar"); + + editIcon = getResources().getDrawable(R.drawable.ic_edit_black_24dp); + removeIcon = getResources().getDrawable(R.drawable.ic_delete_black_24dp); + + btnEditSend.setCompoundDrawablesWithIntrinsicBounds(editIcon, null, null, null); + btnDeleteCancel.setCompoundDrawablesWithIntrinsicBounds(removeIcon, null, null, null); + + intent.putExtra("ID", ID); + intent.putExtra("Project", txtProject.getText().toString()); + intent.putExtra("Repository", txtRepository.getText().toString()); + if(connection.getMsgStatus()){ Toast.makeText(getContext(), "Salvo", Toast.LENGTH_SHORT).show(); }else{ @@ -136,6 +152,7 @@ public void onClick(View view) { txtProject.setText(intent.getStringExtra("Project")); txtRepository.setText(intent.getStringExtra("Repository")); + } } }); diff --git a/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/ServerConnection.java b/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/ServerConnection.java index 1d81dd1..7750763 100644 --- a/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/ServerConnection.java +++ b/App/app/src/main/java/com/gazeboindustries/sextafeiramobile/ServerConnection.java @@ -16,7 +16,8 @@ import static java.lang.Thread.sleep; public class ServerConnection extends AsyncTask> { - private String IP = "192.168.0.5"; + private String IP = "gazeboindustries.hopto.org"; + //private String IP = "192.168.0.5"; private int port = 5000; private Socket socket; private PrintWriter out;