Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<uses-permission android:name="ANDROID.PERMISSION.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>


<application
android:name=".FirebaseApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand Down Expand Up @@ -74,15 +74,6 @@
android:screenOrientation="portrait" >
</activity>

<receiver
android:name=".BroadcastReceiver"
android:enabled="true"
android:exported="false" >
<intent-filter>
<action android:name="ahhhlvin.c4q.nyc.notification" />
</intent-filter>
</receiver>

<service android:name=".ServiceSellerNotify"
android:exported="false"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Created by c4q-madelyntavarez on 8/11/15.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class Address {
String streetAddress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
import madelyntav.c4q.nyc.chipchop.SignupActivity1;
import madelyntav.c4q.nyc.chipchop.SignupActivity2;

/**
* Created by c4q-madelyntavarez on 8/12/15.
*/
public class DBHelper extends Firebase {
static DBHelper fireBaseRef;
private static final String URL = "https://chipchop.firebaseio.com/";
Expand Down Expand Up @@ -263,7 +260,6 @@ public void onSuccess(Map<String, Object> stringObjectMap) {

UID = String.valueOf(stringObjectMap.get("uid"));


SharedPreferences sharedPreferences = mContext.getSharedPreferences("New User", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("id", UID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@
import android.view.ViewGroup;
import android.view.Window;
import android.widget.Button;

import madelyntav.c4q.nyc.chipchop.DBObjects.Order;
import madelyntav.c4q.nyc.chipchop.DBObjects.Seller;

/**
* Created by alvin2 on 9/12/15.
*/
public class DeliveryDialog extends android.support.v4.app.DialogFragment {
public class DeliveryDialogFragment extends android.support.v4.app.DialogFragment {

Button deliverButton, pickupButton;
Seller seller;
Expand Down Expand Up @@ -53,7 +48,7 @@ public void onClick(View view) {
HelperMethods.getCurrentOrder().setIsPickup(false);
getDialog().dismiss();
FragmentManager fm = getActivity().getSupportFragmentManager();
PaymentDialog alertDialog = new PaymentDialog();
PaymentDialogFragment alertDialog = new PaymentDialogFragment();
alertDialog.show(fm, "fragment_alert");
}
});
Expand All @@ -66,7 +61,7 @@ public void onClick(View view) {
HelperMethods.getCurrentOrder().setToDeliver(false);
getDialog().dismiss();
FragmentManager fm = getActivity().getSupportFragmentManager();
PaymentDialog alertDialog = new PaymentDialog();
PaymentDialogFragment alertDialog = new PaymentDialogFragment();
alertDialog.show(fm, "fragment_alert");
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package madelyntav.c4q.nyc.chipchop;

import android.app.Application;

import com.firebase.client.Firebase;

public class FirebaseApplication extends Application {

private static FirebaseApplication singletonInstance;

public static FirebaseApplication getInstance() {
return singletonInstance;
}

@Override
public void onCreate() {
super.onCreate();
singletonInstance = this;
Firebase.setAndroidContext(this);
}
}
32 changes: 15 additions & 17 deletions app/src/main/java/madelyntav/c4q/nyc/chipchop/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,28 @@ public class MainActivity extends AppCompatActivity {
Seller seller;
Address address;
Address sellerAddress;
String sellerName="BRailyn Torres";
String sellerPhone="646-777-9087";
String sellerStreet="256 Wadsworth Avenue";
String sellerApt="2A";
String sellerCity="New York";
String sellerState="NY";
String sellerZipcode="10033";
String sellerEmail="JackFinnish@gmail.com";
Seller seller2;
ArrayList<Seller> activeSellerList;
private String sellerName="BRailyn Torres";
private String sellerPhone="646-777-9087";
private String sellerStreet="256 Wadsworth Avenue";
private String sellerApt="2A";
private String sellerCity="New York";
private String sellerState="NY";
private String sellerZipcode="10033";
private String sellerEmail="JackFinnish@gmail.com";
private Seller seller2;
private static DBHelper dbHelper = null;
Item item2;
Item item3;
ArrayList<Item> itemsForSale;
ArrayList<User> userList;
User user2;
DBCallback emptyCallback;
private Item item2;
private Item item3;
private ArrayList<Item> itemsForSale;
private ArrayList<User> userList;
private User user2;
private DBCallback emptyCallback;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
dbHelper=DBHelper.getDbHelper(this);
activeSellerList=new ArrayList<>();
userList=new ArrayList<>();

emptyCallback = new DBCallback() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@
import madelyntav.c4q.nyc.chipchop.Payments.PaymentsActivity;
import madelyntav.c4q.nyc.chipchop.fragments.Fragment_Buyer_Orders;

/**
* Created by alvin2 on 9/10/15.
*/
public class PaymentDialog extends android.support.v4.app.DialogFragment {
public class PaymentDialogFragment extends android.support.v4.app.DialogFragment {

View coordinatorLayoutView;
ImageView confirmImage;
Button cardButton, cashButton;
private ImageView confirmImage;
private Button cardButton, cashButton;
private BuyActivity activity;
private Order order;
private DBHelper dbHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@
import madelyntav.c4q.nyc.chipchop.DBObjects.Order;
import madelyntav.c4q.nyc.chipchop.DBObjects.Review;

/**
* Created by alvin2 on 8/22/15.
*/
public class ReviewDialogFragment extends android.support.v4.app.DialogFragment implements View.OnClickListener {

Button submitButton;
Order order;
RatingBar ratingBar;
DBHelper dbHelper;
Review review;
private Button submitButton;
private Order order;
private RatingBar ratingBar;
private DBHelper dbHelper;
private Review review;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
import madelyntav.c4q.nyc.chipchop.R;
import madelyntav.c4q.nyc.chipchop.fragments.Fragment_Buyer_OrderDetails;

/**
* Created by alvin2 on 8/26/15.
*/

public class BuyerOrdersAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
public class BuyerOrdersAdapter extends RecyclerView.Adapter<BuyerOrdersAdapter.BuyerOrdersViewHolder> {

private List<Order> orderItems;
private Context context;
Expand All @@ -37,48 +33,14 @@ public BuyerOrdersAdapter(Context context, List<Order> orderItems) {
this.orderItems = orderItems;
}

private class BuyerOrdersViewHolder extends RecyclerView.ViewHolder {

CardView container;
TextView timeStamp;
TextView total;
TextView nameOfSeller;
TextView deliveryMethod;
TextView sellerAddress;


public BuyerOrdersViewHolder(View itemView) {
super(itemView);

total = (TextView) itemView.findViewById(R.id.order_cost_tv);
container = (CardView) itemView.findViewById(R.id.card_view);
nameOfSeller = (TextView) itemView.findViewById(R.id.seller_name_tv);
timeStamp = (TextView) itemView.findViewById(R.id.order_timestamp_tv);
deliveryMethod = (TextView) itemView.findViewById(R.id.delivery_method_tv);
sellerAddress = (TextView) itemView.findViewById(R.id.seller_address_tv);

container.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
BuyActivity activity = (BuyActivity) context;
activity.setOrderToView(orderItems.get(getAdapterPosition()));
activity.replaceFragment(new Fragment_Buyer_OrderDetails());
}
});

}

}

@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int position) {

View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.buyerorder_list_item, parent, false);
public BuyerOrdersViewHolder onCreateViewHolder(ViewGroup parent, int position) {
View itemView = LayoutInflater.from(context).inflate(R.layout.buyerorder_list_item, parent, false);
return new BuyerOrdersViewHolder(itemView);
}

@Override
public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) {
public void onBindViewHolder(BuyerOrdersViewHolder viewHolder, int position) {

String deliveryMethod = "";
Order order = orderItems.get(position);
Expand Down Expand Up @@ -123,4 +85,36 @@ private void setAnimation(View viewToAnimate, int position) {
public int getItemCount() {
return orderItems.size();
}

public class BuyerOrdersViewHolder extends RecyclerView.ViewHolder {

private CardView container;
private TextView timeStamp;
private TextView total;
private TextView nameOfSeller;
private TextView deliveryMethod;
private TextView sellerAddress;

public BuyerOrdersViewHolder(View itemView) {
super(itemView);

total = (TextView) itemView.findViewById(R.id.order_cost_tv);
container = (CardView) itemView.findViewById(R.id.card_view);
nameOfSeller = (TextView) itemView.findViewById(R.id.seller_name_tv);
timeStamp = (TextView) itemView.findViewById(R.id.order_timestamp_tv);
deliveryMethod = (TextView) itemView.findViewById(R.id.delivery_method_tv);
sellerAddress = (TextView) itemView.findViewById(R.id.seller_address_tv);

container.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
BuyActivity activity = (BuyActivity) context;
activity.setOrderToView(orderItems.get(getAdapterPosition()));
activity.replaceFragment(new Fragment_Buyer_OrderDetails());
}
});

}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
import madelyntav.c4q.nyc.chipchop.FoodItemSelectDialog;
import madelyntav.c4q.nyc.chipchop.R;

/**
* Created by alvin2 on 8/16/15.
*/
public class CartListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

Button removeItemButton;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
import madelyntav.c4q.nyc.chipchop.DBObjects.Item;
import madelyntav.c4q.nyc.chipchop.R;

/**
* Created by alvin2 on 8/16/15.
*/
public class CheckoutListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private List<Item> checkoutItems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
import madelyntav.c4q.nyc.chipchop.FoodItemSelectDialog;
import madelyntav.c4q.nyc.chipchop.R;

/**
* Created by c4q-anthonyf on 8/14/15.
*/
public class FoodListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{

private List<Item> foodItems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
import madelyntav.c4q.nyc.chipchop.fragments.Fragment_Seller_CreateItem;
import madelyntav.c4q.nyc.chipchop.fragments.Fragment_Seller_Items;

/**
* Created by c4q-anthonyf on 8/14/15.
*/
public class SellerItemsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private DBCallback itemRemovalCallback;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
import madelyntav.c4q.nyc.chipchop.R;
import madelyntav.c4q.nyc.chipchop.fragments.Fragment_Buyer_SellerProfile;

/**
* Created by alvin2 on 8/20/15.
*/
public class SellerListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private List<Seller> sellers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
import madelyntav.c4q.nyc.chipchop.SellActivity;
import madelyntav.c4q.nyc.chipchop.fragments.Fragment_Seller_OrderDetails;

/**
* Created by alvin2 on 8/16/15.
*/
public class SellerOrdersAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private List<Order> orderItems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import madelyntav.c4q.nyc.chipchop.DBObjects.Item;
import madelyntav.c4q.nyc.chipchop.DBObjects.Order;
import madelyntav.c4q.nyc.chipchop.DBObjects.Seller;
import madelyntav.c4q.nyc.chipchop.DeliveryDialog;
import madelyntav.c4q.nyc.chipchop.DeliveryDialogFragment;
import madelyntav.c4q.nyc.chipchop.HelperMethods;
import madelyntav.c4q.nyc.chipchop.PaymentDialog;
import madelyntav.c4q.nyc.chipchop.PaymentDialogFragment;
import madelyntav.c4q.nyc.chipchop.R;
import madelyntav.c4q.nyc.chipchop.adapters.CheckoutListAdapter;

Expand Down Expand Up @@ -73,12 +73,12 @@ public void onClick(View view) {
HelperMethods.getCurrentOrder().setToDeliver(false);
}
FragmentManager fm = getActivity().getSupportFragmentManager();
PaymentDialog alertDialog = new PaymentDialog();
PaymentDialogFragment alertDialog = new PaymentDialogFragment();
alertDialog.show(fm, "fragment_alert");
}else {

FragmentManager fm = activity.getSupportFragmentManager();
DeliveryDialog alertDialog = new DeliveryDialog();
DeliveryDialogFragment alertDialog = new DeliveryDialogFragment();
alertDialog.show(fm, "fragment_alert");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
bindViews();
initializeMap();
setListeners();

initializeListPanel();

addSellerMarkers();



return root;
}

Expand Down