We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
Model Class
`public class ImageModel implements AsymmetricItem { private int columnSpan; private int rowSpan; private int position; private String img;
public ImageModel(String img) { this(1, 1, 0); this.img = img; }
public ImageModel(int columnSpan, int rowSpan, int position) { this.columnSpan = columnSpan; this.rowSpan = rowSpan; this.position = position; } public ImageModel(Parcel in) { readFromParcel(in); } @Override public int getColumnSpan() { return columnSpan; } @Override public int getRowSpan() { return rowSpan; } public int getPosition() { return position; } @Override public String toString() { return String.format("%s: %sx%s", position, rowSpan, columnSpan); } @Override public int describeContents() { return 0; } private void readFromParcel(Parcel in) { columnSpan = in.readInt(); rowSpan = in.readInt(); position = in.readInt(); } @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeInt(columnSpan); dest.writeInt(rowSpan); dest.writeInt(position); } /* Parcelable interface implementation */ public final Parcelable.Creator<ImageModel> CREATOR = new Parcelable.Creator<ImageModel>() { @Override public ImageModel createFromParcel(@NonNull Parcel in) { return new ImageModel(in); } @Override @NonNull public ImageModel[] newArray(int size) { return new ImageModel[size]; } }; }`
My Adapter class
`public class DefaultListAdapter extends BaseAdapter {
private List<ImageModel> items; public DefaultListAdapter(Context context, List<ImageModel> items) { this.items = items; } @Override public int getCount() { return items.size(); } @Override public Object getItem(int position) { return items.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View view, @NonNull ViewGroup parent) { if (view == null) { LayoutInflater layoutInflater = LayoutInflater.from(getContext()); view = layoutInflater.inflate(R.layout.gallery_view_event_creation, null); } ImageView mImage = (ImageView) view.findViewById(R.id.img); ImageUtil.LoadImage(getContext(), items.get(position).img, mImage); return view; } public void appendItem(ImageModel newItems) { this.items.add(newItems); notifyDataSetChanged(); } }
`
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: