Пример #1
0
        //Event Refresh Data Page
        private void SwipeRefreshLayoutOnRefresh(object sender, EventArgs e)
        {
            try
            {
                if (IMethods.CheckConnectivity())
                {
                    if (Settings.Show_Story)
                    {
                        StoryAdapter.Clear();
                        Stories_Layout.Visibility = ViewStates.Visible;
                        GetStory_Api();
                    }
                    else
                    {
                        Stories_Layout.Visibility = ViewStates.Gone;
                        Get_Notifications();
                    }

                    switch (Settings.Lang)
                    {
                    case "en":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=english" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    case "ar":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=arabic" + "&type=set_c&c=" + UserDetails.Cookie);
                        Settings.FlowDirection_RightToLeft = true;
                        break;

                    case "de":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=german" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    case "el":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=greek" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    case "es":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=spanish" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    case "fr":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=french" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    case "it":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=italian" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    case "ja":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=japanese" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    case "nl":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=dutch" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    case "pt":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=portuguese" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    case "ro":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=romanian" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    case "ru":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=russian" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    case "sq":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=albanian" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    case "sr":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=serbian" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    case "tr":
                        HybridController.LoadUrl(WoWonder_API.Client.WebsiteUrl + "/app_api.php?application=phone" + "&lang=turkish" + "&type=set_c&c=" + UserDetails.Cookie);
                        break;

                    default:
                        HybridController.LoadUrl(Current.URLS.UrlInstance.API_Get_News_Feed_Cookie + UserDetails.Cookie);
                        break;
                    }
                }
                else
                {
                    Toast.MakeText(Activity, Activity.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                }
            }
            catch (Exception exception)
            {
                Crashes.TrackError(exception);
            }
        }
Пример #2
0
        private void Get_Data_Event()
        {
            try
            {
                _Event_Data = JsonConvert.DeserializeObject <Get_Events_Object.Event>(Intent.GetStringExtra("EventView"));
                if (_Event_Data != null)
                {
                    var CoverSplit     = _Event_Data.cover.Split('/').Last();
                    var getImage_Cover =
                        IMethods.MultiMedia.GetMediaFrom_Disk(IMethods.IPath.FolderDiskEvent, CoverSplit);
                    if (getImage_Cover != "File Dont Exists")
                    {
                        ImageServiceLoader.Load_Image(ImageEventCover, "ImagePlacholder.jpg", getImage_Cover);
                    }
                    else
                    {
                        IMethods.MultiMedia.DownloadMediaTo_DiskAsync(IMethods.IPath.FolderDiskEvent,
                                                                      _Event_Data.cover);
                        ImageServiceLoader.Load_Image(ImageEventCover, "ImagePlacholder.jpg", _Event_Data.cover);
                    }

                    Txt_Name.Text = _Event_Data.name;

                    Txt_Going.Text      = _Event_Data.going_count + " " + GetText(Resource.String.Lbl_GoingPeople);
                    Txt_Interested.Text = _Event_Data.interested_count + " " +
                                          GetText(Resource.String.Lbl_InterestedPeople);
                    Txt_Location.Text = _Event_Data.location;

                    Txt_StartDate.Text = _Event_Data.start_date;
                    Txt_EndDate.Text   = _Event_Data.end_date;

                    var Description =
                        IMethods.Fun_String.DecodeString(
                            IMethods.Fun_String.DecodeStringWithEnter(_Event_Data.description));

                    var readMoreOption = new ReadMoreOption.Builder(this)
                                         .TextLength(250)
                                         .MoreLabel(GetText(Resource.String.Lbl_ReadMore))
                                         .LessLabel(GetText(Resource.String.Lbl_ReadLess))
                                         .MoreLabelColor(Color.ParseColor(Settings.MainColor))
                                         .LessLabelColor(Color.ParseColor(Settings.MainColor))
                                         .LabelUnderLine(true)
                                         .Build();
                    readMoreOption.AddReadMoreTo(Txt_Description, Description);

                    if (_Event_Data.is_going)
                    {
                        Btn_Go.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends_pressed);
                        Btn_Go.SetTextColor(Color.ParseColor("#ffffff"));
                        Btn_Go.Text = GetText(Resource.String.Lbl_Going);
                        Btn_Go.Tag  = "true";
                    }
                    else
                    {
                        Btn_Go.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends);
                        Btn_Go.SetTextColor(Color.ParseColor(Settings.MainColor));
                        Btn_Go.Text = GetText(Resource.String.Lbl_Go);
                        Btn_Go.Tag  = "false";
                    }

                    if (_Event_Data.is_interested)
                    {
                        Btn_Intersted.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends_pressed);
                        Btn_Intersted.SetTextColor(Color.ParseColor("#ffffff"));
                        Btn_Intersted.Text = GetText(Resource.String.Lbl_Interested);
                        Btn_Intersted.Tag  = "true";
                    }
                    else
                    {
                        Btn_Intersted.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends);
                        Btn_Intersted.SetTextColor(Color.ParseColor(Settings.MainColor));
                        Btn_Intersted.Text = GetText(Resource.String.Lbl_Interested);
                        Btn_Intersted.Tag  = "false";
                    }

                    //Set WebView and Load url to be rendered on WebView
                    if (!IMethods.CheckConnectivity())
                    {
                        HybirdView.Visibility = ViewStates.Gone;
                        News_Empty.Visibility = ViewStates.Visible;

                        Txt_News_Empty.Text = GetText(Resource.String.Lbl_Empty_News);
                        Txt_News_start.Text = GetText(Resource.String.Lbl_CheckYourInternetConnection);
                    }
                    else
                    {
                        HybirdView.Visibility = ViewStates.Visible;
                        News_Empty.Visibility = ViewStates.Gone;

                        if (Settings.ClearCachSystem)
                        {
                            HybridController.HybirdView.ClearCache(true);
                        }

                        if (Settings.FlowDirection_RightToLeft)
                        {
                            HybridController.LoadUrl(Current.URLS.UrlInstance.API_Get_News_Feed_Event + _Event_Data.id +
                                                     "&lang=arabic");
                        }
                        else
                        {
                            HybridController.LoadUrl(Current.URLS.UrlInstance.API_Get_News_Feed_Event + _Event_Data.id);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }