void SetText() { UkName.Text = Settings.MobileSettings.main_name; if (!string.IsNullOrWhiteSpace(Settings.Person.companyPhone)) { LabelPhone.Text = "+" + Settings.Person.companyPhone.Replace("+", ""); } else { IconViewLogin.IsVisible = false; LabelPhone.IsVisible = false; } Color hexColor = (Color)Application.Current.Resources["MainColor"]; IconViewLogin.SetAppThemeColor(IconView.ForegroundProperty, hexColor, Color.White); Pancake.SetAppThemeColor(PancakeView.BorderColorProperty, hexColor, Color.Transparent); PancakeViewIcon.SetAppThemeColor(PancakeView.BorderColorProperty, hexColor, Color.Transparent); { if (AppInfo.PackageName == "rom.best.saburovo" || AppInfo.PackageName == "sys_rom.ru.tsg_saburovo") { PancakeViewIcon.Padding = new Thickness(0); } } //LabelTech.SetAppThemeColor(Label.TextColorProperty, hexColor, Color.White); //IconViewTech.SetAppThemeColor(IconView.ForegroundProperty, hexColor, Color.White); }
void SetText() { UkName.Text = Settings.MobileSettings.main_name; if (!string.IsNullOrWhiteSpace(Settings.Person.companyPhone)) { LabelPhone.Text = "+" + Settings.Person.companyPhone.Replace("+", ""); } else { IconViewLogin.IsVisible = false; LabelPhone.IsVisible = false; } LabelTitle.Text = _pollInfo.Name; FrameBtnNext.BackgroundColor = (Color)Application.Current.Resources["MainColor"]; FrameBtnFinish.BackgroundColor = (Color)Application.Current.Resources["MainColor"]; Color hexColor = (Color)Application.Current.Resources["MainColor"]; IconViewLogin.SetAppThemeColor(IconView.ForegroundProperty, hexColor, Color.White); //IconViewTech.SetAppThemeColor(IconView.ForegroundProperty, hexColor, Color.Black); Pancake.SetAppThemeColor(PancakeView.BorderColorProperty, hexColor, Color.Transparent); PancakeViewIcon.SetAppThemeColor(PancakeView.BorderColorProperty, hexColor, Color.Transparent); if (Device.RuntimePlatform == Device.iOS) { if (AppInfo.PackageName == "rom.best.saburovo" || AppInfo.PackageName == "sys_rom.ru.tsg_saburovo") { PancakeViewIcon.Padding = new Thickness(0); } } //LabelTech.SetAppThemeColor(Label.TextColorProperty, hexColor, Color.Black); Color unselect = hexColor.AddLuminosity(0.3); FrameBack.SetAppThemeColor(Frame.BackgroundColorProperty, unselect, Color.FromHex("#4A4A4A")); StackLayoutIndicator.SetAppThemeColor(StackLayout.BackgroundColorProperty, unselect, Color.White); }
async void SetText() { UkName.Text = Settings.MobileSettings.main_name; if (!string.IsNullOrWhiteSpace(Settings.Person.companyPhone)) { LabelPhone.Text = "+" + Settings.Person.companyPhone.Replace("+", ""); } else { IconViewLogin.IsVisible = false; LabelPhone.IsVisible = false; } LabelTitle.Text = _announcementInfo.Header; LabelDate.Text = _announcementInfo.Created; LabelText.Text = _announcementInfo.Text; FrameBtnQuest.BackgroundColor = (Color)Application.Current.Resources["MainColor"]; int announcementInfoAdditionalServiceId = _announcementInfo.AdditionalServiceId; if (announcementInfoAdditionalServiceId != -1) { _additional = Settings.GetAdditionalService(announcementInfoAdditionalServiceId); byte[] imageByte = await _server.GetPhotoAdditional(announcementInfoAdditionalServiceId.ToString()); if (imageByte != null) { Stream stream = new MemoryStream(imageByte); ImageAdd.Source = ImageSource.FromStream(() => { return(stream); }); ImageAdd.IsVisible = true; var openAdditional = new TapGestureRecognizer(); openAdditional.Tapped += async(s, e) => { await Navigation.PushAsync(new AdditionalOnePage(_additional)); }; ImageAdd.GestureRecognizers.Add(openAdditional); } } if (_announcementInfo.QuestionGroupID != -1) { _polls = Settings.GetPollInfo(_announcementInfo.QuestionGroupID); FrameBtnQuest.IsVisible = true; } Color hexColor = (Color)Application.Current.Resources["MainColor"]; IconViewLogin.SetAppThemeColor(IconView.ForegroundProperty, hexColor, Color.White); Pancake.SetAppThemeColor(PancakeView.BorderColorProperty, hexColor, Color.Transparent); PancakeViewIcon.SetAppThemeColor(PancakeView.BorderColorProperty, hexColor, Color.Transparent); if (Device.RuntimePlatform == Device.iOS) { if (AppInfo.PackageName == "rom.best.saburovo" || AppInfo.PackageName == "sys_rom.ru.tsg_saburovo") { PancakeViewIcon.Padding = new Thickness(0); } } //LabelTech.SetAppThemeColor(Label.TextColorProperty, hexColor, Color.Black); //IconViewTech.SetAppThemeColor(IconView.ForegroundProperty, hexColor, Color.Black); }
async void SetText() { UkName.Text = Settings.MobileSettings.main_name; if (!string.IsNullOrWhiteSpace(Settings.Person.companyPhone)) { LabelPhone.Text = "+" + Settings.Person.companyPhone.Replace("+", ""); } else { IconViewLogin.IsVisible = false; LabelPhone.IsVisible = false; } LabelTitle.Text = newsInfo.Header; LabelDate.Text = newsInfo.Created; newsInfoFull = await _server.GetNewsFull(newsInfo.ID.ToString()); //LabelText.Text = newsInfoFull.Text; //LabelText.FormattedText = (FormattedString)(new HtmlTextConverter()).Convert(newsInfoFull.Text, null); //var new_text = System.Text.RegularExpressions.Regex.Replace(newsInfoFull.Text, @"width=\""[0-9]*\""", "width=\"100%\""); //newsInfoFull.Text = System.Text.RegularExpressions.Regex.Replace(new_text, @"height=\""[0-9]*\""", ""); MainText.Source = new HtmlWebViewSource { Html = newsInfoFull.Text }; MainText.FlowDirection = FlowDirection.MatchParent; MainText.Navigated += (s, e) => { if (!navigated) { (s as WebView).Source = new UrlWebViewSource() { Url = e.Url }; navigated = true; } }; Color hexColor = (Color)Application.Current.Resources["MainColor"]; IconViewLogin.SetAppThemeColor(IconView.ForegroundProperty, hexColor, Color.White); Pancake.SetAppThemeColor(PancakeView.BorderColorProperty, hexColor, Color.Transparent); PancakeViewIcon.SetAppThemeColor(PancakeView.BorderColorProperty, hexColor, Color.Transparent); { if (AppInfo.PackageName == "rom.best.saburovo" || AppInfo.PackageName == "sys_rom.ru.tsg_saburovo") { PancakeViewIcon.Padding = new Thickness(0); } } //LabelTech.SetAppThemeColor(Label.TextColorProperty, hexColor, Color.Black); //IconViewTech.SetAppThemeColor(IconView.ForegroundProperty, hexColor, Color.Black); if (Xamarin.Essentials.Connectivity.NetworkAccess != Xamarin.Essentials.NetworkAccess.Internet) { Device.BeginInvokeOnMainThread(async() => await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorNoInternet, "OK")); return; } Files.IsVisible = newsInfoFull.HasImage; }
public TechSendPage(bool isVisibleApp = true) { InitializeComponent(); NavigationPage.SetHasNavigationBar(this, false); switch (Device.RuntimePlatform) { case Device.iOS: int statusBarHeight = DependencyService.Get <IStatusBar>().GetHeight(); Pancake.Padding = new Thickness(0, statusBarHeight, 0, 0); //BackgroundColor = Color.White; break; default: break; } UkName.Text = Settings.MobileSettings.main_name; StackLayoutApp.IsVisible = isVisibleApp; if (Settings.Person.IsDispatcher || !Settings.AppIsVisible) { StackLayoutApp.IsVisible = false; } EntryPhone.Text = Settings.Person.Phone; LabelInfo.Text = AppResources.TechAdditionalText1 + Settings.MobileSettings.main_name + AppResources.TechAdditionalText2; BtnApp.Text = AppResources.TechAdditionalText3 + Settings.MobileSettings.main_name; var backClick = new TapGestureRecognizer(); backClick.Tapped += async(s, e) => { ClosePage(); }; BackStackLayout.GestureRecognizers.Add(backClick); var appOpen = new TapGestureRecognizer(); appOpen.Tapped += async(s, e) => { if (isVisibleApp) { if (Settings.Person.Accounts.Count > 0) { if (Settings.TypeApp.Count > 0) { await Navigation.PushAsync(new NewAppPage()); } else { await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorAppsNoTypes, "OK"); } } else { await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorAppsNoIdent, "OK"); } } }; FrameBtnApp.GestureRecognizers.Add(appOpen); var send = new TapGestureRecognizer(); send.Tapped += async(s, e) => { string phone = EntryPhone.Text .Replace("+", "") .Replace(" ", "") .Replace("(", "") .Replace(")", "") .Replace("-", ""); ; string email = EntryEmail.Text; string text = EntryText.Text; if (phone.Length < 11) { await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorTechNumberFormat, "OK"); return; } if (email.Equals("")) { await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorEnterEmail, "OK"); return; } if (text.Equals("")) { await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorTechDesc, "OK"); return; } await SendTechTask(); }; FrameBtnLogin.GestureRecognizers.Add(send); Color hexColor = (Color)Application.Current.Resources["MainColor"]; IconViewLogin.SetAppThemeColor(IconView.ForegroundProperty, hexColor, Color.White); Pancake.SetAppThemeColor(PancakeView.BorderColorProperty, hexColor, Color.Transparent); PancakeViewIcon.SetAppThemeColor(PancakeView.BorderColorProperty, hexColor, Color.Transparent); { if (AppInfo.PackageName == "rom.best.saburovo" || AppInfo.PackageName == "sys_rom.ru.tsg_saburovo") { PancakeViewIcon.Padding = new Thickness(0); } } Frame.SetAppThemeColor(MaterialFrame.BorderColorProperty, hexColor, Color.White); BindingContext = this; }