Search in sources :

Example 1 with TransactionHistoryAdapter

use of com.example.asus.onlinecanteen.adapter.TransactionHistoryAdapter in project OnlineCanteen by josephgunawan97.

the class TransactionCurrentOrderFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    getActivity().setTitle("On-Progress");
    ArrayList<Transaction> transactions = new ArrayList<>();
    adapter = new TransactionHistoryAdapter(this);
    adapter.setTransactionHistory(transactions);
    recyclerView = view.findViewById(R.id.current_recycler_view);
    layoutManager = new LinearLayoutManager(getContext());
    recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setAdapter(adapter);
}
Also used : Transaction(com.example.asus.onlinecanteen.model.Transaction) ArrayList(java.util.ArrayList) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) TransactionHistoryAdapter(com.example.asus.onlinecanteen.adapter.TransactionHistoryAdapter)

Example 2 with TransactionHistoryAdapter

use of com.example.asus.onlinecanteen.adapter.TransactionHistoryAdapter in project OnlineCanteen by josephgunawan97.

the class TransactionHistoryFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    getActivity().setTitle(R.string.history_title_item);
    ArrayList<Transaction> transactions = new ArrayList<>();
    adapter = new TransactionHistoryAdapter(this);
    adapter.setTransactionHistory(transactions);
    recyclerView = view.findViewById(R.id.history_recycler_view);
    layoutManager = new LinearLayoutManager(getContext());
    recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setAdapter(adapter);
}
Also used : Transaction(com.example.asus.onlinecanteen.model.Transaction) ArrayList(java.util.ArrayList) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) TransactionHistoryAdapter(com.example.asus.onlinecanteen.adapter.TransactionHistoryAdapter)

Aggregations

DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)2 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 TransactionHistoryAdapter (com.example.asus.onlinecanteen.adapter.TransactionHistoryAdapter)2 Transaction (com.example.asus.onlinecanteen.model.Transaction)2 ArrayList (java.util.ArrayList)2