Skip to content

API호출 관련 코드 수정. - #15

Open
Zi-Yun wants to merge 4 commits into
boostcampth:masterfrom
Zi-Yun:develop
Open

API호출 관련 코드 수정.#15
Zi-Yun wants to merge 4 commits into
boostcampth:masterfrom
Zi-Yun:develop

Conversation

@Zi-Yun

@Zi-Yun Zi-Yun commented Jan 19, 2019

Copy link
Copy Markdown

개요

  • API호출 및 리스트 관련 코드 수정.

작업사항

  • 영화 데이터를 불러오는 데 사용된 Disposable이 적절한 시점에 dispose되도록 수정했습니다.
  1. CompositeDisposable`타입의 필드 추가.
  2. 데이터를 불러오는 데 사용된 Disposable을 1-1 에서 생성한 필드에 add.
  3. MainActivityonDestroy호출 시 dispose.

  • subscribeOn의 스케쥴러를 thread pool을 사용하는 Schedulers.io로 변경했습니다.

  • GlideUtilloadImageCenterCrop 수정.
  1. 디코드 된 이미지만 캐시되도록 DiskCacheStrategy.RESOURCE 로 변경했습니다.
  2. 이미지 로드가 부드럽게 보이도록 트랜잭션을 추가했습니다.

  • 데이터 추가 로딩 시 멈추는 현상을 해결하기위해 onScrollStateChanged메소드를 수정했습니다.
  1. 화면에 보이지 않는 아이템의 개수가 5개 이하일 경우, 추가로 데이터를 불러오도록 구현했습니다.

@GODueol GODueol left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

.

@GODueol GODueol left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

.


// 어댑터에 리스트 추가
adapterModel.addItems(movieList);
disposables.add(

@GODueol GODueol Jan 19, 2019

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Single<SearchMovieResponse> searchMovies(@QueryMap Map<String, String> map);
API의 호출부가 Single클래스로 호출되고 있습니다
보통 Single 클레스로 호출하면 한번의 Stream이 흐르고 나면 완료됨을 명시해주는 클래스로
onNext와 onComplete가 같이 이루어 진다고 알고 있는데 명시적인 Dispose를 해주어야 하나요?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants