Ejemplo n.º 1
0
        private void GetAndSetExistingProfilePic(CircleImageView profileimg)
        {
            try
            {
                string mStringLoginInfo    = string.Empty;
                string mStringSessionToken = string.Empty;
                try
                {
                    objdb = new DBaseOperations();
                    var lstu = objdb.selectTable();
                    if (lstu != null && lstu.Count > default(int))
                    {
                        var uobj = lstu.FirstOrDefault();
                        if (uobj.Password == " ")
                        {
                            throw new Exception("Please login again");
                        }
                        mStringLoginInfo    = uobj.EmailId;
                        mStringSessionToken = uobj.AuthToken;
                        _profilepicbase64   = uobj.ProfilePicture;
                    }
                }
                catch { }

                if (!string.IsNullOrEmpty(_profilepicbase64))
                {
                    var btmpimg = BitmapHelpers.Base64ToBitmap(_profilepicbase64);
                    profileimg.RecycleBitmap();
                    profileimg.SetImageBitmap(btmpimg);
                }
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 2
0
        private void SetProfileImageToNavMenuHeader(Activity currActivity, Android.Graphics.Bitmap bmp)
        {
            CircleImageView circular_imageViewLogo = currActivity.FindViewById <CircleImageView>(Resource.Id.circular_imageViewLogo);
            ImageView       imageViewLogo          = currActivity.FindViewById <ImageView>(Resource.Id.imageViewLogo);

            try
            {
                circular_imageViewLogo.Visibility = ViewStates.Visible;
                imageViewLogo.Visibility          = ViewStates.Gone;
                circular_imageViewLogo.RecycleBitmap();
                circular_imageViewLogo.SetImageBitmap(bmp);
            }
            catch
            {
                circular_imageViewLogo.Visibility = ViewStates.Gone;
                imageViewLogo.Visibility          = ViewStates.Visible;
            }
        }