Query Device attributes, etc? #74

Closed
jaygarcia opened this Issue Feb 16, 2015 · 10 comments

Comments

Projects
None yet
7 participants
@jaygarcia
Contributor

jaygarcia commented Feb 16, 2015

Hi,

How does one query Device attributes like screen dimensions via the JS bridge?

@vjeux

This comment has been minimized.

Show comment
Hide comment
@vjeux

vjeux Feb 16, 2015

Contributor

There's a Dimensions module that's not exposed yet. We're working on getting our synchronization in order to be able to expose it

Contributor

vjeux commented Feb 16, 2015

There's a Dimensions module that's not exposed yet. We're working on getting our synchronization in order to be able to expose it

@sahrens

This comment has been minimized.

Show comment
Hide comment
@sahrens

sahrens Feb 16, 2015

Contributor

We're actually re-thinking how this works because it's usually not the right thing to simply grab the screen dimensions (not robust to device rotation, in-call notification bar, etc). We definitely need to provide a solution soon though!

On Feb 16, 2015, at 10:30 AM, Christopher Chedeau notifications@github.com wrote:

There's a Dimensions module that's not exposed yet. We're working on getting our synchronization in order to be able to expose it


Reply to this email directly or view it on GitHub.

Contributor

sahrens commented Feb 16, 2015

We're actually re-thinking how this works because it's usually not the right thing to simply grab the screen dimensions (not robust to device rotation, in-call notification bar, etc). We definitely need to provide a solution soon though!

On Feb 16, 2015, at 10:30 AM, Christopher Chedeau notifications@github.com wrote:

There's a Dimensions module that's not exposed yet. We're working on getting our synchronization in order to be able to expose it


Reply to this email directly or view it on GitHub.

@jaygarcia

This comment has been minimized.

Show comment
Hide comment
@jaygarcia

jaygarcia Feb 23, 2015

Contributor

Thanks guys. I imagine people are going to want to do query the device as they are used to doing this with HTML5 apps :)

Contributor

jaygarcia commented Feb 23, 2015

Thanks guys. I imagine people are going to want to do query the device as they are used to doing this with HTML5 apps :)

@stefalda

This comment has been minimized.

Show comment
Hide comment
@stefalda

stefalda Mar 29, 2015

I think some sort of access to the device screen size and capabilities is badly needed.

I think some sort of access to the device screen size and capabilities is badly needed.

@chirag04

This comment has been minimized.

Show comment
Hide comment
@chirag04

chirag04 Apr 27, 2015

Collaborator

+1

Collaborator

chirag04 commented Apr 27, 2015

+1

@brentvatne

This comment has been minimized.

Show comment
Hide comment
@brentvatne

brentvatne Apr 28, 2015

Collaborator

@chirag04 @stefalda - What capabilities did you have in mind? In terms of screen size, what information do you want to have access to beyond the width/height and pixel ratio?

width/height are currently available with require('Dimensions').get('window') which returns {width: x, height: y} and pixel ratio which you can access directly with the PixelRatio module or require('Dimensions').get('window').scale.

So I think this issue is more about being able to watch the device for events that might change the dimensions eg rotation: #426. We can watch for changes in status bar size using react-native-status-bar-size. What else am I missing?

Collaborator

brentvatne commented Apr 28, 2015

@chirag04 @stefalda - What capabilities did you have in mind? In terms of screen size, what information do you want to have access to beyond the width/height and pixel ratio?

width/height are currently available with require('Dimensions').get('window') which returns {width: x, height: y} and pixel ratio which you can access directly with the PixelRatio module or require('Dimensions').get('window').scale.

So I think this issue is more about being able to watch the device for events that might change the dimensions eg rotation: #426. We can watch for changes in status bar size using react-native-status-bar-size. What else am I missing?

@ide

This comment has been minimized.

Show comment
Hide comment
@ide

ide Apr 28, 2015

Collaborator

There is also https://github.com/pjjanak/react-native-viewport for viewport sizes.

Collaborator

ide commented Apr 28, 2015

There is also https://github.com/pjjanak/react-native-viewport for viewport sizes.

@stefalda

This comment has been minimized.

Show comment
Hide comment
@stefalda

stefalda Apr 28, 2015

@brentvatne I didn't know about those methods, but I think they'd be enough for now.
Thank you for the clarification.

@brentvatne I didn't know about those methods, but I think they'd be enough for now.
Thank you for the clarification.

@chirag04

This comment has been minimized.

Show comment
Hide comment
@chirag04

chirag04 Apr 28, 2015

Collaborator

@brentvatne We only need width/height and pixel ratio and for now we are using Dimensions.

But as i read in github issues, dimensions is going to go and is a bad practice. Documented component/module for this would be helpful.

Collaborator

chirag04 commented Apr 28, 2015

@brentvatne We only need width/height and pixel ratio and for now we are using Dimensions.

But as i read in github issues, dimensions is going to go and is a bad practice. Documented component/module for this would be helpful.

@brentvatne

This comment has been minimized.

Show comment
Hide comment
@brentvatne

brentvatne Apr 28, 2015

Collaborator

@chirag04 - check out the Viewport module that @ide mentioned above, it seems like a good alternative 😄

I'm going to close this issue, let's create a new one when we have some specific attributes that we want to be able to query for so we can handle those on a case-by-case basis.

Collaborator

brentvatne commented Apr 28, 2015

@chirag04 - check out the Viewport module that @ide mentioned above, it seems like a good alternative 😄

I'm going to close this issue, let's create a new one when we have some specific attributes that we want to be able to query for so we can handle those on a case-by-case basis.

@brentvatne brentvatne closed this Apr 28, 2015

harrykiselev pushed a commit to harrykiselev/react-native that referenced this issue Aug 5, 2015

Merge pull request #74 from ptomasroos/master
Added cursor pointer to none active thread items

@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.