示例#1
0
        public override void Build()
        {
            base.Build();
            Debug.WriteLine("AlphaSettingsPage.Rebuild();");

            var ButtonFrame = new Grid()
            {
                VerticalOptions   = LayoutOptions.End,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                //BackgroundColor = Color.White,
            }
            .HorizontalJustificate
            (
                AddButton,
                DeleteButton
            );

            Content = new StackLayout
            {
                Children =
                {
                    List,
                    ButtonFrame,
                },
            };
            UpdateList();
            AlphaTheme.Apply(this);
        }
示例#2
0
        public void ApplyUserLabelTheme(string User)
        {
            var UserLabelAnimation = "DefaultButtn";

            if (Content.AnimationIsRunning(UserLabelAnimation))
            {
                Content.AbortAnimation(UserLabelAnimation);
            }
            var Theme = AlphaTheme.Get();

            if (!String.IsNullOrWhiteSpace(User))
            {
                AlphaTheme.Apply(UserLabel, Theme);
            }
            else
            {
                Content.Animate
                (
                    UserLabelAnimation,
                    d =>
                {
                    var Rate                  = Math.Abs(Math.Sin(d));
                    UserLabel.TextColor       = ColorEx.MergeWithRate(Theme.AccentColor, Theme.BackgroundColor, Rate);
                    UserLabel.BackgroundColor = ColorEx.MergeWithRate(Theme.BackgroundColor, Theme.AccentColor, Rate);
                },
                    0.0,
                    1000.0,
                    16,
                    (uint)2000000,
                    Easing.Linear
                );
            }
        }
示例#3
0
 public static AlphaTheme Get()
 {
     return(Cache ??
            (
                Cache = Get(Settings.Theme).Value
            ));
 }
示例#4
0
 public void RebuildMainPage()
 {
     Debug.WriteLine("AlphaApp::RebuildMainPage");
     Main.Build();
     AlphaTheme.Apply(Navigation);
     AlphaTheme.Apply(Main);
 }
示例#5
0
        public static void Set(String Theme)
        {
            var i = Get(Theme);

            Cache          = i.Value;
            Settings.Theme = i.Key;
        }
示例#6
0
        protected override void OnDisappearing()
        {
            base.OnDisappearing();
            bool IsChanged = false;

            var OldTheme = AlphaTheme.Get();

            AlphaTheme.Set(AlphaTheme.All.Keys.ElementAt(ThemeCell.SelectedIndex));
            if (OldTheme != AlphaTheme.Get())
            {
                IsChanged = true;
            }

            var OldLanguage = L.Get();

            Settings.Language = L.DisplayNames.Keys.ElementAt(LanguageCell.SelectedIndex);
            if (OldLanguage != L.Get())
            {
                L.Update();
                IsChanged = true;
            }

            if (IsChanged)
            {
                Root.RebuildMainPage();
                Root.OnChangeSettings();
            }
        }
示例#7
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            ApplyUser(Settings.UserName);

            var Theme = AlphaTheme.Get();

            //ThemeCell.Items.Clear(); 2回目でこける。 Xamarin.Forms さん、もっと頑張って。。。
            foreach (var i in AlphaTheme.All.Keys)
            {
                if (!ThemeCell.Items.Where(j => j == i).Any())
                {
                    ThemeCell.Items.Add(L[i]);
                }
            }
            ThemeCell.SelectedIndex = AlphaTheme.All.Values
                                      .IndexOf(Theme);

            var Language = Settings.Language ?? "";

            //LanguageCell.Items.Clear(); 2回目でこける。 Xamarin.Forms さん、もっと頑張って。。。
            foreach (var i in L.DisplayNames.Select(i => i.Value))
            {
                if (!LanguageCell.Items.Where(j => j == L[i]).Any())
                {
                    LanguageCell.Items.Add(L[i]);
                }
            }
            LanguageCell.SelectedIndex = L.DisplayNames
                                         .Select(i => i.Key)
                                         .IndexOf(Language);
        }
示例#8
0
        public AlphaActivityIndicatorTextCell() : base()
        {
            View = new Grid().SetSingleChild
                   (
                new StackLayout
            {
                Orientation     = StackOrientation.Horizontal,
                VerticalOptions = LayoutOptions.Center,
                Padding         = new Thickness(20, 0, 0, 0),
                Children        =
                {
                    Indicator,
                    TextLabel,
                    RefreshImage,
                },
            }
                   );
            Indicator.VerticalOptions      = LayoutOptions.Center;
            Indicator.HorizontalOptions    = LayoutOptions.Center;
            TextLabel.VerticalOptions      = LayoutOptions.Center;
            TextLabel.HorizontalOptions    = LayoutOptions.StartAndExpand;
            RefreshImage.VerticalOptions   = LayoutOptions.Center;
            RefreshImage.HorizontalOptions = LayoutOptions.End;
            RefreshImage.Source            = AlphaFactory.GetApp().GetRefreshImageSource();
            RefreshImage.IsVisible         = null != CommandValue;

            Indicator.IsVisible = false;
            ApplyTheme(AlphaTheme.Get());
        }
示例#9
0
        public AlphaCircleImageCell() : base()
        {
            View = new Grid().SetSingleChild
                   (
                new StackLayout
            {
                Orientation     = StackOrientation.Horizontal,
                VerticalOptions = LayoutOptions.Center,
                Padding         = new Thickness(20, 2, 0, 2),
                Children        =
                {
                    Image,
                    TextLabel,
                    OptionImage,
                },
            }
                   );

            Image.IsVisible               = null != Image.Source;
            Image.VerticalOptions         = LayoutOptions.Center;
            TextLabel.VerticalOptions     = LayoutOptions.Center;
            TextLabel.HorizontalOptions   = LayoutOptions.StartAndExpand;
            OptionImage.VerticalOptions   = LayoutOptions.Center;
            OptionImage.HorizontalOptions = LayoutOptions.End;
            OptionImage.Source            = AlphaFactory.GetApp().GetRightImageSource();
            OptionImage.IsVisible         = null != CommandValue;
            AlphaTheme.Apply(this);
        }
示例#10
0
 protected override void OnSizeAllocated(double width, double height)
 {
     base.OnSizeAllocated(width, height);
     Debug.WriteLine(string.Format("OnSizeAllocated(width:{0},height:{1});", width, height));
     if (BuiltWidth != (int)width || BuiltHeight != (int)height)
     {
         Build();
         AlphaTheme.Apply(this);
     }
 }
示例#11
0
        public AlphaApp()
        {
            AlphaFactory.SetApp(this);

            MainPage = Navigation = new NavigationPage
                                    (
                Main = AlphaFactory.MakeMainPage()
                                    );
            MainPage.Title = "keep.grass";
            AlphaTheme.Apply(Navigation);
        }
        public AlphaActivityIndicatorButton() : base()
        {
            Orientation       = StackOrientation.Horizontal;
            VerticalOptions   = LayoutOptions.Center;
            HorizontalOptions = LayoutOptions.FillAndExpand;
            Padding           = new Thickness(20, 0, 0, 0);
            Children.Add(Indicator);
            Children.Add(Button);

            Indicator.VerticalOptions   = LayoutOptions.Center;
            Indicator.HorizontalOptions = LayoutOptions.FillAndExpand;
            Button.VerticalOptions      = LayoutOptions.Center;
            Button.HorizontalOptions    = LayoutOptions.FillAndExpand;

            Indicator.IsVisible = false;
            ApplyTheme(AlphaTheme.Get());
        }
示例#13
0
        public static void Apply(object UIObject, AlphaTheme Theme)
        {
            var ApplyHandler = UIObject as IAlphaThemeApplyHandler;

            if (null != ApplyHandler)
            {
                ApplyHandler.ApplyTheme(Theme);
            }
            else
            {
                ApplyCore(UIObject, Theme);
            }
            var AppliedHandler = UIObject as IAlphaThemeAppliedHandler;

            if (null != AppliedHandler)
            {
                AppliedHandler.AppliedTheme(Theme);
            }
        }
示例#14
0
        public override void Build()
        {
            base.Build();
            Debug.WriteLine("AlphaLeftTimeSettingsPage.Rebuild();");

            var StackContent = new StackLayout
            {
                Orientation     = StackOrientation.Horizontal,
                Spacing         = 1.0,
                BackgroundColor = Color.Gray,
            };

            foreach (var i in GetColumns((Width <= Height && Width < 640) ? 1 : 2))
            {
                StackContent.Children.Add(i);
            }
            Content = StackContent;
            AlphaTheme.Apply(this);
        }
示例#15
0
        public AlphaSwitchCell() : base()
        {
            View = new Grid().SetSingleChild
                   (
                new StackLayout
            {
                Orientation     = StackOrientation.Horizontal,
                VerticalOptions = LayoutOptions.Center,
                Padding         = new Thickness(20, 2, 0, 2),
                Children        =
                {
                    TextLabel,
                    Switch,
                },
            }
                   );

            TextLabel.VerticalOptions   = LayoutOptions.Center;
            TextLabel.HorizontalOptions = LayoutOptions.StartAndExpand;
            Switch.VerticalOptions      = LayoutOptions.Center;
            Switch.HorizontalOptions    = LayoutOptions.End;
            AlphaTheme.Apply(this);
        }
示例#16
0
 public AlphaFeedPage(string User)
 {
     Title = L["Activity"];
     Domain.GetFeed(User).ContinueWith
     (
         t => Device.BeginInvokeOnMainThread
         (
             () =>
     {
         if (null == t.Exception)
         {
             Feed = t.Result;
             Build();
             AlphaTheme.Apply(this);
         }
         else
         {
             Debug.WriteLine(t.Exception);
             AlphaFactory.MakeSureApp().Navigation.PopAsync();
         }
     }
         )
     );
 }
示例#17
0
 public override void Build()
 {
     base.Build();
     Debug.WriteLine("AlphaFeedPage.Rebuild();");
     if (null == Feed)
     {
         Content = new ActivityIndicator
         {
             VerticalOptions   = LayoutOptions.CenterAndExpand,
             HorizontalOptions = LayoutOptions.CenterAndExpand,
             IsRunning         = true,
         };
     }
     else
     {
         Content = new ListView
         {
             HasUnevenRows = true,
             ItemTemplate  = new DataTemplateEx(AlphaFactory.GetFeedEntryCellType()).SetBindingList("Entry"),
             ItemsSource   = Feed?.EntryList?.Select(i => new { Entry = i, }),
         };
     }
     AlphaTheme.Apply(this);
 }
示例#18
0
 public static void ApplyTheme(this View View, AlphaTheme Theme)
 {
     View.BackgroundColor = Theme.BackgroundColor;
 }
示例#19
0
        private static void ApplyCore(object UIObject, AlphaTheme Theme)
        {
            //  C# 7.0 を早く・・・

            var CircleGraph = UIObject as AlphaUserCircleGraph;

            if (null != CircleGraph)
            {
                //CircleGraph.AltTextColor = Theme.AccentColor;
                CircleGraph.BackgroundColor = Color.Default == Theme.BackgroundColor ?
                                              Color.White :
                                              Theme.BackgroundColor;
                return;
            }

            var ContentPage = UIObject as ContentPage;

            if (null != ContentPage)
            {
                ContentPage.BackgroundColor = Theme.BackgroundColor;
                Apply(ContentPage.Content);
                return;
            }

            var NavigationPage = UIObject as NavigationPage;

            if (null != NavigationPage)
            {
                NavigationPage.BarTextColor       = Theme.ForegroundColor;
                NavigationPage.BarBackgroundColor = Theme.BackgroundColor;
                NavigationPage.BackgroundColor    = Theme.BackgroundColor;
                Apply(NavigationPage.CurrentPage);
                return;
            }

            var Layout = UIObject as StackLayout;

            if (null != Layout)
            {
                Layout.BackgroundColor = Theme.BackgroundColor;
                foreach (var i in Layout.Children)
                {
                    //Debug.WriteLine($"i:{i.GetType().FullName}");
                    Apply(i);
                }
                return;
            }

            var Table = UIObject as TableView;

            if (null != Table)
            {
                Table.BackgroundColor = Theme.BackgroundColor;
                foreach (var i in Table.Root.AsEnumerable())
                {
                    Apply(i);
                }
                return;
            }

            var Section = UIObject as TableSection;

            if (null != Section)
            {
                foreach (var i in Section.AsEnumerable())
                {
                    Apply(i);
                }
                return;
            }

            var List = UIObject as ListView;

            if (null != List)
            {
                List.BackgroundColor = Theme.BackgroundColor;
                return;
            }

            var Search = UIObject as SearchBar;

            if (null != Search)
            {
                return;
            }

            var Label = UIObject as Label;

            if (null != Label)
            {
                Label.TextColor       = Theme.ForegroundColor;
                Label.BackgroundColor = Theme.BackgroundColor;
                return;
            }

            var Button = UIObject as Button;

            if (null != Button)
            {
                Button.TextColor       = Theme.AccentColor;
                Button.BackgroundColor = Theme.BackgroundColor;
                return;
            }

            var Grid = UIObject as Grid;

            if (null != Grid)
            {
                Grid.BackgroundColor = Theme.BackgroundColor;
                foreach (var i in Grid.Children)
                {
                    //Debug.WriteLine($"i:{i.GetType().FullName}");
                    Apply(i);
                }
                return;
            }

            var ViewCell = UIObject as ViewCell;

            if (null != ViewCell)
            {
                Apply(ViewCell.View);
                return;
            }

            var View = UIObject as View;

            if (null != View)
            {
                View.BackgroundColor = Theme.BackgroundColor;
                return;
            }
        }
示例#20
0
        public override void Build()
        {
            base.Build();
            Debug.WriteLine("AlphaSettingsPage.Rebuild();");

            var Friends = AlphaFactory.MakeCircleImageCell
                          (
                Text: L["Rivals"] /*+string.Format("({0})", Settings.GetFriendCount())*/,
                Command: new Command(o => Root.Navigation.PushAsync(new AlphaFriendsPage()))
                          );

            var ThemeCell = AlphaFactory.MakePickerCell();

            //ThemeCell.Items.Clear(); 2回目でこける。 Xamarin.Forms さん、もっと頑張って。。。
            foreach (var i in AlphaTheme.All.Keys)
            {
                if (!ThemeCell.Items.Where(j => j == i).Any())
                {
                    ThemeCell.Items.Add(L[i]);
                }
            }
            OldTheme = AlphaTheme.Get();
            ThemeCell.SelectedIndex = AlphaTheme.All.Values
                                      .IndexOf(OldTheme);
            ThemeCell.Picker.Unfocused += (sender, e) =>
            {
                var ThemeName = AlphaTheme.All.Keys.ElementAt(ThemeCell.SelectedIndex);
                AlphaTheme.Set(ThemeName);
                var NewTheme = AlphaTheme.Get();
                if (OldTheme != AlphaTheme.Get())
                {
                    OldTheme = NewTheme;
                    AlphaTheme.Apply(Root.Navigation);
                    AlphaTheme.Apply(Root.Main);
                    Build();
                    Analytics.TrackEvent(
                        name: "[Changed] Theme",
                        properties: new Dictionary <string, string> {
                        { "Category", "Settings" }, { "Theme", ThemeName }
                    }
                        );
                }
            };

            var LanguageCell = AlphaFactory.MakePickerCell();
            var Language     = Settings.Language ?? "";

            //LanguageCell.Items.Clear(); 2回目でこける。 Xamarin.Forms さん、もっと頑張って。。。
            foreach (var i in L.DisplayNames.Select(i => i.Value))
            {
                if (!LanguageCell.Items.Where(j => j == L[i]).Any())
                {
                    LanguageCell.Items.Add(L[i]);
                }
            }
            LanguageCell.SelectedIndex = L.DisplayNames
                                         .Select(i => i.Key)
                                         .IndexOf(Language);
            LanguageCell.Picker.Unfocused += (sender, e) =>
            {
                var OldLanguage = L.Get();
                Settings.Language = L.DisplayNames.Keys.ElementAt(LanguageCell.SelectedIndex);
                if (OldLanguage != L.Get())
                {
                    L.Update();
                    Root.OnChangeSettings();
                    Root.RebuildMainPage();
                    Build();
                    Analytics.TrackEvent(
                        name: "[Changed] Language",
                        properties: new Dictionary <string, string>
                    {
                        { "Category", "Settings" },
                        { "Language", string.IsNullOrEmpty(Settings.Language) ? "default": Settings.Language }
                    }
                        );
                }
            };

            if (Width <= Height)
            {
                Content = new StackLayout
                {
                    Children =
                    {
                        new TableView
                        {
                            Root = new TableRoot
                            {
                                new TableSection(L["Github Account"])
                                {
                                    UserLabel,
                                    Friends,
                                },
                                new TableSection(L["Notifications"])
                                {
                                    AlphaFactory.MakeCircleImageCell
                                    (
                                        Text: L["Alert by Left Time"],
                                        Command: new Command(o => Root.Navigation.PushAsync(new AlphaLeftTimeSettingsPage()))
                                    ),
                                    AlphaFactory.MakeCircleImageCell
                                    (
                                        Text: L["Daily Alert"],
                                        Command: new Command(o => Root.Navigation.PushAsync(new AlphaDailyAlertSettingsPage()))
                                    )
                                },
                                new TableSection(L["Theme"])
                                {
                                    ThemeCell
                                },
                                new TableSection(L["Language"])
                                {
                                    LanguageCell
                                },
                                new TableSection(L["Information"])
                                {
                                    AlphaFactory.MakeCircleImageCell
                                    (
                                        ImageSource: Root.GetApplicationImageSource(),
                                        Text: L["keep.grass"],
                                        Command: new Command(o => Root.Navigation.PushAsync(AlphaFactory.MakeInfoPage()))
                                    ),
                                },
                            },
                        },
                    },
                };
            }
            else
            {
                Content = new StackLayout
                {
                    Children =
                    {
                        new StackLayout
                        {
                            Orientation     = StackOrientation.Horizontal,
                            Spacing         = 1.0,
                            BackgroundColor = Color.Gray,
                            Children        =
                            {
                                new TableView
                                {
                                    BackgroundColor = Color.White,
                                    Root            = new TableRoot
                                    {
                                        new TableSection(L["Github Account"])
                                        {
                                            UserLabel,
                                            Friends,
                                        },
                                        new TableSection(L["Theme"])
                                        {
                                            ThemeCell
                                        },
                                        new TableSection(L["Language"])
                                        {
                                            LanguageCell
                                        },
                                    },
                                },
                                new TableView
                                {
                                    BackgroundColor = Color.White,
                                    Root            = new TableRoot
                                    {
                                        new TableSection(L["Notifications"])
                                        {
                                            AlphaFactory.MakeCircleImageCell
                                            (
                                                Text: L["Alert by Left Time"],
                                                Command: new Command(o => Root.Navigation.PushAsync(new AlphaLeftTimeSettingsPage()))
                                            ),
                                            AlphaFactory.MakeCircleImageCell
                                            (
                                                Text: L["Daily Alert"],
                                                Command: new Command(o => Root.Navigation.PushAsync(new AlphaDailyAlertSettingsPage()))
                                            )
                                        },
                                        new TableSection(L["Information"])
                                        {
                                            AlphaFactory.MakeCircleImageCell
                                            (
                                                ImageSource: Root.GetApplicationImageSource(),
                                                Text: L["keep.grass"],
                                                Command: new Command(o => Root.Navigation.PushAsync(AlphaFactory.MakeInfoPage()))
                                            ),
                                        },
                                    },
                                },
                            },
                        },
                    },
                };
            }
            AlphaTheme.Apply(this);
            ApplyUser(Settings.UserName);
        }
示例#21
0
 public void AppliedTheme(AlphaTheme Theme)
 {
     IsInvalidCanvas = true;
 }
示例#22
0
        public override void Build()
        {
            base.Build();
            Debug.WriteLine("AlphaMainPage.Rebuild();");

            AlphaApp Root = AlphaFactory.MakeSureApp();

            if (null == Friends || Settings.GetFriendCount() != Friends.Count())
            {
                Friends = Settings.GetFriendList().Select(i => AlphaFactory.MakeUserCircleGraph()).ToArray();
                for (var i = 0; i < Friends?.Count(); ++i)
                {
                    var Friend       = Settings.GetFriend(i);
                    var FriendCircle = Friends[i];
                    InitCircleGraph(FriendCircle, Friend);
                    FriendCircle.HorizontalOptions       = LayoutOptions.Center;
                    FriendCircle.VerticalOptions         = LayoutOptions.Center;
                    FriendCircle.IsVisibleLeftTimeBar    = false;
                    FriendCircle.IsVisibleSatelliteTexts = false;
                    FriendCircle.FontSize    *= 0.5f;
                    FriendCircle.CircleMargin = new Thickness(2.0);
                }
            }

            UpdateButton.Text = L["Update"];
            var SettingsButton = new Button
            {
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Text    = L["Settings"],
                Command = new Command(o => Root.ShowSettingsPage()),
            };
            var ButtonFrame = new Grid()
            {
                VerticalOptions   = LayoutOptions.End,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            }
            .HorizontalJustificate
            (
                UpdateButton,
                SettingsButton
            );

            if (Width <= Height)
            {
                CircleGraph.WidthRequest  = Width;
                CircleGraph.HeightRequest = Math.Floor(Height * 0.10);
                foreach (var Friend in Friends)
                {
                    Friend.WidthRequest  = Math.Floor(Width / Math.Min(Math.Max(Friends.Count(), 2), 4));
                    Friend.HeightRequest = Friend.WidthRequest;
                }
                var StackContent = new StackLayout
                {
                    Spacing = 0.0,
                };
                StackContent.Children.Add(CircleGraph);
                BuildFriends(StackContent, StackOrientation.Horizontal);
                StackContent.Children.Add(ButtonFrame);
                Content = StackContent;
            }
            else
            {
                CircleGraph.WidthRequest  = Math.Floor(Width * 0.10);
                CircleGraph.HeightRequest = Math.Floor(Height * 0.60);
                foreach (var Friend in Friends)
                {
                    Friend.HeightRequest = Math.Floor(Height / Math.Min(Math.Max(Friends.Count(), 2), 4));
                    Friend.WidthRequest  = Friend.HeightRequest;
                }
                var StackContent = new StackLayout
                {
                    Orientation     = StackOrientation.Horizontal,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    Spacing         = 0.0,
                };
                StackContent.Children.Add(CircleGraph);
                BuildFriends(StackContent, StackOrientation.Vertical);
                Content = new StackLayout
                {
                    Spacing = 0.0,
                    //BackgroundColor = Color.White,
                    Children =
                    {
                        StackContent,
                        ButtonFrame,
                    },
                };
            }

            //  Indicator を表示中にレイアウトを変えてしまうと簡潔かつ正常に Indicator を再表示できないようなので、問答無用でテキストを表示してしまう。
            UpdateButton.ShowText();

            ApplyCircleGraph(i => i.IsInvalidCanvas = true);
            OnUpdateLastPublicActivity(Settings.UserName, Domain.GetLastPublicActivity(Settings.UserName));

            var SettingsButtonAnimation = "DefaultButtn";

            if (SettingsButton.AnimationIsRunning(SettingsButtonAnimation))
            {
                SettingsButton.AbortAnimation(SettingsButtonAnimation);
            }
            AlphaTheme.Apply(this);

            if (string.IsNullOrWhiteSpace(CircleGraph.User))
            {
                var Theme = AlphaTheme.Get();
                SettingsButton.Animate
                (
                    SettingsButtonAnimation,
                    d =>
                {
                    var Rate = Math.Abs(Math.Sin(d));
                    SettingsButton.TextColor       = ColorEx.MergeWithRate(Theme.AccentColor, Theme.BackgroundColor, Rate);
                    SettingsButton.BackgroundColor = ColorEx.MergeWithRate(Theme.BackgroundColor, Theme.AccentColor, Rate);
                },
                    0.0,
                    1000.0,
                    16,
                    (uint)2000000,
                    Easing.Linear
                );
            }
        }
示例#23
0
 public void ApplyTheme(AlphaTheme Theme)
 {
     BackgroundColor = Theme.BackgroundColor;
 }
示例#24
0
 public static Color MakeLeftTimeColor(TimeSpan LeftTime)
 {
     return(AlphaTheme.Get().MakeLeftTimeColor(Math.Max(0.0, Math.Min(1.0, LeftTime.TotalHours / 24.0))));
 }
示例#25
0
 public void ApplyTheme(AlphaTheme Theme)
 {
     BackgroundColor = Theme.BackgroundColor;
     CircleGraph.ApplyTheme(Theme);
     AlphaTheme.Apply(this);
 }
示例#26
0
 public override void Build()
 {
     base.Build();
     Debug.WriteLine("AlphaSelectUserPage.Rebuild();");
     AlphaTheme.Apply(this);
 }
示例#27
0
 public void ApplyTheme(AlphaTheme Theme)
 {
     Indicator.Color     = Theme.ForegroundColor;
     TextLabel.TextColor = Theme.ForegroundColor;
     //View.BackgroundColor = Theme.BackGroundColor;
 }
示例#28
0
 public void AppliedTheme(AlphaTheme Theme)
 {
     SearchButton.TextColor       = Theme.BackgroundColor;
     SearchButton.BackgroundColor = Theme.AccentColor;
 }
示例#29
0
        public override void Build()
        {
            base.Build();
            Debug.WriteLine("AlphaDetailPage.Rebuild();");

            Theme = AlphaTheme.Get();
            var MainTable = new TableView
            {
                Root = new TableRoot
                {
                    new TableSection(L["Github Account"])
                    {
                        UserLabel,
                    },
                    new TableSection(L["Last Activity Stamp"])
                    {
                        LastActivityStampLabel,
                    },
                    new TableSection(L["Left Time"])
                    {
                        LeftTimeLabel,
                    },
                },
            };

            MainTable.ApplyTheme(Theme);
            if (Width <= Height)
            {
                //CircleGraph.WidthRequest = Width;
                CircleGraph.HeightRequest     = Height * 0.55;
                CircleGraph.HorizontalOptions = LayoutOptions.FillAndExpand;
                CircleGraph.VerticalOptions   = LayoutOptions.Start;

                Content = new StackLayout
                {
                    Spacing         = 1.0,
                    BackgroundColor = Color.Gray,
                    Children        =
                    {
                        CircleGraph,
                        MainTable,
                    },
                };
            }
            else
            {
                CircleGraph.WidthRequest = Width * 0.55;
                //CircleGraph.HeightRequest = Height;
                CircleGraph.HorizontalOptions = LayoutOptions.Start;
                CircleGraph.VerticalOptions   = LayoutOptions.FillAndExpand;

                Content = new StackLayout
                {
                    Spacing         = 1.0,
                    BackgroundColor = Color.Gray,
                    Children        =
                    {
                        new StackLayout
                        {
                            Orientation = StackOrientation.Horizontal,
                            Spacing     = 1.0,
                            Children    =
                            {
                                CircleGraph,
                                MainTable,
                            },
                        },
                    },
                };
            }

            //  Indicator を表示中にレイアウトを変えてしまうと簡潔かつ正常に Indicator を再表示できないようなので、問答無用でテキストを表示してしまう。
            //LastActivityStampLabel.ShowText();
            LeftTimeLabel.ShowText();

            CircleGraph.IsInvalidCanvas = true;
            OnUpdateLastPublicActivity();
            ApplyTheme(Theme);
        }
示例#30
0
        public override void Build()
        {
            base.Build();
            Debug.WriteLine("AlphaInfoPage.Rebuild();");

            var Version = new TableSection(L["Version"])
            {
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: Root.GetApplicationImageSource(),
                    Text: "2.00.004",
                    Command: new Command
                    (
                        o => Device.OpenUri
                        (
                            AlphaFactory.MakeSureDomain().GetApplicationStoreUri()
                        )
                    ),
                    OptionImageSource: Root.GetExportImageSource()
                ),
            };
            var Auther = new TableSection(L["Auther"])
            {
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: Root.GetWraithImageSource(),
                    Text: "@wraith13",
                    Command: new Command(o => Device.OpenUri(new Uri("https://twitter.com/wraith13"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
            };
            var Repository = new TableSection(L["Github Repository"])
            {
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: Root.GetGitHubImageSource(),
                    Text: "wraith13/keep.grass",
                    Command: new Command(o => Device.OpenUri(new Uri("https://github.com/wraith13/keep.grass"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
            };
            var BuiltWith = new TableSection(L["Built with"])
            {
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "Xamarin",
                    Command: new Command(o => Device.OpenUri(new Uri("https://www.xamarin.com"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "Visual Studio",
                    Command: new Command(o => Device.OpenUri(new Uri("https://www.visualstudio.com/vs/"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "Visual Studio Code",
                    Command: new Command(o => Device.OpenUri(new Uri("https://code.visualstudio.com/"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "GIMP",
                    Command: new Command(o => Device.OpenUri(new Uri("https://www.gimp.org"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "Microsoft HTTP Client Lib.",
                    Command: new Command(o => Device.OpenUri(new Uri("https://www.nuget.org/packages/Microsoft.Net.Http/"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "Microsoft.Azure.Mobile.Analytics",
                    Command: new Command(o => Device.OpenUri(new Uri("https://www.nuget.org/packages/Microsoft.Azure.Mobile.Analytics/"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "Microsoft.Azure.Mobile.Crashes",
                    Command: new Command(o => Device.OpenUri(new Uri("https://www.nuget.org/packages/Microsoft.Azure.Mobile.Crashes//"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "Settings Plugin",
                    Command: new Command(o => Device.OpenUri(new Uri("https://github.com/jamesmontemagno/SettingsPlugin"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "Circle Image Control Plugin",
                    Command: new Command(o => Device.OpenUri(new Uri("https://github.com/jamesmontemagno/ImageCirclePlugin"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "NotificationsExtensions",
                    Command: new Command(o => Device.OpenUri(new Uri("https://github.com/WindowsNotifications/NotificationsExtensions"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "SkiaSharp(.Views.Forms)",
                    Command: new Command(o => Device.OpenUri(new Uri("https://github.com/mono/SkiaSharp"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "Json.NET",
                    Command: new Command(o => Device.OpenUri(new Uri("http://www.newtonsoft.com/json"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "Noto Sans CJK jp Regular",
                    Command: new Command(o => Device.OpenUri(new Uri("https://www.google.com/get/noto/help/cjk/"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
                AlphaFactory.MakeCircleImageCell
                (
                    ImageSource: null,
                    Text: "GitHub Octicons",
                    Command: new Command(o => Device.OpenUri(new Uri("https://octicons.github.com"))),
                    OptionImageSource: Root.GetExportImageSource()
                ),
            };

            var StackContent = new StackLayout
            {
                Orientation     = StackOrientation.Horizontal,
                Spacing         = 1.0,
                BackgroundColor = Color.Gray,
            };

            if (Width <= Height)
            {
                StackContent.Children.Add
                (
                    new TableView
                {
                    BackgroundColor = Color.White,
                    Root            = new TableRoot
                    {
                        Version,
                        Auther,
                        Repository,
                        BuiltWith,
                    }
                }
                );
            }
            else
            {
                StackContent.Children.Add
                (
                    new TableView
                {
                    BackgroundColor = Color.White,
                    Root            = new TableRoot
                    {
                        Version,
                        Auther,
                        Repository,
                    }
                }
                );
                StackContent.Children.Add
                (
                    new TableView
                {
                    BackgroundColor = Color.White,
                    Root            = new TableRoot
                    {
                        BuiltWith,
                    }
                }
                );
            }
            Content = StackContent;
            AlphaTheme.Apply(this);
        }