mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-15 18:28:47 +00:00
Fixes for create list dialog
This commit is contained in:
parent
d3571cec3d
commit
96c3f2772d
@ -20,7 +20,7 @@ public class CreateListAddDialogFragment extends DialogFragment {
|
||||
void sendNewListName(String name, int quantity);
|
||||
}
|
||||
|
||||
public OnNewListAddListener onNewListListener;
|
||||
public OnNewListAddListener onNewAddListListener;
|
||||
|
||||
EditText etNewListName;
|
||||
EditText etQuantity;
|
||||
@ -44,7 +44,7 @@ public class CreateListAddDialogFragment extends DialogFragment {
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
onNewListListener.sendNewListName(etNewListName.getText().toString(), Integer.parseInt(etQuantity.getText().toString()));
|
||||
onNewAddListListener.sendNewListName(etNewListName.getText().toString(), Integer.parseInt(etQuantity.getText().toString()));
|
||||
}
|
||||
})
|
||||
.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
|
||||
@ -89,7 +89,7 @@ public class CreateListAddDialogFragment extends DialogFragment {
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
try {
|
||||
onNewListListener = (OnNewListAddListener) getActivity();
|
||||
onNewAddListListener = (OnNewListAddListener) getActivity();
|
||||
} catch (ClassCastException e) {
|
||||
Log.e("CreateListAddDialogFragment", "onAttach: ClassCastException: " + e.getMessage());
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ import java.util.Arrays;
|
||||
import java.util.Properties;
|
||||
import java.util.Random;
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements CreateListAddDialogFragment.OnNewListAddListener {
|
||||
public class MainActivity extends AppCompatActivity implements CreateListDialogFragment.OnNewListListener {
|
||||
private AppBarConfiguration mAppBarConfiguration;
|
||||
|
||||
@Override
|
||||
@ -176,7 +176,7 @@ public class MainActivity extends AppCompatActivity implements CreateListAddDial
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendNewListName(String name, int quantity) {
|
||||
public void sendNewListName(String name) {
|
||||
AuthManager authManager = new AuthManager();
|
||||
try {
|
||||
authManager.signIn("merzn@purdue.edu", "Password123");
|
||||
|
||||
@ -28,7 +28,7 @@ import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Properties;
|
||||
|
||||
public class ListsFragment extends Fragment implements CreateListAddDialogFragment.OnNewListAddListener {
|
||||
public class ListsFragment extends Fragment implements CreateListDialogFragment.OnNewListListener {
|
||||
ArrayList<List> shoppingLists = new ArrayList<>();
|
||||
ListView shoppingListsView;
|
||||
|
||||
@ -89,7 +89,7 @@ public class ListsFragment extends Fragment implements CreateListAddDialogFragme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendNewListName(String name, int quantity) {
|
||||
public void sendNewListName(String name) {
|
||||
AuthManager authManager = new AuthManager();
|
||||
try {
|
||||
authManager.signIn("merzn@purdue.edu", "Password123");
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:hint="@string/new_list_name"/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -16,7 +16,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:hint="@string/new_list_name"/>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
Loading…
Reference in New Issue
Block a user