Search in sources :

Example 1 with OutputListItem

use of org.gateshipone.malp.application.listviewitems.OutputListItem in project malp by gateship-one.

the class OutputAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    MPDOutput output = (MPDOutput) getItem(position);
    // Profile name
    String outputName = output.getOutputName();
    int outputId = output.getID();
    boolean active = output.getOutputState();
    if (convertView == null) {
        // Create a new View and not reuse it
        convertView = new OutputListItem(mContext, outputName, active, outputId);
    } else {
        OutputListItem outputItem = (OutputListItem) convertView;
        outputItem.setName(outputName);
        outputItem.setChecked(active);
    }
    return convertView;
}
Also used : MPDOutput(org.gateshipone.malp.mpdservice.mpdprotocol.mpdobjects.MPDOutput) OutputListItem(org.gateshipone.malp.application.listviewitems.OutputListItem)

Aggregations

OutputListItem (org.gateshipone.malp.application.listviewitems.OutputListItem)1 MPDOutput (org.gateshipone.malp.mpdservice.mpdprotocol.mpdobjects.MPDOutput)1