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();
        }
Beispiel #3
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;
        }