コード例 #1
0
        public MainPostAdapter(Activity activityContext)
        {
            try
            {
                if (AppSettings.ShowGalleryImage)
                {
                    PostTypeList.Add(new Classes.PostType
                    {
                        Id         = 1,
                        TypeText   = activityContext.GetText(Resource.String.Lbl_ImageGallery),
                        Image      = Resource.Drawable.icon_photos_vector,
                        ImageColor = ""
                    });
                }

                if (AppSettings.ShowGalleryVideo && WoWonderTools.CheckAllowedFileSharingInServer("Video"))
                {
                    PostTypeList.Add(new Classes.PostType
                    {
                        Id         = 2,
                        TypeText   = activityContext.GetText(Resource.String.Lbl_VideoGallery),
                        Image      = Resource.Drawable.icon_video_gallary_vector,
                        ImageColor = "#00CF91"
                    });
                }

                if (AppSettings.ShowMention)
                {
                    PostTypeList.Add(new Classes.PostType
                    {
                        Id         = 3,
                        TypeText   = activityContext.GetText(Resource.String.Lbl_MentionContact),
                        Image      = Resource.Drawable.icon_mention_contact_vector,
                        ImageColor = "#1776CD"
                    });
                }

                if (AppSettings.ShowLocation)
                {
                    var name = activityContext.GetText(Resource.String.Lbl_Location) + "/" +
                               activityContext.GetText(Resource.String.Lbl_Place);
                    PostTypeList.Add(new Classes.PostType
                    {
                        Id         = 4,
                        TypeText   = name,
                        Image      = Resource.Drawable.icon_map_marker_filled_vector,
                        ImageColor = "#F85C50"
                    });
                }

                if (AppSettings.ShowFeelingActivity)
                {
                    var name = activityContext.GetText(Resource.String.Lbl_Feeling) + "/" +
                               activityContext.GetText(Resource.String.Lbl_Activity);

                    PostTypeList.Add(new Classes.PostType
                    {
                        Id         = 5,
                        TypeText   = name,
                        Image      = Resource.Drawable.icon_smile_emoji_vector,
                        ImageColor = ""
                    });
                }
                //if (AppSettings.ShowCamera)
                //    PostTypeList.Add(new Classes.PostType
                //    {
                //        Id = 6,
                //        TypeText = activityContext.GetText(Resource.String.Lbl_Camera),
                //        Image = Resource.Drawable.ic__Attach_video,
                //        ImageColor = ""
                //    });
                if (AppSettings.ShowGif)
                {
                    PostTypeList.Add(new Classes.PostType
                    {
                        Id         = 7,
                        TypeText   = activityContext.GetText(Resource.String.Lbl_Gif),
                        Image      = Resource.Drawable.icon_gif_vector,
                        ImageColor = "#A854A5"
                    });
                }
                if (AppSettings.ShowFile && WoWonderTools.CheckAllowedFileSharingInServer("File"))
                {
                    PostTypeList.Add(new Classes.PostType
                    {
                        Id         = 8,
                        TypeText   = activityContext.GetText(Resource.String.Lbl_File),
                        Image      = Resource.Drawable.ic_attach_file,
                        ImageColor = ""
                    });
                }
                if (AppSettings.ShowMusic && WoWonderTools.CheckAllowedFileSharingInServer("Audio"))
                {
                    PostTypeList.Add(new Classes.PostType
                    {
                        Id         = 9,
                        TypeText   = activityContext.GetText(Resource.String.Lbl_Music),
                        Image      = Resource.Drawable.ic_attach_music,
                        ImageColor = ""
                    });
                }
                if (AppSettings.ShowMusic && WoWonderTools.CheckAllowedFileSharingInServer("Audio"))
                {
                    PostTypeList.Add(new Classes.PostType
                    {
                        Id         = 10,
                        TypeText   = activityContext.GetText(Resource.String.Lbl_VoiceRecord),
                        Image      = Resource.Drawable.ic_attach_microphone,
                        ImageColor = ""
                    });
                }
                if (AppSettings.ShowPolls)
                {
                    PostTypeList.Add(new Classes.PostType
                    {
                        Id         = 11,
                        TypeText   = activityContext.GetText(Resource.String.Lbl2_Polls),
                        Image      = Resource.Drawable.icon_bar_polls_vector,
                        ImageColor = "#8CBA51"
                    });
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }