Android Open Source - WarehouseBarcode Work Order Adapter






From Project

Back to project page WarehouseBarcode.

License

The source code is released under:

MIT License

If you think the Android project WarehouseBarcode listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.hlgranite.warehousescanner;
/*ww w  . ja  va 2 s .c  o m*/
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.text.DateFormat;
import java.util.ArrayList;

/**
 * Created by yeang-shing.then on 9/27/13.
 */
public class WorkOrderAdapter extends ArrayAdapter<WorkOrder> {
    private final Context context;
    private final ArrayList<WorkOrder> values;

    public WorkOrderAdapter(Context context, ArrayList<WorkOrder> values) {
        super(context, R.layout.layout_workorder, values);
        this.context = context;
        this.values = values;
    }

    public View getView(int position, View contentView, ViewGroup parent) {

        LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View rowView = inflater.inflate(R.layout.layout_workorder, parent, false);

        WorkOrder order = values.get(position);

        TextView textView = (TextView)rowView.findViewById(R.id.textView);
        textView.setText(order.getBarcode().toString());
        // see http://developer.android.com/reference/java/text/SimpleDateFormat.html
        TextView textView3 = (TextView)rowView.findViewById(R.id.textView3);
        textView3.setText(DateFormat.getDateTimeInstance().format(order.getDate()));

        TextView textView2 = (TextView)rowView.findViewById(R.id.textView2);
        textView2.setText(order.getCustomer());
        TextView textView4 = (TextView)rowView.findViewById(R.id.textView4);
        textView4.setText(order.getReference());

        return rowView;
    }

}




Java Source Code List

com.hlgranite.Utils.java
com.hlgranite.warehousescanner.AboutActivity.java
com.hlgranite.warehousescanner.AreaComparator.java
com.hlgranite.warehousescanner.Area.java
com.hlgranite.warehousescanner.BalanceActivity.java
com.hlgranite.warehousescanner.Barcode.java
com.hlgranite.warehousescanner.CheckoutActivity.java
com.hlgranite.warehousescanner.Customer.java
com.hlgranite.warehousescanner.FusionManager.java
com.hlgranite.warehousescanner.HistoryActivity.java
com.hlgranite.warehousescanner.InventoryAdapter.java
com.hlgranite.warehousescanner.InventoryExpandableAdapter.java
com.hlgranite.warehousescanner.MainActivity.java
com.hlgranite.warehousescanner.ManualActivity.java
com.hlgranite.warehousescanner.QuantityComparator.java
com.hlgranite.warehousescanner.SettingsActivity.java
com.hlgranite.warehousescanner.ShipCode.java
com.hlgranite.warehousescanner.Shipment.java
com.hlgranite.warehousescanner.StockCodeComparator.java
com.hlgranite.warehousescanner.Stock.java
com.hlgranite.warehousescanner.Unit.java
com.hlgranite.warehousescanner.Warehouse.java
com.hlgranite.warehousescanner.WorkOrderAdapter.java
com.hlgranite.warehousescanner.WorkOrder.java