use of com.example.asus.onlinecanteen.adapter.ProductListAdapter in project OnlineCanteen by josephgunawan97.
the class MerchantProductListFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_main_activity_merchant, container, false);
// Inflate the layout for this fragment
ArrayList<Product> productArrayList = new ArrayList<>();
menuListAdapter = new ProductListAdapter((Activity) container.getContext(), productArrayList);
swipeLayout = (SwipeRefreshLayout) view.findViewById(R.id.swiperefresh);
swipeLayout.setOnRefreshListener(this);
swipeLayout.setColorSchemeResources(R.color.colorPrimary, R.color.colorPrimaryDark, R.color.colorPrimaryLight);
firebaseAuth = FirebaseAuth.getInstance();
merchant = firebaseAuth.getCurrentUser();
// Initialize References
databaseUsers = FirebaseDatabase.getInstance().getReference("users");
databaseProducts = FirebaseDatabase.getInstance().getReference("products");
databaseStore = FirebaseDatabase.getInstance().getReference("store");
// Initialize ListView
productListView = view.findViewById(R.id.gridview);
productListView.setAdapter(menuListAdapter);
return view;
}
Aggregations