Search in sources :

Example 1 with ProfileListItem

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

the class ProfileAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    MPDServerProfile profile = (MPDServerProfile) getItem(position);
    // Profile name
    String profileName = profile.getProfileName();
    int port = profile.getPort();
    String portString = String.valueOf(port);
    String hostname = profile.getHostname();
    boolean checked = profile.getAutoconnect();
    if (convertView != null) {
        ProfileListItem profileListItem = (ProfileListItem) convertView;
        profileListItem.setProfileName(profileName);
        profileListItem.setHostname(hostname);
        profileListItem.setPort(portString);
        profileListItem.setChecked(checked);
    } else {
        convertView = new ProfileListItem(mContext, profileName, hostname, portString, checked);
    }
    return convertView;
}
Also used : ProfileListItem(org.gateshipone.malp.application.listviewitems.ProfileListItem) MPDServerProfile(org.gateshipone.malp.mpdservice.profilemanagement.MPDServerProfile)

Aggregations

ProfileListItem (org.gateshipone.malp.application.listviewitems.ProfileListItem)1 MPDServerProfile (org.gateshipone.malp.mpdservice.profilemanagement.MPDServerProfile)1