예제 #1
0
        private async void Ada_ItemClick(object sender, int e)
        {
            var item = await Detail.GetVideo(_id, (_exRecyclerView.ViewAdapter as DetailListAdapter).Items[e].Set, LanguageHelper.PrefLang);

            var dlg    = new BottomSheetDialog(this);
            var layout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical
            };

            layout.AddView(GetHeaderText("Choose Quality"));
            if (item.OriginalQuality != null)
            {
                layout.AddView(CreateRow("Source", item.OriginalQuality));
            }
            if (item.HighQuality != null)
            {
                layout.AddView(CreateRow("720P", item.HighQuality));
            }
            if (item.MediumQuality != null)
            {
                layout.AddView(CreateRow("480P", item.MediumQuality));
            }
            if (item.LowQuality != null)
            {
                layout.AddView(CreateRow("240P", item.LowQuality));
            }
            dlg.SetContentView(layout);
            dlg.SetCancelable(false);
            dlg.Show();
        }
예제 #2
0
        protected override Dialog CreateDialog(ActionSheetConfig config)
        {
            var dlg    = new BottomSheetDialog(this.Activity);
            var layout = new LinearLayout(this.Activity)
            {
                Orientation = Orientation.Vertical
            };

            if (!String.IsNullOrWhiteSpace(config.Title))
            {
                layout.AddView(this.GetHeaderText(config.Title));
            }

            if (!String.IsNullOrWhiteSpace(config.Message))
            {
                layout.AddView(this.GetText(config.Message, false));
            }

            foreach (var action in config.Options)
            {
                layout.AddView(this.CreateRow(action, false));
            }

            if (config.Destructive != null)
            {
                layout.AddView(this.CreateDivider());
                layout.AddView(this.CreateRow(config.Destructive, true));
            }
            if (config.Cancel != null)
            {
                if (config.Destructive == null)
                {
                    layout.AddView(this.CreateDivider());
                }

                layout.AddView(this.CreateRow(config.Cancel, false));
            }
            dlg.SetContentView(layout);
            dlg.SetCancelable(false);
            return(dlg);
        }