jamesbutler01 / Mymou

Mymou: A standalone touchscreen in-cage testing device
16 stars 10 forks source link

Tablet rotation #10

Closed iandol closed 5 years ago

iandol commented 5 years ago

Is there a reason you hard-wired Mymou to use portrait mode? Perhaps it is a problem with camera position? Being able to rotate and choose the orientation depending on the task may make sense?

jamesbutler01 commented 5 years ago

Well the tablet itself will never be rotated when attached to the bars, so there's no need to have to code all task layouts twice, once for each orientation. I can't think of any reason why you would want to switch orientation? Unless you have something specific planned? E.g. if you want your stimuli to rotate in the task this is easiest done in situ with 1 line (mImageView.setRotation(angle);) and then you don't have to recalculate all your task object positions for the swapped width/height dimensions etc

iandol commented 5 years ago

Well as a vision scientist, I'm thinking more in terms of the visual field, with portrait you get more upper vs lower visual field; landscape allowing more of the left vs. right visual field to be stimulated (different amounts of monocular vs. binocular stimulation). I haven't thought about how you need to implement this at all in terms of the task layout files, but you're saying you need separate layouts?

We can design our tablet holders so you can put the tablet in portrait or landscape position...

jamesbutler01 commented 5 years ago

That's cool if you support both positions for the tablet in one holder, I'd love to see your design if you do this.

To support Android's orientation mode you need to have both landscape and portrait XML files, and android switches between them when you rotate the screen (and this process involves calling onpause, oncreate etc so essentially restarts the task). The landscape/portrait modes main purpose is to allow apps to change orientation while using them, which I don't think you mean?

Currently, Mymou does all layout alterations in the java on instantiation, rather than XML due to XML being weak for precise layout alterations/changes (and the java already has all this in it as the tasks generally require lots of moving of objects etc). If you want to code some tasks in portrait some in landscape currently you just need to specify on instantiation in oncreate landscape positions rather than portrait in the java. If we instead used Android's portrait/landscape mode then every task will have to have XML layouts for both orientations even though they will only ever use 1 orientation.