public void setImages(String[] pics) { adapter.setFiles(pics); if (resourceId != -1) { ((Gallery) container.$form().findViewById(resourceId)).setAdapter(adapter); ((Gallery) container.$form().findViewById(resourceId)).requestLayout(); } else { view.setAdapter(adapter); view.requestLayout(); } }
public ImageGallery(ComponentContainer container, String[] picnames, int[] basestyle) { super(container); view = new Gallery(container.$context()); adapter = new ImageAdapter(container.$context(), basestyle); adapter.setFiles(picnames); view.setAdapter(adapter); view.setOnItemClickListener(this); container.$add(this); view.requestLayout(); }
public void setPicSize(int width, int height) { adapter.setWidth(width); adapter.setHeight(height); if (resourceId != -1) { ((Gallery) container.$form().findViewById(resourceId)).setAdapter(adapter); ((Gallery) container.$form().findViewById(resourceId)).requestLayout(); } else { view.setAdapter(adapter); view.requestLayout(); } }
public ImageGallery( ComponentContainer container, String[] picnames, int[] basestyle, int resourceId) { super(container, resourceId); view = null; Gallery view = (Gallery) container.$form().findViewById(resourceId); adapter = new ImageAdapter(container.$context(), basestyle); adapter.setFiles(picnames); view.setAdapter(adapter); view.setOnItemClickListener(this); view.requestLayout(); }