Beispiel #1
0
        public AnimazioneView(Context context, Animazione animaz, string path) : base(context)
        {
            this.Settings.UserAgentString   = "Mozilla/5.0 (Linux; U; Android 2.0; en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17";
            this.Settings.JavaScriptEnabled = true;
            //this.Settings.PluginsEnabled = true;
            this.Settings.SetPluginState(WebSettings.PluginState.OnDemand);
            this.Settings.AllowFileAccess = true;
            this.Settings.SetAppCacheEnabled(true);
            //this.Settings.JavaScriptCanOpenWindowsAutomatically = true;
            this.SetBackgroundColor(Android.Graphics.Color.Transparent);
            this.ScrollBarStyle = ScrollbarStyles.OutsideOverlay;

            this.Settings.LoadWithOverviewMode = true;
            this.Settings.UseWideViewPort      = true;

            this.VerticalScrollBarEnabled   = false;
            this.HorizontalScrollBarEnabled = false;

            LoadingWebViewClient webClient = new LoadingWebViewClient();

            this.SetWebViewClient(webClient);

            resPath = Path.GetFullPath(Path.Combine(path, System.Web.HttpUtility.UrlDecode(animaz.UrlStream)));

            /*string pa = Path.GetFullPath(Path.Combine(path, System.Web.HttpUtility.UrlDecode(animaz.UrlStream)));
             * string url = "file://" + pa;
             * this.LoadUrl(url);*/
        }
        /// <summary>
        /// Dato il PersisterMapper di un Elemento, se esso è un'animazione verrà caricato nell'editor
        /// </summary>
        /// <param name="element"></param>
        public override void CaricaElemento(PersisterMapper <Elemento> element)
        {
            Animazione animazione = element.Element as Animazione;

            Mapper      = element;
            _animazione = animazione ?? throw new ArgumentException("Elemento non compatibile con l'editor delle animazioni");
            _editor.Pannello.TabPages.Clear();
            _editor.Pannello.TabPages.Add(_editor.TabAggiungi);
            foreach (Frame f in _animazione.Frames)
            {
                AddFrame(f);
            }
            _editor.FramerateNumeric.Value = _animazione.FrameRate;
        }