naver / egjs-rotate

Tiny custom rotate event binder
https://naver.github.io/egjs-rotate/
MIT License
13 stars 5 forks source link

Support Galaxy fold #12

Open 4spartame opened 5 years ago

4spartame commented 5 years ago

Description

egjs-rotate doesn't trigger event when unfold Galaxy fold.

egjs-rotate triggers event when be changed the viewport to vertical from horizontal(and in the reverse case), but viewport is changed to vertical from vertical when Galaxy fold is unfolded.

Strictly, It isn't rotated in this case. but I think egjs-rotate have to support that.

jongmoon commented 5 years ago

egjs originates from the jindo component. 'rotate' is designed to support the following terminal environments that do not support 'orientationchange', which is an event that can determine screen rotation.

Related Code: https://github.com/naver/jindojs-jindo/blob/d861414d641644c9718bb446279d2dd5e8055823/test/desktop/etc/jindo_mobile_component.js#L461

In other words, rotate is intended to serve as a polyfill (?) Function to perform orientationchange.

In Galaxy Fold, assuming that orientationchange does not occur when the fold state changes, it seems that firing rotate in this context is different from the original intention.

Based on recent trends (September 2019) that do not support Android 2.3 or lower, rotate seems to be Unnecessary. I thought it would be better to create a new module like egjs-resize....., but I also think it makes no sense because this is already possible enough with" resize "events.

I'm curious about @4spartame 's opinion in this regard.

egjs 는 jindo 컴포넌트를 기원으로 합니다. 'rotate' 는 화면 회전을 판단할 수 있는 이벤트인 'orientationchange' 를 정상적으로 지원하지 않는 다음 단말 환경을 지원하기 위해 만들어졌습니다.

  • android 2.1 : orientationchange 미지원
  • android 2.2, 2.3: orientationchange 지원하지만 버그있음.

관련 코드: https://github.com/naver/jindojs-jindo/blob/d861414d641644c9718bb446279d2dd5e8055823/test/desktop/etc/jindo_mobile_component.js#L461 즉, rotate 는 orientationchange 을 수행하기 위한 polyfill(?) 기능을 하는 용도라고 볼 수 있습니다.

Galaxy Fold 에서는 fold 상태가 변경되었을때 orientationchange 가 발생하지 않는다고 가정한다면, 위와 같은 맥락에서 rotate 를 발생시키는 것은 원래 의도와는 다르다고 보입니다.

Android 2.3 이하를 지원하지 않는 최근(2019년 9월)의 트렌드를 봤을 때 rotate 는 유명무실한 것 같습니다. 차라리 egjs-resize와 같은 모듈을 새로 만드는 것이 나을 거 같다는 생각입니다만... 이 또한 이미 "resize" 이벤트로 충분히 이용가능한 부분이기 때문에 새로 만드는게 의미가 있을까라는 생각도 듭니다.

관련해서 @4spartame 님의 의견이 궁금합니다.