use of com.example.asus.onlinecanteen.adapter.OrderAdapter in project OnlineCanteen by josephgunawan97.
the class MerchantOrderListFragment method detachDatabaseReadListener.
private void detachDatabaseReadListener() {
if (eventListener != null) {
adapter.notifyDataSetChanged();
transactions = new ArrayList<Transaction>();
adapter = new OrderAdapter(transactions);
databaseProducts.removeEventListener(eventListener);
eventListener = null;
}
}
use of com.example.asus.onlinecanteen.adapter.OrderAdapter in project OnlineCanteen by josephgunawan97.
the class MerchantOrderListFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_main_activity_merchant_order, container, false);
// Inflate the layout for this fragment
swipeLayout = (SwipeRefreshLayout) view.findViewById(R.id.swiperefresh);
swipeLayout.setOnRefreshListener(this);
swipeLayout.setColorSchemeResources(R.color.colorPrimary, R.color.colorPrimaryDark, R.color.colorPrimaryLight);
// Initialize References
databaseTransaction = FirebaseDatabase.getInstance().getReference("transactions");
databaseProducts = FirebaseDatabase.getInstance().getReference("products");
databaseStore = FirebaseDatabase.getInstance().getReference("store");
transactions = new ArrayList<Transaction>();
adapter = new OrderAdapter(transactions);
firebaseAuth = FirebaseAuth.getInstance();
merchant = firebaseAuth.getCurrentUser();
recyclerView = view.findViewById(R.id.list);
layoutManager = new LinearLayoutManager(view.getContext());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(adapter);
return view;
}
Aggregations