Beispiel #1
0
        private void InitActionMenu()
        {
            _actionMenu?.Close(true);
            _actionMenu?.Dispose();
            var param   = new ViewGroup.LayoutParams(DimensionsHelper.DpToPx(45), DimensionsHelper.DpToPx(45));
            var builder = new FloatingActionMenu.Builder(Activity)
                          .AddSubActionView(BuildFabActionButton(param, Resource.Drawable.icon_filter))
                          .AddSubActionView(BuildFabActionButton(param, Resource.Drawable.icon_sort))
                          .AddSubActionView(BuildFabActionButton(param, Resource.Drawable.icon_shuffle));

            switch (ViewModel.WorkMode)
            {
            case AnimeListWorkModes.SeasonalAnime:
                builder.AddSubActionView(BuildFabActionButton(param, Resource.Drawable.icon_calendar));
                builder.SetRadius(DimensionsHelper.DpToPx(95));
                break;

            case AnimeListWorkModes.TopAnime:
                builder.AddSubActionView(BuildFabActionButton(param, Resource.Drawable.icon_fav_outline));
                builder.SetRadius(DimensionsHelper.DpToPx(95));
                break;

            default:
                builder.SetRadius(DimensionsHelper.DpToPx(75));
                break;
            }
            _actionMenu = builder.AttachTo(AnimeListPageActionButton).Build();
        }
Beispiel #2
0
        private void InitActionMenu()
        {
            _actionMenu?.Close(true);
            _actionMenu?.Dispose();
            var param   = new ViewGroup.LayoutParams(DimensionsHelper.DpToPx(45), DimensionsHelper.DpToPx(45));
            var builder = new FloatingActionMenu.Builder(Activity)
                          .AddSubActionView(BuildFabActionButton(param, Resource.Drawable.icon_filter))
                          .AddSubActionView(BuildFabActionButton(param, Resource.Drawable.icon_linear_blur))
                          .AddSubActionView(BuildFabActionButton(param, Resource.Drawable.icon_sort));

            builder.SetRadius(DimensionsHelper.DpToPx(75));
            _actionMenu = builder.AttachTo(ComparisonPageActionButton).Build();
        }
        protected override void InitBindings()
        {
            var swipeRefresh = RootView as SwipeRefreshLayout;

            //AnimeListPageGridView.ScrollingCacheEnabled = false;


            Bindings.Add(
                this.SetBinding(() => ViewModel.Loading,
                                () => AnimeListPageLoadingSpinner.Visibility).ConvertSourceToTarget(Converters.BoolToVisibility));


            Bindings.Add(
                this.SetBinding(() => ViewModel.AppbarBtnPinTileVisibility,
                                () => AnimeListPageSeasonMenu.Visibility).ConvertSourceToTarget(Converters.BoolToVisibility));

            Bindings.Add(
                this.SetBinding(() => ViewModel.AppBtnSortingVisibility,
                                () => AnimeListPageSortMenu.Visibility).ConvertSourceToTarget(Converters.BoolToVisibility));

            ViewModel.PropertyChanged += AnimeListOnPropertyChanged;

            AnimeListPageFilterMenu.SetCommand("Click", new RelayCommand(ShowFilterMenu));
            AnimeListPageSortMenu.SetCommand("Click", new RelayCommand(ShowSortMenu));
            AnimeListPageDisplayMenu.SetCommand("Click", new RelayCommand(ShowDisplayMenu));
            AnimeListPageSeasonMenu.SetCommand("Click", new RelayCommand(ShowSeasonMenu));

            swipeRefresh.NestedScrollingEnabled = true;
            swipeRefresh.Refresh += (sender, args) =>
            {
                swipeRefresh.Refreshing = false;

                ViewModel.RefreshCommand.Execute(null);
            };


            var padding = DimensionsHelper.DpToPx(10);
            var param   = new ViewGroup.LayoutParams(DimensionsHelper.DpToPx(45), DimensionsHelper.DpToPx(45));

            _actionMenu = new FloatingActionMenu.Builder(Activity)
                          .AddSubActionView(BuildFabActionButton(param, padding, Resource.Drawable.icon_filter))
                          .AddSubActionView(BuildFabActionButton(param, padding, Resource.Drawable.icon_sort))
                          .AddSubActionView(BuildFabActionButton(param, padding, Resource.Drawable.icon_eye))
                          .SetRadius(DimensionsHelper.DpToPx(75))
                          .AttachTo(AnimeListPageActionButton)
                          .Build();
            InitDrawer();
        }
Beispiel #4
0
        protected override void InitBindings()
        {
            _actionMenu?.Close(true);
            var padding = DimensionsHelper.DpToPx(10);
            var param   = new ViewGroup.LayoutParams(DimensionsHelper.DpToPx(45), DimensionsHelper.DpToPx(45));
            var builder = new FloatingActionMenu.Builder(Activity)
                          .AddSubActionView(BuildFabActionButton(param, Resource.Drawable.icon_message_new))
                          .AddSubActionView(BuildFabActionButton(param, Resource.Drawable.icon_message_sent));

            builder.SetRadius(DimensionsHelper.DpToPx(75));
            _actionMenu = builder.AttachTo(MessagingPageActionButton).Build();

            Bindings.Add(this.SetBinding(() => ViewModel.DisplaySentMessages).WhenSourceChanges(() =>
            {
                MessagingPageList.Adapter = ViewModel.DisplaySentMessages
                    ? ViewModel.Outbox.GetAdapter(GetMessageTemplateDelegate)
                    : ViewModel.Inbox.GetAdapter(GetMessageTemplateDelegate);
            }));

            Bindings.Add(this.SetBinding(() => ViewModel.LoadingVisibility).WhenSourceChanges(() =>
            {
                if (ViewModel.LoadingVisibility)
                {
                    MessagingPageList.Adapter = null;
                    return;
                }
                MessagingPageList.Adapter = ViewModel.DisplaySentMessages
                    ? ViewModel.Outbox.GetAdapter(GetMessageTemplateDelegate)
                    : ViewModel.Inbox.GetAdapter(GetMessageTemplateDelegate);
            }));



            Bindings.Add(
                this.SetBinding(() => ViewModel.LoadingVisibility,
                                () => MessagingPageProgressSpinner.Visibility).ConvertSourceToTarget(Converters.BoolToVisibility));

            var scrollToRefresh = RootView as ScrollableSwipeToRefreshLayout;

            scrollToRefresh.ScrollingView = MessagingPageList;
            scrollToRefresh.Refresh      += ScrollToRefreshOnRefresh;
        }