protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);
                SetTheme(AppSettings.SetTabDarkTheme ? Resource.Style.MyTheme_Dark_Base : Resource.Style.MyTheme_Base);

                Methods.App.FullScreenApp(this, true);

                // Create your application here
                SetContentView(Resource.Layout.View_Story_Layout);

                GlobalContext = TabbedMainActivity.GetInstance();

                //Get Value And Set Toolbar
                InitComponent();
                InitToolbar();

                if (Intent != null)
                {
                    UserId      = Intent.GetStringExtra("UserId") ?? "";
                    IndexItem   = Intent.GetIntExtra("IndexItem", 0);
                    DataStories = JsonConvert.DeserializeObject <StoryDataObject>(Intent?.GetStringExtra("DataItem") ?? "");
                }

                LoadData(DataStories);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Beispiel #2
0
        public void EventClickNotification(Activity activity, NotificationObject item)
        {
            try
            {
                switch (item.Type)
                {
                case "following":
                case "visited_profile":
                case "accepted_request":
                    WoWonderTools.OpenProfile(Activity, item.Notifier.UserId, item.Notifier);
                    break;

                case "liked_page":
                case "invited_page":
                case "accepted_invite":
                {
                    var intent = new Intent(Activity, typeof(PageProfileActivity));
                    //intent.PutExtra("PageObject", JsonConvert.SerializeObject(item));
                    intent.PutExtra("PageId", item.PageId);
                    activity.StartActivity(intent);
                    break;
                }

                case "joined_group":
                case "accepted_join_request":
                case "added_you_to_group":
                {
                    var intent = new Intent(activity, typeof(GroupProfileActivity));
                    //intent.PutExtra("GroupObject", JsonConvert.SerializeObject(item));
                    intent.PutExtra("GroupId", item.GroupId);
                    activity.StartActivity(intent);
                    break;
                }

                case "comment":
                case "wondered_post":
                case "wondered_comment":
                case "reaction":
                case "wondered_reply_comment":
                case "comment_mention":
                case "comment_reply_mention":
                case "liked_post":
                case "liked_comment":
                case "liked_reply_comment":
                case "post_mention":
                case "share_post":
                case "shared_your_post":
                case "comment_reply":
                case "also_replied":
                case "profile_wall_post":
                {
                    var intent = new Intent(activity, typeof(ViewFullPostActivity));
                    intent.PutExtra("Id", item.PostId);
                    // intent.PutExtra("DataItem", JsonConvert.SerializeObject(item));
                    activity.StartActivity(intent);
                    break;
                }

                case "going_event":
                {
                    var intent = new Intent(activity, typeof(EventViewActivity));
                    intent.PutExtra("EventId", item.EventId);
                    if (item.Event != null)
                    {
                        intent.PutExtra("EventView", JsonConvert.SerializeObject(item.Event));
                    }
                    activity.StartActivity(intent);
                    break;
                }

                case "viewed_story":
                {
                    //"url": "https:\/\/demo.wowonder.com\/timeline&u=Matan&story=true&story_id=1946",
                    //var id = item.Url.Split("/").Last().Split("&story_id=").Last();

                    StoryDataObject dataMyStory = GlobalContext?.NewsFeedTab?.PostFeedAdapter?.HolderStory?.StoryAdapter?.StoryList?.FirstOrDefault(o => o.UserId == UserDetails.UserId);
                    if (dataMyStory != null)
                    {
                        Intent intent = new Intent(activity, typeof(ViewStoryActivity));
                        intent.PutExtra("UserId", dataMyStory.UserId);
                        intent.PutExtra("DataItem", JsonConvert.SerializeObject(dataMyStory));
                        activity.StartActivity(intent);
                    }

                    break;
                }

                case "requested_to_join_group":
                {
                    var intent = new Intent(activity, typeof(JoinRequestActivity));
                    intent.PutExtra("GroupId", item.GroupId);
                    activity.StartActivity(intent);
                    break;
                }

                case "memory":
                {
                    var intent = new Intent(activity, typeof(MemoriesActivity));
                    activity.StartActivity(intent);
                    break;
                }

                case "gift":
                {
                    var ajaxUrl  = item.AjaxUrl.Split(new[] { "&", "gift_img=" }, StringSplitOptions.None);
                    var urlImage = WoWonderTools.GetTheFinalLink(ajaxUrl?[3]?.Replace("%2F", "/"));

                    var intent = new Intent(Activity, typeof(UserProfileActivity));
                    intent.PutExtra("UserObject", JsonConvert.SerializeObject(item.Notifier));
                    intent.PutExtra("UserId", item.Notifier.UserId);
                    intent.PutExtra("GifLink", urlImage);
                    Activity.StartActivity(intent);
                    break;
                }

                default:
                    WoWonderTools.OpenProfile(Activity, item.Notifier.UserId, item.Notifier);
                    break;
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }