Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onBindViewHolder(InstalledFontViewRecyclerAdapter.ViewHolder holder, int position) {
- if (//Some Condition) {
- holder.itemView.setBackgroundColor(Color.GREY);
- }
- else {
- holder.itemView.setBackgroundColor(Color.RED);
- }
- }
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical" android:layout_width="match_parent"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_height="match_parent"
- >
- <android.support.v7.widget.RecyclerView
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- app:layout_behavior="@string/appbar_scrolling_view_behavior"
- android:id="@+id/installed_recyclerView"
- android:paddingTop="1dp"
- ></android.support.v7.widget.RecyclerView>
- </LinearLayout>
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical" android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:elevation="3dp"
- android:paddingBottom="1dp"
- android:clickable="true"
- android:focusable="true"
- android:focusableInTouchMode="true"
- >
- <android.support.v7.widget.CardView
- xmlns:card_view="http://schemas.android.com/apk/res-auto"
- android:id="@+id/post_card_view"
- android:layout_gravity="center"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- card_view:cardCornerRadius="1dp"
- >
- //Many things here like buttons etx
- </android.support.v7.widget.CardView>
- </LinearLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement