Skip to content

Commit

Permalink
Created cinema reference to extract data
Browse files Browse the repository at this point in the history
  • Loading branch information
PopPsyA committed Aug 2, 2018
1 parent e0f0940 commit f3fa43d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.ru.devit.mediateka.domain.UseCaseSubscriber;
import com.ru.devit.mediateka.domain.cinemausecases.GetFavouriteListCinema;
import com.ru.devit.mediateka.models.model.Cinema;
import com.ru.devit.mediateka.models.model.DateAndTimeInfo;
import com.ru.devit.mediateka.presentation.base.BasePresenter;
import com.ru.devit.mediateka.presentation.base.BaseView;

Expand All @@ -15,6 +16,7 @@ public class CinemaDetailPresenter extends BasePresenter<CinemaDetailPresenter.V

private int cinemaId;
private boolean isFABMenuOpen;
private Cinema cinemaInPresenter;
private final GetCinemaById getCinemaById;
private final GetFavouriteListCinema useCaseGetFavouriteListCinema;

Expand Down Expand Up @@ -58,6 +60,10 @@ public void onAddFavouriteCinemaClicked() {
.subscribe(getView()::showSuccessfullyFavouriteCinemaAdded);
}

public void onShowedDateAndTimePickerDialog(DateAndTimeInfo dateAndTimeInfo) {
getView().sendScheduledCinemaNotification(cinemaId , cinemaInPresenter.getTitle() , cinemaInPresenter.getDescription() , dateAndTimeInfo);
}

public void onDestroy(){
getCinemaById.dispose();
useCaseGetFavouriteListCinema.dispose();
Expand All @@ -75,11 +81,14 @@ public interface View extends BaseView{
void showFABCinemaMenu();
void hideFABCinemaMenu();
void showSuccessfullyFavouriteCinemaAdded();
void sendScheduledCinemaNotification(int cinemaId , String title, String description, DateAndTimeInfo dateAndTimeInfo);
}

private final class CinemaDetailSubscriber extends UseCaseSubscriber<Cinema>{

@Override
public void onNext(Cinema cinema) {
cinemaInPresenter = cinema;
getView().showCinemaDetail(cinema);
}

Expand Down

0 comments on commit f3fa43d

Please sign in to comment.