Beispiel #1
0
 public static ScanningView Start(UIView View, RectangleF frame)
 {
     var _scanner = new ScanningView (frame);
     _scanner.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
     _scanner.Alpha = 0;
     _scanner.StartScanning ();
     View.AddSubview (_scanner);
     UIView.BeginAnimations ("RetFadeIn");
     _scanner.Alpha = 1;
     UIView.CommitAnimations ();
     return _scanner;
 }
Beispiel #2
0
        public static ScanningView Start(UIView View, RectangleF frame)
        {
            var _scanner = new ScanningView(frame);

            _scanner.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            _scanner.Alpha            = 0;
            _scanner.StartScanning();
            View.AddSubview(_scanner);
            UIView.BeginAnimations("RetFadeIn");
            _scanner.Alpha = 1;
            UIView.CommitAnimations();
            return(_scanner);
        }
Beispiel #3
0
        public void SetSources(params Source[] sources)
        {
            QuerySources = sources;

            SourceType = QuerySources.Length > 0 ? QuerySources[0].GetType() : typeof(News);

            //
            // Buttons to get to related sources
            //
            var allSources = new Source[0];

            if (QuerySources != null && QuerySources.Length > 0)
            {
                allSources = Repo.Foreground.GetActiveSources(SourceType).OrderBy(s => s.GetDistinguisher()).ToArray();
            }
            var n       = allSources.Length;
            var buttons = new LcarsDef[n];

            for (int i = 0; i < n; i++)
            {
                var s = allSources[i];
                var b = new LcarsDef();
                b.Caption = s.GetShortDistinguisher().ToUpperInvariant();

                b.ComponentType = PossibleTypes[s.Id % PossibleTypes.Length];

                b.Command = delegate { App.Inst.ShowSourceMessages(s); };

                buttons[i] = b;
            }

            Info.CommandButtons = buttons;

            Info.MainTop.Caption = "ADD " + SourceTypes.GetTitle(SourceType);
            if (sources.Length == 1)
            {
                Info.MiscBtn.ComponentType = LcarsComponentType.DisplayFunction;
                if (App.Inst.IsIPad)
                {
                    Info.MiscBtn.Caption = "REMOVE " + sources[0].GetShortDistinguisher().TruncateWords(15).ToUpperInvariant();
                }
                else
                {
                    Info.MiscBtn.Caption = "REMOVE";
                }
                Info.MiscBtn.IsCommandable = true;
            }
            else
            {
                Info.MiscBtn.ComponentType = LcarsComponentType.Static;
                Info.MiscBtn.Caption       = "";
                Info.MiscBtn.IsCommandable = false;
            }

            UpdateTitle();

            if (!_showingData && QuerySources.Length > 1 && PlayAnimation)
            {
                _scanner = new ScanningView(new RectangleF(0, 20, View.Frame.Width, View.Frame.Height - 20));
                _scanner.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
                _scanner.Alpha            = 0;
                _scanner.StartScanning();
                View.AddSubview(_scanner);
                UIView.BeginAnimations("RetFadeIn");
                _scanner.Alpha = 1;
                UIView.CommitAnimations();

                _showingData = true;
            }

            RefreshMessages();
        }