diff --git a/Listify/app/src/main/java/com/example/listify/ListPage.java b/Listify/app/src/main/java/com/example/listify/ListPage.java index 6f719d7..67f894e 100644 --- a/Listify/app/src/main/java/com/example/listify/ListPage.java +++ b/Listify/app/src/main/java/com/example/listify/ListPage.java @@ -42,7 +42,7 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver { Button decrQuan; Button removeItem; Button clearAll; - //Button shareList; + Button shareList; TextView tvTotalPrice; ProgressBar loadingListItems; @@ -109,7 +109,7 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver { } }); - /*shareList = (Button) findViewById(R.id.buttonShare); + shareList = (Button) findViewById(R.id.buttonShare); shareList.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -139,7 +139,7 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver { AlertDialog dialog = builder.create(); dialog.show(); } - });*/ + }); } @Override diff --git a/Listify/app/src/main/java/com/example/listify/ui/home/HomeFragment.java b/Listify/app/src/main/java/com/example/listify/ui/home/HomeFragment.java index d7bac2c..7375918 100644 --- a/Listify/app/src/main/java/com/example/listify/ui/home/HomeFragment.java +++ b/Listify/app/src/main/java/com/example/listify/ui/home/HomeFragment.java @@ -3,6 +3,7 @@ package com.example.listify.ui.home; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.View; @@ -64,10 +65,26 @@ public class HomeFragment extends Fragment { am.changePassword(am.getEmail()); } catch (Exception e) {} - try { + /*try { am.confirmPasswordReset("", ""); } - catch (Exception e) {} + + String[] TO = {am.getEmail()}; + Intent emailIntent = new Intent(Intent.ACTION_SEND); + emailIntent.setData(Uri.parse("mailto:")); + emailIntent.setType("text/plain"); + emailIntent.putExtra(Intent.EXTRA_EMAIL, TO); + emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Listify account deleted"); + emailIntent.putExtra(Intent.EXTRA_TEXT, "Hello, this email is to confirm that you have deleted your Listify account."); + try { + startActivity(Intent.createChooser(emailIntent, "Send mail...")); + getActivity().finish(); + Log.i("Finished sending email...", ""); + System.out.println("A"); + } catch (Exception e) { + e.printStackTrace(); + System.out.println("B"); + }*/ am.deleteUser(requestor); Intent intent = new Intent(getActivity(), com.example.listify.ui.LoginPage.class); diff --git a/Listify/app/src/main/res/layout/activity_list.xml b/Listify/app/src/main/res/layout/activity_list.xml index 3b3427a..94d1b61 100644 --- a/Listify/app/src/main/res/layout/activity_list.xml +++ b/Listify/app/src/main/res/layout/activity_list.xml @@ -26,14 +26,14 @@ android:text="Clear All" android:textSize="10sp"/> - + android:textSize="10sp"/>