Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. public void onBindViewHolder(InstalledFontViewRecyclerAdapter.ViewHolder holder, int position) {
  2.  
  3. if (//Some Condition) {
  4. holder.itemView.setBackgroundColor(Color.GREY);
  5. }
  6. else {
  7. holder.itemView.setBackgroundColor(Color.RED);
  8. }
  9. }
  10.  
  11. <?xml version="1.0" encoding="utf-8"?>
  12. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  13. android:orientation="vertical" android:layout_width="match_parent"
  14. xmlns:app="http://schemas.android.com/apk/res-auto"
  15. android:layout_height="match_parent"
  16. >
  17. <android.support.v7.widget.RecyclerView
  18. android:layout_width="match_parent"
  19. android:layout_height="match_parent"
  20. app:layout_behavior="@string/appbar_scrolling_view_behavior"
  21. android:id="@+id/installed_recyclerView"
  22. android:paddingTop="1dp"
  23. ></android.support.v7.widget.RecyclerView>
  24. </LinearLayout>
  25.  
  26. <?xml version="1.0" encoding="utf-8"?>
  27. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  28. android:orientation="vertical" android:layout_width="match_parent"
  29. android:layout_height="wrap_content"
  30. android:elevation="3dp"
  31. android:paddingBottom="1dp"
  32. android:clickable="true"
  33. android:focusable="true"
  34. android:focusableInTouchMode="true"
  35.  
  36. >
  37.  
  38. <android.support.v7.widget.CardView
  39. xmlns:card_view="http://schemas.android.com/apk/res-auto"
  40. android:id="@+id/post_card_view"
  41. android:layout_gravity="center"
  42. android:layout_width="match_parent"
  43. android:layout_height="wrap_content"
  44. card_view:cardCornerRadius="1dp"
  45. >
  46.  
  47. //Many things here like buttons etx
  48.  
  49. </android.support.v7.widget.CardView>
  50. </LinearLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement