How to set the space inside the grid view after three elements in each row?

The expected view is given below:
.
This is my main activity code. please check my screen, which I cited above I want space inside the grid in android, How to provide space inside the grid in 3 elements on each row?
public void submit() { String URLL= "https://api.myjson.com/bins/14h7rp"; StringRequest stringRequest = new StringRequest(Request.Method.GET, URLL, new Response.Listener<String>() { @Override public void onResponse(String response) { try { JSONObject object=new JSONObject(response); String status=object.getString("Status"); String Data=object.getJSONObject("Data").getString("Seat_details"); JSONArray jsonArray=new JSONArray(Data); for (int i=0;i<jsonArray.length();i++){ JSONObject J=jsonArray.getJSONObject(i); String seats=J.getString("seats"); JSONArray jsonArray1=new JSONArray(seats); for (int k=0;k<jsonArray1.length();k++){ JSONObject l=jsonArray1.getJSONObject(k); String id=l.getString("id"); String name=l.getString("name"); String bookedStatus=l.getString("bookedStatus"); m=new Model(); m.setId(id); m.setName(name); m.setBookedStatus(bookedStatus); arrayList.add(m); } } } catch (JSONException e) { e.printStackTrace(); } adapter=new MainActivityAdapter(arrayList,MainActivity.this); recyclerView.setAdapter(adapter); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { } }) { @Override } }
my Recylerview initialization is below
private void init_views() { recyclerView=(RecyclerView)findViewById(R.id.recyclerview); int spacingInPixels = getResources().getDimensionPixelSize(R.dimen.spacing); recyclerView.addItemDecoration(new SpacesItemDecoration(spacingInPixels)); recyclerView.setHasFixedSize(true); RecyclerView.LayoutManager layoutManager = new GridLayoutManager(getApplicationContext(),5); recyclerView.setLayoutManager(layoutManager); }
source share