Created
March 7, 2014 07:10
-
-
Save sudhanshuraheja/9406766 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public View getView(int position, View convertView, ViewGroup paramViewGroup) { | |
Object current_event = mObjects.get(position); | |
ViewHolder holder = null; | |
if (convertView == null) { | |
holder = new ViewHolder(); | |
convertView = inflater.inflate(R.layout.row_event, null); | |
holder.ThreeDimension = (ImageView) convertView.findViewById(R.id.ThreeDim); | |
holder.EventPoster = (ImageView) convertView.findViewById(R.id.EventPoster); | |
convertView.setTag(holder); | |
} else { | |
holder = (ViewHolder) convertView.getTag(); | |
} | |
// If you have conditions like below then you may face problem | |
if (doesSomeComplexChecking()) { | |
holder.ThreeDimention.setVisibility(View.VISIBLE); | |
} else { | |
holder.ThreeDimention.setVisibility(View.GONE); | |
} | |
// This method is setting layout parameters each time when getView is getting called which is wrong. | |
RelativeLayout.LayoutParams imageParams = new RelativeLayout.LayoutParams(measuredwidth, rowHeight); | |
holder.EventPoster.setLayoutParams(imageParams); | |
return convertView; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment