title: Android CardView padding error
body: <h1>---TLDR---</h1>
  <p>I'm following a tutorial where with the help of cardview and recyclerview i should be able to list text beneath each other like this :
  how it should kind of look like(the image isn't needed)
  <img src="https://i.stack.imgur.com/mZo2g.png" alt="" /></p>
  <p>how it actually looks</p>
  <p><img src="https://i.stack.imgur.com/BRjbu.png" alt="" /></p>
  <h1>---PROBLEM---</h1>
  <p>As the title states and as it can be seen on the picture, it seems like theres a huge padding between 2 cardview item, which obviously isn't something i would like to have. I want them to be close to eachother, as it can be seen on the other picture.</p>
  <p><em><strong>Please keep in mind that im an ultra-beginner programmer :D. Thanks for all answers in advance.</strong></em></p>
  <h1>---CODE---</h1>
  <p><em><strong>cards_layout.xml</strong></em></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout
      xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:orientation=&quot;vertical&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:tag=&quot;cards main container&quot;&gt;
  
          &lt;android.support.v7.widget.CardView
              android:layout_width=&quot;300dp&quot;
              android:layout_height=&quot;60dp&quot;
              xmlns:card_view=&quot;http://schemas.android.com/apk/res-auto&quot;
              card_view:cardElevation=&quot;5dp&quot;
              card_view:cardUseCompatPadding=&quot;true&quot;
              card_view:cardBackgroundColor=&quot;#FFF&quot;
              android:id=&quot;@+id/card_view&quot;
              android:layout_gravity=&quot;center_horizontal&quot;&gt;
                  &lt;LinearLayout
                      android:layout_width=&quot;match_parent&quot;
                      android:layout_height=&quot;wrap_content&quot;
                      android:orientation=&quot;vertical&quot;&gt;
  
                      &lt;TextView
                          android:layout_width=&quot;match_parent&quot;
                          android:layout_height=&quot;wrap_content&quot;
                          android:layout_gravity=&quot;center_horizontal&quot;
                          android:layout_marginTop=&quot;10dp&quot;
                          android:text=&quot;Marketing Tip&quot;
                          android:id=&quot;@+id/textviewName&quot;
                          android:textColor=&quot;#000&quot;/&gt;
  
                  &lt;/LinearLayout&gt;
  
          &lt;/android.support.v7.widget.CardView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  <p><em><strong>HomeActivity.java</strong></em></p>
  <pre><code>import android.content.Context;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.support.v7.widget.DefaultItemAnimator;
  import android.support.v7.widget.LinearLayoutManager;
  import android.support.v7.widget.RecyclerView;
  import android.view.View;
  
  import java.util.ArrayList;
  
  public class HomeActivity extends AppCompatActivity {
  
      private static RecyclerView.Adapter adapter;
      private RecyclerView.LayoutManager layoutManager;
      private static RecyclerView recyclerView;
      private static ArrayList&lt;DataModel&gt; data;
      static View.OnClickListener myOnClickListener;
  
  
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_home);
  
          setTitle(&quot;Home&quot;);
  
  
          myOnClickListener = new myOnClickListener(this);
  
  
          recyclerView = (RecyclerView) findViewById(R.id.my_recycler_view);
          recyclerView.setHasFixedSize(true);
  
          layoutManager = new LinearLayoutManager(this);
          recyclerView.setLayoutManager(layoutManager);
          recyclerView.setItemAnimator(new DefaultItemAnimator());
  
          data = new ArrayList&lt;DataModel&gt;();
          for (int i = 0; i &lt; MyData.nameArray.length; i++) {
              data.add(new DataModel(
                      MyData.nameArray[i],
                      MyData.id_[i]
              ));
  
              adapter = new CustomAdapter(data);
              recyclerView.setAdapter(adapter);
  
          }
  
      }
  
          private static class myOnClickListener implements View.OnClickListener {
  
              private final Context context;
  
              private myOnClickListener(Context context) {
                  this.context = context;
              }
  
              @Override
              public void onClick(View v) {
                  //TODO WRITE THE CODE TO START AN ACTIVITY ONCE THE CARDVIEW IS CLICKED
              }
          }
  
  }
  </code></pre>
  <p><em><strong>CustomAdapter.java</strong></em></p>
  <pre><code>import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.TextView;
  
  import java.util.ArrayList;
  
  public class CustomAdapter extends RecyclerView.Adapter&lt;CustomAdapter.MyViewHolder&gt;{
  
      private ArrayList&lt;DataModel&gt; dataSet;
  
      public static class MyViewHolder extends RecyclerView.ViewHolder {
  
          TextView textviewName;
  
  
          public MyViewHolder(View itemView) {
              super(itemView);
              this.textviewName = (TextView)itemView.findViewById(R.id.textviewName);
  
          }
      }
  
      public CustomAdapter(ArrayList&lt;DataModel&gt; data){
          this.dataSet = data;
  
      }
  
      @Override
      public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.cards_layout, parent, false);
          view.setOnClickListener(HomeActivity.myOnClickListener);
  
          MyViewHolder myViewHolder = new MyViewHolder(view);
  
          return myViewHolder;
      }
  
      @Override
      public void onBindViewHolder(final MyViewHolder holder, final int listPosition) {
  
          TextView textviewName = holder.textviewName;
  
          textviewName.setText(dataSet.get(listPosition).getName());
  
  
      }
  
      @Override
      public int getItemCount() {
          return dataSet.size();
      }
  }
  </code></pre>
  <p><em><strong>DataModel.java</strong></em></p>
  <pre><code>public class DataModel {
      String name;
      int id_;
  
      public DataModel(String name, int id_) {
  
          this.name = name;
          this.id_ = id_;
      }
  
      public String getName() {
          return name;
      }
  
      public int getId() {
          return id_;
      }
  }
  </code></pre>
  <p><em><strong>MyData.java</strong></em></p>
  <pre><code>public class MyData {
  
      static String[] nameArray = {&quot;Buzi&quot;, &quot;Kocsog&quot;, &quot;Fostalicska&quot;, &quot;CiganyTibi&quot;};
  
      static Integer[] id_ = {0, 1, 2, 3};
  }
  </code></pre>