title: Is it possible to make webview responsive in cardview or recyclerview?
body: <p>MainActivity.java</p>
  
  <pre><code>import android.content.Context;
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.LinearLayoutManager;
  import android.support.v7.widget.RecyclerView;
  import android.view.View;
  import android.widget.Button;
  
  import com.android.volley.Request;
  import com.android.volley.RequestQueue;
  import com.android.volley.Response;
  import com.android.volley.VolleyError;
  import com.android.volley.toolbox.JsonArrayRequest;
  import com.android.volley.toolbox.Volley;
  
  import org.json.JSONArray;
  import org.json.JSONException;
  import org.json.JSONObject;
  
  import java.util.ArrayList;
  import java.util.List;
  
  public class MainActivity extends AppCompatActivity {
      Context mContext;
      RecyclerView recyclerView;
      RecyclerView.LayoutManager layoutManager;
      Button start;
     // TextView textView;
      RequestQueue requestQueue;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
  
          start = (Button)findViewById(R.id.button);
          requestQueue = Volley.newRequestQueue(this);
          start.setOnClickListener(new View.OnClickListener(){
              @Override
              public void onClick(final View view) {
                  JsonArrayRequest jsonObjectRequest = new JsonArrayRequest(Request.Method.GET, "http://192.168.0.103:3001", new Response.Listener&lt;JSONArray&gt;() {
  
                      @Override
                      public void onResponse(JSONArray response) {
                          try {
                              System.out.println(response);
                              for(int i = 0; i &lt; response.length();i++){
  
                                  JSONObject json_res = response.getJSONObject(i);
  
                                  RecyclerAdapter.embed_html.add(json_res.getString("v.embed_html"));
  
                              }
  
                          //Recycler View Setup
                          recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
                          layoutManager = new LinearLayoutManager(MainActivity.this);
                          recyclerView.setLayoutManager(layoutManager);
                          RecyclerAdapter adapter = new RecyclerAdapter(getApplicationContext());
                          recyclerView.setAdapter(adapter);
                          }catch (JSONException e){
                              e.printStackTrace();
                              System.out.println(e);                        }
                      }
                      },
                      new Response.ErrorListener(){
                          @Override
                                  public void onErrorResponse(VolleyError error){
                                      System.out.println(error);
                          }
                  }
                  );
                 requestQueue.add(jsonObjectRequest);
              }
          });
  
      }
  }
  </code></pre>
  
  <p>RecyclerAdapter.java</p>
  
  <pre><code>import android.content.Context;
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.MotionEvent;
  import android.view.View;
  import android.view.ViewGroup;
  import android.webkit.WebView;
  import android.widget.ImageView;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import newsee.novasyslabs.com.nodefetch.Others.CircularTransform;
  
  import com.squareup.picasso.MemoryPolicy;
  import com.squareup.picasso.Picasso;
  
  import java.io.File;
  import java.util.ArrayList;
  
  public class RecyclerAdapter extends RecyclerView.Adapter&lt;RecyclerAdapter.ViewHolder&gt; {
      Context mContext;
      public static ArrayList &lt;String&gt; embed_html = new ArrayList&lt;&gt;();
  
      public RecyclerAdapter(Context mContext){
          this.mContext = mContext;
      }
  
      class ViewHolder extends RecyclerView.ViewHolder{
  
  
          WebView webView;
          public ViewHolder(View itemView) {
              super(itemView);
              this.webView = (WebView) itemView.findViewById(R.id.web);
  
          }
      }
  
      @Override
      public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
          View v = LayoutInflater.from(viewGroup.getContext())
                  .inflate(R.layout.layout_card, viewGroup, false);
          ViewHolder viewHolder = new ViewHolder(v);
          return viewHolder;
      }
  
      @Override
      public void onBindViewHolder(final ViewHolder holder, final int position) {
              holder.webView.getSettings().setJavaScriptEnabled(true);
              holder.webView.loadData(embed_html.get(position), "text/html", "utf-8");
  
          }
      @Override
      public int getItemCount() {
          return embed_html.size();
      }
  }
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      tools:context="newsee.novasyslabs.com.nodefetch.MainActivity"&gt;
  
      &lt;Button
          android:text="Request"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/button"
          android:layout_alignStart="@+id/appBarLayout"
          /&gt;
  
  
      &lt;android.support.design.widget.AppBarLayout
          android:layout_height="wrap_content"
          android:layout_width="match_parent"
          android:id="@+id/appBarLayout" /&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/recycler_view"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_below="@+id/appBarLayout"
          android:layout_marginTop="82dp"
          /&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>layout_card.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
    &gt;
              &lt;WebView
                  android:id="@+id/web"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:layout_centerVertical="true"
                  android:background="#000000"
                  android:layout_alignParentTop="true"
                  /&gt;
  
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>I'm trying to set my webview in cardview and it is working fine but the I'm facing that when I run on 5.5 inch phone then it goes out of the screen and when i run my code on tablet it cover the whole screen.
  I want it to be like. It fit on that card with wrap_content height and and fill the parent when I run app on any of the device. whether Tab or Mobile.
  Please help me I m new to android.
  Thanks in Advance!!!</p>
  
  <p><a href="https://i.stack.imgur.com/I7uaY.jpg" rel="nofollow noreferrer">click here to see image</a></p>