Code example for ViewGroup.MarginLayoutParams

Methods: setMargins

		public Object instantiateItem(ViewGroup container, int position) {
			ImageView item = new ImageView(mContext);
			MarginLayoutParams params = new MarginLayoutParams(MarginLayoutParams.MATCH_PARENT, MarginLayoutParams.MATCH_PARENT);
			params.setMargins(10, 0, 10, 0);
			String imageUrl = mData.get(position);
			if (imageUrl == null){
				Log.e(TAG, "instantiateItem | oups mo is null");
				return item;
			//disable hardware acceleration to render this view, because some of the image are too large to be uploaded as a opengl texture 
			// avoid error | W/OpenGLRenderer: Bitmap too large to be uploaded into a texture 
//			Log.e(TAG, "is imageview hardware accelerated before:" + coverImgView.isHardwareAccelerated());