示例#1
0
 private bool OnSelection(MaterialDialog dialog, int[] which, string[] text)
 {
     try
     {
         if (TypeDialog == "Audience")
         {
             TotalIdAudienceChecked = "";
             var countriesArray = WoWonderTools.GetCountryList(this);
             for (int i = 0; i < which.Length; i++)
             {
                 var itemString = text[i];
                 var check      = countriesArray.FirstOrDefault(a => a.Value == itemString).Key;
                 if (check != null)
                 {
                     TotalIdAudienceChecked += check + ",";
                 }
             }
         }
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
         return(true);
     }
     return(true);
 }
        private void InitComponent()
        {
            try
            {
                ImageUser       = FindViewById <ImageView>(Resource.Id.ImageUser);
                TxtLink         = FindViewById <TextView>(Resource.Id.linkText);
                TxtMyAffiliates = FindViewById <TextView>(Resource.Id.myAffiliatesText);
                BtnShare        = FindViewById <Button>(Resource.Id.cont);

                GlideImageLoader.LoadImage(this, UserDetails.Avatar, ImageUser, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);

                TxtLink.Text = Client.WebsiteUrl + "?ref=" + UserDetails.Username;

                if (int.Parse(ListUtils.SettingsSiteList?.AmountPercentRef ?? "0") > 0)
                {
                    TxtMyAffiliates.Text = GetString(Resource.String.Lbl_EarnUpTo) + "%" + ListUtils.SettingsSiteList?.AmountPercentRef + " " + GetString(Resource.String.Lbl_forEachUserYourReferToUs) + " !";
                }
                else if (int.Parse(ListUtils.SettingsSiteList?.AmountRef ?? "0") > 0)
                {
                    var(currency, currencyIcon) = WoWonderTools.GetCurrency(ListUtils.SettingsSiteList?.AdsCurrency);
                    Console.WriteLine(currency);

                    TxtMyAffiliates.Text = GetString(Resource.String.Lbl_EarnUpTo) + " " + currencyIcon + ListUtils.SettingsSiteList?.AmountRef + " " + GetString(Resource.String.Lbl_forEachUserYourReferToUs) + " !";
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
 private void MAdapterOnItemLongClick(object sender, ContactsAdapterClickEventArgs e)
 {
     try
     {
         var position = e.Position;
         if (position >= 0)
         {
             var item = MAdapter.GetItem(position);
             if (item == null)
             {
                 return;
             }
             if (item.Avatar == "addImage")
             {
                 return;
             }
             Type     = "RemoveUser";
             Position = e.Position;
             var dialog = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme
                 ? AFollestad.MaterialDialogs.Theme.Dark
                 : AFollestad.MaterialDialogs.Theme.Light);
             dialog.Title(GetString(Resource.String.Lbl_Remove) + " " + WoWonderTools.GetNameFinal(item));
             dialog.PositiveText(GetText(Resource.String.Lbl_Yes)).OnPositive(this);
             dialog.NegativeText(GetText(Resource.String.Lbl_No)).OnNegative(this);
             dialog.AlwaysCallSingleChoiceCallback();
             dialog.Build().Show();
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
示例#4
0
        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            MenuInflater.Inflate(Resource.Menu.SearchGif_Menu, menu);
            WoWonderTools.ChangeMenuIconColor(menu, Color.ParseColor("#888888"));

            var        item       = menu.FindItem(Resource.Id.searchUserBar);
            SearchView searchItem = (SearchView)item.ActionView;

            SearchView = searchItem.JavaCast <SearchView>();
            SearchView.SetIconifiedByDefault(true);
            SearchView.QueryTextChange += SearchView_OnTextChange;
            SearchView.QueryTextSubmit += SearchView_OnTextSubmit;

            //Change text colors
            var editText = (EditText)SearchView.FindViewById(Resource.Id.search_src_text);

            editText.SetHintTextColor(Color.Black);
            editText.SetTextColor(Color.ParseColor("#888888"));

            //Change Color Icon Search
            ImageView searchViewIcon = (ImageView)SearchView.FindViewById(Resource.Id.search_mag_icon);

            searchViewIcon.SetColorFilter(Color.ParseColor(AppSettings.MainColor));

            return(base.OnCreateOptionsMenu(menu));
        }
示例#5
0
 public void OnFollowButtonItemClick(object sender, RateUsersAdapterClickEventArgs e)
 {
     try
     {
         if (!Methods.CheckConnectivity())
         {
             Toast.MakeText(ActivityContext, ActivityContext.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show();
         }
         else
         {
             if (e.Position > -1)
             {
                 UserDataObject item = GetItem(e.Position);
                 if (item != null)
                 {
                     WoWonderTools.SetAddFriend(ActivityContext, item, e.BtnAddUser);
                 }
             }
         }
     }
     catch (Exception exception)
     {
         Methods.DisplayReportResultTrack(exception);
     }
 }
示例#6
0
        private void TxtSalaryDateOnTouch(object sender, View.TouchEventArgs e)
        {
            try
            {
                if (e?.Event?.Action != MotionEventActions.Down)
                {
                    return;
                }

                var dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light);

                TypeDialog = "SalaryDate";

                var arrayAdapter = WoWonderTools.GetSalaryDateList(this).Select(item => item.Value).ToList();

                dialogList.Title(GetText(Resource.String.Lbl_SalaryDate));
                dialogList.Items(arrayAdapter);
                dialogList.NegativeText(GetText(Resource.String.Lbl_Close)).OnNegative(this);
                dialogList.AlwaysCallSingleChoiceCallback();
                dialogList.ItemsCallback(this).Build().Show();
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
示例#7
0
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                if (viewHolder is ShowApplyJobsAdapterViewHolder holder)
                {
                    var item = JobList[position];
                    if (item != null)
                    {
                        GlideImageLoader.LoadImage(ActivityContext, item.UserData.Avatar, holder.Image, ImageStyle.CenterCrop, ImagePlaceholders.Drawable);

                        holder.Username.Text      = WoWonderTools.GetNameFinal(item.UserData);
                        holder.AddressText.Text   = item.Position;
                        holder.TimeText.Text      = item.Location;
                        holder.PhoneText.Text     = item.PhoneNumber;
                        holder.EmailText.Text     = item.Email;
                        holder.PositionText.Text  = item.Position;
                        holder.StartDateText.Text = item.ExperienceStartDate;
                        holder.EndDateText.Text   = item.ExperienceEndDate;

                        holder.Description.Text = Methods.FunString.DecodeString(item.ExperienceDescription);
                        ReadMoreOption.AddReadMoreTo(holder.Description, new String(holder.Description.Text));
                    }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                if (viewHolder is InviteMembersAdapterViewHolder holder)
                {
                    var item = UserList[position];
                    if (item != null)
                    {
                        GlideImageLoader.LoadImage(ActivityContext, item.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);

                        holder.Name.Text  = Methods.FunString.SubStringCutOf(WoWonderTools.GetNameFinal(item), 25);
                        holder.About.Text = item.UserId == UserDetails.UserId ? ActivityContext.GetString(Resource.String.Lbl_Online) : ActivityContext.GetString(Resource.String.Lbl_Last_seen) + " " + Methods.Time.TimeAgo(int.Parse(item.LastseenUnixTime));

                        if (item.Verified == "1")
                        {
                            holder.Name.SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.icon_checkmark_small_vector, 0);
                        }

                        //Online Or offline
                        var online = WoWonderTools.GetStatusOnline(int.Parse(item.LastseenUnixTime), item.LastseenStatus);
                        holder.ImageLastSeen.SetImageResource(online ? Resource.Drawable.Green_Color : Resource.Drawable.Grey_Offline);

                        if (item.UserId == UserDetails.UserId)
                        {
                            holder.ButtonMore.Visibility = ViewStates.Gone;
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                switch (viewHolder)
                {
                case LiveMessageAdapterViewHolder holder:
                {
                    var item = CommentList[position];
                    if (item != null)
                    {
                        GlideImageLoader.LoadImage(ActivityContext, item.Publisher.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);

                        holder.TxtName.Text    = WoWonderTools.GetNameFinal(item.Publisher);
                        holder.TxtMessage.Text = Methods.FunString.DecodeString(item.Orginaltext);
                    }

                    break;
                }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
示例#10
0
 // Event Show all Friend Request
 private void ProUsersAdapterOnItemClick(object sender, ProUsersAdapterClickEventArgs adapterClickEvents)
 {
     try
     {
         var position = adapterClickEvents.Position;
         if (position >= 0)
         {
             var item = GlobalContext.ProUsersAdapter.GetItem(position);
             if (item != null)
             {
                 if (item.Type == "Your")
                 {
                     var intent = new Intent(Activity, typeof(GoProActivity));
                     Activity.StartActivity(intent);
                 }
                 else
                 {
                     WoWonderTools.OpenProfile(Activity, item.UserId, item);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Methods.DisplayReportResultTrack(ex);
     }
 }
        private void TxtAddQuestionOnTouch(object sender, View.TouchEventArgs e)
        {
            try
            {
                if (e?.Event?.Action != MotionEventActions.Down)
                {
                    return;
                }

                switch (MAdapter.ItemCount)
                {
                case < 4:
                {
                    TypeDialog = "AddQuestion";

                    var dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light);

                    var arrayAdapter = WoWonderTools.GetAddQuestionList(this).Select(item => item.Value).ToList();

                    dialogList.Title(GetText(Resource.String.Lbl_TypeQuestion)).TitleColorRes(Resource.Color.primary);
                    dialogList.Items(arrayAdapter);
                    dialogList.NegativeText(GetText(Resource.String.Lbl_Close)).OnNegative(this);
                    dialogList.AlwaysCallSingleChoiceCallback();
                    dialogList.ItemsCallback(this).Build().Show();
                    break;
                }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
示例#12
0
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                if (viewHolder is ReviewsAdapterViewHolder holder)
                {
                    var item = UserList[position];
                    if (item != null)
                    {
                        GlideImageLoader.LoadImage(ActivityContext, item.UserData.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);

                        holder.Name.Text = WoWonderTools.GetNameFinal(item.UserData);

                        if (!string.IsNullOrEmpty(item.Valuation))
                        {
                            holder.Review.Text       = Methods.FunString.DecodeString(item.Review);
                            holder.Review.Visibility = ViewStates.Visible;
                        }
                        else
                        {
                            holder.Review.Visibility = ViewStates.Gone;
                        }

                        holder.Val.Text = item.Valuation;
                    }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
示例#13
0
        private void Initialize(ArticlesAdapterViewHolder holder, ArticleDataObject item)
        {
            try
            {
                var colorImage = Color.ParseColor(Methods.FunString.RandomColor());

                Glide.With(ActivityContext)
                .Load(item.Thumbnail)
                .Apply(RequestOptions.CenterCropTransform().Placeholder(new ColorDrawable(colorImage)).Fallback(new ColorDrawable(colorImage)).SetPriority(Priority.High))
                .Into(holder.Image);

                Glide.With(ActivityContext)
                .Load(item.Author.Avatar)
                .Apply(RequestOptions.CircleCropTransform())
                .Into(holder.UserImageProfile);

                holder.Category.SetBackgroundColor(colorImage);

                CategoriesController cat = new CategoriesController();
                string id = item.CategoryLink.Split('/').Last();


                holder.Category.Text = cat.Get_Translate_Categories_Communities(id, item.CategoryName, "Blog");

                holder.Description.Text = Methods.FunString.DecodeString(item.Description);
                holder.Title.Text       = Methods.FunString.DecodeString(item.Title);
                holder.Username.Text    = WoWonderTools.GetNameFinal(item.Author);
                holder.ViewMore.Text    = ActivityContext.GetText(Resource.String.Lbl_ReadMore) + " >"; //READ MORE &gt;
                holder.Time.Text        = item.Posted;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            MenuInflater.Inflate(Resource.Menu.MenuArticleShare, menu);
            WoWonderTools.ChangeMenuIconColor(menu, Color.ParseColor("#888888"));

            return(base.OnCreateOptionsMenu(menu));
        }
        private void Initialize(MarketAdapterViewHolder holder, ProductDataObject item)
        {
            try
            {
                if (item.Images?.Count > 0)
                {
                    if (item.Images[0].Image.Contains("http"))
                    {
                        GlideImageLoader.LoadImage(ActivityContext, item.Images?[0]?.Image, holder.Thumbnail, ImageStyle.CenterCrop, ImagePlaceholders.Drawable);
                    }
                    else
                    {
                        Glide.With(ActivityContext).Load(new File(item.Images?[0]?.Image)).Apply(new RequestOptions().CenterCrop().Placeholder(Resource.Drawable.ImagePlacholder).Error(Resource.Drawable.ImagePlacholder)).Into(holder.Thumbnail);
                    }
                }

                GlideImageLoader.LoadImage(ActivityContext, item.Seller?.Avatar, holder.Userprofilepic, ImageStyle.CircleCrop, ImagePlaceholders.Color);



                holder.Title.Text    = Methods.FunString.DecodeString(item.Name);
                holder.UserName.Text = WoWonderTools.GetNameFinal(item.Seller);
                holder.Time.Text     = item.TimeText;

                var(currency, currencyIcon) = WoWonderTools.GetCurrency(item.Currency);
                Console.WriteLine(currency);

                holder.TxtPrice.Text     = currencyIcon + " " + item.Price;
                holder.LocationText.Text = !string.IsNullOrEmpty(item.Location) ? item.Location : ActivityContext.GetText(Resource.String.Lbl_Unknown);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private void GetMyInfoData()
        {
            try
            {
                var local = ListUtils.MyProfileList?.FirstOrDefault();
                if (local != null)
                {
                    TxtFirstName.Text = Methods.FunString.DecodeString(local.FirstName);
                    TxtLastName.Text  = Methods.FunString.DecodeString(local.LastName);
                    TxtLocation.Text  = local.Address;
                    TxtMobile.Text    = local.PhoneNumber;
                    TxtWebsite.Text   = local.Website;
                    TxtWork.Text      = local.Working;
                    TxtSchool.Text    = local.School;
                    IdRelationShip    = local.RelationshipId;

                    string relationship = WoWonderTools.GetRelationship(Convert.ToInt32(local.RelationshipId));
                    if (Methods.FunString.StringNullRemover(relationship) != "Empty")
                    {
                        TxtRelationship.Text = relationship;
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private async void LoadData()
        {
            try
            {
                DataStories = JsonConvert.DeserializeObject <GetUserStoriesObject.StoryObject>(Intent.GetStringExtra("DataItem"));
                if (DataStories != null)
                {
                    GlideImageLoader.LoadImage(this, DataStories.Avatar, UserImageView, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);
                    UsernameTextView.Text     = WoWonderTools.GetNameFinal(DataStories);
                    DeleteIconView.Visibility = DataStories.Stories[0].IsOwner ? ViewStates.Visible : ViewStates.Invisible;

                    int count = DataStories.Stories.Count;
                    StoriesProgress.Visibility = ViewStates.Visible;
                    StoriesProgress.SetStoriesCount(count);   // <- set stories
                    StoriesProgress.SetStoriesListener(this); // <- set listener
                    //StoriesProgress.SetStoryDuration(10000L); // <- set a story duration

                    var fistStory = DataStories.Stories.FirstOrDefault();
                    if (fistStory != null)
                    {
                        StoriesProgress.SetStoriesCountWithDurations(DataStories.DurationsList.ToArray());

                        await SetStory(fistStory);

                        StoriesProgress.StartStories(); // <- start progress
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
示例#18
0
 public void OnSelection(MaterialDialog p0, View p1, int itemId, ICharSequence itemString)
 {
     try
     {
         if (TypeDialog == "Categories")
         {
             CategoryId       = CategoriesController.ListCategoriesJob.FirstOrDefault(categories => categories.CategoriesName == itemString.ToString())?.CategoriesId;
             TxtCategory.Text = itemString.ToString();
         }
         else if (TypeDialog == "JobType")
         {
             JobTypeId       = WoWonderTools.GetJobTypeList(this)?.FirstOrDefault(a => a.Value == itemString.ToString()).Key.ToString();
             TxtJobType.Text = itemString.ToString();
         }
         else if (TypeDialog == "SalaryDate")
         {
             SalaryDateId       = WoWonderTools.GetSalaryDateList(this)?.FirstOrDefault(a => a.Value == itemString.ToString()).Key.ToString();
             TxtSalaryDate.Text = itemString.ToString();
         }
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                if (viewHolder is BlockedUsersAdapterViewHolder holder)
                {
                    var item = UserList[position];
                    if (item != null)
                    {
                        GlideImageLoader.LoadImage(ActivityContext, item.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable, true);

                        holder.Name.Text = Methods.FunString.SubStringCutOf(WoWonderTools.GetNameFinal(item), 20);

                        if (item.Verified == "1")
                        {
                            holder.Name.SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.icon_checkmark_small_vector, 0);
                        }

                        holder.About.Text = ActivityContext.GetString(Resource.String.Lbl_Last_seen) + " " + Methods.Time.TimeAgo(Convert.ToInt32(item.LastseenUnixTime), true);

                        //Online Or offline
                        //var online = WoWonderTools.GetStatusOnline(Convert.ToInt32(users.LastseenUnixTime), users.LastseenStatus);
                        //holder.ImageLastSeen.SetImageResource(online ? Resource.Drawable.Green_Color : Resource.Drawable.Grey_Offline);
                    }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
示例#20
0
        private void Initialize(MembersAdapterViewHolder holder, UserDataObject users)
        {
            try
            {
                GlideImageLoader.LoadImage(ActivityContext, users.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);

                holder.Name.Text = Methods.FunString.SubStringCutOf(WoWonderTools.GetNameFinal(users), 25);

                if (users.Verified == "1")
                {
                    holder.Name.SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.icon_checkmark_small_vector, 0);
                }

                holder.About.Text = users.UserId == UserDetails.UserId ? ActivityContext.GetString(Resource.String.Lbl_Online): ActivityContext.GetString(Resource.String.Lbl_Last_seen) + " " + Methods.Time.TimeAgo(Convert.ToInt32(users.LastseenUnixTime), false);

                //Online Or offline
                var online = WoWonderTools.GetStatusOnline(Convert.ToInt32(users.LastseenUnixTime), users.LastseenStatus);
                holder.ImageLastSeen.SetImageResource(online ? Resource.Drawable.Green_Color : Resource.Drawable.Grey_Offline);


                if (users.UserId == UserDetails.UserId)
                {
                    holder.ButtonMore.Visibility = ViewStates.Gone;
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        private void InitComponent()
        {
            try
            {
                ImageUser       = FindViewById <ImageView>(Resource.Id.ImageUser);
                TxtLink         = FindViewById <TextView>(Resource.Id.linkText);
                TxtMyAffiliates = FindViewById <TextView>(Resource.Id.myAffiliatesText);
                BtnShare        = FindViewById <Button>(Resource.Id.cont);

                GlideImageLoader.LoadImage(this, UserDetails.Avatar, ImageUser, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);

                //https://demo.wowonder.com/register?ref=waelanjo
                TxtLink.Text = Client.WebsiteUrl + "/register?ref=" + UserDetails.Username;

                switch (Convert.ToInt32(ListUtils.SettingsSiteList?.AmountPercentRef ?? "0"))
                {
                case > 0:
                    TxtMyAffiliates.Text = GetString(Resource.String.Lbl_EarnUpTo) + "%" + ListUtils.SettingsSiteList?.AmountPercentRef + " " + GetString(Resource.String.Lbl_forEachUserYourReferToUs) + " !";
                    break;

                default:
                    var(currency, currencyIcon) = WoWonderTools.GetCurrency(ListUtils.SettingsSiteList?.AdsCurrency);
                    Console.WriteLine(currency);

                    TxtMyAffiliates.Text = GetString(Resource.String.Lbl_EarnUpTo) + " " + currencyIcon + ListUtils.SettingsSiteList?.AmountRef + " " + GetString(Resource.String.Lbl_forEachUserYourReferToUs) + " !";
                    break;
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
示例#22
0
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                if (viewHolder is FriendRequestsAdapterViewHolder holder)
                {
                    var item = UserList[position];
                    if (item != null)
                    {
                        GlideImageLoader.LoadImage(ActivityContext, item.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);
                        holder.Name.Text = Methods.FunString.SubStringCutOf(WoWonderTools.GetNameFinal(item), 35);

                        if (item.Verified == "1")
                        {
                            holder.Name.SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.icon_checkmark_small_vector, 0);
                        }

                        holder.About.Text = ActivityContext.GetString(Resource.String.Lbl_Last_seen) + " " + Methods.Time.TimeAgo(Convert.ToInt32(item.LastseenUnixTime), false);
                    }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
        private void TxtCurrencyOnTouch(object sender, View.TouchEventArgs e)
        {
            try
            {
                if (e.Event.Action != MotionEventActions.Down)
                {
                    return;
                }

                if (ListUtils.SettingsSiteList?.CurrencySymbolArray.CurrencyList != null)
                {
                    TypeDialog = "Currency";

                    var arrayAdapter = WoWonderTools.GetCurrencySymbolList();
                    if (arrayAdapter?.Count > 0)
                    {
                        var dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light);

                        dialogList.Title(GetText(Resource.String.Lbl_SelectCurrency));
                        dialogList.Items(arrayAdapter);
                        dialogList.NegativeText(GetText(Resource.String.Lbl_Close)).OnNegative(this);
                        dialogList.AlwaysCallSingleChoiceCallback();
                        dialogList.ItemsCallback(this).Build().Show();
                    }
                }
                else
                {
                    Methods.DisplayReportResult(this, "Not have List Currency Products");
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
        private void Initialize(NotificationsAdapterViewHolder holder, Notification notify)
        {
            try
            {
                if (notify.Type == "memory")
                {
                    Glide.With(ActivityContext).Load(Resource.Mipmap.icon).Apply(new RequestOptions().CircleCrop()).Into(holder.ImageUser);
                    holder.UserNameNotfy.Text = AppSettings.ApplicationName;
                }
                else
                {
                    GlideImageLoader.LoadImage(ActivityContext, notify.Notifier?.Avatar, holder.ImageUser, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);
                    holder.UserNameNotfy.Text = WoWonderTools.GetNameFinal(notify.Notifier);
                }

                AddIconFonts(holder, notify.Type, notify.Icon);

                var drawable = TextDrawable.InvokeBuilder().BeginConfig().FontSize(30).EndConfig().BuildRound("", Color.ParseColor(GetColorFonts(notify.Type, notify.Icon)));
                holder.Image.SetImageDrawable(drawable);

                if (notify.Type == "share_post" || notify.Type == "shared_your_post")
                {
                    holder.TextNotfy.Text = ActivityContext.GetText(Resource.String.Lbl_sharedYourPost);
                }
                else
                {
                    holder.TextNotfy.Text = notify.TypeText;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
示例#25
0
        private void Initialize(RateUsersAdapterViewHolder holder, UserDataObject users)
        {
            try
            {
                GlideImageLoader.LoadImage(ActivityContext, users.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable, true);

                holder.Name.Text            = Methods.FunString.SubStringCutOf(WoWonderTools.GetNameFinal(users), 20);
                holder.UserRatingBar.Rating = (float)Convert.ToDouble(users.Points);
                //if (users.Verified == "1")
                //    holder.Name.SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.icon_checkmark_small_vector, 0);

                //if (Type == TypeTextSecondary.None)
                //{
                //    holder.About.Visibility = ViewStates.Gone;
                //}
                //else
                //{
                //    holder.About.Text = Type == TypeTextSecondary.About ? Methods.FunString.SubStringCutOf(WoWonderTools.GetAboutFinal(users), 25) : ActivityContext.GetString(Resource.String.Lbl_Last_seen) + " " + Methods.Time.TimeAgo(Convert.ToInt32(users.LastseenUnixTime), true);
                //}

                //Online Or offline
                //var online = WoWonderTools.GetStatusOnline(Convert.ToInt32(users.LastseenUnixTime), users.LastseenStatus);
                //holder.ImageLastSeen.SetImageResource(online ? Resource.Drawable.Green_Color : Resource.Drawable.Grey_Offline);

                //if (!ShowButton) return;

                //WoWonderTools.SetAddFriendCondition(users.IsFollowing, holder.Button);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                if (viewHolder is RecentDonationAdapterViewHolder holder)
                {
                    var item = UserList[position];
                    if (item != null)
                    {
                        GlideImageLoader.LoadImage(ActivityContext, item.UserData.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable, true);

                        holder.Name.Text = Methods.FunString.SubStringCutOf(WoWonderTools.GetNameFinal(item.UserData), 20);

                        if (item.UserData.Verified == "1")
                        {
                            holder.Name.SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.icon_checkmark_small_vector, 0);
                        }

                        holder.About.Text = AppSettings.CurrencyFundingPriceStatic + item.Amount + " " + Methods.Time.TimeAgo(Convert.ToInt32(item.Time), true);

                        //Online Or offline
                        var online = WoWonderTools.GetStatusOnline(Convert.ToInt32(item.UserData.LastseenUnixTime), item.UserData.LastseenStatus);
                        holder.ImageLastSeen.SetImageResource(online ? Resource.Drawable.Green_Color : Resource.Drawable.Grey_Offline);

                        WoWonderTools.SetAddFriendCondition(item.UserData.IsFollowing, holder.Button);
                    }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
示例#27
0
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                switch (viewHolder)
                {
                case SuggestionsUserAdapterViewHolder holder:
                {
                    var item = UserList[position];
                    if (item != null)
                    {
                        holder.Username.Text = Methods.FunString.SubStringCutOf("@" + item.Username, 15);
                        holder.Name.Text     = Methods.FunString.SubStringCutOf(WoWonderTools.GetNameFinal(item), 15);

                        GlideImageLoader.LoadImage(ActivityContext, item.Avatar, holder.Image, ImageStyle.CenterCrop, ImagePlaceholders.Drawable);

                        WoWonderTools.SetAddFriendCondition(item.IsFollowing, holder.Button);
                    }

                    break;
                }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            try
            {
                base.OnCreateView(inflater, container, savedInstanceState);
                var view = inflater.Inflate(Resource.Layout.Dialog_BlockUser_Fragment, container, false);

                // Get values
                TxtUsername = view.FindViewById <TextView>(Resource.Id.Txt_Username);
                TxtName     = view.FindViewById <TextView>(Resource.Id.Txt_SecendreName);

                BtnUnBlockUser = view.FindViewById <Button>(Resource.Id.UnBlockUser_Button);

                ImageUserProfile = view.FindViewById <ImageView>(Resource.Id.profileAvatar_image);

                GlideImageLoader.LoadImage(ActivityContext, Item.Avatar, ImageUserProfile, ImageStyle.CenterCrop, ImagePlaceholders.Drawable);

                TxtUsername.Text = WoWonderTools.GetNameFinal(Item);
                TxtName.Text     = "@" + Item.Username;

                return(view);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(null);
            }
        }
示例#29
0
 private void MAdapterOnItemClick(object sender, LastActivitiesAdapterClickEventArgs e)
 {
     try
     {
         var position = e.Position;
         if (position >= 0)
         {
             var item = MAdapter.GetItem(position);
             if (item != null)
             {
                 if (item.ActivityType == "following" || item.ActivityType == "friend")
                 {
                     WoWonderTools.OpenProfile(this, item.UserId, item.Activator);
                 }
                 else
                 {
                     var intent = new Intent(this, typeof(ViewFullPostActivity));
                     intent.PutExtra("Id", item.PostId);
                     intent.PutExtra("DataItem", JsonConvert.SerializeObject(item.PostData));
                     StartActivity(intent);
                 }
             }
         }
     }
     catch (Exception exception)
     {
         Methods.DisplayReportResultTrack(exception);
     }
 }
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                switch (viewHolder)
                {
                case CommonThingsAdapterViewHolder holder:
                {
                    var item = CommonThingsList[position];
                    if (item != null)
                    {
                        GlideImageLoader.LoadImage(ActivityContext, item.UserData.Avatar, holder.Image, ImageStyle.FitCenter, ImagePlaceholders.Drawable);

                        holder.Name.Text        = WoWonderTools.GetNameFinal(item.UserData);
                        holder.CountCommon.Text = item.CommonThings + " " + ActivityContext.GetText(Resource.String.Lbl_ThingInCommon);
                    }

                    break;
                }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }