title: Imageview looks different on different size and density
body: <p>I've made a Viewpager with swipe-able fragments where you can see a partial view of the other fragment. The fragments have a single imageview and that is what is shown. I've tried running my code on different emulators and the result is always different. How can I make it so it looks the same on all screen sizes?
  This is the fragment containing the viewpager and buttons:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
           xmlns:tools="http://schemas.android.com/tools"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           tools:context="com.example.digital05.masu.Fragments.MassageViewFragment"&gt;
  
  &lt;android.support.v4.view.ViewPager
      android:layout_width="match_parent"
      android:layout_height="150dp"
      android:id="@+id/massageViewPager"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:layout_alignParentTop="true"&gt;
  &lt;/android.support.v4.view.ViewPager&gt;
  
  &lt;Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Date"
      android:id="@+id/buttonDate"
      android:layout_below="@+id/massageViewPager"
      android:layout_alignLeft="@+id/buttonTime"
      android:layout_alignStart="@+id/buttonTime"
      android:layout_marginTop="43dp"/&gt;
  
  &lt;Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Time"
      android:id="@+id/buttonTime"
      android:layout_below="@+id/buttonDate"
      android:layout_centerHorizontal="true"/&gt;
  </code></pre>
  
  <p>This is how the fragments look like:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:tools="http://schemas.android.com/tools"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              tools:context="com.example.digital05.masu.Fragments.SwedishMFragment"&gt;
  
  &lt;ImageView
      android:id="@+id/imageView2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center_horizontal"
      android:layout_marginTop="58dp"
      android:src="@drawable/prenatal_massage"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>And this is how I set the viewpager to show the partial view of other fragments(their imageviews):</p>
  
  <pre><code>mViewPager.setClipToPadding(false);
  mViewPager.setPadding(300, 0, 300, 0);
  mViewPager.setPageMargin(50);
  </code></pre>
  
  <p>And this is the output I get:</p>
  
  <p><a href="https://i.stack.imgur.com/rZUNV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rZUNV.png" alt="enter image description here"></a></p>
  
  <p>How can I make it so all of them look the same like on the Nexus 6P? Do I need to convert the dp to px or vice versa and how to do that?
  Thank you!</p>