Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Conversation

SeoJungHong
Copy link

@SeoJungHong SeoJungHong commented Feb 18, 2019

문제 상황

  • HoverView 를 윈도우에 붙일 때 처음부터 스크린의 전체 영역으로 붙이기 때문에 WindowManager 에서 특정 뷰만 집어내어 touchable 하게 바꾸기에는 어려운 구조
  • 기존의 Dragger 는 FloatingTab 의 위치에 Drag 가능한 커버 뷰를 새로 만들어서 붙이는데, Dragger 에서 DragStart 뿐만 아니라 Tap, Press 등의 성격이 다른 이벤트도 같이 처리하고 있다.
  • 지금 필요한 기능은 Dragger 에서 '커버 뷰가 실제로 Draggable 한' 피쳐를 제거하고, Tap, Press 이벤트만을 받는 것이다.

변경 내용

  • Dragger 에서 위와 같이 기본 기능을 분리해 내기 위해 먼저 InWindowDragger 와 InViewDragger 에서 변경이 필요한 부분만 인터페이스로 분리하고, 나머지 공통 기능은 Dragger 에서 직접 구현하도록 리팩토링 (Dragger 를 interface 에서 abstract class 로 변경)
  • Dragger 에서 Touch 관련된 기능만 분리해서 그걸 BaseTouchController 로 이름짓고 Dragger 가 이를 상속받아서 본래의 dragger 기능으로 확장시키도록 함.
  • 최종적인 클래스 간의 의존 관계는 다음과 같다
    • BaseTouchController
      • <- Dragger
        • <- InWindowDragger
        • <- InViewDragger
  • HoverViewStateAnchored 에서 takeControl 이 불릴 때에는 Collapsed 와 다르게 BaseTouchController.TouchListener 를 넘겨, BaseTouchController 의 기능만 activate 되도록 함
  • HoverView#OnInteractionListener 의 onTap 이 어느 state 에서 발생하였는지 알게 하기 위하여 해당 메소드에 현재 State 의 Type 을 표시하는 enum 을 넘김 (HoverViewStateType)

@SeoJungHong SeoJungHong requested a review from josh-yun February 18, 2019 09:14
Copy link

@josh-yun josh-yun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@SeoJungHong SeoJungHong merged commit 597400d into master Feb 18, 2019
@SeoJungHong SeoJungHong deleted the feature/update_anchored branch February 18, 2019 10:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants