androidandroid-layoutandroid-recyclerviewspacingandroid-screen-support

Android spacing issue in same resolution devices 1080x1920


I am designing screen from Zeplin. (Zeplin provides each item attributes in dp)

Following is the horizontal recycler view design example with 4 items from Zeplin.

zeplin

360 dp means 1080 for xxhdpi devices

dp to px

I am testing my code on two 1080 devices with different dpi

  1. Samsung c5 [1080 x 1920 pixels, 16:9 ratio (480dpi)]
  2. Nexus 5X [1080 x 1920 pixels, 16:9 ratio (420dpi)]

I am facing spacing issue in Nexus-5x, the Zeplin design works great on Samsung-c5.

Samsung c5 result

Samsung-c5 result

Nexus 5x result

Nexus-5x result - spacing issue in horizontal recycler view

QUESTION:

Why the design in different on same resolution (1080x1920) devices (different dpi). How can I make it look same on each and every device like facebook does with its status


Similar Questions:

  1. How to use 1080x1920: 420 dpi - Android studio

  2. Android xxhdpi, 420 dpi and 480 dpi

  3. XXHDPI Layout different on different XXHDPI devices

  4. Sol1 - Calculator app different layout on same screen size but different DPI (420 DPI vs 480 DPI) - Android Developer

  5. Sol2 - Android layout folders for different screen sizes


Solution

  • Placing dimens in values-w410dp worked, as mentioned in the answer here