Beispiel #1
0
 private void Clear()
 {
     TxtFullName.Clear();
     TxtPhone.Clear();
     TxtUserEmail.Clear();
     TxtPassword.Clear();
 }
Beispiel #2
0
 private void TxtIdx_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)
     {
         TxtFullName.Focus();
     }
 }
Beispiel #3
0
 private void UserPassWordConfirm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TxtFullName.Focus();
     }
 }
Beispiel #4
0
 private void wdwEmployeeRelative_Loaded(object sender, RoutedEventArgs e)
 {
     if (TxtFullName.Text.Contains("-"))
     {
         TxtFullName.Text = TxtFullName.Text.Replace('-', ' ');
     }
     TxtFullName.Focus();
 }
        private void InitComponent(View view)
        {
            try
            {
                CollapsingToolbar       = view.FindViewById <CollapsingToolbarLayout>(Resource.Id.collapsingToolbar);
                CollapsingToolbar.Title = "";

                TxtUserName = view.FindViewById <TextView>(Resource.Id.username);
                BtnSettings = view.FindViewById <TextView>(Resource.Id.setting_btn);

                ImageUser   = view.FindViewById <ImageView>(Resource.Id.user_image);
                TxtFullName = view.FindViewById <TextView>(Resource.Id.fullname);

                FollowingLayout   = view.FindViewById <LinearLayout>(Resource.Id.following_layout);
                TxtFollowingCount = view.FindViewById <TextView>(Resource.Id.following_count_txt);

                FollowersLayout   = view.FindViewById <LinearLayout>(Resource.Id.followers_layout);
                TxtFollowersCount = view.FindViewById <TextView>(Resource.Id.followers_count_txt);

                PostLayout   = view.FindViewById <LinearLayout>(Resource.Id.post_layout);
                TxtPostCount = view.FindViewById <TextView>(Resource.Id.post_count_txt);

                BtnEditProfile = view.FindViewById <TextView>(Resource.Id.edit_profile_btn);

                ViewPager = view.FindViewById <ViewPager>(Resource.Id.pager);
                TabLayout = view.FindViewById <TabLayout>(Resource.Id.tabs);

                TxtFollowingCount.Text = "0";
                TxtFollowersCount.Text = "0";
                TxtPostCount.Text      = "0";

                if (AppSettings.SetTabDarkTheme)
                {
                    TxtFullName.SetTextColor(Color.White);
                    BtnSettings.SetTextColor(Color.White);
                }

                ViewPager.OffscreenPageLimit = 2;
                SetUpViewPager(ViewPager);
                TabLayout.SetupWithViewPager(ViewPager);

                TabLayout.GetTabAt(0).SetIcon(Resource.Drawable.ic_tab_more);
                TabLayout.GetTabAt(1).SetIcon(Resource.Drawable.ic_action_like_1);

                // set icon color pre-selected
                TabLayout.GetTabAt(0).Icon.SetColorFilter(new PorterDuffColorFilter(AppSettings.SetTabDarkTheme ? Color.White : Color.Gray, PorterDuff.Mode.SrcIn));
                TabLayout.GetTabAt(1).Icon.SetColorFilter(new PorterDuffColorFilter(AppSettings.SetTabDarkTheme ? Color.White : Color.Gray, PorterDuff.Mode.SrcIn));

                TabLayout.GetTabAt(0).Icon.SetColorFilter(new PorterDuffColorFilter(Color.ParseColor(AppSettings.MainColor), PorterDuff.Mode.SrcIn));

                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, BtnSettings, IonIconsFonts.AndroidSettings);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public void LoadUserData(UserDataObject cl, bool friends = true)
        {
            try
            {
                PPrivacy = cl.PPrivacy;

                GlideImageLoader.LoadImage(Activity, cl.Avatar, ImageUser, ImageStyle.CircleCrop, ImagePlaceholders.Color);

                AboutTab.TextSanitizerAutoLink.Load(AppTools.GetAboutFinal(cl));
                AboutTab.TxtGender.Text = cl.Gender;
                AboutTab.TxtEmail.Text  = cl.Email;
                if (string.IsNullOrEmpty(cl.Website))
                {
                    AboutTab.WebsiteLinearLayout.Visibility = ViewStates.Gone;
                }
                else
                {
                    AboutTab.TxtWebsite.Text = cl.Website;
                    AboutTab.WebsiteLinearLayout.Visibility = ViewStates.Visible;
                }

                TxtUserName.Text = "@" + cl.Username;

                var font = Typeface.CreateFromAsset(Application.Context.Resources.Assets, "ionicons.ttf");
                TxtFullName.SetTypeface(font, TypefaceStyle.Normal);

                var textHighLighter = AppTools.GetNameFinal(cl);

                if (cl.Verified == "1")
                {
                    textHighLighter += " " + IonIconsFonts.CheckmarkCircled;
                }

                if (cl.BusinessAccount == "1")
                {
                    textHighLighter += " " + IonIconsFonts.SocialUsd;
                }

                var decorator = TextDecorator.Decorate(TxtFullName, textHighLighter);

                if (cl.Verified == "1")
                {
                    decorator.SetTextColor(Resource.Color.Post_IsVerified, IonIconsFonts.CheckmarkCircled);
                }

                if (cl.BusinessAccount == "1")
                {
                    decorator.SetTextColor(Resource.Color.Post_IsBusiness, IonIconsFonts.SocialUsd);
                }

                decorator.Build();

                TxtPostCount.Text = Methods.FunString.FormatPriceValue(Int32.Parse(cl.PostsCount));

                if (cl.Followers != null && int.TryParse(cl.Followers, out var numberFollowers))
                {
                    TxtFollowersCount.Text = Methods.FunString.FormatPriceValue(numberFollowers);
                }

                if (cl.Following != null && int.TryParse(cl.Following, out var numberFollowing))
                {
                    TxtFollowingCount.Text = Methods.FunString.FormatPriceValue(numberFollowing);
                }

                if (!string.IsNullOrEmpty(cl.Google))
                {
                    AboutTab.Google = cl.Google;
                    AboutTab.SocialGoogle.SetTypeface(font, TypefaceStyle.Normal);
                    AboutTab.SocialGoogle.Text            = IonIconsFonts.SocialGoogle;
                    AboutTab.SocialGoogle.Visibility      = ViewStates.Visible;
                    AboutTab.SocialLinksLinear.Visibility = ViewStates.Visible;
                }

                if (!string.IsNullOrEmpty(cl.Facebook))
                {
                    AboutTab.Facebook = cl.Facebook;
                    AboutTab.SocialFacebook.SetTypeface(font, TypefaceStyle.Normal);
                    AboutTab.SocialFacebook.Text          = IonIconsFonts.SocialFacebook;
                    AboutTab.SocialFacebook.Visibility    = ViewStates.Visible;
                    AboutTab.SocialLinksLinear.Visibility = ViewStates.Visible;
                }

                if (!string.IsNullOrEmpty(cl.Website))
                {
                    AboutTab.Website = cl.Website;
                    AboutTab.WebsiteButton.SetTypeface(font, TypefaceStyle.Normal);
                    AboutTab.WebsiteButton.Text           = IonIconsFonts.AndroidGlobe;
                    AboutTab.WebsiteButton.Visibility     = ViewStates.Visible;
                    AboutTab.SocialLinksLinear.Visibility = ViewStates.Visible;
                }


                if (!string.IsNullOrEmpty(cl.Twitter))
                {
                    AboutTab.Twitter = cl.Twitter;
                    AboutTab.SocialTwitter.SetTypeface(font, TypefaceStyle.Normal);
                    AboutTab.SocialTwitter.Text           = IonIconsFonts.SocialTwitter;
                    AboutTab.SocialTwitter.Visibility     = ViewStates.Visible;
                    AboutTab.SocialLinksLinear.Visibility = ViewStates.Visible;
                }

                BtnMessage.Visibility = cl.IsFollowing != null && (cl.CPrivacy == "1" || cl.CPrivacy == "2" && cl.IsFollowing.Value) ? ViewStates.Visible : ViewStates.Invisible;

                if (cl.IsFollowing != null)
                {
                    SIsFollowing = cl.IsFollowing.Value;
                }

                if (!friends)
                {
                    return;
                }
                if (cl.IsFollowing != null && cl.IsFollowing.Value) // My Friend
                {
                    FollowButton.SetBackgroundColor(Color.ParseColor("#efefef"));
                    FollowButton.SetTextColor(Color.ParseColor("#444444"));
                    FollowButton.Text = Context.GetText(Resource.String.Lbl_Following);
                    FollowButton.Tag  = "true";
                }
                else
                {
                    //Not Friend
                    FollowButton.SetBackgroundResource(Resource.Drawable.buttonFlatNormal);
                    FollowButton.SetTextColor(Color.ParseColor("#ffffff"));
                    FollowButton.Text = Context.GetText(Resource.String.Lbl_Follow);
                    FollowButton.Tag  = "false";
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private void InitComponent(View view)
        {
            try
            {
                CollapsingToolbar       = view.FindViewById <CollapsingToolbarLayout>(Resource.Id.collapsingToolbar);
                CollapsingToolbar.Title = "";

                IconBack    = view.FindViewById <TextView>(Resource.Id.back_btn);
                TxtUserName = view.FindViewById <TextView>(Resource.Id.username);
                BtnMore     = view.FindViewById <TextView>(Resource.Id.more_btn);

                ImageUser   = view.FindViewById <ImageView>(Resource.Id.user_image);
                TxtFullName = view.FindViewById <TextView>(Resource.Id.fullname);

                FollowingLayout   = view.FindViewById <LinearLayout>(Resource.Id.following_layout);
                TxtFollowingCount = view.FindViewById <TextView>(Resource.Id.following_count_txt);

                FollowersLayout   = view.FindViewById <LinearLayout>(Resource.Id.followers_layout);
                TxtFollowersCount = view.FindViewById <TextView>(Resource.Id.followers_count_txt);

                PostLayout   = view.FindViewById <LinearLayout>(Resource.Id.post_layout);
                TxtPostCount = view.FindViewById <TextView>(Resource.Id.post_count_txt);

                BtnMessage   = view.FindViewById <TextView>(Resource.Id.message_btn);
                FollowButton = view.FindViewById <Button>(Resource.Id.add_btn);

                ViewPager = view.FindViewById <ViewPager>(Resource.Id.pager);
                TabLayout = view.FindViewById <TabLayout>(Resource.Id.tabs);

                TxtFollowingCount.Text = "0";
                TxtFollowersCount.Text = "0";
                TxtPostCount.Text      = "0";

                ViewPager.OffscreenPageLimit = 2;
                SetUpViewPager(ViewPager);
                TabLayout.SetupWithViewPager(ViewPager);

                TabLayout.GetTabAt(0).SetIcon(Resource.Drawable.ic_tab_more);
                TabLayout.GetTabAt(1).SetIcon(Resource.Drawable.ic_tab_user_profile);

                // set icon color pre-selected
                TabLayout.GetTabAt(0).Icon.SetColorFilter(new PorterDuffColorFilter(AppSettings.SetTabDarkTheme ? Color.White : Color.Gray, PorterDuff.Mode.SrcIn));
                TabLayout.GetTabAt(1).Icon.SetColorFilter(new PorterDuffColorFilter(AppSettings.SetTabDarkTheme ? Color.White : Color.Gray, PorterDuff.Mode.SrcIn));

                TabLayout.GetTabAt(0).Icon.SetColorFilter(new PorterDuffColorFilter(Color.ParseColor(AppSettings.MainColor), PorterDuff.Mode.SrcIn));

                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconBack, IonIconsFonts.AndroidArrowBack);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, BtnMore, IonIconsFonts.AndroidMoreVertical);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, BtnMessage, FontAwesomeIcon.PaperPlane);

                TxtUserName.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                BtnMore.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                TxtFullName.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);

                if (AppSettings.FlowDirectionRightToLeft)
                {
                    FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconBack, IonIconsFonts.AndroidArrowForward);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Beispiel #8
0
 private void BtnAddNew_Click(object sender, RoutedEventArgs e)
 {
     TxtFullName.Focus();
 }
Beispiel #9
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     TxtFullName.Focus();
 }
Beispiel #10
0
 private void wdwEmployeeTestimony_Loaded(object sender, RoutedEventArgs e)
 {
     TxtFullName.Focus();
 }
        private async void LoadProfile()
        {
            try
            {
                if (ListUtils.MyProfileList.Count == 0)
                {
                    await ApiRequest.GetProfile_Api(Activity);
                }

                var data = ListUtils.MyProfileList.FirstOrDefault();
                if (data != null)
                {
                    GlideImageLoader.LoadImage(Activity, data.Avatar, ImageUser, ImageStyle.CircleCrop, ImagePlaceholders.Color);

                    //TxtFullName.Text = AppTools.GetNameFinal(data);
                    CollapsingToolbar.Title = AppTools.GetNameFinal(data);
                    TxtUserName.Text        = "@" + data.Username;

                    TxtPostCount.Text = Methods.FunString.FormatPriceValue(Int32.Parse(data.Favourites));

                    if (data.Followers != null && int.TryParse(data.Followers, out var numberFollowers))
                    {
                        TxtFollowersCount.Text = Methods.FunString.FormatPriceValue(numberFollowers);
                    }

                    if (data.Following != null && int.TryParse(data.Following, out var numberFollowing))
                    {
                        TxtFollowingCount.Text = Methods.FunString.FormatPriceValue(numberFollowing);
                    }

                    var font = Typeface.CreateFromAsset(Application.Context.Resources.Assets, "ionicons.ttf");
                    TxtFullName.SetTypeface(font, TypefaceStyle.Normal);

                    var textHighLighter = AppTools.GetNameFinal(data);
                    var textIsPro       = string.Empty;

                    if (data.Verified == "1")
                    {
                        textHighLighter += " " + IonIconsFonts.CheckmarkCircled;
                    }

                    if (data.BusinessAccount == "1")
                    {
                        textIsPro        = " " + IonIconsFonts.SocialUsd;
                        textHighLighter += textIsPro;
                    }

                    var decorator = TextDecorator.Decorate(TxtFullName, textHighLighter);

                    if (data.Verified == "1")
                    {
                        decorator.SetTextColor(Resource.Color.Post_IsVerified, IonIconsFonts.CheckmarkCircled);
                    }

                    if (data.BusinessAccount == "1")
                    {
                        decorator.SetTextColor(Resource.Color.Post_IsBusiness, IonIconsFonts.SocialUsd);
                    }

                    decorator.Build();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Beispiel #12
0
 private void ClearInput()
 {
     TxtIdx.Text = TxtFullName.Text = TxtMobile.Text = TxtAddr.Text = "";
     TxtFullName.Focus();
 }
Beispiel #13
0
 private void FrmMain_Load(object sender, EventArgs e)
 {
     RefreshData();
     TxtFullName.Focus();
 }