private UserListViewBuilder(IGetSocialNativeBridge getSocialImpl, UserListType userListType, Action <User> onUserSelected, Action onCancel)
     : base(getSocialImpl)
 {
     this.onUserSelected = onUserSelected;
     this.onCancel       = onCancel;
     this.userListType   = userListType;
 }
示例#2
0
        private static IGetSocialNativeBridge FindNativeBridge()
        {
            IGetSocialNativeBridge nativeBridge = null;

#if UNITY_ANDROID && !UNITY_EDITOR
            nativeBridge = FindBridgeImplementation(AvailableRuntimes.Android);
#elif UNITY_IOS && !UNITY_EDITOR
            nativeBridge = FindBridgeImplementation(AvailableRuntimes.iOS);
#elif UNITY_STANDALONE_WIN
            nativeBridge = FindBridgeImplementation(AvailableRuntimes.Windows);
#elif UNITY_STANDALONE_LINUX
            nativeBridge = FindBridgeImplementation(AvailableRuntimes.Linux);
#elif UNITY_STANDALONE_OSX
            nativeBridge = FindBridgeImplementation(AvailableRuntimes.OSX);
#elif UNITY_EDITOR
            nativeBridge = FindBridgeImplementation(AvailableRuntimes.Editor);
#else
            nativeBridge = GetSocialNativeBridgeMock.Instance;
#endif
            if (nativeBridge != null)
            {
                return(nativeBridge);
            }

            if (Application.isEditor)
            {
                return(GetSocialNativeBridgeMock.Instance);
            }

            throw new Exception("Could not find native implementation.");
        }
示例#3
0
        /// <summary>
        /// Must not be invoked directly. Call <see cref="GetSocialChat.CreateChatViewForRoomName"/> instead.
        /// </summary>
        public static ChatViewBuilder ConstructWithRoomName(IGetSocialNativeBridge getSocialImpl, string roomName)
        {
            Check.Argument.IsNotNull(roomName, "roomName", "Can't create chat view with null roomName");

            var chatViewBuilder = new ChatViewBuilder(getSocialImpl);

            chatViewBuilder.roomName = roomName;

            return(chatViewBuilder);
        }
示例#4
0
        /// <summary>
        /// Must not be invoked directly. Call <see cref="GetSocialChat.CreateChatViewForConversationId"/> instead.
        /// </summary>
        public static ChatViewBuilder ConstructWithConversationId(IGetSocialNativeBridge getSocialImpl, string conversationId)
        {
            Check.Argument.IsNotNull(conversationId, "conversationId", "Can't create chat view with null conversationId");

            var chatViewBuilder = new ChatViewBuilder(getSocialImpl);

            chatViewBuilder.conversationId = conversationId;

            return(chatViewBuilder);
        }
示例#5
0
        /// <summary>
        /// Must not be invoked directly. Call <see cref="GetSocialChat.CreateChatViewForUserId"/> instead.
        /// </summary>
        public static ChatViewBuilder ConstructWithUserId(IGetSocialNativeBridge getSocialImpl, string userId)
        {
            Check.Argument.IsNotNull(userId, "userId", "Can't create chat view with null userId");

            var chatViewBuilder = new ChatViewBuilder(getSocialImpl);

            chatViewBuilder.userId = userId;

            return(chatViewBuilder);
        }
示例#6
0
        public static IGetSocialNativeBridge GetInstance()
        {
            if (instance == null)
            {
                instance = new GetSocialNativeBridgeIOS();
            }

            MainThreadExecutor.Init();

            return(instance);
        }
示例#7
0
        private GetSocialChat()
        {
            unreadRoomCountChangedListeners = new List <IUnreadRoomCountChangedListener>();
            messagesListeners     = new List <IChatMessageListener>();
            typingStatusListeners = new List <ITypingStatusListener>();

            getSocialImpl     = GetSocialFactory.InstantiateGetSocial();
            getSocialChatImpl = GetSocialChatFactory.InstantiateGetSocialChat();

            getSocialChatImpl.SetOnUnreadCountChangedListenerInternal(OnPublicRoomCountChange, OnPrivateRoomCountChange);
            getSocialChatImpl.SetMessagesListenerInternal(OnPublicRoomMessageReceived, OnPrivateRoomMessageReceived);
            getSocialChatImpl.SetTypingStatusListenerInternal(OnPublicRoomTypingStatusReceived, OnPrivateRoomTypingStatusReceived);
        }
        /// <summary>
        /// Must not be invoked directly. Invoke <c><see cref="GetSocial.CreateActivitiesView"/></c> instead.
        /// </summary>
        public static ActivitiesViewBuilder Construct(IGetSocialNativeBridge getSocialImpl, string group, params string[] tags)
        {
            Check.Argument.IsNotNull(group, "group", "Can't create activity view with null group");

            var filteredTags = Array.FindAll(tags, tag => !string.IsNullOrEmpty(tag));

            var activitiesViewBuilder = new ActivitiesViewBuilder(getSocialImpl);

            activitiesViewBuilder.group = group;
            activitiesViewBuilder.tags  = filteredTags;

            return(activitiesViewBuilder);
        }
示例#9
0
        private GetSocial()
        {
            getSocialImpl = GetSocialFactory.InstantiateGetSocial();
            currentUser   = new CurrentUser(getSocialImpl);

            getSocialImpl.SetOnWindowStateChangeListener(
                () =>
            {
                IsViewOpened = true;
                if (onViewOpen != null)
                {
                    onViewOpen();
                }
            },
                () =>
            {
                IsViewOpened = false;
                if (onViewClose != null)
                {
                    onViewClose();
                }
            }
                );
        }
示例#10
0
 private ChatViewBuilder(IGetSocialNativeBridge getSocialImpl) : base(getSocialImpl)
 {
 }
 /// <summary>
 /// Must not be invoked directly. Invoke <c><see cref="GetSocial.CreateActivitiesView"/></c> instead.
 /// </summary>
 public static ActivitiesViewBuilder Construct(IGetSocialNativeBridge getSocialImpl)
 {
     return(new ActivitiesViewBuilder(getSocialImpl));
 }
 private ActivitiesViewBuilder(IGetSocialNativeBridge getSocialImpl) : base(getSocialImpl)
 {
 }
 internal static IGetSocialNativeBridge GetInstance()
 {
     return(instance ?? (instance = new GetSocialEditorMock()));
 }
 protected ViewBuilder(IGetSocialNativeBridge getSocialImpl)
 {
     this.getSocialImpl = getSocialImpl;
 }
示例#15
0
 private SmartInviteViewBuilder(IGetSocialNativeBridge getSocialImpl) : base(getSocialImpl)
 {
 }
示例#16
0
 /// <summary>
 /// Must not be invoked directly. Invoke <c><see cref="GetSocial.CreateSmartInviteView"/></c> instead.
 /// </summary>
 public static SmartInviteViewBuilder Construct(IGetSocialNativeBridge getSocialImpl)
 {
     return(new SmartInviteViewBuilder(getSocialImpl));
 }
示例#17
0
 /// <summary>
 /// Must not be invoked directly. Invoke <c><see cref="GetSocialChat.CreateChatListView"/></c> instead.
 /// </summary>
 public static ChatListViewBuilder Construct(IGetSocialNativeBridge getSocialImpl)
 {
     return(new ChatListViewBuilder(getSocialImpl));
 }
 /// <summary>
 /// Must not be invoked directly. Invoke <c><see cref="GetSocial.CreateUserListView"/></c> instead.
 /// </summary>
 public static UserListViewBuilder Construct(IGetSocialNativeBridge getSocialImpl, UserListType type,
                                             Action <User> onUserSelected, Action onCancel)
 {
     return(new UserListViewBuilder(getSocialImpl, type, onUserSelected, onCancel));
 }
示例#19
0
 private NotificationsViewBuilder(IGetSocialNativeBridge getSocialImpl) : base(getSocialImpl)
 {
 }
示例#20
0
 internal CurrentUser(IGetSocialNativeBridge nativeBridge)
 {
     this.nativeBridge = nativeBridge;
 }
示例#21
0
 /// <summary>
 /// Must not be invoked directly. Invoke <c><see cref="GetSocial.CreateNotificationsView"/></c> instead.
 /// </summary>
 public static NotificationsViewBuilder Construct(IGetSocialNativeBridge getSocialImpl)
 {
     return(new NotificationsViewBuilder(getSocialImpl));
 }