예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }