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 15, 2019

  • HoverViewState 변경 로직 리팩토링

    • State 가 변경되면 HoverView -> HoverViewState -> HoverView 이런 식으로 순환하면서 변경 로직을 처리해줘서 알아보기가 힘들었음
    • 각 HoverViewState 는 takeControl, giveUpControl 로직 구현에 신경을 쓰고, State 간의 transition 은 HoverView 에서 전담한다.
    // In HoverView
    void setState(@NonNull HoverViewState newState, Runnable onStateChanged) {
        if (mState != newState) {
            if (mState != null) {
                mState.giveUpControl(newState);
            }
            mState = newState;
            mState.takeControl(this, onStateChanged);
        }
    }
    • HoverViewState interface 에서 state 의 역할에 맞지 않는 메소드는 제거함
  • OnStateChangeListener 에서 아직은 쓰일 일이 없을 것 같기도 하고, 케이스의 구분이 애매해서 ~ing 콜백은 제거하고 ~ed 콜백만 남김

  • OnInteractionListener 추가. FloatingTab 과 유저의 인터렉션을 통해 발생하는 이벤트에 대한 콜백. 이번에 액티비티를 띄울 때에도 필요하고, 이후 드래그 중일때 메세지를 보여주는 로직에서도 쓰일 수 있음

  • HoverViewStateAnchored 추가. FloatingTab 이 지정된 위치로 고정되는 상태이다.

@SeoJungHong SeoJungHong requested a review from josh-yun February 15, 2019 03:01
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.

LGTM 👍

@SeoJungHong SeoJungHong merged commit e6e30a8 into master Feb 15, 2019
@SeoJungHong SeoJungHong deleted the feature/activity branch February 15, 2019 04:47
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