protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.CalendarSettingsActivity); InitializeViews(); setupToolbar(); setupRecyclerView(); toggleCalendarsView.Rx().Tap() .Subscribe(ViewModel.TogglCalendarIntegration.Inputs) .DisposedBy(DisposeBag); ViewModel.CalendarListVisible .Subscribe(toggleCalendarsSwitch.Rx().CheckedObserver()) .DisposedBy(DisposeBag); ViewModel.CalendarListVisible .Subscribe(calendarsContainer.Rx().IsVisible()) .DisposedBy(DisposeBag); ViewModel .Calendars .Select(calendars => calendars.ToList()) .Subscribe(userCalendarsAdapter.Rx().Items()) .DisposedBy(DisposeBag); userCalendarsAdapter .ItemTapObservable .Subscribe(ViewModel.SelectCalendar.Inputs) .DisposedBy(DisposeBag); }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); setupRecyclerView(); cancelButton.Rx().Tap() .Subscribe(ViewModel.CloseWithDefaultResult) .DisposedBy(DisposeBag); doneButton .Rx() .BindAction(ViewModel.Save) .DisposedBy(DisposeBag); ViewModel .Calendars .Select(calendars => calendars.ToList()) .Subscribe(userCalendarsAdapter.Rx().Items()) .DisposedBy(DisposeBag); userCalendarsAdapter .ItemTapObservable .Subscribe(ViewModel.SelectCalendar.Inputs) .DisposedBy(DisposeBag); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); var contextThemeWrapper = new ContextThemeWrapper(Activity, Resource.Style.TogglDialog); var wrappedInflater = inflater.CloneInContext(contextThemeWrapper); var view = wrappedInflater.Inflate(Resource.Layout.SelectUserCalendarsFragment, container, false); InitializeViews(view); setupRecyclerView(); cancelButton .Rx() .BindAction(ViewModel.Close) .DisposedBy(DisposeBag); doneButton .Rx() .BindAction(ViewModel.Done) .DisposedBy(DisposeBag); ViewModel .Calendars .Select(calendars => calendars.ToList()) .Subscribe(userCalendarsAdapter.Rx().Items()) .DisposedBy(DisposeBag); userCalendarsAdapter .ItemTapObservable .Subscribe(ViewModel.SelectCalendar.Inputs) .DisposedBy(DisposeBag); return(view); }