Пример #1
0
        /**
         * Shows the selection dialog for a given renderer.
         *
         * @param activity The parent activity.
         * @param title The dialog's title.
         * @param trackInfo The current track information.
         * @param rendererIndex The index of the renderer.
         */
        public void ShowSelectionDialog(Activity activity, char[] title, MappingTrackSelector.MappedTrackInfo trackInfo,
                                        int rendererIndex)
        {
            _trackInfo     = trackInfo;
            _rendererIndex = rendererIndex;

            _trackGroups         = trackInfo.GetTrackGroups(rendererIndex);
            _trackGroupsAdaptive = new bool[_trackGroups.Length];
            for (int i = 0; i < _trackGroups.Length; i++)
            {
                _trackGroupsAdaptive[i] = _adaptiveVideoTrackSelectionFactory != null &&
                                          trackInfo.GetAdaptiveSupport(rendererIndex, i, false)
                                          != RendererCapabilities.AdaptiveNotSupported &&
                                          _trackGroups.Get(i).Length > 1;
            }
            _isDisabled = _selector.GetRendererDisabled(rendererIndex);

            _override = _selector.GetSelectionOverride(rendererIndex, _trackGroups);

            AlertDialog.Builder builder = new AlertDialog.Builder(activity);
            builder.SetTitle(title.ToString())
            .SetView(BuildView(LayoutInflater.From(builder.Context)))
            .SetPositiveButton(Android.Resource.String.Ok, this)
            .SetNegativeButton(Android.Resource.String.Cancel, this)
            .Create()
            .Show();
        }
        /**
         * Shows the selection dialog for a given renderer.
         *
         * @param activity The parent activity.
         * @param title The dialog's title.
         * @param trackInfo The current track information.
         * @param rendererIndex The index of the renderer.
         */
        public void showSelectionDialog(Activity activity, string title, MappingTrackSelector.MappedTrackInfo trackInfo,
                                        int rendererIndex)
        {
            this.trackInfo     = trackInfo;
            this.rendererIndex = rendererIndex;

            trackGroups         = trackInfo.GetTrackGroups(rendererIndex);
            trackGroupsAdaptive = new bool[trackGroups.Length];
            for (int i = 0; i < trackGroups.Length; i++)
            {
                trackGroupsAdaptive[i] = adaptiveTrackSelectionFactory != null &&
                                         trackInfo.GetAdaptiveSupport(rendererIndex, i, false)
                                         != RendererCapabilities.AdaptiveNotSupported &&
                                         trackGroups.Get(i).Length > 1;
            }
            isDisabled = selector.GetRendererDisabled(rendererIndex);

            _override = selector.GetSelectionOverride(rendererIndex, trackGroups);

            AlertDialog.Builder builder = new AlertDialog.Builder(activity);
            builder.SetTitle(title)
            .SetView(buildView(builder.Context))
            .SetPositiveButton(global::Android.Resource.String.Ok, this)
            .SetNegativeButton(global::Android.Resource.String.Cancel, delegate { })
            .Create()
            .Show();
        }