Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. public View getView(int position, View convertView, ViewGroup parent) {
  2. View vi=convertView;
  3. int[] colors = new int[] { 0x30ffffff, 0x30808080 };
  4. Galeria city = items.get(position);
  5. String color =city.getEquipo().toString();
  6. if(convertView == null) {
  7. LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  8. vi = inflater.inflate(R.layout.activity_main, null);
  9. }
  10.  
  11. ImageView image3 = (ImageView) vi.findViewById(R.id.imgCel);
  12. //image3.setImageBitmap(city.getPhoto());
  13.  
  14. ImageView image2 = (ImageView) vi.findViewById(R.id.imgRojo);
  15.  
  16. if (position<=5){
  17. image3.setVisibility(View.VISIBLE);
  18. image2.setVisibility(View.GONE);
  19. }else{
  20.  
  21. image2.setVisibility(View.VISIBLE);
  22. image3.setVisibility(View.GONE);
  23.  
  24. }
  25.  
  26. if(position<3) {
  27. view.setBackgroundColor(Color.RED);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement