Beispiel #1
0
        public void Initialize()
        {
            try
            {
                HomeButton         = MainContext.FindViewById <LinearLayout>(Resource.Id.llHome);
                NotificationButton = MainContext.FindViewById <FrameLayout>(Resource.Id.llNotification);
                ProfileButton      = MainContext.FindViewById <LinearLayout>(Resource.Id.llProfile);
                TrendButton        = MainContext.FindViewById <LinearLayout>(Resource.Id.llTrend);
                MessagesButton     = MainContext.FindViewById <LinearLayout>(Resource.Id.llMessages);

                HomeImage         = MainContext.FindViewById <ImageView>(Resource.Id.ivHome);
                NotificationImage = MainContext.FindViewById <ImageView>(Resource.Id.ivNotification);
                ProfileImage      = MainContext.FindViewById <ImageView>(Resource.Id.ivProfile);
                TrendImage        = MainContext.FindViewById <ImageView>(Resource.Id.ivTrend);
                MessagesImage     = MainContext.FindViewById <ImageView>(Resource.Id.ivMessages);

                HomeButton.SetOnClickListener(this);
                TrendButton.SetOnClickListener(this);
                NotificationButton.SetOnClickListener(this);
                ProfileButton.SetOnClickListener(this);
                MessagesButton.SetOnClickListener(this);
            }

            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public void Initialize()
        {
            try
            {
                MainLayout         = MainContext.FindViewById <LinearLayout>(Resource.Id.llMain);
                HomeButton         = MainContext.FindViewById <LinearLayout>(Resource.Id.llHome);
                ResponseHomeButton = MainContext.FindViewById <LinearLayout>(Resource.Id.llResponseHome);
                TrendButton        = MainContext.FindViewById <LinearLayout>(Resource.Id.llTrend);
                BlogButton         = MainContext.FindViewById <LinearLayout>(Resource.Id.llBlog);
                NotificationButton = MainContext.FindViewById <FrameLayout>(Resource.Id.llNotification);
                ProfileButton      = MainContext.FindViewById <LinearLayout>(Resource.Id.llProfile);

                if (!UserDetails.IsLogin)
                {
                    BlogButton.Visibility         = ViewStates.Gone;
                    NotificationButton.Visibility = ViewStates.Gone;
                    ProfileButton.Visibility      = ViewStates.Gone;

                    MainLayout.WeightSum = 2;
                }
                else
                {
                    if (!AppSettings.ShowArticle)
                    {
                        BlogButton.Visibility = ViewStates.Gone;
                        MainLayout.WeightSum  = 4;
                    }
                }

                HomeImage         = MainContext.FindViewById <ImageView>(Resource.Id.ivHome);
                ResponseHomeImage = MainContext.FindViewById <ImageView>(Resource.Id.ivResponseHome);
                NotificationImage = MainContext.FindViewById <ImageView>(Resource.Id.ivNotification);
                ProfileImage      = MainContext.FindViewById <ImageView>(Resource.Id.ivProfile);
                TrendImage        = MainContext.FindViewById <ImageView>(Resource.Id.ivTrend);
                BlogImage         = MainContext.FindViewById <ImageView>(Resource.Id.ivBlog);
                txtUnSeenCount    = MainContext.FindViewById <TextView>(Resource.Id.txtUnSeenCount);

                HomeButton.SetOnClickListener(this);
                ResponseHomeButton.SetOnClickListener(this);
                TrendButton.SetOnClickListener(this);

                if (UserDetails.IsLogin)
                {
                    if (AppSettings.ShowArticle)
                    {
                        BlogButton.SetOnClickListener(this);
                    }

                    NotificationButton.SetOnClickListener(this);
                    ProfileButton.SetOnClickListener(this);
                }
            }

            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }