mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 10:48:46 +00:00
Merge pull request #111 from ClaytonWWilson/aaron-branch-2
Aaron branch 2
This commit is contained in:
commit
edba58ebec
@ -67,7 +67,6 @@ public class MainActivity extends AppCompatActivity implements CreateListDialogF
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//------------------------------Auth Testing---------------------------------------------//
|
//------------------------------Auth Testing---------------------------------------------//
|
||||||
|
|
||||||
boolean testAuth = false;
|
boolean testAuth = false;
|
||||||
@ -89,14 +88,10 @@ public class MainActivity extends AppCompatActivity implements CreateListDialogF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//NOTE: deleteUser is slightly unusual in that it requires a Requestor. See below for building one
|
|
||||||
//authManager.deleteUser(requestor);
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------//
|
|
||||||
|
|
||||||
|
//----------------------------------API Testing---------------------------------------------//
|
||||||
|
|
||||||
boolean testAPI = false;
|
boolean testAPI = false;
|
||||||
//----------------------------------API Testing---------------------------------------------//
|
|
||||||
|
|
||||||
if (testAPI) {
|
if (testAPI) {
|
||||||
AuthManager authManager = new AuthManager();
|
AuthManager authManager = new AuthManager();
|
||||||
@ -114,10 +109,7 @@ public class MainActivity extends AppCompatActivity implements CreateListDialogF
|
|||||||
|
|
||||||
Requestor requestor = new Requestor(authManager, configs.getProperty("apiKey"));
|
Requestor requestor = new Requestor(authManager, configs.getProperty("apiKey"));
|
||||||
|
|
||||||
|
|
||||||
//The name is the only part of this that is used, the rest is generated by the Lambda.
|
|
||||||
List testList = new List(-1, "New List", "user filled by lambda", Instant.now().toEpochMilli());
|
List testList = new List(-1, "New List", "user filled by lambda", Instant.now().toEpochMilli());
|
||||||
//Everything except addedDate is used for ItemEntry
|
|
||||||
ListEntry entry = new ListEntry(1, 4, Math.abs(new Random().nextInt()), Instant.now().toEpochMilli(),false);
|
ListEntry entry = new ListEntry(1, 4, Math.abs(new Random().nextInt()), Instant.now().toEpochMilli(),false);
|
||||||
|
|
||||||
SynchronousReceiver<Integer> idReceiver = new SynchronousReceiver<>();
|
SynchronousReceiver<Integer> idReceiver = new SynchronousReceiver<>();
|
||||||
@ -148,37 +140,26 @@ public class MainActivity extends AppCompatActivity implements CreateListDialogF
|
|||||||
receiverError.printStackTrace();
|
receiverError.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------------------//
|
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------------//
|
||||||
|
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
/*FloatingActionButton fab = findViewById(R.id.fab);
|
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
DrawerLayout drawer = findViewById(R.id.drawer_layout);
|
DrawerLayout drawer = findViewById(R.id.drawer_layout);
|
||||||
NavigationView navigationView = findViewById(R.id.nav_view);
|
NavigationView navigationView = findViewById(R.id.nav_view);
|
||||||
// Passing each menu ID as a set of Ids because each menu should be considered as top level destinations.
|
|
||||||
mAppBarConfiguration = new AppBarConfiguration.Builder(
|
mAppBarConfiguration = new AppBarConfiguration.Builder(
|
||||||
R.id.nav_home, R.id.nav_lists)
|
R.id.nav_home, R.id.nav_profile)
|
||||||
.setDrawerLayout(drawer)
|
.setDrawerLayout(drawer)
|
||||||
.build();
|
.build();
|
||||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
|
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
|
||||||
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
|
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
|
||||||
NavigationUI.setupWithNavController(navigationView, navController);
|
NavigationUI.setupWithNavController(navigationView, navController);
|
||||||
|
|
||||||
// Handle search button click
|
|
||||||
ImageButton searchButton = (ImageButton) findViewById(R.id.searchButton);
|
ImageButton searchButton = (ImageButton) findViewById(R.id.searchButton);
|
||||||
searchButton.setOnClickListener(new View.OnClickListener() {
|
searchButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Intent intent = new Intent(MainActivity.this, SearchResults.class);
|
Intent intent = new Intent(MainActivity.this, SearchResults.class);
|
||||||
// Send user to SearchResults activity
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.enter_from_left, R.anim.exit_from_left);
|
overridePendingTransition(R.anim.enter_from_left, R.anim.exit_from_left);
|
||||||
|
|
||||||
@ -186,13 +167,6 @@ public class MainActivity extends AppCompatActivity implements CreateListDialogF
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
//Inflate the menu; this adds items to the action bar if it is present.
|
|
||||||
getMenuInflater().inflate(R.menu.main, menu);
|
|
||||||
return true;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onSupportNavigateUp() {
|
public boolean onSupportNavigateUp() {
|
||||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
|
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
|
||||||
|
|||||||
@ -1,49 +1,84 @@
|
|||||||
package com.example.listify.ui.home;
|
package com.example.listify.ui.home;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.ListView;
|
||||||
import android.widget.EditText;
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import com.example.listify.AuthManager;
|
import com.example.listify.AuthManager;
|
||||||
|
import com.example.listify.CreateListDialogFragment;
|
||||||
|
import com.example.listify.LoadingCircleDialog;
|
||||||
import com.example.listify.R;
|
import com.example.listify.R;
|
||||||
import com.example.listify.Requestor;
|
import com.example.listify.Requestor;
|
||||||
|
import com.example.listify.SynchronousReceiver;
|
||||||
|
import com.example.listify.adapter.ShoppingListsSwipeableAdapter;
|
||||||
|
import com.example.listify.data.List;
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import static com.example.listify.MainActivity.am;
|
import static com.example.listify.MainActivity.am;
|
||||||
|
|
||||||
public class HomeFragment extends Fragment {
|
public class HomeFragment extends Fragment implements CreateListDialogFragment.OnNewListListener, Requestor.Receiver {
|
||||||
private Button toDeleteAccountPage;
|
ArrayList<List> shoppingLists = new ArrayList<>();
|
||||||
|
ShoppingListsSwipeableAdapter shoppingListsSwipeableAdapter;
|
||||||
|
Requestor requestor;
|
||||||
|
ListView shoppingListsView;
|
||||||
|
ProgressBar loadingLists;
|
||||||
|
TextView emptyMessage;
|
||||||
|
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
View root = inflater.inflate(R.layout.fragment_home, container, false);
|
View root = inflater.inflate(R.layout.fragment_home, container, false);
|
||||||
|
shoppingListsView = root.findViewById(R.id.shopping_lists);
|
||||||
|
loadingLists = (ProgressBar) root.findViewById(R.id.progress_loading_lists);
|
||||||
|
loadingLists.setVisibility(View.VISIBLE);
|
||||||
|
emptyMessage = (TextView) root.findViewById(R.id.textViewEmpty);
|
||||||
|
|
||||||
toDeleteAccountPage = (Button) root.findViewById(R.id.button);
|
Properties configs = new Properties();
|
||||||
toDeleteAccountPage.setOnClickListener(new View.OnClickListener() {
|
try {
|
||||||
|
configs = AuthManager.loadProperties(getContext(), "android.resource://" + getActivity().getPackageName() + "/raw/auths.json");
|
||||||
|
} catch (IOException | JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
requestor = new Requestor(am, configs.getProperty("apiKey"));
|
||||||
|
SynchronousReceiver<Integer[]> listIdsReceiver = new SynchronousReceiver<>();
|
||||||
|
|
||||||
|
final Requestor.Receiver<Integer[]> recv = this;
|
||||||
|
requestor.getListOfIds(List.class, recv, null);
|
||||||
|
|
||||||
|
|
||||||
|
FloatingActionButton fab = (FloatingActionButton) root.findViewById(R.id.new_list_fab);
|
||||||
|
Fragment thisFragment = this;
|
||||||
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
View passwordView = getLayoutInflater().inflate(R.layout.activity_code, null);
|
CreateListDialogFragment createListDialogFragment = new CreateListDialogFragment();
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
createListDialogFragment.show(getFragmentManager(), "Create New List");
|
||||||
builder.setView(passwordView);
|
createListDialogFragment.setTargetFragment(thisFragment, 0);
|
||||||
builder.setTitle("Account deletion verification");
|
}
|
||||||
builder.setMessage("Are you sure you want to delete your account? If so, enter your password below and hit \"Yes\".");
|
});
|
||||||
builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void sendNewListName(String name) {
|
||||||
EditText passwordText = (EditText) passwordView.findViewById(R.id.editTextCode);
|
LoadingCircleDialog loadingDialog = new LoadingCircleDialog(getActivity());
|
||||||
String password = passwordText.getText().toString();
|
loadingDialog.show();
|
||||||
if(password.equals(am.getPassword())) {
|
|
||||||
try {
|
|
||||||
Properties configs = new Properties();
|
Properties configs = new Properties();
|
||||||
try {
|
try {
|
||||||
configs = AuthManager.loadProperties(getContext(), "android.resource://" + getActivity().getPackageName() + "/raw/auths.json");
|
configs = AuthManager.loadProperties(getContext(), "android.resource://" + getActivity().getPackageName() + "/raw/auths.json");
|
||||||
@ -51,51 +86,106 @@ public class HomeFragment extends Fragment {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
Requestor requestor = new Requestor(am, configs.getProperty("apiKey"));
|
Requestor requestor = new Requestor(am, configs.getProperty("apiKey"));
|
||||||
|
SynchronousReceiver<Integer> idReceiver = new SynchronousReceiver<>();
|
||||||
|
|
||||||
// try {
|
List newList = new List(-1, name, "user filled by lambda", Instant.now().toEpochMilli());
|
||||||
// am.changePassword(am.getEmail());
|
|
||||||
// }
|
try {
|
||||||
// catch (Exception e) {}
|
requestor.postObject(newList, idReceiver, idReceiver);
|
||||||
/*try {
|
emptyMessage.setVisibility(View.GONE);
|
||||||
am.confirmPasswordReset("", "");
|
} catch (Exception e) {
|
||||||
|
Toast.makeText(getContext(), "An error occurred", Toast.LENGTH_LONG).show();
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
Thread t = new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
newList.setItemID(idReceiver.await());
|
||||||
|
} catch (Exception e) {
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Toast.makeText(getContext(), "An error occurred", Toast.LENGTH_LONG).show();
|
||||||
|
loadingDialog.cancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
}
|
||||||
|
shoppingLists.add(newList);
|
||||||
|
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
shoppingListsSwipeableAdapter.notifyDataSetChanged();
|
||||||
|
loadingDialog.cancel();
|
||||||
|
Toast.makeText(getContext(), String.format("%s created", name), Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
t.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] TO = {am.getEmail()};
|
@Override
|
||||||
Intent emailIntent = new Intent(Intent.ACTION_SEND);
|
public void acceptDelivery(Object delivered) {
|
||||||
emailIntent.setData(Uri.parse("mailto:"));
|
Integer[] listIds = (Integer[]) delivered;
|
||||||
emailIntent.setType("text/plain");
|
// Create threads and add them to a list
|
||||||
emailIntent.putExtra(Intent.EXTRA_EMAIL, TO);
|
Thread[] threads = new Thread[listIds.length];
|
||||||
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Listify account deleted");
|
List[] results = new List[listIds.length];
|
||||||
emailIntent.putExtra(Intent.EXTRA_TEXT, "Hello, this email is to confirm that you have deleted your Listify account.");
|
for (int i = 0; i < listIds.length; i++) {
|
||||||
|
SynchronousReceiver<List> listReceiver = new SynchronousReceiver<>();
|
||||||
|
requestor.getObject(Integer.toString(listIds[i]), List.class, listReceiver, listReceiver);
|
||||||
|
final int finalI = i;
|
||||||
|
Thread t = new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
try {
|
try {
|
||||||
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
|
results[finalI] = listReceiver.await();
|
||||||
Log.i("Finished sending email...", "");
|
|
||||||
System.out.println("A");
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.out.println("B");
|
|
||||||
}*/
|
|
||||||
|
|
||||||
am.deleteUser(requestor);
|
|
||||||
am.nullify();
|
|
||||||
Intent intent = new Intent(getActivity(), com.example.listify.ui.LoginPage.class);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
Log.i("Authentication", e.toString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
threads[i] = t;
|
||||||
|
t.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for each thread to finish and add results to shoppingLists
|
||||||
|
for (int i = 0; i < threads.length; i++) {
|
||||||
|
try {
|
||||||
|
threads[i].join();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
shoppingLists.add(results[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set adapter and display this users lists
|
||||||
|
shoppingListsSwipeableAdapter = new ShoppingListsSwipeableAdapter(getActivity(), shoppingLists);
|
||||||
|
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {}
|
public void run() {
|
||||||
});
|
shoppingListsView.setAdapter(shoppingListsSwipeableAdapter);
|
||||||
AlertDialog dialog = builder.create();
|
// shoppingListsView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
dialog.show();
|
// @Override
|
||||||
|
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
// Intent listPage = new Intent(getContext(), ListPage.class);
|
||||||
|
//
|
||||||
|
// // Send the list ID
|
||||||
|
// listPage.putExtra("listID", shoppingLists.get(position).getItemID());
|
||||||
|
// startActivity(listPage);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
loadingLists.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if(listIds.length == 0) {
|
||||||
|
emptyMessage.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return root;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,183 +0,0 @@
|
|||||||
package com.example.listify.ui.lists;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.widget.ListView;
|
|
||||||
import android.widget.ProgressBar;
|
|
||||||
import android.widget.Toast;
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
|
|
||||||
import com.example.listify.AuthManager;
|
|
||||||
import com.example.listify.CreateListDialogFragment;
|
|
||||||
import com.example.listify.LoadingCircleDialog;
|
|
||||||
import com.example.listify.R;
|
|
||||||
import com.example.listify.Requestor;
|
|
||||||
import com.example.listify.SynchronousReceiver;
|
|
||||||
import com.example.listify.adapter.ShoppingListsSwipeableAdapter;
|
|
||||||
import com.example.listify.data.List;
|
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
|
||||||
|
|
||||||
import org.json.JSONException;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.time.Instant;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
import static com.example.listify.MainActivity.am;
|
|
||||||
|
|
||||||
public class ListsFragment extends Fragment implements CreateListDialogFragment.OnNewListListener, Requestor.Receiver {
|
|
||||||
ArrayList<List> shoppingLists = new ArrayList<>();
|
|
||||||
ShoppingListsSwipeableAdapter shoppingListsSwipeableAdapter;
|
|
||||||
Requestor requestor;
|
|
||||||
ListView shoppingListsView;
|
|
||||||
ProgressBar loadingLists;
|
|
||||||
int resultsIndex;
|
|
||||||
|
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
|
||||||
View root = inflater.inflate(R.layout.fragment_lists, container, false);
|
|
||||||
shoppingListsView = root.findViewById(R.id.shopping_lists);
|
|
||||||
loadingLists = (ProgressBar) root.findViewById(R.id.progress_loading_lists);
|
|
||||||
loadingLists.setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
Properties configs = new Properties();
|
|
||||||
try {
|
|
||||||
configs = AuthManager.loadProperties(getContext(), "android.resource://" + getActivity().getPackageName() + "/raw/auths.json");
|
|
||||||
} catch (IOException | JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
requestor = new Requestor(am, configs.getProperty("apiKey"));
|
|
||||||
SynchronousReceiver<Integer[]> listIdsReceiver = new SynchronousReceiver<>();
|
|
||||||
|
|
||||||
final Requestor.Receiver<Integer[]> recv = this;
|
|
||||||
requestor.getListOfIds(List.class, recv, null);
|
|
||||||
|
|
||||||
|
|
||||||
FloatingActionButton fab = (FloatingActionButton) root.findViewById(R.id.new_list_fab);
|
|
||||||
Fragment thisFragment = this;
|
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
CreateListDialogFragment createListDialogFragment = new CreateListDialogFragment();
|
|
||||||
createListDialogFragment.show(getFragmentManager(), "Create New List");
|
|
||||||
createListDialogFragment.setTargetFragment(thisFragment, 0);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return root;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendNewListName(String name) {
|
|
||||||
LoadingCircleDialog loadingDialog = new LoadingCircleDialog(getActivity());
|
|
||||||
loadingDialog.show();
|
|
||||||
|
|
||||||
Properties configs = new Properties();
|
|
||||||
try {
|
|
||||||
configs = AuthManager.loadProperties(getContext(), "android.resource://" + getActivity().getPackageName() + "/raw/auths.json");
|
|
||||||
} catch (IOException | JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
Requestor requestor = new Requestor(am, configs.getProperty("apiKey"));
|
|
||||||
SynchronousReceiver<Integer> idReceiver = new SynchronousReceiver<>();
|
|
||||||
|
|
||||||
List newList = new List(-1, name, "user filled by lambda", Instant.now().toEpochMilli());
|
|
||||||
|
|
||||||
try {
|
|
||||||
requestor.postObject(newList, idReceiver, idReceiver);
|
|
||||||
} catch (Exception e) {
|
|
||||||
Toast.makeText(getContext(), "An error occurred", Toast.LENGTH_LONG).show();
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
Thread t = new Thread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
newList.setItemID(idReceiver.await());
|
|
||||||
} catch (Exception e) {
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(getContext(), "An error occurred", Toast.LENGTH_LONG).show();
|
|
||||||
loadingDialog.cancel();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
e.printStackTrace();
|
|
||||||
|
|
||||||
}
|
|
||||||
shoppingLists.add(newList);
|
|
||||||
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
shoppingListsSwipeableAdapter.notifyDataSetChanged();
|
|
||||||
loadingDialog.cancel();
|
|
||||||
Toast.makeText(getContext(), String.format("%s created", name), Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
t.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void acceptDelivery(Object delivered) {
|
|
||||||
Integer[] listIds = (Integer[]) delivered;
|
|
||||||
// Create threads and add them to a list
|
|
||||||
Thread[] threads = new Thread[listIds.length];
|
|
||||||
List[] results = new List[listIds.length];
|
|
||||||
for (int i = 0; i < listIds.length; i++) {
|
|
||||||
SynchronousReceiver<List> listReceiver = new SynchronousReceiver<>();
|
|
||||||
requestor.getObject(Integer.toString(listIds[i]), List.class, listReceiver, listReceiver);
|
|
||||||
final int finalI = i;
|
|
||||||
Thread t = new Thread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
results[finalI] = listReceiver.await();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
threads[i] = t;
|
|
||||||
t.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wait for each thread to finish and add results to shoppingLists
|
|
||||||
for (int i = 0; i < threads.length; i++) {
|
|
||||||
try {
|
|
||||||
threads[i].join();
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
shoppingLists.add(results[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set adapter and display this users lists
|
|
||||||
shoppingListsSwipeableAdapter = new ShoppingListsSwipeableAdapter(getActivity(), shoppingLists);
|
|
||||||
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
shoppingListsView.setAdapter(shoppingListsSwipeableAdapter);
|
|
||||||
// shoppingListsView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
||||||
// Intent listPage = new Intent(getContext(), ListPage.class);
|
|
||||||
//
|
|
||||||
// // Send the list ID
|
|
||||||
// listPage.putExtra("listID", shoppingLists.get(position).getItemID());
|
|
||||||
// startActivity(listPage);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
loadingLists.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
package com.example.listify.ui.profile;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import com.example.listify.AuthManager;
|
||||||
|
import com.example.listify.R;
|
||||||
|
import com.example.listify.Requestor;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import static com.example.listify.MainActivity.am;
|
||||||
|
|
||||||
|
public class ProfileFragment extends Fragment {
|
||||||
|
private Button toDeleteAccountPage;
|
||||||
|
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
View root = inflater.inflate(R.layout.fragment_profile, container, false);
|
||||||
|
|
||||||
|
TextView emailText = (TextView) root.findViewById(R.id.textViewEmail);
|
||||||
|
emailText.setText(am.getEmail());
|
||||||
|
|
||||||
|
toDeleteAccountPage = (Button) root.findViewById(R.id.button);
|
||||||
|
toDeleteAccountPage.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
View passwordView = getLayoutInflater().inflate(R.layout.activity_code, null);
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||||
|
builder.setView(passwordView);
|
||||||
|
builder.setTitle("Account deletion verification");
|
||||||
|
builder.setMessage("Are you sure you want to delete your account? If so, enter your password below and hit \"Yes\".");
|
||||||
|
builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
EditText passwordText = (EditText) passwordView.findViewById(R.id.editTextCode);
|
||||||
|
String password = passwordText.getText().toString();
|
||||||
|
if(password.equals(am.getPassword())) {
|
||||||
|
try {
|
||||||
|
Properties configs = new Properties();
|
||||||
|
try {
|
||||||
|
configs = AuthManager.loadProperties(getContext(), "android.resource://" + getActivity().getPackageName() + "/raw/auths.json");
|
||||||
|
} catch (IOException | JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
Requestor requestor = new Requestor(am, configs.getProperty("apiKey"));
|
||||||
|
am.deleteUser(requestor);
|
||||||
|
am.nullify();
|
||||||
|
Intent intent = new Intent(getActivity(), com.example.listify.ui.LoginPage.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
Log.i("Authentication", e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {}
|
||||||
|
});
|
||||||
|
AlertDialog dialog = builder.create();
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
10
Listify/app/src/main/res/drawable/ic_baseline_person_24.xml
Normal file
10
Listify/app/src/main/res/drawable/ic_baseline_person_24.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
|
||||||
|
</vector>
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 53 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 127 KiB |
@ -1,19 +1,49 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
tools:context=".ui.home.HomeFragment">
|
tools:context=".ui.home.HomeFragment">
|
||||||
|
|
||||||
<Button
|
<ProgressBar
|
||||||
android:id="@+id/button"
|
android:id="@+id/progress_loading_lists"
|
||||||
|
style="?android:attr/progressBarStyleLarge"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Delete Account"
|
android:layout_centerHorizontal="true"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:layout_centerVertical="true"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:indeterminate="true"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:visibility="gone"/>
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
<ListView
|
||||||
|
android:id="@+id/shopping_lists"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:divider="@color/list_divider"
|
||||||
|
android:dividerHeight="1dp"/>
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/new_list_fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
app:srcCompat="@drawable/ic_baseline_add_28"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_alignParentEnd="true"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textViewEmpty"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:text="You currently have no shopping lists."
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@ -1,41 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
|
||||||
tools:context=".ui.lists.ListsFragment"
|
|
||||||
tools:showIn="@layout/fragment_lists">
|
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/progress_loading_lists"
|
|
||||||
style="?android:attr/progressBarStyleLarge"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:indeterminate="true"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
<ListView
|
|
||||||
android:id="@+id/shopping_lists"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:divider="@color/list_divider"
|
|
||||||
android:dividerHeight="1dp"/>
|
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
||||||
android:id="@+id/new_list_fab"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="@dimen/fab_margin"
|
|
||||||
app:srcCompat="@drawable/ic_baseline_add_28"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_alignParentEnd="true"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
42
Listify/app/src/main/res/layout/fragment_profile.xml
Normal file
42
Listify/app/src/main/res/layout/fragment_profile.xml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:text="Delete Account"
|
||||||
|
android:backgroundTint="#C82832"
|
||||||
|
android:textColor="#fff"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textViewEmailHeader"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="Your Email Address:"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textViewEmail"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:text="qwerty@uiop.com"
|
||||||
|
android:textSize="20sp"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/textViewEmailHeader"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textViewEmailHeader" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@ -6,8 +6,19 @@
|
|||||||
<group android:checkableBehavior="single">
|
<group android:checkableBehavior="single">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_home"
|
android:id="@+id/nav_home"
|
||||||
android:icon="@drawable/ic_menu_camera"
|
android:icon="@drawable/ic_baseline_list_alt_28"
|
||||||
android:title="@string/menu_home" />
|
android:title="@string/menu_home" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_profile"
|
||||||
|
android:icon="@drawable/ic_baseline_person_24"
|
||||||
|
android:title="@string/menu_profile" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_logout"
|
||||||
|
android:title="Sign out"
|
||||||
|
android:onClick="onClickSignout" />
|
||||||
|
|
||||||
<!-- <item-->
|
<!-- <item-->
|
||||||
<!-- android:id="@+id/nav_gallery"-->
|
<!-- android:id="@+id/nav_gallery"-->
|
||||||
<!-- android:icon="@drawable/ic_menu_gallery"-->
|
<!-- android:icon="@drawable/ic_menu_gallery"-->
|
||||||
@ -16,18 +27,5 @@
|
|||||||
<!-- android:id="@+id/nav_slideshow"-->
|
<!-- android:id="@+id/nav_slideshow"-->
|
||||||
<!-- android:icon="@drawable/ic_menu_slideshow"-->
|
<!-- android:icon="@drawable/ic_menu_slideshow"-->
|
||||||
<!-- android:title="@string/menu_slideshow" />-->
|
<!-- android:title="@string/menu_slideshow" />-->
|
||||||
<item
|
|
||||||
android:id="@+id/nav_lists"
|
|
||||||
android:icon="@drawable/ic_baseline_list_alt_28"
|
|
||||||
android:title="@string/menu_lists" />
|
|
||||||
<!-- <item-->
|
|
||||||
<!-- android:id="@+id/nav_create_list"-->
|
|
||||||
<!-- android:icon="@drawable/ic_baseline_add_28"-->
|
|
||||||
<!-- android:title="Create New List"-->
|
|
||||||
<!-- android:onClick="onClickCreateList" />-->
|
|
||||||
<item
|
|
||||||
android:id="@+id/nav_logout"
|
|
||||||
android:title="Sign out"
|
|
||||||
android:onClick="onClickSignout" />
|
|
||||||
</group>
|
</group>
|
||||||
</menu>
|
</menu>
|
||||||
@ -11,6 +11,12 @@
|
|||||||
android:label="@string/menu_home"
|
android:label="@string/menu_home"
|
||||||
tools:layout="@layout/fragment_home" />
|
tools:layout="@layout/fragment_home" />
|
||||||
|
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/nav_profile"
|
||||||
|
android:name="com.example.listify.ui.profile.ProfileFragment"
|
||||||
|
android:label="@string/menu_profile"
|
||||||
|
tools:layout="@layout/fragment_profile" />
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/nav_gallery"
|
android:id="@+id/nav_gallery"
|
||||||
android:name="com.example.listify.ui.gallery.GalleryFragment"
|
android:name="com.example.listify.ui.gallery.GalleryFragment"
|
||||||
@ -23,9 +29,4 @@
|
|||||||
android:label="@string/menu_slideshow"
|
android:label="@string/menu_slideshow"
|
||||||
tools:layout="@layout/fragment_slideshow" />
|
tools:layout="@layout/fragment_slideshow" />
|
||||||
|
|
||||||
<fragment
|
|
||||||
android:id="@+id/nav_lists"
|
|
||||||
android:name="com.example.listify.ui.lists.ListsFragment"
|
|
||||||
android:label="@string/menu_lists"
|
|
||||||
tools:layout="@layout/fragment_lists" />
|
|
||||||
</navigation>
|
</navigation>
|
||||||
@ -7,7 +7,8 @@
|
|||||||
<string name="nav_header_desc">Navigation header</string>
|
<string name="nav_header_desc">Navigation header</string>
|
||||||
<string name="action_settings">Settings</string>
|
<string name="action_settings">Settings</string>
|
||||||
|
|
||||||
<string name="menu_home">Profile</string>
|
<string name="menu_home">My Lists</string>
|
||||||
|
<string name="menu_profile">Profile</string>
|
||||||
<string name="menu_gallery">Gallery</string>
|
<string name="menu_gallery">Gallery</string>
|
||||||
<string name="menu_slideshow">Slideshow</string>
|
<string name="menu_slideshow">Slideshow</string>
|
||||||
|
|
||||||
@ -29,7 +30,6 @@
|
|||||||
<string name="search_button_desc">Search Button</string>
|
<string name="search_button_desc">Search Button</string>
|
||||||
<string name="title_activity_search_results">SearchResults</string>
|
<string name="title_activity_search_results">SearchResults</string>
|
||||||
<string name="store_selection">Store selection</string>
|
<string name="store_selection">Store selection</string>
|
||||||
<string name="menu_lists">My Lists</string>
|
|
||||||
<string name="title_activity_item_details">ItemDetails</string>
|
<string name="title_activity_item_details">ItemDetails</string>
|
||||||
<string name="add_to_list">Add to list</string>
|
<string name="add_to_list">Add to list</string>
|
||||||
<string name="create_new_list">Add to new list</string>
|
<string name="create_new_list">Add to new list</string>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user