// Path: Susurrus/app/src/main/java/rocks/susurrus/susurrus/models/MessageModel.java
// public class MessageModel implements Serializable {
//     static final String LOG_TAG = "MessageModel";
// 
//     /**
//      * Constants
//      */
//     public static final int TEXT_MESSAGE = 1;
//     public static final int IMAGE_MESSAGE = 2;
//     public static final int VIDEO_MESSAGE = 3;
//     public static final int AUDIO_MESSAGE = 4;
//     public static final int FILE_MESSAGE = 5;
// 
//     /**
//      * Attributes
//      */
//     public boolean owner;
//     private InetAddress ownerAddress;
//     private String ownerName;
//     private int messageType;
// 
//     /**
//      * Optional Attributes
//      */
//     private String message;
//     private byte[] stream = null;
//     private int streamLength = 0;
//     private String streamExtension;
//     private String streamName;
// 
//     /**
//      * Model constructor.
//      * Initiates the model.
//      * @param owner
//      * @param ownerName
//      * @param type
//      */
//     public MessageModel(boolean owner, String ownerName, int type) {
//         super();
//         this.owner = owner;
//         this.ownerName = ownerName;
//         this.messageType = type;
//     }
// 
//     /**
//      * Getter/Setter
//      */
//     public String getMessage() {
//         return this.message;
//     }
//     public String getOwnerName() { return this.ownerName; }
//     public InetAddress getOwnerAddress() {
//         return this.ownerAddress;
//     }
//     public int getMessageType() {
//         return this.messageType;
//     }
//     public String getStreamName() {
//         return this.streamName;
//     }
// 
//     public Boolean isOwner() {
//         return this.owner;
//     }
// 
//     public void setMessage(String messageText) {
//         this.message = messageText;
//     }
//     public void setOwnerAddress(InetAddress ip) {
//         this.ownerAddress = ip;
//     }
//     public void setOwnership(boolean hasOwnership) {
//         this.owner = hasOwnership;
//     }
//     public void setStream(byte[] _stream, int _length, String _name, String _extension) {
//         this.stream = _stream;
//         this.streamLength = _length;
//         this.streamName = _name;
//         this.streamExtension = _extension;
//     }
// 
// }
// 
// Path: Susurrus/app/src/main/java/rocks/susurrus/susurrus/models/RoomModel.java
// public class RoomModel implements Serializable {
//     final static String LOG_TAG = "RoomModel";
// 
//     /**
//      * Networking
//      */
//     private String ownerName;
//     private String ownerAddr;
// 
//     /**
//      * Attributes
//      */
//     private String roomName;
//     private String roomCategory;
//     private String roomImage;
//     private boolean roomEncrypted;
//     private int roomMembers;
// 
//     /**
//      * Encryption
//      */
//     private String roomPassword;
// 
//     /**
//      * Constructor.
//      * Sets model attributes.
//      * @param ownerName
//      * @param roomName
//      * @param roomCategory
//      * @param roomImage
//      * @param roomEncrypted
//      */
//     public RoomModel(String ownerName, String roomName, String roomCategory,
//                      String roomImage, boolean roomEncrypted) {
//         this.ownerName = ownerName;
//         this.roomName = roomName;
//         this.roomCategory = roomCategory;
//         this.roomImage = roomImage;
//         this.roomEncrypted = roomEncrypted;
// 
//         Log.d(LOG_TAG, "New room added: " + this.roomName);
//     }
// 
//     /**
//      * Getter/Setter
//      */
//     public void setPassword(String pass) {
//         this.roomPassword = pass;
//     }
//     public void setRoomMembers(int count) {
//         this.roomMembers = count;
//     }
//     public void setOwnerAddr(String addr) {
//         this.ownerAddr = addr;
//     }
// 
//     public String getOwnerName() {
//         return this.ownerName;
//     }
//     public String getRoomPassword() {
//         return this.roomPassword;
//     }
//     public String getOwnerAddr() { return this.ownerAddr; }
//     public String getRoomName() {
//         return this.roomName;
//     }
//     public String getRoomCategory() {
//         return this.roomCategory;
//     }
// 
//     public boolean hasEncryption() {
//         return this.roomEncrypted;
//     }
// 
//     /**
//      * Converts our model to an HashMap (without password).
//      * @return Model attributes as HashMap.
//      */
//     public Map toHashMap() {
//         Map roomMap = new HashMap();
//         roomMap.put("port", String.valueOf(WifiDirectService.SERVICE_PORT));
//         roomMap.put("user_name", this.ownerName);
//         roomMap.put("room_name", this.roomName);
//         roomMap.put("room_category", this.roomCategory);
//         roomMap.put("room_private", String.valueOf(roomEncrypted));
//         roomMap.put("room_image", this.roomImage);
//         roomMap.put("available", "visible");
// 
//         return roomMap;
//     }
// }


import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
import rocks.susurrus.susurrus.R;
import rocks.susurrus.susurrus.models.MessageModel;
import rocks.susurrus.susurrus.models.RoomModel;
package rocks.susurrus.susurrus.adapters;




/**
 * Created by simon on 04.06.15.
 */
public class RoomAdapter extends ArrayAdapter<RoomModel> {
    private static final String LOG_TAG = "RoomAdapter";

// Path: Susurrus/app/src/main/java/rocks/susurrus/susurrus/models/MessageModel.java
// public class MessageModel implements Serializable {
//     static final String LOG_TAG = "MessageModel";
// 
//     /**
//      * Constants
//      */
//     public static final int TEXT_MESSAGE = 1;
//     public static final int IMAGE_MESSAGE = 2;
//     public static final int VIDEO_MESSAGE = 3;
//     public static final int AUDIO_MESSAGE = 4;
//     public static final int FILE_MESSAGE = 5;
// 
//     /**
//      * Attributes
//      */
//     public boolean owner;
//     private InetAddress ownerAddress;
//     private String ownerName;
//     private int messageType;
// 
//     /**
//      * Optional Attributes
//      */
//     private String message;
//     private byte[] stream = null;
//     private int streamLength = 0;
//     private String streamExtension;
//     private String streamName;
// 
//     /**
//      * Model constructor.
//      * Initiates the model.
//      * @param owner
//      * @param ownerName
//      * @param type
//      */
//     public MessageModel(boolean owner, String ownerName, int type) {
//         super();
//         this.owner = owner;
//         this.ownerName = ownerName;
//         this.messageType = type;
//     }
// 
//     /**
//      * Getter/Setter
//      */
//     public String getMessage() {
//         return this.message;
//     }
//     public String getOwnerName() { return this.ownerName; }
//     public InetAddress getOwnerAddress() {
//         return this.ownerAddress;
//     }
//     public int getMessageType() {
//         return this.messageType;
//     }
//     public String getStreamName() {
//         return this.streamName;
//     }
// 
//     public Boolean isOwner() {
//         return this.owner;
//     }
// 
//     public void setMessage(String messageText) {
//         this.message = messageText;
//     }
//     public void setOwnerAddress(InetAddress ip) {
//         this.ownerAddress = ip;
//     }
//     public void setOwnership(boolean hasOwnership) {
//         this.owner = hasOwnership;
//     }
//     public void setStream(byte[] _stream, int _length, String _name, String _extension) {
//         this.stream = _stream;
//         this.streamLength = _length;
//         this.streamName = _name;
//         this.streamExtension = _extension;
//     }
// 
// }
// 
// Path: Susurrus/app/src/main/java/rocks/susurrus/susurrus/models/RoomModel.java
// public class RoomModel implements Serializable {
//     final static String LOG_TAG = "RoomModel";
// 
//     /**
//      * Networking
//      */
//     private String ownerName;
//     private String ownerAddr;
// 
//     /**
//      * Attributes
//      */
//     private String roomName;
//     private String roomCategory;
//     private String roomImage;
//     private boolean roomEncrypted;
//     private int roomMembers;
// 
//     /**
//      * Encryption
//      */
//     private String roomPassword;
// 
//     /**
//      * Constructor.
//      * Sets model attributes.
//      * @param ownerName
//      * @param roomName
//      * @param roomCategory
//      * @param roomImage
//      * @param roomEncrypted
//      */
//     public RoomModel(String ownerName, String roomName, String roomCategory,
//                      String roomImage, boolean roomEncrypted) {
//         this.ownerName = ownerName;
//         this.roomName = roomName;
//         this.roomCategory = roomCategory;
//         this.roomImage = roomImage;
//         this.roomEncrypted = roomEncrypted;
// 
//         Log.d(LOG_TAG, "New room added: " + this.roomName);
//     }
// 
//     /**
//      * Getter/Setter
//      */
//     public void setPassword(String pass) {
//         this.roomPassword = pass;
//     }
//     public void setRoomMembers(int count) {
//         this.roomMembers = count;
//     }
//     public void setOwnerAddr(String addr) {
//         this.ownerAddr = addr;
//     }
// 
//     public String getOwnerName() {
//         return this.ownerName;
//     }
//     public String getRoomPassword() {
//         return this.roomPassword;
//     }
//     public String getOwnerAddr() { return this.ownerAddr; }
//     public String getRoomName() {
//         return this.roomName;
//     }
//     public String getRoomCategory() {
//         return this.roomCategory;
//     }
// 
//     public boolean hasEncryption() {
//         return this.roomEncrypted;
//     }
// 
//     /**
//      * Converts our model to an HashMap (without password).
//      * @return Model attributes as HashMap.
//      */
//     public Map toHashMap() {
//         Map roomMap = new HashMap();
//         roomMap.put("port", String.valueOf(WifiDirectService.SERVICE_PORT));
//         roomMap.put("user_name", this.ownerName);
//         roomMap.put("room_name", this.roomName);
//         roomMap.put("room_category", this.roomCategory);
//         roomMap.put("room_private", String.valueOf(roomEncrypted));
//         roomMap.put("room_image", this.roomImage);
//         roomMap.put("available", "visible");
// 
//         return roomMap;
//     }
// }


// Path: Susurrus/app/src/main/java/rocks/susurrus/susurrus/adapters/RoomAdapter.java
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
import rocks.susurrus.susurrus.R;
import rocks.susurrus.susurrus.models.MessageModel;
import rocks.susurrus.susurrus.models.RoomModel;

package rocks.susurrus.susurrus.adapters;




/**
 * Created by simon on 04.06.15.
 */
public class RoomAdapter extends ArrayAdapter<RoomModel> {
    private static final String LOG_TAG = "RoomAdapter";

    private ArrayList<RoomModel> roomList = new ArrayList<RoomModel>();