I am using a recycler view in one of my activities and I am populating that recycler view using an ArrayList
. However, I wish to hide an element (which is in the layout file example_item.xml
). Is there a way I can do this?
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.circularreveal.CircularRevealRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:numberpicker="http://schemas.android.com/apk/res-auto"
tools:context=".FlightResults">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/darker_gray"
android:padding="4dp"
android:scrollbars="vertical">
</android.support.v7.widget.RecyclerView>
</android.support.design.circularreveal.CircularRevealRelativeLayout>
Xml layout of the activity I'm working in.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginBottom="4dp"
app:cardCornerRadius="4dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="4dp">
<ImageView
android:id="@+id/outbound"
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="2dp"
android:src="@drawable/ic_return"/>
<TextView
android:id="@+id/fromTo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/outbound"
android:text="From - To"
android:textColor="@android:color/black"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/fromTo"
android:layout_marginStart="8dp"
android:layout_toEndOf="@+id/outbound"
android:text="Time leaving - time arriving"
android:textSize="15sp" />
<ImageView
android:id="@+id/returning"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_below="@+id/outbound"
android:padding="2dp"
android:src="@drawable/ic_outbound"/>
<TextView
android:id="@+id/fromTo2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:layout_toEndOf="@+id/returning"
android:layout_below="@id/time"
android:text="From - To"
android:textColor="@android:color/black"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/time2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/fromTo2"
android:layout_marginStart="8dp"
android:layout_toEndOf="@+id/returning"
android:text="Time leaving - time arriving"
android:textSize="15sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
Layout i wish to change (an element from this layout - id:returning)