Ejemplo n.º 1
0
        private void InitComponent(View view)
        {
            try
            {
                ProfileImage     = view.FindViewById <ImageView>(Resource.Id.Iconimage2);
                Username         = view.FindViewById <TextView>(Resource.Id.username);
                WalletNumber     = view.FindViewById <TextView>(Resource.Id.walletnumber);
                TxtUpgrade       = view.FindViewById <TextView>(Resource.Id.upgradeText);
                XtBoostMe        = view.FindViewById <TextView>(Resource.Id.tv_Boost);
                EditButton       = view.FindViewById <CircleButton>(Resource.Id.EditButton);
                SettingsButton   = view.FindViewById <CircleButton>(Resource.Id.SettingsButton);
                BoostButton      = view.FindViewById <CircleButton>(Resource.Id.BoostButton);
                WalletButton     = view.FindViewById <RelativeLayout>(Resource.Id.walletSection);
                PopularityButton = view.FindViewById <RelativeLayout>(Resource.Id.popularitySection);
                UpgradeButton    = view.FindViewById <RelativeLayout>(Resource.Id.upgradeSection);
                FriendsButton    = view.FindViewById <RelativeLayout>(Resource.Id.StFriendsLayout);
                FavoriteButton   = view.FindViewById <RelativeLayout>(Resource.Id.StFavoriteLayout);
                InviteButton     = view.FindViewById <RelativeLayout>(Resource.Id.StInviteFriendsLayout);
                BlogsButton      = view.FindViewById <RelativeLayout>(Resource.Id.StBlogsLayout);
                HelpButton       = view.FindViewById <RelativeLayout>(Resource.Id.StNeedHelpLayout);
                HeaderSection    = view.FindViewById <LinearLayout>(Resource.Id.headerSection);

                MWaveLoadingView            = (WaveLoadingView)view.FindViewById(Resource.Id.waveLoadingView);
                MWaveLoadingView.Visibility = ViewStates.Gone;

                BoostButton.Tag = "Off";

                GlideImageLoader.LoadImage(Activity, UserDetails.Avatar, ProfileImage, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);

                if (AppSettings.SetTabDarkTheme)
                {
                    SettingsButton.SetColor(Color.Black);
                    EditButton.SetColor(Color.Black);
                    BoostButton.SetColor(Color.Black);
                }

                if (AppSettings.EnableAppFree)
                {
                    WalletButton.Visibility  = ViewStates.Invisible;
                    UpgradeButton.Visibility = ViewStates.Invisible;
                }

                if (!AppSettings.PremiumSystemEnabled)
                {
                    Activity.RunOnUiThread(() =>
                    {
                        UpgradeButton.Visibility = ViewStates.Invisible;
                        UpgradeButton.Enabled    = false;
                    });
                }

                if (Build.VERSION.SdkInt < BuildVersionCodes.Lollipop)
                {
                    return;
                }

                Activity.Window.ClearFlags(WindowManagerFlags.TranslucentStatus);
                Activity.Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
                Activity.Window.SetStatusBarColor(Color.ParseColor(AppSettings.MainColor));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }