How to add layouts for both Galaxy S7 and S8


(Quint Rahaman) #1

How does one add a layout for a device when the width is the same but the heights different? For example, the CSS width for the S7 is 360 px (height: 640 px) and for the S8, the width is 360 px (height: 740 px). In Hype, I am unable to add another layout where the width is exactly the same.


(Quint Rahaman) #2

I guess I could duplicate the Hype document and then modify the height in the duplicate, then use JavaScript to determine the portal dimensions to pull the proper layout (use a different url) when the device attempts to load the page?


(Hans-Gerd Claßen) #3

this should really not be a common request in days of responsive layout …

… but the answer in hype would be the event layoutRequest

use a php or js-library to check for the exact device then use layoutRequest to deliver your favorite …

examples within forum … search (edit: and documentation¡! :slight_smile: ) will be your friend :slight_smile:


(Quint Rahaman) #4

Thanks for responding, Hans. Unfortunately, I can’t use the responsive/flexible layout feature in Hype. Given the weird height of the S8, exact element placement and sizing is my only option. As you suggest, I will use jQuery to determine the dimensions and then load the appropriate page.

Thanks, again!