重构了表情的View
This commit is contained in:
@@ -209,4 +209,4 @@ SPEC CHECKSUMS:
|
||||
|
||||
PODFILE CHECKSUM: 4a92c59848ac53b9507af31a85a3d21b5c11188c
|
||||
|
||||
COCOAPODS: 1.11.2
|
||||
COCOAPODS: 1.11.0
|
||||
|
@@ -113,22 +113,9 @@
|
||||
9B0086C627BA392B0032BD2B /* AnchorStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C527BA392B0032BD2B /* AnchorStageView.m */; };
|
||||
9B0086CA27BA4F570032BD2B /* AnchorMicroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C927BA4F570032BD2B /* AnchorMicroView.m */; };
|
||||
9B060B5827BCAEE20001B767 /* AnchorGiftValueView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B060B5727BCAEE20001B767 /* AnchorGiftValueView.m */; };
|
||||
9B04CE20278937D100434F47 /* XPFaceParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B04CE1F278937D100434F47 /* XPFaceParser.m */; };
|
||||
9B04CE232789392E00434F47 /* FaceSendInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B04CE212789392E00434F47 /* FaceSendInfo.m */; };
|
||||
9B04CE26278940D700434F47 /* XPFaceProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B04CE25278940D700434F47 /* XPFaceProtocol.m */; };
|
||||
9B0E1C5926E77022005D4442 /* BaseNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0E1C5826E77022005D4442 /* BaseNavigationController.m */; };
|
||||
9B17F71827BD150600440843 /* SVGAParserManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B17F71727BD150600440843 /* SVGAParserManager.m */; };
|
||||
9B7B605B27BB53060070BB72 /* XPAnchorAudienceUpMicView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7B605A27BB53060070BB72 /* XPAnchorAudienceUpMicView.m */; };
|
||||
9B7B606227BB96E40070BB72 /* XPRoomAnchorInfoCardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7B606127BB96E40070BB72 /* XPRoomAnchorInfoCardView.m */; };
|
||||
9B7B606627BBA0EE0070BB72 /* XPAnchorAttentSendInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7B606527BBA0EE0070BB72 /* XPAnchorAttentSendInfo.m */; };
|
||||
9B208A362779B50100F9E54A /* GiftNobleInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B208A352779B50100F9E54A /* GiftNobleInfoModel.m */; };
|
||||
9B208A3B2779C2E400F9E54A /* XPRoomFaceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B208A392779C2E400F9E54A /* XPRoomFaceView.m */; };
|
||||
9B208A452779C30100F9E54A /* XCGameRoomFaceTitleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B208A3D2779C30100F9E54A /* XCGameRoomFaceTitleCell.m */; };
|
||||
9B208A462779C30100F9E54A /* XCGameRoomFaceCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B208A3E2779C30100F9E54A /* XCGameRoomFaceCell.m */; };
|
||||
9B208A472779C30100F9E54A /* XCGameRoomFaceTitleButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B208A422779C30100F9E54A /* XCGameRoomFaceTitleButton.m */; };
|
||||
9B208A482779C30100F9E54A /* XCGameRoomFaceContainerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B208A442779C30100F9E54A /* XCGameRoomFaceContainerCell.m */; };
|
||||
9B208A4E2779C30600F9E54A /* XCGameRoomFaceTitleDisplayModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B208A4B2779C30600F9E54A /* XCGameRoomFaceTitleDisplayModel.m */; };
|
||||
9B208A4F2779C30600F9E54A /* XCGameRoomFaceViewDisplayModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B208A4D2779C30600F9E54A /* XCGameRoomFaceViewDisplayModel.m */; };
|
||||
9B2A12D52783EEC700CED41B /* XPNobleCenterTableHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A12D42783EEC700CED41B /* XPNobleCenterTableHeadView.m */; };
|
||||
9B2A12D82783F42300CED41B /* XPNoblePrivilegeContentCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A12D72783F42300CED41B /* XPNoblePrivilegeContentCell.m */; };
|
||||
9B2A12DB2783F88800CED41B /* XPNoblePrivilegeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A12DA2783F88800CED41B /* XPNoblePrivilegeCell.m */; };
|
||||
@@ -136,27 +123,17 @@
|
||||
9B2A12E127845DD300CED41B /* XPNobleCenterMyNobleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A12E027845DD300CED41B /* XPNobleCenterMyNobleView.m */; };
|
||||
9B2A12E427846D7100CED41B /* NobleRechargeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A12E327846D7100CED41B /* NobleRechargeModel.m */; };
|
||||
9B6B3AA5278BDA20005551EC /* MicroFaceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B3AA4278BDA20005551EC /* MicroFaceView.m */; };
|
||||
9B6B3AA8278BE821005551EC /* FaceImageTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B3AA6278BE821005551EC /* FaceImageTool.m */; };
|
||||
9B6B3AAB278C2EA7005551EC /* XPRoomNobleLevelUpView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B3AAA278C2EA7005551EC /* XPRoomNobleLevelUpView.m */; };
|
||||
9B7B605B27BB53060070BB72 /* XPAnchorAudienceUpMicView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7B605A27BB53060070BB72 /* XPAnchorAudienceUpMicView.m */; };
|
||||
9B7B606227BB96E40070BB72 /* XPRoomAnchorInfoCardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7B606127BB96E40070BB72 /* XPRoomAnchorInfoCardView.m */; };
|
||||
9B7B606627BBA0EE0070BB72 /* XPAnchorAttentSendInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7B606527BBA0EE0070BB72 /* XPAnchorAttentSendInfo.m */; };
|
||||
9B7D804A2753783D003DAC0C /* SessionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D80492753783D003DAC0C /* SessionViewController.m */; };
|
||||
9B7D804D27537950003DAC0C /* MessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D804C27537950003DAC0C /* MessageCell.m */; };
|
||||
9B7D80502753AA9D003DAC0C /* UITableView+NIMScrollToBottom.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D804E2753AA9D003DAC0C /* UITableView+NIMScrollToBottom.m */; };
|
||||
9B7D80562753C595003DAC0C /* SendMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D80552753C595003DAC0C /* SendMessageView.m */; };
|
||||
9BAA5FED277A1BBE007453F3 /* XPPrivacyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAA5FEC277A1BBE007453F3 /* XPPrivacyViewController.m */; };
|
||||
9BAA5FF0277A23F4007453F3 /* XPPermissionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAA5FEF277A23F4007453F3 /* XPPermissionsViewController.m */; };
|
||||
9BE29A6B27D1BFF700446AB5 /* anchor_room_speak.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */; };
|
||||
9BE29A6D27D210A500446AB5 /* anchor_room_bg.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */; };
|
||||
9B8585D3278837CE00D7D5C6 /* NobleLevelUpModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B8585D2278837CE00D7D5C6 /* NobleLevelUpModel.m */; };
|
||||
9B8585D6278844B300D7D5C6 /* NSString+JsonToDic.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B8585D4278844B300D7D5C6 /* NSString+JsonToDic.m */; };
|
||||
9B8585EE27885B3E00D7D5C6 /* YYWebResourceDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B8585ED27885B3E00D7D5C6 /* YYWebResourceDownloader.m */; };
|
||||
9B8585F52788699400D7D5C6 /* FBKVOController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B8585F42788699400D7D5C6 /* FBKVOController.m */; };
|
||||
9B8585F927886A1100D7D5C6 /* CommonFileUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B8585F827886A1000D7D5C6 /* CommonFileUtils.m */; };
|
||||
9BA41F2527CBB7950043B11F /* UIColor+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BA41F2427CBB7950043B11F /* UIColor+Extension.m */; };
|
||||
9BA9AD832789344E00C0BF8F /* FaceReceiveInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BA9AD7B2789344D00C0BF8F /* FaceReceiveInfo.m */; };
|
||||
9BA9AD842789344E00C0BF8F /* FaceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BA9AD7D2789344D00C0BF8F /* FaceInfo.m */; };
|
||||
9BA9AD852789344E00C0BF8F /* FaceConfigInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BA9AD7F2789344D00C0BF8F /* FaceConfigInfo.m */; };
|
||||
9BA9AD862789344E00C0BF8F /* FaceInfoStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BA9AD802789344D00C0BF8F /* FaceInfoStorage.m */; };
|
||||
9BA9AD872789344E00C0BF8F /* FacePlayInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BA9AD812789344D00C0BF8F /* FacePlayInfo.m */; };
|
||||
9BAA5FED277A1BBE007453F3 /* XPPrivacyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAA5FEC277A1BBE007453F3 /* XPPrivacyViewController.m */; };
|
||||
9BAA5FF0277A23F4007453F3 /* XPPermissionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAA5FEF277A23F4007453F3 /* XPPermissionsViewController.m */; };
|
||||
9BB549592782E6A30090CD26 /* XPNobleCenterPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BB549582782E6A30090CD26 /* XPNobleCenterPresenter.m */; };
|
||||
@@ -169,7 +146,6 @@
|
||||
9BBC028E2786FA060007C24B /* NobleCardModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BBC028D2786FA060007C24B /* NobleCardModel.m */; };
|
||||
9BBC02912786FC570007C24B /* XPMineNobleCardTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BBC02902786FC570007C24B /* XPMineNobleCardTableViewCell.m */; };
|
||||
9BC5B58727915CF6004960AE /* XPGlobalMessageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BC5B58627915CF6004960AE /* XPGlobalMessageManager.m */; };
|
||||
9BC5C8E9277AB6AE007C8719 /* XPFacePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BC5C8E8277AB6AE007C8719 /* XPFacePresenter.m */; };
|
||||
9BC5C8ED277AFF63007C8719 /* XPNobleCenterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BC5C8EC277AFF63007C8719 /* XPNobleCenterViewController.m */; };
|
||||
9BC5C8F6277B0263007C8719 /* XPNobleCenterListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BC5C8F5277B0263007C8719 /* XPNobleCenterListViewController.m */; };
|
||||
9BC5C8F9277B02EA007C8719 /* Api+NobleCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BC5C8F8277B02EA007C8719 /* Api+NobleCenter.m */; };
|
||||
@@ -182,6 +158,8 @@
|
||||
9BD63FAB277EE885006EB744 /* Api+RoomRadio.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD63FAA277EE885006EB744 /* Api+RoomRadio.m */; };
|
||||
9BD63FAE277EE97A006EB744 /* XPReleaseRadioPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD63FAD277EE97A006EB744 /* XPReleaseRadioPresenter.m */; };
|
||||
9BD63FB4277EF1B3006EB744 /* XPReleaseRadioModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD63FB3277EF1B3006EB744 /* XPReleaseRadioModel.m */; };
|
||||
9BE29A6B27D1BFF700446AB5 /* anchor_room_speak.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */; };
|
||||
9BE29A6D27D210A500446AB5 /* anchor_room_bg.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */; };
|
||||
9BEE3D0E27853BD000C83219 /* ThemeColor+NobleCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BEE3D0D27853BD000C83219 /* ThemeColor+NobleCenter.m */; };
|
||||
9BEE3D11278584FE00C83219 /* XPNobleCenterEmptyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BEE3D10278584FE00C83219 /* XPNobleCenterEmptyView.m */; };
|
||||
9BEE3D142785884A00C83219 /* XPNobleCenterResidueView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BEE3D132785884A00C83219 /* XPNobleCenterResidueView.m */; };
|
||||
@@ -329,6 +307,8 @@
|
||||
E87A27032758BC81002DDC7A /* XPRoomSearchContainerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E87A27022758BC81002DDC7A /* XPRoomSearchContainerViewController.m */; };
|
||||
E87AE7F9277AABE50037823A /* XPRoomTagListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E87AE7F8277AABE50037823A /* XPRoomTagListViewController.m */; };
|
||||
E87AE7FC277AAC450037823A /* XPRoomTagPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E87AE7FB277AAC450037823A /* XPRoomTagPresenter.m */; };
|
||||
E87C0A9D27D9986700CB2241 /* XPRoomFaceCollectionFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = E87C0A9C27D9986700CB2241 /* XPRoomFaceCollectionFlowLayout.m */; };
|
||||
E87C0AA027D9DE6400CB2241 /* RoomFaceSendInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E87C0A9F27D9DE6400CB2241 /* RoomFaceSendInfoModel.m */; };
|
||||
E87E914E2796678D00A7B3F2 /* XPMineDressEmptyTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E87E914D2796678D00A7B3F2 /* XPMineDressEmptyTableViewCell.m */; };
|
||||
E87E91522796A15500A7B3F2 /* MicroExtModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E87E91512796A15500A7B3F2 /* MicroExtModel.m */; };
|
||||
E87E91552796B6DE00A7B3F2 /* XPRoomInviteUserViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E87E91542796B6DE00A7B3F2 /* XPRoomInviteUserViewController.m */; };
|
||||
@@ -452,6 +432,13 @@
|
||||
E8B846D626FDE01B00A777FE /* XPMineRechargePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846D526FDE01B00A777FE /* XPMineRechargePresenter.m */; };
|
||||
E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E8B846D726FDE16300A777FE /* XPMineRechargeProtocol.h */; };
|
||||
E8B846DC26FDE24300A777FE /* RechargeListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846DB26FDE24300A777FE /* RechargeListModel.m */; };
|
||||
E8C1CD6627D88EF800376F83 /* XPRoomFaceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C1CD6527D88EF800376F83 /* XPRoomFaceViewController.m */; };
|
||||
E8C1CD6A27D8937800376F83 /* XPRoomFaceCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C1CD6927D8937800376F83 /* XPRoomFaceCollectionViewCell.m */; };
|
||||
E8C1CD6D27D8938C00376F83 /* XPRoomFaceTitleCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C1CD6C27D8938C00376F83 /* XPRoomFaceTitleCollectionViewCell.m */; };
|
||||
E8C1CD7027D894B800376F83 /* RoomFaceTitleItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C1CD6F27D894B800376F83 /* RoomFaceTitleItemModel.m */; };
|
||||
E8C1CD7327D8A16500376F83 /* XPRoomFaceTool.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C1CD7227D8A16500376F83 /* XPRoomFaceTool.m */; };
|
||||
E8C1CD7627D8AE3D00376F83 /* XPRoomFacePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C1CD7527D8AE3D00376F83 /* XPRoomFacePresenter.m */; };
|
||||
E8C1CD7A27D8B29E00376F83 /* RoomFaceInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C1CD7927D8B29E00376F83 /* RoomFaceInfoModel.m */; };
|
||||
E8C21501274B76F60079E6BF /* XPRoomAnimationHitView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C21500274B76F60079E6BF /* XPRoomAnimationHitView.m */; };
|
||||
E8C6FFCA27548120004DC9F0 /* XPHomePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C6FFC027548120004DC9F0 /* XPHomePresenter.m */; };
|
||||
E8C6FFCB27548120004DC9F0 /* XPHomePartyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C6FFC527548120004DC9F0 /* XPHomePartyViewController.m */; };
|
||||
@@ -734,38 +721,12 @@
|
||||
9B0086C927BA4F570032BD2B /* AnchorMicroView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorMicroView.m; sourceTree = "<group>"; };
|
||||
9B060B5627BCAEE20001B767 /* AnchorGiftValueView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorGiftValueView.h; sourceTree = "<group>"; };
|
||||
9B060B5727BCAEE20001B767 /* AnchorGiftValueView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorGiftValueView.m; sourceTree = "<group>"; };
|
||||
9B04CE1E278937D100434F47 /* XPFaceParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPFaceParser.h; sourceTree = "<group>"; };
|
||||
9B04CE1F278937D100434F47 /* XPFaceParser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFaceParser.m; sourceTree = "<group>"; };
|
||||
9B04CE212789392E00434F47 /* FaceSendInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FaceSendInfo.m; sourceTree = "<group>"; };
|
||||
9B04CE222789392E00434F47 /* FaceSendInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FaceSendInfo.h; sourceTree = "<group>"; };
|
||||
9B04CE24278940D700434F47 /* XPFaceProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPFaceProtocol.h; sourceTree = "<group>"; };
|
||||
9B04CE25278940D700434F47 /* XPFaceProtocol.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFaceProtocol.m; sourceTree = "<group>"; };
|
||||
9B0E1C5726E77022005D4442 /* BaseNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseNavigationController.h; sourceTree = "<group>"; };
|
||||
9B0E1C5826E77022005D4442 /* BaseNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseNavigationController.m; sourceTree = "<group>"; };
|
||||
9B17F71627BD150600440843 /* SVGAParserManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAParserManager.h; sourceTree = "<group>"; };
|
||||
9B17F71727BD150600440843 /* SVGAParserManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVGAParserManager.m; sourceTree = "<group>"; };
|
||||
9B7B605927BB53060070BB72 /* XPAnchorAudienceUpMicView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPAnchorAudienceUpMicView.h; sourceTree = "<group>"; };
|
||||
9B7B605A27BB53060070BB72 /* XPAnchorAudienceUpMicView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPAnchorAudienceUpMicView.m; sourceTree = "<group>"; };
|
||||
9B7B606027BB96E40070BB72 /* XPRoomAnchorInfoCardView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPRoomAnchorInfoCardView.h; sourceTree = "<group>"; };
|
||||
9B7B606127BB96E40070BB72 /* XPRoomAnchorInfoCardView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPRoomAnchorInfoCardView.m; sourceTree = "<group>"; };
|
||||
9B7B606427BBA0EE0070BB72 /* XPAnchorAttentSendInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorAttentSendInfo.h; sourceTree = "<group>"; };
|
||||
9B7B606527BBA0EE0070BB72 /* XPAnchorAttentSendInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorAttentSendInfo.m; sourceTree = "<group>"; };
|
||||
9B208A342779B50100F9E54A /* GiftNobleInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiftNobleInfoModel.h; sourceTree = "<group>"; };
|
||||
9B208A352779B50100F9E54A /* GiftNobleInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiftNobleInfoModel.m; sourceTree = "<group>"; };
|
||||
9B208A392779C2E400F9E54A /* XPRoomFaceView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPRoomFaceView.m; sourceTree = "<group>"; };
|
||||
9B208A3A2779C2E400F9E54A /* XPRoomFaceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPRoomFaceView.h; sourceTree = "<group>"; };
|
||||
9B208A3D2779C30100F9E54A /* XCGameRoomFaceTitleCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCGameRoomFaceTitleCell.m; sourceTree = "<group>"; };
|
||||
9B208A3E2779C30100F9E54A /* XCGameRoomFaceCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCGameRoomFaceCell.m; sourceTree = "<group>"; };
|
||||
9B208A3F2779C30100F9E54A /* XCGameRoomFaceTitleButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCGameRoomFaceTitleButton.h; sourceTree = "<group>"; };
|
||||
9B208A402779C30100F9E54A /* XCGameRoomFaceContainerCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCGameRoomFaceContainerCell.h; sourceTree = "<group>"; };
|
||||
9B208A412779C30100F9E54A /* XCGameRoomFaceTitleCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCGameRoomFaceTitleCell.h; sourceTree = "<group>"; };
|
||||
9B208A422779C30100F9E54A /* XCGameRoomFaceTitleButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCGameRoomFaceTitleButton.m; sourceTree = "<group>"; };
|
||||
9B208A432779C30100F9E54A /* XCGameRoomFaceCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCGameRoomFaceCell.h; sourceTree = "<group>"; };
|
||||
9B208A442779C30100F9E54A /* XCGameRoomFaceContainerCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCGameRoomFaceContainerCell.m; sourceTree = "<group>"; };
|
||||
9B208A4A2779C30600F9E54A /* XCGameRoomFaceViewDisplayModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCGameRoomFaceViewDisplayModel.h; sourceTree = "<group>"; };
|
||||
9B208A4B2779C30600F9E54A /* XCGameRoomFaceTitleDisplayModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCGameRoomFaceTitleDisplayModel.m; sourceTree = "<group>"; };
|
||||
9B208A4C2779C30600F9E54A /* XCGameRoomFaceTitleDisplayModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCGameRoomFaceTitleDisplayModel.h; sourceTree = "<group>"; };
|
||||
9B208A4D2779C30600F9E54A /* XCGameRoomFaceViewDisplayModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCGameRoomFaceViewDisplayModel.m; sourceTree = "<group>"; };
|
||||
9B2A12D32783EEC700CED41B /* XPNobleCenterTableHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNobleCenterTableHeadView.h; sourceTree = "<group>"; };
|
||||
9B2A12D42783EEC700CED41B /* XPNobleCenterTableHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNobleCenterTableHeadView.m; sourceTree = "<group>"; };
|
||||
9B2A12D62783F42300CED41B /* XPNoblePrivilegeContentCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNoblePrivilegeContentCell.h; sourceTree = "<group>"; };
|
||||
@@ -780,10 +741,14 @@
|
||||
9B2A12E327846D7100CED41B /* NobleRechargeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NobleRechargeModel.m; sourceTree = "<group>"; };
|
||||
9B6B3AA3278BDA20005551EC /* MicroFaceView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MicroFaceView.h; sourceTree = "<group>"; };
|
||||
9B6B3AA4278BDA20005551EC /* MicroFaceView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MicroFaceView.m; sourceTree = "<group>"; };
|
||||
9B6B3AA6278BE821005551EC /* FaceImageTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FaceImageTool.m; sourceTree = "<group>"; };
|
||||
9B6B3AA7278BE821005551EC /* FaceImageTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FaceImageTool.h; sourceTree = "<group>"; };
|
||||
9B6B3AA9278C2EA7005551EC /* XPRoomNobleLevelUpView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomNobleLevelUpView.h; sourceTree = "<group>"; };
|
||||
9B6B3AAA278C2EA7005551EC /* XPRoomNobleLevelUpView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomNobleLevelUpView.m; sourceTree = "<group>"; };
|
||||
9B7B605927BB53060070BB72 /* XPAnchorAudienceUpMicView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPAnchorAudienceUpMicView.h; sourceTree = "<group>"; };
|
||||
9B7B605A27BB53060070BB72 /* XPAnchorAudienceUpMicView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPAnchorAudienceUpMicView.m; sourceTree = "<group>"; };
|
||||
9B7B606027BB96E40070BB72 /* XPRoomAnchorInfoCardView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPRoomAnchorInfoCardView.h; sourceTree = "<group>"; };
|
||||
9B7B606127BB96E40070BB72 /* XPRoomAnchorInfoCardView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPRoomAnchorInfoCardView.m; sourceTree = "<group>"; };
|
||||
9B7B606427BBA0EE0070BB72 /* XPAnchorAttentSendInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorAttentSendInfo.h; sourceTree = "<group>"; };
|
||||
9B7B606527BBA0EE0070BB72 /* XPAnchorAttentSendInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorAttentSendInfo.m; sourceTree = "<group>"; };
|
||||
9B7D80482753783D003DAC0C /* SessionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SessionViewController.h; sourceTree = "<group>"; };
|
||||
9B7D80492753783D003DAC0C /* SessionViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SessionViewController.m; sourceTree = "<group>"; };
|
||||
9B7D804B27537950003DAC0C /* MessageCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageCell.h; sourceTree = "<group>"; };
|
||||
@@ -794,26 +759,10 @@
|
||||
9B7D80552753C595003DAC0C /* SendMessageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SendMessageView.m; sourceTree = "<group>"; };
|
||||
9B8585D1278837CE00D7D5C6 /* NobleLevelUpModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NobleLevelUpModel.h; sourceTree = "<group>"; };
|
||||
9B8585D2278837CE00D7D5C6 /* NobleLevelUpModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NobleLevelUpModel.m; sourceTree = "<group>"; };
|
||||
9B8585D4278844B300D7D5C6 /* NSString+JsonToDic.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+JsonToDic.m"; sourceTree = "<group>"; };
|
||||
9B8585D5278844B300D7D5C6 /* NSString+JsonToDic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+JsonToDic.h"; sourceTree = "<group>"; };
|
||||
9B8585EC27885B3E00D7D5C6 /* YYWebResourceDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YYWebResourceDownloader.h; sourceTree = "<group>"; };
|
||||
9B8585ED27885B3E00D7D5C6 /* YYWebResourceDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YYWebResourceDownloader.m; sourceTree = "<group>"; };
|
||||
9B8585F32788699400D7D5C6 /* FBKVOController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBKVOController.h; sourceTree = "<group>"; };
|
||||
9B8585F42788699400D7D5C6 /* FBKVOController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBKVOController.m; sourceTree = "<group>"; };
|
||||
9B8585F727886A1000D7D5C6 /* CommonFileUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonFileUtils.h; sourceTree = "<group>"; };
|
||||
9B8585F827886A1000D7D5C6 /* CommonFileUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommonFileUtils.m; sourceTree = "<group>"; };
|
||||
9BA41F2327CBB7950043B11F /* UIColor+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+Extension.h"; sourceTree = "<group>"; };
|
||||
9BA41F2427CBB7950043B11F /* UIColor+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+Extension.m"; sourceTree = "<group>"; };
|
||||
9BA9AD792789344D00C0BF8F /* FaceConfigInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FaceConfigInfo.h; sourceTree = "<group>"; };
|
||||
9BA9AD7A2789344D00C0BF8F /* FaceInfoStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FaceInfoStorage.h; sourceTree = "<group>"; };
|
||||
9BA9AD7B2789344D00C0BF8F /* FaceReceiveInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FaceReceiveInfo.m; sourceTree = "<group>"; };
|
||||
9BA9AD7C2789344D00C0BF8F /* FacePlayInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FacePlayInfo.h; sourceTree = "<group>"; };
|
||||
9BA9AD7D2789344D00C0BF8F /* FaceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FaceInfo.m; sourceTree = "<group>"; };
|
||||
9BA9AD7E2789344D00C0BF8F /* FaceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FaceInfo.h; sourceTree = "<group>"; };
|
||||
9BA9AD7F2789344D00C0BF8F /* FaceConfigInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FaceConfigInfo.m; sourceTree = "<group>"; };
|
||||
9BA9AD802789344D00C0BF8F /* FaceInfoStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FaceInfoStorage.m; sourceTree = "<group>"; };
|
||||
9BA9AD812789344D00C0BF8F /* FacePlayInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FacePlayInfo.m; sourceTree = "<group>"; };
|
||||
9BA9AD822789344E00C0BF8F /* FaceReceiveInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FaceReceiveInfo.h; sourceTree = "<group>"; };
|
||||
9BAA5FEB277A1BBE007453F3 /* XPPrivacyViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPrivacyViewController.h; sourceTree = "<group>"; };
|
||||
9BAA5FEC277A1BBE007453F3 /* XPPrivacyViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPrivacyViewController.m; sourceTree = "<group>"; };
|
||||
9BAA5FEE277A23F4007453F3 /* XPPermissionsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPermissionsViewController.h; sourceTree = "<group>"; };
|
||||
@@ -829,8 +778,6 @@
|
||||
9BB54964278303EB0090CD26 /* XPNobleCenterNavView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNobleCenterNavView.h; sourceTree = "<group>"; };
|
||||
9BB54965278303EB0090CD26 /* XPNobleCenterNavView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNobleCenterNavView.m; sourceTree = "<group>"; };
|
||||
9BB865B4272076140029CDE0 /* RtcImplDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RtcImplDelegate.h; sourceTree = "<group>"; };
|
||||
9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_speak.svga; sourceTree = "<group>"; };
|
||||
9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_bg.svga; sourceTree = "<group>"; };
|
||||
9BBC02852786D75C0007C24B /* XPNobleUpgradeLevelView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNobleUpgradeLevelView.h; sourceTree = "<group>"; };
|
||||
9BBC02862786D75C0007C24B /* XPNobleUpgradeLevelView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNobleUpgradeLevelView.m; sourceTree = "<group>"; };
|
||||
9BBC02892786E05A0007C24B /* XPNobleCenterEntranceView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNobleCenterEntranceView.h; sourceTree = "<group>"; };
|
||||
@@ -841,8 +788,6 @@
|
||||
9BBC02902786FC570007C24B /* XPMineNobleCardTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineNobleCardTableViewCell.m; sourceTree = "<group>"; };
|
||||
9BC5B58527915CF6004960AE /* XPGlobalMessageManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGlobalMessageManager.h; sourceTree = "<group>"; };
|
||||
9BC5B58627915CF6004960AE /* XPGlobalMessageManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGlobalMessageManager.m; sourceTree = "<group>"; };
|
||||
9BC5C8E7277AB6AE007C8719 /* XPFacePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPFacePresenter.h; sourceTree = "<group>"; };
|
||||
9BC5C8E8277AB6AE007C8719 /* XPFacePresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFacePresenter.m; sourceTree = "<group>"; };
|
||||
9BC5C8EB277AFF63007C8719 /* XPNobleCenterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNobleCenterViewController.h; sourceTree = "<group>"; };
|
||||
9BC5C8EC277AFF63007C8719 /* XPNobleCenterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNobleCenterViewController.m; sourceTree = "<group>"; };
|
||||
9BC5C8F3277B0144007C8719 /* XPNobleCenterProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNobleCenterProtocol.h; sourceTree = "<group>"; };
|
||||
@@ -869,6 +814,8 @@
|
||||
9BD63FB1277EF14A006EB744 /* XPReleaseRadioProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPReleaseRadioProtocol.h; sourceTree = "<group>"; };
|
||||
9BD63FB2277EF1B3006EB744 /* XPReleaseRadioModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPReleaseRadioModel.h; sourceTree = "<group>"; };
|
||||
9BD63FB3277EF1B3006EB744 /* XPReleaseRadioModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPReleaseRadioModel.m; sourceTree = "<group>"; };
|
||||
9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_speak.svga; sourceTree = "<group>"; };
|
||||
9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_bg.svga; sourceTree = "<group>"; };
|
||||
9BEE3D0C27853BD000C83219 /* ThemeColor+NobleCenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ThemeColor+NobleCenter.h"; sourceTree = "<group>"; };
|
||||
9BEE3D0D27853BD000C83219 /* ThemeColor+NobleCenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "ThemeColor+NobleCenter.m"; sourceTree = "<group>"; };
|
||||
9BEE3D0F278584FE00C83219 /* XPNobleCenterEmptyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNobleCenterEmptyView.h; sourceTree = "<group>"; };
|
||||
@@ -1171,6 +1118,10 @@
|
||||
E87AE7FA277AAC450037823A /* XPRoomTagPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTagPresenter.h; sourceTree = "<group>"; };
|
||||
E87AE7FB277AAC450037823A /* XPRoomTagPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTagPresenter.m; sourceTree = "<group>"; };
|
||||
E87AE7FD277AAC5A0037823A /* XPRoomTagProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTagProtocol.h; sourceTree = "<group>"; };
|
||||
E87C0A9B27D9986700CB2241 /* XPRoomFaceCollectionFlowLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomFaceCollectionFlowLayout.h; sourceTree = "<group>"; };
|
||||
E87C0A9C27D9986700CB2241 /* XPRoomFaceCollectionFlowLayout.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomFaceCollectionFlowLayout.m; sourceTree = "<group>"; };
|
||||
E87C0A9E27D9DE6400CB2241 /* RoomFaceSendInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomFaceSendInfoModel.h; sourceTree = "<group>"; };
|
||||
E87C0A9F27D9DE6400CB2241 /* RoomFaceSendInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomFaceSendInfoModel.m; sourceTree = "<group>"; };
|
||||
E87E914C2796678D00A7B3F2 /* XPMineDressEmptyTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPMineDressEmptyTableViewCell.h; sourceTree = "<group>"; };
|
||||
E87E914D2796678D00A7B3F2 /* XPMineDressEmptyTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPMineDressEmptyTableViewCell.m; sourceTree = "<group>"; };
|
||||
E87E91502796A15500A7B3F2 /* MicroExtModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MicroExtModel.h; sourceTree = "<group>"; };
|
||||
@@ -1403,6 +1354,21 @@
|
||||
E8B846D726FDE16300A777FE /* XPMineRechargeProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineRechargeProtocol.h; sourceTree = "<group>"; };
|
||||
E8B846DA26FDE24300A777FE /* RechargeListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RechargeListModel.h; sourceTree = "<group>"; };
|
||||
E8B846DB26FDE24300A777FE /* RechargeListModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RechargeListModel.m; sourceTree = "<group>"; };
|
||||
E8C1CD6427D88EF800376F83 /* XPRoomFaceViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomFaceViewController.h; sourceTree = "<group>"; };
|
||||
E8C1CD6527D88EF800376F83 /* XPRoomFaceViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomFaceViewController.m; sourceTree = "<group>"; };
|
||||
E8C1CD6827D8937800376F83 /* XPRoomFaceCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomFaceCollectionViewCell.h; sourceTree = "<group>"; };
|
||||
E8C1CD6927D8937800376F83 /* XPRoomFaceCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomFaceCollectionViewCell.m; sourceTree = "<group>"; };
|
||||
E8C1CD6B27D8938C00376F83 /* XPRoomFaceTitleCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomFaceTitleCollectionViewCell.h; sourceTree = "<group>"; };
|
||||
E8C1CD6C27D8938C00376F83 /* XPRoomFaceTitleCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomFaceTitleCollectionViewCell.m; sourceTree = "<group>"; };
|
||||
E8C1CD6E27D894B800376F83 /* RoomFaceTitleItemModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomFaceTitleItemModel.h; sourceTree = "<group>"; };
|
||||
E8C1CD6F27D894B800376F83 /* RoomFaceTitleItemModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomFaceTitleItemModel.m; sourceTree = "<group>"; };
|
||||
E8C1CD7127D8A16500376F83 /* XPRoomFaceTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomFaceTool.h; sourceTree = "<group>"; };
|
||||
E8C1CD7227D8A16500376F83 /* XPRoomFaceTool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomFaceTool.m; sourceTree = "<group>"; };
|
||||
E8C1CD7427D8AE3D00376F83 /* XPRoomFacePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomFacePresenter.h; sourceTree = "<group>"; };
|
||||
E8C1CD7527D8AE3D00376F83 /* XPRoomFacePresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomFacePresenter.m; sourceTree = "<group>"; };
|
||||
E8C1CD7727D8AE5600376F83 /* XPRoomFaceProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomFaceProtocol.h; sourceTree = "<group>"; };
|
||||
E8C1CD7827D8B29E00376F83 /* RoomFaceInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomFaceInfoModel.h; sourceTree = "<group>"; };
|
||||
E8C1CD7927D8B29E00376F83 /* RoomFaceInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomFaceInfoModel.m; sourceTree = "<group>"; };
|
||||
E8C214FF274B76F60079E6BF /* XPRoomAnimationHitView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomAnimationHitView.h; sourceTree = "<group>"; };
|
||||
E8C21500274B76F60079E6BF /* XPRoomAnimationHitView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomAnimationHitView.m; sourceTree = "<group>"; };
|
||||
E8C6FFBF27548120004DC9F0 /* XPHomePresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPHomePresenter.h; sourceTree = "<group>"; };
|
||||
@@ -1986,9 +1952,7 @@
|
||||
9BA41F2227CBB7500043B11F /* UIColor */,
|
||||
180116F6279E8C3100F2CBC0 /* Date */,
|
||||
9B17F71527BD14FF00440843 /* SVGAParserManager */,
|
||||
9B8585F627886A1000D7D5C6 /* File */,
|
||||
9B8585F22788699400D7D5C6 /* KVO */,
|
||||
9B8585EA27885B3D00D7D5C6 /* WebResource */,
|
||||
E82D5C77276B25B000858D6D /* SpriteSheetManager */,
|
||||
E865964E2701A1A900846EBD /* StatisticsService */,
|
||||
E89DA6612700590A008483C1 /* IAPHelper */,
|
||||
@@ -2236,6 +2200,17 @@
|
||||
path = SVGAParserManager;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B208A372779C1EF00F9E54A /* FaceView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E8C1CD5F27D88E4900376F83 /* Model */,
|
||||
E8C1CD6127D88E6A00376F83 /* View */,
|
||||
E8C1CD6227D88E7900376F83 /* Presenter */,
|
||||
E8C1CD6327D88EA300376F83 /* Protocol */,
|
||||
);
|
||||
path = FaceView;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B7B605827BB52FD0070BB72 /* AnchorView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -2256,94 +2231,6 @@
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B04CE1B2789379B00434F47 /* XPFaceParser */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9B6B3AA7278BE821005551EC /* FaceImageTool.h */,
|
||||
9B6B3AA6278BE821005551EC /* FaceImageTool.m */,
|
||||
9B04CE1E278937D100434F47 /* XPFaceParser.h */,
|
||||
9B04CE1F278937D100434F47 /* XPFaceParser.m */,
|
||||
);
|
||||
path = XPFaceParser;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B04CE1C278937B300434F47 /* Procotol */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9B04CE24278940D700434F47 /* XPFaceProtocol.h */,
|
||||
9B04CE25278940D700434F47 /* XPFaceProtocol.m */,
|
||||
);
|
||||
path = Procotol;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B04CE1D278937BB00434F47 /* Api */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
path = Api;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B208A372779C1EF00F9E54A /* FaceView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9B04CE1D278937BB00434F47 /* Api */,
|
||||
9B04CE1C278937B300434F47 /* Procotol */,
|
||||
9B04CE1B2789379B00434F47 /* XPFaceParser */,
|
||||
9BC5C8E6277AAD8B007C8719 /* Presenter */,
|
||||
9B208A492779C30600F9E54A /* Model */,
|
||||
9B208A382779C2CA00F9E54A /* View */,
|
||||
);
|
||||
path = FaceView;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B208A382779C2CA00F9E54A /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9B208A3C2779C30100F9E54A /* Cell */,
|
||||
9B208A3A2779C2E400F9E54A /* XPRoomFaceView.h */,
|
||||
9B208A392779C2E400F9E54A /* XPRoomFaceView.m */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B208A3C2779C30100F9E54A /* Cell */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9B208A412779C30100F9E54A /* XCGameRoomFaceTitleCell.h */,
|
||||
9B208A3D2779C30100F9E54A /* XCGameRoomFaceTitleCell.m */,
|
||||
9B208A432779C30100F9E54A /* XCGameRoomFaceCell.h */,
|
||||
9B208A3E2779C30100F9E54A /* XCGameRoomFaceCell.m */,
|
||||
9B208A3F2779C30100F9E54A /* XCGameRoomFaceTitleButton.h */,
|
||||
9B208A422779C30100F9E54A /* XCGameRoomFaceTitleButton.m */,
|
||||
9B208A402779C30100F9E54A /* XCGameRoomFaceContainerCell.h */,
|
||||
9B208A442779C30100F9E54A /* XCGameRoomFaceContainerCell.m */,
|
||||
);
|
||||
path = Cell;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B208A492779C30600F9E54A /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9BA9AD792789344D00C0BF8F /* FaceConfigInfo.h */,
|
||||
9BA9AD7F2789344D00C0BF8F /* FaceConfigInfo.m */,
|
||||
9BA9AD7E2789344D00C0BF8F /* FaceInfo.h */,
|
||||
9BA9AD7D2789344D00C0BF8F /* FaceInfo.m */,
|
||||
9BA9AD7A2789344D00C0BF8F /* FaceInfoStorage.h */,
|
||||
9BA9AD802789344D00C0BF8F /* FaceInfoStorage.m */,
|
||||
9BA9AD7C2789344D00C0BF8F /* FacePlayInfo.h */,
|
||||
9BA9AD812789344D00C0BF8F /* FacePlayInfo.m */,
|
||||
9BA9AD822789344E00C0BF8F /* FaceReceiveInfo.h */,
|
||||
9BA9AD7B2789344D00C0BF8F /* FaceReceiveInfo.m */,
|
||||
9B04CE222789392E00434F47 /* FaceSendInfo.h */,
|
||||
9B04CE212789392E00434F47 /* FaceSendInfo.m */,
|
||||
9B208A4A2779C30600F9E54A /* XCGameRoomFaceViewDisplayModel.h */,
|
||||
9B208A4D2779C30600F9E54A /* XCGameRoomFaceViewDisplayModel.m */,
|
||||
9B208A4C2779C30600F9E54A /* XCGameRoomFaceTitleDisplayModel.h */,
|
||||
9B208A4B2779C30600F9E54A /* XCGameRoomFaceTitleDisplayModel.m */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B7D804727537819003DAC0C /* Session */ = {
|
||||
isa = PBXGroup;
|
||||
@@ -2370,30 +2257,6 @@
|
||||
path = NobleVIP;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B8585D727884FE200D7D5C6 /* Face */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
path = Face;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B8585EA27885B3D00D7D5C6 /* WebResource */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9B8585EB27885B3E00D7D5C6 /* Downloader */,
|
||||
);
|
||||
path = WebResource;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B8585EB27885B3E00D7D5C6 /* Downloader */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9B8585EC27885B3E00D7D5C6 /* YYWebResourceDownloader.h */,
|
||||
9B8585ED27885B3E00D7D5C6 /* YYWebResourceDownloader.m */,
|
||||
);
|
||||
path = Downloader;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B8585F22788699400D7D5C6 /* KVO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -2403,15 +2266,6 @@
|
||||
path = KVO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B8585F627886A1000D7D5C6 /* File */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9B8585F727886A1000D7D5C6 /* CommonFileUtils.h */,
|
||||
9B8585F827886A1000D7D5C6 /* CommonFileUtils.m */,
|
||||
);
|
||||
path = File;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9BA41F2227CBB7500043B11F /* UIColor */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -2455,15 +2309,6 @@
|
||||
path = NobleCenter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9BC5C8E6277AAD8B007C8719 /* Presenter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9BC5C8E7277AB6AE007C8719 /* XPFacePresenter.h */,
|
||||
9BC5C8E8277AB6AE007C8719 /* XPFacePresenter.m */,
|
||||
);
|
||||
path = Presenter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9BC5C8EA277AFEDC007C8719 /* Noble */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -2682,8 +2527,6 @@
|
||||
E81366E426F0A4820076364C /* NSString */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9B8585D5278844B300D7D5C6 /* NSString+JsonToDic.h */,
|
||||
9B8585D4278844B300D7D5C6 /* NSString+JsonToDic.m */,
|
||||
E81366E526F0A49E0076364C /* NSString+Utils.h */,
|
||||
E81366E626F0A49E0076364C /* NSString+Utils.m */,
|
||||
);
|
||||
@@ -3682,7 +3525,6 @@
|
||||
E8412F9A2779BAC2006E1101 /* Setting */,
|
||||
E84150B027747A7400A7F548 /* FirstRecharge */,
|
||||
E81C1B1327705EF00020D1E4 /* ArrangeMic */,
|
||||
9B8585D727884FE200D7D5C6 /* Face */,
|
||||
9B8585D0278835BF00D7D5C6 /* NobleVIP */,
|
||||
9BC5C915277C809E007C8719 /* ReleaseRadio */,
|
||||
E8A1E4462761F8EA00B294CA /* CandyTree */,
|
||||
@@ -3845,6 +3687,61 @@
|
||||
path = Recharge;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E8C1CD5F27D88E4900376F83 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E8C1CD6E27D894B800376F83 /* RoomFaceTitleItemModel.h */,
|
||||
E8C1CD6F27D894B800376F83 /* RoomFaceTitleItemModel.m */,
|
||||
E8C1CD7827D8B29E00376F83 /* RoomFaceInfoModel.h */,
|
||||
E8C1CD7927D8B29E00376F83 /* RoomFaceInfoModel.m */,
|
||||
E87C0A9E27D9DE6400CB2241 /* RoomFaceSendInfoModel.h */,
|
||||
E87C0A9F27D9DE6400CB2241 /* RoomFaceSendInfoModel.m */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E8C1CD6127D88E6A00376F83 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E8C1CD6727D8933A00376F83 /* Cell */,
|
||||
E8C1CD6427D88EF800376F83 /* XPRoomFaceViewController.h */,
|
||||
E8C1CD6527D88EF800376F83 /* XPRoomFaceViewController.m */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E8C1CD6227D88E7900376F83 /* Presenter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E8C1CD7127D8A16500376F83 /* XPRoomFaceTool.h */,
|
||||
E8C1CD7227D8A16500376F83 /* XPRoomFaceTool.m */,
|
||||
E8C1CD7427D8AE3D00376F83 /* XPRoomFacePresenter.h */,
|
||||
E8C1CD7527D8AE3D00376F83 /* XPRoomFacePresenter.m */,
|
||||
);
|
||||
path = Presenter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E8C1CD6327D88EA300376F83 /* Protocol */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E8C1CD7727D8AE5600376F83 /* XPRoomFaceProtocol.h */,
|
||||
);
|
||||
path = Protocol;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E8C1CD6727D8933A00376F83 /* Cell */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E8C1CD6827D8937800376F83 /* XPRoomFaceCollectionViewCell.h */,
|
||||
E8C1CD6927D8937800376F83 /* XPRoomFaceCollectionViewCell.m */,
|
||||
E8C1CD6B27D8938C00376F83 /* XPRoomFaceTitleCollectionViewCell.h */,
|
||||
E8C1CD6C27D8938C00376F83 /* XPRoomFaceTitleCollectionViewCell.m */,
|
||||
E87C0A9B27D9986700CB2241 /* XPRoomFaceCollectionFlowLayout.h */,
|
||||
E87C0A9C27D9986700CB2241 /* XPRoomFaceCollectionFlowLayout.m */,
|
||||
);
|
||||
path = Cell;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E8C6FFBD27548120004DC9F0 /* Home */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -4441,14 +4338,11 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E8E5E1AF27C3920100F457D8 /* XPHomeRecommendPresenter.m in Sources */,
|
||||
9B208A4F2779C30600F9E54A /* XCGameRoomFaceViewDisplayModel.m in Sources */,
|
||||
181D7F1B2726CE2A00B7C059 /* StageView.m in Sources */,
|
||||
18EE3FF12750D2AD00A452BF /* NIMTimeUtils.m in Sources */,
|
||||
E8ACEFEF27C8C45100F66D1A /* XPHomeHapppyRoomTableViewCell.m in Sources */,
|
||||
E84BF7DA277C72AC00EF8877 /* XPRoomRoleTableViewCell.m in Sources */,
|
||||
9B6B3AA8278BE821005551EC /* FaceImageTool.m in Sources */,
|
||||
E839532D276A030F00CF2F24 /* XPMineDressUpListViewController.m in Sources */,
|
||||
9BA9AD832789344E00C0BF8F /* FaceReceiveInfo.m in Sources */,
|
||||
E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */,
|
||||
E82D5C7D276B343300858D6D /* YYAnimatedImageView+ImageShow.m in Sources */,
|
||||
E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */,
|
||||
@@ -4462,6 +4356,7 @@
|
||||
9B2A12E427846D7100CED41B /* NobleRechargeModel.m in Sources */,
|
||||
E88B5CBA26FB329C00DA9178 /* XPMineTeenagerPwdProtocol.h in Sources */,
|
||||
E83953222769F33B00CF2F24 /* XPRoomFunctionContainerView.m in Sources */,
|
||||
E87C0AA027D9DE6400CB2241 /* RoomFaceSendInfoModel.m in Sources */,
|
||||
E88B5CB226FB1CFF00DA9178 /* XPMineTeenagerProtocol.h in Sources */,
|
||||
E824546626F5FF6000BE8163 /* XPMineResetPayPasswordProtocol.h in Sources */,
|
||||
E89DA66427005932008483C1 /* XPIAPHelper.m in Sources */,
|
||||
@@ -4504,14 +4399,13 @@
|
||||
E84150BB27747BAF00A7F548 /* XPFirstRechargePresenter.m in Sources */,
|
||||
9BEE3D1727858E5700C83219 /* XPNobleAuthorityDescView.m in Sources */,
|
||||
E82325F9274E2E42003A3332 /* Api+UserCard.m in Sources */,
|
||||
9B04CE20278937D100434F47 /* XPFaceParser.m in Sources */,
|
||||
E82109B026F1D83500FC3319 /* LoginBindPhonePresent.m in Sources */,
|
||||
E81C1B1F27705F7A0020D1E4 /* XPArrangeMicViewController.m in Sources */,
|
||||
9BA9AD852789344E00C0BF8F /* FaceConfigInfo.m in Sources */,
|
||||
E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */,
|
||||
E824544E26F5BC1A00BE8163 /* XPMineModifPayPwdView.m in Sources */,
|
||||
E8A6C2A227CF856E00AC7442 /* HomeCollectRoomModel.m in Sources */,
|
||||
9B8585F52788699400D7D5C6 /* FBKVOController.m in Sources */,
|
||||
E8C1CD7327D8A16500376F83 /* XPRoomFaceTool.m in Sources */,
|
||||
E8A03DE22762FA000098D9EA /* XPCandyTreeMoreView.m in Sources */,
|
||||
E8B825CA26EA1231009E8E9F /* LoginVerifCodeViewController.m in Sources */,
|
||||
189DD76226E60DDC00AB55B1 /* Api+Login.m in Sources */,
|
||||
@@ -4561,7 +4455,6 @@
|
||||
189DD53426DE255300AB55B1 /* TabbarViewController.m in Sources */,
|
||||
E87A26F927587C62002DDC7A /* XPHomeContainerPresenter.m in Sources */,
|
||||
18EE401A2754BA9F00A452BF /* NIMMessageMaker.m in Sources */,
|
||||
9B8585EE27885B3E00D7D5C6 /* YYWebResourceDownloader.m in Sources */,
|
||||
E8EEB91D26FC9D58007C6EBA /* XPMineUserInfoDateView.m in Sources */,
|
||||
E82325E9274CE56A003A3332 /* XPShareItem.m in Sources */,
|
||||
E890BC0D273D09A50007C46B /* XPGiftCountView.m in Sources */,
|
||||
@@ -4574,6 +4467,7 @@
|
||||
E84B0E3F2727EDF6008818C6 /* XPRoomMessageTableViewCell.m in Sources */,
|
||||
E8E5E18B27C332EE00F457D8 /* XPHomeViewController.m in Sources */,
|
||||
E82325FC274E4735003A3332 /* XPUserCardItemModel.m in Sources */,
|
||||
E8C1CD6627D88EF800376F83 /* XPRoomFaceViewController.m in Sources */,
|
||||
E80DE4102775C34E00BE5BCB /* XPFirstRechargeSuccessView.m in Sources */,
|
||||
E8412FB32779E285006E1101 /* Api+RoomSetting.m in Sources */,
|
||||
E8A6C29827CF448700AC7442 /* XPHomeCollectRoomTableViewCell.m in Sources */,
|
||||
@@ -4631,6 +4525,7 @@
|
||||
1808073027315E8E001FD836 /* NetImageView.m in Sources */,
|
||||
18486235271EB794005FC5DC /* AgoraRtcImpl.m in Sources */,
|
||||
E8A1E454276208E500B294CA /* CandyTreeInfoModel.m in Sources */,
|
||||
E8C1CD7A27D8B29E00376F83 /* RoomFaceInfoModel.m in Sources */,
|
||||
E81C1B1C27705F6B0020D1E4 /* XPArrangeMicPresenter.m in Sources */,
|
||||
184862CE27213FD7005FC5DC /* ZegoRtcImpl.m in Sources */,
|
||||
9B0E1C5926E77022005D4442 /* BaseNavigationController.m in Sources */,
|
||||
@@ -4642,7 +4537,6 @@
|
||||
189DD54B26DE338800AB55B1 /* BaseViewController.m in Sources */,
|
||||
E8B846C226FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m in Sources */,
|
||||
E816C11527608A7500C84014 /* XPRoomMiniManager.m in Sources */,
|
||||
9B208A462779C30100F9E54A /* XCGameRoomFaceCell.m in Sources */,
|
||||
E8EEB91726FC7B35007C6EBA /* XPMineUserInfoDesViewController.m in Sources */,
|
||||
E80CBDED27D0D899001E1EC2 /* XPHomeLikeEmptyTableViewCell.m in Sources */,
|
||||
180806FB2729A354001FD836 /* ThemeColor+Room.m in Sources */,
|
||||
@@ -4673,6 +4567,7 @@
|
||||
18E7B1B226E8AF980064BC9B /* MainPresenter.m in Sources */,
|
||||
E81366F626F0C0DF0076364C /* LoginFullInfoPresenter.m in Sources */,
|
||||
18A61BE8274F9CF000A09A54 /* SessionListViewController.m in Sources */,
|
||||
E8C1CD6A27D8937800376F83 /* XPRoomFaceCollectionViewCell.m in Sources */,
|
||||
E811FFF72742367B00918544 /* XPGiftEmptyCollectionViewCell.m in Sources */,
|
||||
189DD67E26E1FD8900AB55B1 /* UIImage+Utils.m in Sources */,
|
||||
E824545626F5E51900BE8163 /* XPMineVerifIdentityViewController.m in Sources */,
|
||||
@@ -4683,8 +4578,6 @@
|
||||
18E7B31E26F0984C0064BC9B /* UserLevelVo.m in Sources */,
|
||||
E82D5C7A276B25D100858D6D /* SpriteSheetImageManager.m in Sources */,
|
||||
E874B88B27215EAF003954B9 /* MicroQueueModel.m in Sources */,
|
||||
9BA9AD872789344E00C0BF8F /* FacePlayInfo.m in Sources */,
|
||||
9B8585D6278844B300D7D5C6 /* NSString+JsonToDic.m in Sources */,
|
||||
E8EE827D272B9A2300A17217 /* XPRoomSendTextView.m in Sources */,
|
||||
9BD63FAE277EE97A006EB744 /* XPReleaseRadioPresenter.m in Sources */,
|
||||
E8EEB90626FC5772007C6EBA /* XPMineUserInfoEditViewController.m in Sources */,
|
||||
@@ -4734,17 +4627,12 @@
|
||||
186A534A26FC6ED900D67B2C /* TTActionSheetConfig.m in Sources */,
|
||||
9BBC028B2786E05A0007C24B /* XPNobleCenterEntranceView.m in Sources */,
|
||||
E81C279326EB394D0031E639 /* LoginForgetPasswordViewController.m in Sources */,
|
||||
9BA9AD862789344E00C0BF8F /* FaceInfoStorage.m in Sources */,
|
||||
E81C278D26EAFAF60031E639 /* DESEncrypt.m in Sources */,
|
||||
9BC5C8E9277AB6AE007C8719 /* XPFacePresenter.m in Sources */,
|
||||
E81366E726F0A49E0076364C /* NSString+Utils.m in Sources */,
|
||||
E87A26F627587C48002DDC7A /* XPHomePartyContainerViewController.m in Sources */,
|
||||
9B208A452779C30100F9E54A /* XCGameRoomFaceTitleCell.m in Sources */,
|
||||
9B208A472779C30100F9E54A /* XCGameRoomFaceTitleButton.m in Sources */,
|
||||
E8EEB90126FC31B6007C6EBA /* XPMineUserInfoPresenter.m in Sources */,
|
||||
18F404BB2760982000A6C548 /* ChatLimitModel.m in Sources */,
|
||||
189DD56526DE465A00AB55B1 /* LoginViewController.m in Sources */,
|
||||
9B208A3B2779C2E400F9E54A /* XPRoomFaceView.m in Sources */,
|
||||
E824544B26F5BBB800BE8163 /* XPMineModifPayPwdViewController.m in Sources */,
|
||||
E81C1B2227705F950020D1E4 /* Api+ArrangeMic.m in Sources */,
|
||||
E8ACEFF527C8EF0500F66D1A /* XPHomeHotRoomViewController.m in Sources */,
|
||||
@@ -4799,6 +4687,7 @@
|
||||
186A534626FC6ED900D67B2C /* TTPopup.m in Sources */,
|
||||
E896EFB62771D55500AD2CC1 /* FansInfoModel.m in Sources */,
|
||||
E81C278C26EAFAF60031E639 /* Base64.m in Sources */,
|
||||
E8C1CD7027D894B800376F83 /* RoomFaceTitleItemModel.m in Sources */,
|
||||
189DD73D26E21C3F00AB55B1 /* YYUtility+Device.m in Sources */,
|
||||
187EEEDC26E89B32002833B2 /* BaseModel.m in Sources */,
|
||||
E81366FC26F0D2980076364C /* UIButton+EnlargeTouchArea.m in Sources */,
|
||||
@@ -4809,7 +4698,6 @@
|
||||
E884C3722743AEDE00E1EBED /* CustomAttachmentDecoder.m in Sources */,
|
||||
18EE3FEE2750CE6D00A452BF /* NIMMessageUtils.m in Sources */,
|
||||
E8DEC9AC2764A6CD0078CB70 /* XPRoomMoreMenuCollectionViewCell.m in Sources */,
|
||||
9B208A482779C30100F9E54A /* XCGameRoomFaceContainerCell.m in Sources */,
|
||||
9B7D804A2753783D003DAC0C /* SessionViewController.m in Sources */,
|
||||
E839533F276A0CDB00CF2F24 /* XPMineNameplateTableViewCell.m in Sources */,
|
||||
E8B846BC26FD7C1200A777FE /* UploadImage.m in Sources */,
|
||||
@@ -4818,9 +4706,10 @@
|
||||
E83DB481274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.m in Sources */,
|
||||
E878893F273A54F500BF1D57 /* XPGiftPresenter.m in Sources */,
|
||||
E8A03DF62763367F0098D9EA /* XPCandyTreeEmptyableViewCell.m in Sources */,
|
||||
9B04CE232789392E00434F47 /* FaceSendInfo.m in Sources */,
|
||||
E8AEAEED27141AE20017FCE0 /* XPRoomBackContainerView.m in Sources */,
|
||||
E88B5CC126FB407B00DA9178 /* XPMineUserInfoViewController.m in Sources */,
|
||||
E8C1CD6D27D8938C00376F83 /* XPRoomFaceTitleCollectionViewCell.m in Sources */,
|
||||
E8C1CD7627D8AE3D00376F83 /* XPRoomFacePresenter.m in Sources */,
|
||||
18F4043A275E20D900A6C548 /* TRTCRtcImpl.m in Sources */,
|
||||
E8899C7F27853B6A007944BE /* DatingMicroView.m in Sources */,
|
||||
E8E5E19A27C36C0B00F457D8 /* XPHomeHotRoomTableViewCell.m in Sources */,
|
||||
@@ -4832,11 +4721,9 @@
|
||||
E8A6C28C27CF436300AC7442 /* XPHomeLikeViewController.m in Sources */,
|
||||
E8E70D8F26F2F5DB00F03460 /* XPMineMenuTableViewCell.m in Sources */,
|
||||
E8E5E1A927C3850400F457D8 /* XPHomeHotRoomCollectionViewCell.m in Sources */,
|
||||
9B8585F927886A1100D7D5C6 /* CommonFileUtils.m in Sources */,
|
||||
187EEEE126E89BFB002833B2 /* AccountModel.m in Sources */,
|
||||
E896EFA92771AEEC00AD2CC1 /* XPMineAttentionTableViewCell.m in Sources */,
|
||||
9BBC02912786FC570007C24B /* XPMineNobleCardTableViewCell.m in Sources */,
|
||||
9B04CE26278940D700434F47 /* XPFaceProtocol.m in Sources */,
|
||||
E8AC722126F47E23007D6E91 /* XPMineAboutUsViewController.m in Sources */,
|
||||
18F403CB2758C66800A6C548 /* MessageContentText.m in Sources */,
|
||||
E8232600274E48EA003A3332 /* XPUserCardItemCollectionViewCell.m in Sources */,
|
||||
@@ -4859,7 +4746,6 @@
|
||||
E84BF7E0277C869A00EF8877 /* XPRoomOnLineViewController.m in Sources */,
|
||||
186A534826FC6ED900D67B2C /* TTAlertButtonConfig.m in Sources */,
|
||||
E8ACEFF827C9034C00F66D1A /* XPHomeListEmptyTableViewCell.m in Sources */,
|
||||
9BA9AD842789344E00C0BF8F /* FaceInfo.m in Sources */,
|
||||
9BA41F2527CBB7950043B11F /* UIColor+Extension.m in Sources */,
|
||||
E89D60BA271D643A001F8895 /* Api+Room.m in Sources */,
|
||||
E872308926E89BE000B90D4F /* LoginPhoneViewController.m in Sources */,
|
||||
@@ -4874,11 +4760,11 @@
|
||||
E8395334276A03C300CF2F24 /* XPMineDressUpPresenter.m in Sources */,
|
||||
9BC5C8F6277B0263007C8719 /* XPNobleCenterListViewController.m in Sources */,
|
||||
189DD75926E6003C00AB55B1 /* Api.m in Sources */,
|
||||
E87C0A9D27D9986700CB2241 /* XPRoomFaceCollectionFlowLayout.m in Sources */,
|
||||
E8133916273E532D00708B66 /* XPGiftItemCollectionViewCell.m in Sources */,
|
||||
E833ED0D274FAD1C00A2463B /* XPKickUserModel.m in Sources */,
|
||||
E8788934273A53D700BF1D57 /* XPSendGiftView.m in Sources */,
|
||||
E896EF9C2771AE6B00AD2CC1 /* XPMineFansViewController.m in Sources */,
|
||||
9B208A4E2779C30600F9E54A /* XCGameRoomFaceTitleDisplayModel.m in Sources */,
|
||||
E88B5CB826FB325200DA9178 /* XPMineTeenagerPwdPresenter.m in Sources */,
|
||||
E84B0E462727EF9D008818C6 /* XPRoomMessageParser.m in Sources */,
|
||||
E838D9A0275E1BF60079E0B5 /* XPRoomAnimationView.m in Sources */,
|
||||
|
22
xplan-ios/Assets.xcassets/Room/Face/room_face_nobel_lock.imageset/Contents.json
vendored
Normal file
22
xplan-ios/Assets.xcassets/Room/Face/room_face_nobel_lock.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_face_nobel_lock@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_face_nobel_lock@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Room/Face/room_face_nobel_lock.imageset/room_face_nobel_lock@2x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Room/Face/room_face_nobel_lock.imageset/room_face_nobel_lock@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 521 B |
BIN
xplan-ios/Assets.xcassets/Room/Face/room_face_nobel_lock.imageset/room_face_nobel_lock@3x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Room/Face/room_face_nobel_lock.imageset/room_face_nobel_lock@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 843 B |
22
xplan-ios/Assets.xcassets/Room/Face/room_face_nobel_privil.imageset/Contents.json
vendored
Normal file
22
xplan-ios/Assets.xcassets/Room/Face/room_face_nobel_privil.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_face_nobel_privil@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_face_nobel_privil@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Room/Face/room_face_nobel_privil.imageset/room_face_nobel_privil@2x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Room/Face/room_face_nobel_privil.imageset/room_face_nobel_privil@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
BIN
xplan-ios/Assets.xcassets/Room/Face/room_face_nobel_privil.imageset/room_face_nobel_privil@3x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Room/Face/room_face_nobel_privil.imageset/room_face_nobel_privil@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
@@ -1,91 +0,0 @@
|
||||
//
|
||||
// CommonFileUtils.h
|
||||
// Commons
|
||||
//
|
||||
// Created by 小城 on 14-6-5.
|
||||
// Copyright (c) 2014年 YY Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface CommonFileUtils : NSObject
|
||||
|
||||
/**Some FilePaths
|
||||
*/
|
||||
+ (NSString *)documentsDirectory;
|
||||
+ (NSString *)cachesDirectory;
|
||||
|
||||
/**
|
||||
* File Operation
|
||||
*/
|
||||
|
||||
/**
|
||||
* 创建文件所在的目录
|
||||
*
|
||||
* @param path 文件的绝对路径
|
||||
*
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
+ (BOOL)createDirForPath:(NSString *)path;
|
||||
|
||||
/**
|
||||
* 创建目录
|
||||
*
|
||||
* @param dirPath 目录绝对路径
|
||||
*
|
||||
* @return 是否创建成功
|
||||
*/
|
||||
+ (BOOL)createDirWithDirPath:(NSString *)dirPath;
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*
|
||||
* @param path 文件所在的绝对路径
|
||||
*
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
+ (BOOL)deleteFileWithFullPath:(NSString *)path;
|
||||
|
||||
/**
|
||||
* 指定路径的文件是否存在
|
||||
*
|
||||
* @param filePath 文件的绝对路径
|
||||
*
|
||||
* @return 是否存在
|
||||
*/
|
||||
+ (BOOL)isFileExists:(NSString *)filePath;
|
||||
|
||||
/**
|
||||
* 在文件的末尾追加文本内容
|
||||
*
|
||||
* @param content 文本内容
|
||||
* @param filePath 文件绝对路径,比如保证该文件是存在的,返回会返回NO
|
||||
*
|
||||
* @return 是否追加成功
|
||||
*/
|
||||
+ (BOOL)appendContent:(NSString *)content toFilePath:(NSString *)filePath;
|
||||
|
||||
|
||||
/**FileUtils In UserDefault
|
||||
*/
|
||||
+ (BOOL)writeObject:(id)object toUserDefaultWithKey:(NSString*)key;
|
||||
+ (id)readObjectFromUserDefaultWithKey:(NSString*)key;
|
||||
+ (BOOL)deleteObjectFromUserDefaultWithKey:(NSString*)key;
|
||||
|
||||
/**FileUtils In CachesPath
|
||||
*/
|
||||
+ (void)writeObject:(id)object toCachesPath:(NSString*)path;
|
||||
+ (id)readObjectFromCachesPath:(NSString*)path;
|
||||
+ (BOOL)deleteFileFromCachesPath:(NSString *)path;
|
||||
|
||||
/**FileUtils In DocumentPath
|
||||
*/
|
||||
+ (void)writeObject:(id)object toDocumentPath:(NSString *)path;
|
||||
+ (id)readObjectFromDocumentPath:(NSString *)path;
|
||||
+ (BOOL)deleteFileFromDocumentPath:(NSString *)path;
|
||||
|
||||
+ (BOOL)copyItem:(NSString *)destination toPath:(NSString *)toPath;
|
||||
|
||||
+ (NSString*)getFileMD5WithPath:(NSString*)path;
|
||||
|
||||
@end
|
@@ -1,360 +0,0 @@
|
||||
//
|
||||
// CommonFileUtils.m
|
||||
// Commons
|
||||
//
|
||||
// Created by 小城 on 14-6-5.
|
||||
// Copyright (c) 2014年 YY Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CommonFileUtils.h"
|
||||
#import <CommonCrypto/CommonDigest.h>
|
||||
#define FileHashDefaultChunkSizeForReadingData 1024*8 // 8K
|
||||
|
||||
@implementation CommonFileUtils
|
||||
|
||||
+ (NSString *)documentsDirectory
|
||||
{
|
||||
static NSString *docsDir = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
docsDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
|
||||
});
|
||||
return docsDir;
|
||||
}
|
||||
|
||||
+ (NSString *)cachesDirectory
|
||||
{
|
||||
static NSString *cachesDir = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
cachesDir = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0];
|
||||
});
|
||||
return cachesDir;
|
||||
}
|
||||
|
||||
+ (BOOL)createDirForPath:(NSString *)path
|
||||
{
|
||||
return [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)createDirWithDirPath:(NSString *)dirPath
|
||||
{
|
||||
return [[NSFileManager defaultManager] createDirectoryAtPath:dirPath
|
||||
withIntermediateDirectories:YES
|
||||
attributes:nil
|
||||
error:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)deleteFileWithFullPath:(NSString *)fullPath
|
||||
{
|
||||
BOOL deleteSucc = NO;
|
||||
if ([[NSFileManager defaultManager] isDeletableFileAtPath:fullPath]) {
|
||||
deleteSucc = [[NSFileManager defaultManager] removeItemAtPath:fullPath error:NULL];
|
||||
}
|
||||
|
||||
return deleteSucc;
|
||||
}
|
||||
|
||||
|
||||
/**UserDefault
|
||||
*/
|
||||
+ (BOOL)writeObject:(id)object toUserDefaultWithKey:(NSString*)key
|
||||
{
|
||||
if (object == nil || key == nil) return NO;
|
||||
|
||||
NSData *myEncodedObject = [NSKeyedArchiver archivedDataWithRootObject:object];
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults setObject:myEncodedObject forKey:key];
|
||||
return [defaults synchronize];
|
||||
}
|
||||
|
||||
+ (id)readObjectFromUserDefaultWithKey:(NSString*)key
|
||||
{
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSData *myEncodedObject = [defaults objectForKey:key];
|
||||
|
||||
if (myEncodedObject == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
@try {
|
||||
return [NSKeyedUnarchiver unarchiveObjectWithData: myEncodedObject];
|
||||
}
|
||||
@catch (NSException *e){
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
+ (BOOL)deleteObjectFromUserDefaultWithKey:(NSString*)key
|
||||
{
|
||||
if (!key) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults removeObjectForKey:key];
|
||||
return [defaults synchronize];
|
||||
}
|
||||
|
||||
+ (BOOL)isFileExists:(NSString *)filePath
|
||||
{
|
||||
return [[NSFileManager defaultManager] fileExistsAtPath:filePath];
|
||||
}
|
||||
|
||||
+ (BOOL)appendContent:(NSString *)content toFilePath:(NSString *)filePath
|
||||
{
|
||||
if (![CommonFileUtils isFileExists:filePath]) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
BOOL appendSucc = YES;
|
||||
|
||||
NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:filePath];
|
||||
if (!fileHandle) {
|
||||
appendSucc = NO;
|
||||
} else {
|
||||
[fileHandle seekToEndOfFile];
|
||||
[fileHandle writeData:[content dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
[fileHandle closeFile];
|
||||
}
|
||||
|
||||
return appendSucc;
|
||||
}
|
||||
|
||||
|
||||
/**CachesPath
|
||||
*/
|
||||
+ (void)writeObject:(id)object toCachesPath:(NSString*)path
|
||||
{
|
||||
if (object == nil || [path length] == 0)
|
||||
return;
|
||||
|
||||
NSString *fullPath = [[CommonFileUtils cachesDirectory] stringByAppendingPathComponent:path];
|
||||
[CommonFileUtils _writeObject:object toPath:fullPath];
|
||||
}
|
||||
|
||||
+ (id)readObjectFromCachesPath:(NSString*)path
|
||||
{
|
||||
if ([path length] == 0)
|
||||
return nil;
|
||||
|
||||
NSString *fullPath = [[CommonFileUtils cachesDirectory] stringByAppendingPathComponent:path];
|
||||
return [CommonFileUtils _readObjectFromPath:fullPath];
|
||||
}
|
||||
|
||||
+ (BOOL)deleteFileFromCachesPath:(NSString *)path
|
||||
{
|
||||
NSString *fullPath = [[CommonFileUtils cachesDirectory] stringByAppendingPathComponent:path];
|
||||
return [CommonFileUtils deleteFileWithFullPath:fullPath];
|
||||
}
|
||||
|
||||
/**DocumentPath
|
||||
*/
|
||||
+ (void)writeObject:(id)object toDocumentPath:(NSString *)path
|
||||
{
|
||||
if (object == nil || [path length] == 0)
|
||||
return;
|
||||
|
||||
NSString *fullPath = [[CommonFileUtils documentsDirectory] stringByAppendingPathComponent:path];
|
||||
[CommonFileUtils _writeObject:object toPath:fullPath];
|
||||
|
||||
}
|
||||
|
||||
+ (id)readObjectFromDocumentPath:(NSString *)path
|
||||
{
|
||||
if ([path length] == 0)
|
||||
return nil;
|
||||
|
||||
NSString *fullPath = [[CommonFileUtils documentsDirectory] stringByAppendingPathComponent:path];
|
||||
return [CommonFileUtils _readObjectFromPath:fullPath];
|
||||
}
|
||||
|
||||
+ (BOOL)deleteFileFromDocumentPath:(NSString *)path
|
||||
{
|
||||
NSString *fullPath = [[CommonFileUtils documentsDirectory] stringByAppendingPathComponent:path];
|
||||
return [CommonFileUtils deleteFileWithFullPath:fullPath];
|
||||
}
|
||||
|
||||
+ (BOOL)copyItem:(NSString *)destination toPath:(NSString *)toPath
|
||||
{
|
||||
NSError *error = nil;
|
||||
[[NSFileManager defaultManager] copyItemAtPath:destination toPath:toPath error:&error];
|
||||
return error != nil;
|
||||
}
|
||||
|
||||
#pragma mark - private
|
||||
static id getSemaphore(NSString *key)
|
||||
{
|
||||
static NSMutableDictionary *dict = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
dict = [[NSMutableDictionary alloc] initWithCapacity:10];
|
||||
});
|
||||
|
||||
id obj = [dict objectForKey:key];
|
||||
if (!obj)
|
||||
{
|
||||
obj = [[NSObject alloc] init];
|
||||
[dict setObject:obj forKey:key];
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
static dispatch_queue_t getFileQueue()
|
||||
{
|
||||
static dispatch_queue_t queue = NULL;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
queue = dispatch_queue_create("FileQueue", NULL);
|
||||
});
|
||||
return queue;
|
||||
}
|
||||
|
||||
|
||||
+ (void)_writeObject:(id)obj toPath:(NSString *)fullPath
|
||||
{
|
||||
if (obj == nil || [fullPath length] == 0)
|
||||
return;
|
||||
|
||||
id newObj = obj;
|
||||
if ([obj isKindOfClass:[NSArray class]] || [obj isKindOfClass:[NSDictionary class]])
|
||||
{
|
||||
//集合类型为了避免出现写的同时另一个线程在操作同一个集合可能导致崩溃,这里在主线程生成一个新的集合
|
||||
if ([obj isKindOfClass:[NSMutableArray class]])
|
||||
newObj = [NSMutableArray arrayWithArray:obj];
|
||||
else if ([obj isKindOfClass:[NSArray class]])
|
||||
newObj = [NSArray arrayWithArray:obj];
|
||||
else if ([obj isKindOfClass:[NSMutableDictionary class]])
|
||||
newObj = [NSMutableDictionary dictionaryWithDictionary:obj];
|
||||
else
|
||||
newObj = [NSDictionary dictionaryWithDictionary:obj];
|
||||
}
|
||||
|
||||
id sema = getSemaphore(fullPath);
|
||||
|
||||
//在queue中操作
|
||||
dispatch_async(getFileQueue(), ^{
|
||||
@synchronized(sema)
|
||||
{
|
||||
//必须先创建目录,否则archiveRootObject操作在没有目录的情况下会失败!
|
||||
if ([CommonFileUtils createDirForPath:fullPath])
|
||||
{
|
||||
[NSKeyedArchiver archiveRootObject:newObj toFile:fullPath];
|
||||
}
|
||||
// else
|
||||
// {
|
||||
|
||||
// }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+ (id)_readObjectFromPath:(NSString *)fullPath
|
||||
{
|
||||
id sema = getSemaphore(fullPath);
|
||||
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath])
|
||||
{
|
||||
@try
|
||||
{
|
||||
@synchronized(sema)
|
||||
{
|
||||
return [NSKeyedUnarchiver unarchiveObjectWithFile:fullPath];
|
||||
}
|
||||
}
|
||||
@catch (NSException *e)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
else
|
||||
return nil;
|
||||
}
|
||||
|
||||
+(NSString*)getFileMD5WithPath:(NSString*)path
|
||||
{
|
||||
return (__bridge NSString *)FileMD5HashCreateWithPath((__bridge CFStringRef)path,FileHashDefaultChunkSizeForReadingData);
|
||||
}
|
||||
|
||||
CFStringRef FileMD5HashCreateWithPath(CFStringRef filePath,
|
||||
size_t chunkSizeForReadingData) {
|
||||
|
||||
// Declare needed variables
|
||||
CFStringRef result = NULL;
|
||||
CFReadStreamRef readStream = NULL;
|
||||
|
||||
// Get the file URL
|
||||
CFURLRef fileURL =
|
||||
CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
|
||||
(CFStringRef)filePath,
|
||||
kCFURLPOSIXPathStyle,
|
||||
(Boolean)false);
|
||||
|
||||
CC_MD5_CTX hashObject;
|
||||
bool hasMoreData = true;
|
||||
bool didSucceed;
|
||||
|
||||
if (!fileURL) goto done;
|
||||
|
||||
// Create and open the read stream
|
||||
readStream = CFReadStreamCreateWithFile(kCFAllocatorDefault,
|
||||
(CFURLRef)fileURL);
|
||||
if (!readStream) goto done;
|
||||
didSucceed = (bool)CFReadStreamOpen(readStream);
|
||||
if (!didSucceed) goto done;
|
||||
|
||||
// Initialize the hash object
|
||||
CC_MD5_Init(&hashObject);
|
||||
|
||||
// Make sure chunkSizeForReadingData is valid
|
||||
if (!chunkSizeForReadingData) {
|
||||
chunkSizeForReadingData = FileHashDefaultChunkSizeForReadingData;
|
||||
}
|
||||
|
||||
// Feed the data to the hash object
|
||||
while (hasMoreData) {
|
||||
uint8_t buffer[chunkSizeForReadingData];
|
||||
CFIndex readBytesCount = CFReadStreamRead(readStream,
|
||||
(UInt8 *)buffer,
|
||||
(CFIndex)sizeof(buffer));
|
||||
if (readBytesCount == -1)break;
|
||||
if (readBytesCount == 0) {
|
||||
hasMoreData =false;
|
||||
continue;
|
||||
}
|
||||
CC_MD5_Update(&hashObject,(const void *)buffer,(CC_LONG)readBytesCount);
|
||||
}
|
||||
|
||||
// Check if the read operation succeeded
|
||||
didSucceed = !hasMoreData;
|
||||
|
||||
// Compute the hash digest
|
||||
unsigned char digest[CC_MD5_DIGEST_LENGTH];
|
||||
CC_MD5_Final(digest, &hashObject);
|
||||
|
||||
// Abort if the read operation failed
|
||||
if (!didSucceed) goto done;
|
||||
|
||||
// Compute the string result
|
||||
char hash[2 *sizeof(digest) + 1];
|
||||
for (size_t i =0; i < sizeof(digest); ++i) {
|
||||
snprintf(hash + (2 * i),3, "%02x", (int)(digest[i]));
|
||||
}
|
||||
result = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
(const char *)hash,
|
||||
kCFStringEncodingUTF8);
|
||||
|
||||
done:
|
||||
|
||||
if (readStream) {
|
||||
CFReadStreamClose(readStream);
|
||||
CFRelease(readStream);
|
||||
}
|
||||
if (fileURL) {
|
||||
CFRelease(fileURL);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// NSString+JsonToDic.h
|
||||
// XChatFramework
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/11.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface NSString (JsonToDic)
|
||||
|
||||
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
|
||||
|
||||
+ (id)idWithJsonString:(NSString *)str;
|
||||
@end
|
@@ -1,61 +0,0 @@
|
||||
//
|
||||
// NSString+JsonToDic.m
|
||||
// XChatFramework
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/11.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSString+JsonToDic.h"
|
||||
|
||||
@implementation NSString (JsonToDic)
|
||||
|
||||
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString {
|
||||
|
||||
if (jsonString == nil) {
|
||||
|
||||
return nil;
|
||||
|
||||
}
|
||||
|
||||
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
NSError *err;
|
||||
|
||||
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData
|
||||
|
||||
options:NSJSONReadingMutableContainers
|
||||
|
||||
error:&err];
|
||||
if(err) {
|
||||
|
||||
NSLog(@"json解析失败:%@",err);
|
||||
|
||||
return nil;
|
||||
|
||||
}
|
||||
|
||||
return dic;
|
||||
|
||||
}
|
||||
|
||||
+ (id)idWithJsonString:(NSString *)str {
|
||||
|
||||
if (!str) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSError *error = nil;
|
||||
id jsonObject = [NSJSONSerialization JSONObjectWithData:[str dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments
|
||||
error:nil];
|
||||
|
||||
if (jsonObject != nil && error == nil){
|
||||
return jsonObject;
|
||||
}else{
|
||||
// 解析错误
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -1,72 +0,0 @@
|
||||
//
|
||||
// YYWebResourceDownloader.h
|
||||
// YYMobileFramework
|
||||
//
|
||||
// Created by wuwei on 14/6/12.
|
||||
// Copyright (c) 2014年 YY Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
typedef NS_OPTIONS(NSUInteger, YYWebResourceDownloaderOptions) {
|
||||
YYWebResourceDownloaderProgressiveDownload = 1 << 1,
|
||||
YYWebResourceDownloaderUseNSURLCache = 1 << 2,
|
||||
YYWebResourceDownloaderIgnoreCachedResponse = 1 << 3,
|
||||
YYWebResourceDownloaderContinueInBackground = 1 << 4,
|
||||
YYWebResourceDownloaderHandleCookies = 1 << 5,
|
||||
};
|
||||
|
||||
/**
|
||||
* 下载的进度回调
|
||||
*
|
||||
* @param received
|
||||
* @param expected
|
||||
*/
|
||||
typedef void(^YYWebResourceDownloaderProgressBlock)(int64_t received, int64_t expected, CGFloat progress);
|
||||
|
||||
/**
|
||||
* 下载完成回调Block
|
||||
*
|
||||
* @param filePath 下载完成后文件的URL(fileURL)
|
||||
* @param error 下载过程中的错误
|
||||
* @param finished 是否完成
|
||||
*/
|
||||
typedef void(^YYWebResourceDownloaderCompletionBlock)(NSURL *filePath, NSError *error, BOOL finished);
|
||||
|
||||
@class YYWebResourceDownloader;
|
||||
@class YYWebResourceDownloadOperation;
|
||||
|
||||
@interface YYWebResourceDownloadOperation : NSOperation
|
||||
|
||||
@end
|
||||
|
||||
NS_AVAILABLE_IOS(7_0) @interface YYWebResourceDownloader : NSObject
|
||||
|
||||
+ (instancetype)sharedDownloader;
|
||||
|
||||
/**
|
||||
* The designated initializer
|
||||
*
|
||||
* @param name name of the downloader
|
||||
*
|
||||
* @return The initialized YYWebResourceDownloader instance
|
||||
*/
|
||||
- (instancetype)initWithName:(NSString *)name;
|
||||
|
||||
@property (nonatomic, strong, readonly) NSString *downloaderName;
|
||||
|
||||
// default is 15.0
|
||||
@property (nonatomic, assign) NSTimeInterval downloadTimeout;
|
||||
|
||||
@property (nonatomic, strong) NSDictionary*(^headerFilter)(NSURL *url, NSDictionary *headers);
|
||||
|
||||
- (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field;
|
||||
- (NSString *)valueForHTTPHeaderField:(NSString *)field;
|
||||
|
||||
- (YYWebResourceDownloadOperation *)downloadWithURL:(NSURL *)url
|
||||
fileName:(NSString *)fileName
|
||||
options:(YYWebResourceDownloaderOptions)options
|
||||
progress:(YYWebResourceDownloaderProgressBlock)progress
|
||||
completion:(YYWebResourceDownloaderCompletionBlock)completion;
|
||||
|
||||
@end
|
@@ -1,415 +0,0 @@
|
||||
//
|
||||
// YYWebResourceDownloader.m
|
||||
// YYMobileFramework
|
||||
//
|
||||
// Created by wuwei on 14/6/12.
|
||||
// Copyright (c) 2014年 YY Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import "YYWebResourceDownloader.h"
|
||||
#import <AFURLSessionManager.h>
|
||||
#import "FBKVOController.h"
|
||||
|
||||
#if TRAFFIC_DATA
|
||||
#import "../../../../YYMobileCore/YYMobileCore/Cores/CoreManager.h"
|
||||
#import "../../../../YYMobileCore/YYMobileCore/Cores/Carrier/ICarrierService.h"
|
||||
#import "../../../../YYMobileCore/YYMobileCore/Cores/Carrier/CarrierServiceTypes.h"
|
||||
#endif
|
||||
|
||||
#define ENABLE_UNICOM_PROXY 0
|
||||
|
||||
static NSString * const kProgressCallbackKey = @"progress";
|
||||
static NSString * const kCompletionCallbackKey = @"completed";
|
||||
|
||||
#if TRAFFIC_DATA
|
||||
extern NSString * const CarrierDataTrafficPackageSubscribeStateUpdateNotification;
|
||||
#endif
|
||||
|
||||
static const NSTimeInterval kDefaultDownloadTimeout = 15.0f;
|
||||
|
||||
@interface YYWebResourceDownloadOperation ()
|
||||
|
||||
- (instancetype)initWithTask:(NSURLSessionTask *)task;
|
||||
- (instancetype)initWithTask:(NSURLSessionTask *)task cancelledBlock:(dispatch_block_t)cancelBlock;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YYWebResourceDownloadOperation
|
||||
{
|
||||
NSURLSessionTask *_task;
|
||||
dispatch_block_t _cancelBlock;
|
||||
}
|
||||
|
||||
- (instancetype)initWithTask:(NSURLSessionTask *)task {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_task = task;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithTask:(NSURLSessionTask *)task cancelledBlock:(dispatch_block_t)cancel
|
||||
{
|
||||
self = [self initWithTask:task];
|
||||
if (self) {
|
||||
_cancelBlock = cancel;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)cancel {
|
||||
[super cancel];
|
||||
|
||||
[_task cancel];
|
||||
if (_cancelBlock) {
|
||||
_cancelBlock();
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@interface YYWebResourceDownloader ()
|
||||
|
||||
@property (nonatomic, strong, readonly) AFURLSessionManager *sessionManager;
|
||||
@property (nonatomic, strong) NSURLSessionConfiguration *sessionConfiguration;
|
||||
|
||||
@property (nonatomic, strong, readonly) dispatch_queue_t barrierQueue;
|
||||
@property (nonatomic, strong, readonly) NSMutableDictionary *URLCallbacks;
|
||||
@property (nonatomic, strong, readonly) NSMutableDictionary *HTTPHeaders;
|
||||
@property (nonatomic, strong, readonly) NSMapTable *downloadingTasks;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YYWebResourceDownloader
|
||||
|
||||
@synthesize barrierQueue = _barrierQueue;
|
||||
@synthesize URLCallbacks = _URLCallbacks;
|
||||
@synthesize HTTPHeaders =_HTTPHeaders;
|
||||
@synthesize downloaderName = _downloaderName;
|
||||
@synthesize sessionManager = _sessionManager;
|
||||
|
||||
+ (instancetype)sharedDownloader
|
||||
{
|
||||
static id instance;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
instance = [[self alloc] initWithName:@"default"];
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
|
||||
- (instancetype)initWithName:(NSString *)name
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_downloaderName = name;
|
||||
_downloadingTasks = [NSMapTable strongToWeakObjectsMapTable];
|
||||
|
||||
#if TRAFFIC_DATA
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(OnCarrierDataTrafficPackageSubscribeStateUpdate:) name:CarrierDataTrafficPackageSubscribeStateUpdateNotification object:nil];
|
||||
#endif
|
||||
|
||||
NSURLSessionConfiguration *defaultConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration];
|
||||
|
||||
/*
|
||||
defaultConfiguration.connectionProxyDictionary = @{
|
||||
(NSString *)kCFStreamPropertyHTTPProxyHost: @"huanjushidai.gzproxy.10155.com",
|
||||
(NSString *)kCFStreamPropertyHTTPProxyPort: @(8080)};
|
||||
|
||||
defaultConfiguration.HTTPAdditionalHeaders = @{@"Authorization": @"Basic MzAwMDAwNDU0NDo5OEI4NTU5MDI0ODYwQkE1NDE2MTUwNDM4NzA2NjdGMQ=="};
|
||||
*/
|
||||
|
||||
_sessionManager = [[AFURLSessionManager alloc] initWithSessionConfiguration:defaultConfiguration];
|
||||
_downloadTimeout = kDefaultDownloadTimeout;
|
||||
_URLCallbacks = [NSMutableDictionary dictionary];
|
||||
_HTTPHeaders = [NSMutableDictionary dictionary];
|
||||
// Create a queue using the downloader name
|
||||
name = name ? : @"<anonymous>";
|
||||
NSString *queueName = [NSString stringWithFormat:@"com.yy.webResourceDownloader.%@.barrierQueue", name];
|
||||
_barrierQueue = dispatch_queue_create([queueName UTF8String], DISPATCH_QUEUE_CONCURRENT);
|
||||
|
||||
static char kBarrierQueueSpecificKey;
|
||||
dispatch_queue_set_specific(self.barrierQueue, &kBarrierQueueSpecificKey, (__bridge void *)self, NULL);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
return [self initWithName:nil];
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
- (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field
|
||||
{
|
||||
if (value) {
|
||||
self.HTTPHeaders[field] = value;
|
||||
}
|
||||
else {
|
||||
[self.HTTPHeaders removeObjectForKey:field];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)valueForHTTPHeaderField:(NSString *)field
|
||||
{
|
||||
return self.HTTPHeaders[field];
|
||||
}
|
||||
|
||||
- (YYWebResourceDownloadOperation *)downloadWithURL:(NSURL *)url
|
||||
fileName:(NSString *)fileName
|
||||
options:(YYWebResourceDownloaderOptions)options
|
||||
progress:(YYWebResourceDownloaderProgressBlock)progress
|
||||
completion:(YYWebResourceDownloaderCompletionBlock)completion
|
||||
{
|
||||
#if TRAFFIC_DATA
|
||||
//处理缓存的Session的代理配置
|
||||
if(!_sessionManager)
|
||||
{
|
||||
NSURLSessionConfiguration *defaultConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration];
|
||||
|
||||
BOOL isDataTrafficeFree = [GetCoreI(ICarrierService) isDataTrafficFree];
|
||||
if(isDataTrafficeFree)
|
||||
{
|
||||
CarrierProxyConfiguration* httpProxyConfiguration = [GetCoreI(ICarrierService) getProxyConfiguration];
|
||||
if(httpProxyConfiguration)
|
||||
{
|
||||
defaultConfiguration.connectionProxyDictionary = @{ (NSString *)kCFStreamPropertyHTTPProxyHost: httpProxyConfiguration.serverAddress,
|
||||
(NSString *)kCFStreamPropertyHTTPProxyPort: @(httpProxyConfiguration.serverPort)};
|
||||
defaultConfiguration.HTTPAdditionalHeaders = @{@"Authorization": [NSString stringWithFormat:@"Basic %@", httpProxyConfiguration.authenticationString]};
|
||||
}
|
||||
self.sessionConfiguration = defaultConfiguration;
|
||||
}
|
||||
|
||||
_sessionManager = [[AFURLSessionManager alloc] initWithSessionConfiguration:self.sessionConfiguration];
|
||||
|
||||
[_sessionManager setTaskWillPerformHTTPRedirectionBlock:^NSURLRequest *(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request) {
|
||||
|
||||
NSMutableURLRequest *redirectRequest = [request mutableCopy];
|
||||
if(isDataTrafficeFree)
|
||||
{
|
||||
CarrierProxyConfiguration* httpProxyConfiguration = [GetCoreI(ICarrierService) getProxyConfiguration];
|
||||
[redirectRequest addValue:[NSString stringWithFormat:@"Basic %@", httpProxyConfiguration.authenticationString] forHTTPHeaderField:@"Authorization"];
|
||||
}
|
||||
return redirectRequest;
|
||||
}];
|
||||
}
|
||||
#endif
|
||||
|
||||
__block YYWebResourceDownloadOperation *downloadOperation = nil;
|
||||
__weak YYWebResourceDownloader *wself = self;
|
||||
|
||||
[self _addProgressCallback:progress andCompletionBlock:completion forURL:url createCallback:^{
|
||||
NSTimeInterval timeoutInterval = wself.downloadTimeout;
|
||||
if (timeoutInterval == 0.0) {
|
||||
timeoutInterval = kDefaultDownloadTimeout;
|
||||
}
|
||||
|
||||
// In order to prevent from potential duplicate caching (NSURLCache + YYImageCache), we disable the cache for image requests if told otherwise
|
||||
NSURLRequestCachePolicy cachePolicy = (options & YYWebResourceDownloaderUseNSURLCache) ? NSURLRequestUseProtocolCachePolicy : NSURLRequestReloadIgnoringLocalCacheData;
|
||||
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url
|
||||
cachePolicy:cachePolicy
|
||||
timeoutInterval:timeoutInterval];
|
||||
request.HTTPShouldHandleCookies = (options & YYWebResourceDownloaderHandleCookies);
|
||||
request.HTTPShouldUsePipelining = YES;
|
||||
if (wself.headerFilter) {
|
||||
request.allHTTPHeaderFields = wself.headerFilter(url, [wself.HTTPHeaders copy]);
|
||||
}
|
||||
else {
|
||||
request.allHTTPHeaderFields = [wself.HTTPHeaders copy];
|
||||
}
|
||||
|
||||
__block NSProgress *progress;
|
||||
__block FBKVOController *controller = [FBKVOController controllerWithObserver:wself];
|
||||
|
||||
__block NSURLSessionTask *sessionTask = [wself.sessionManager downloadTaskWithRequest:request progress:^(NSProgress * _Nonnull downloadProgress) {
|
||||
progress = downloadProgress;
|
||||
} destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) {
|
||||
// return [targetPath URLByAppendingPathExtension:@"download"];
|
||||
NSString *fullPath;
|
||||
if (fileName.length > 0 || fileName) {
|
||||
fullPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:fileName];
|
||||
}else {
|
||||
fullPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:response.suggestedFilename];
|
||||
}
|
||||
|
||||
return [NSURL fileURLWithPath:fullPath];
|
||||
} completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) {
|
||||
if (error) {
|
||||
// [YYLogger debug:TAG(THTTP,TNetSend) message:@"[Task: %@] Download %@ failed with error %@", sessionTask, url, error];
|
||||
} else {
|
||||
// [YYLogger debug:TAG(THTTP,TNetSend) message:@"[Task: %@] Download %@ successfully, store to %@", sessionTask, url, filePath];
|
||||
}
|
||||
|
||||
if (error.code == NSURLErrorCancelled) {
|
||||
// Cancel由YYWebResourceOperation的cancelBlock处理
|
||||
return;
|
||||
}
|
||||
|
||||
if (!wself) return; // return if deallocated
|
||||
__strong __typeof__(wself) sself = wself;
|
||||
NSArray *callbacksForURL = [sself _callbacksForURL:url];
|
||||
[sself _removeCallbacksForURL:url];
|
||||
for (NSDictionary *callbacks in callbacksForURL) {
|
||||
YYWebResourceDownloaderCompletionBlock complete = callbacks[kCompletionCallbackKey];
|
||||
if (complete) {
|
||||
complete(filePath, error, YES);
|
||||
}
|
||||
}
|
||||
|
||||
// 移除文件
|
||||
[[NSFileManager defaultManager] removeItemAtURL:filePath error:nil];
|
||||
|
||||
// Remove KVO
|
||||
controller = nil;
|
||||
|
||||
}];
|
||||
|
||||
// Observe the fractionCompleted property of the progress
|
||||
[controller observe:progress keyPath:@"fractionCompleted" options:NSKeyValueObservingOptionNew block:^(id observer, id object, NSDictionary *change) {
|
||||
if (!wself) return; // return if deallocated
|
||||
__strong __typeof__(wself) sself = wself;
|
||||
NSArray *callbacksForURL = [sself _callbacksForURL:url];
|
||||
for (NSDictionary *callbacks in callbacksForURL) {
|
||||
YYWebResourceDownloaderProgressBlock progressBlock = callbacks[kProgressCallbackKey];
|
||||
if (progressBlock) {
|
||||
progressBlock(progress.completedUnitCount, progress.totalUnitCount, progress.fractionCompleted);
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
// [YYLogger debug:TAG(THTTP,TNetSend)message:@"[Task: %@] download %@ DID START!", sessionTask, url];
|
||||
|
||||
downloadOperation = [[YYWebResourceDownloadOperation alloc] initWithTask:sessionTask cancelledBlock:^{
|
||||
__strong __typeof__(wself) sself = wself;
|
||||
if (sself) {
|
||||
[sself _removeCallbacksForURL:url];
|
||||
}
|
||||
}];
|
||||
|
||||
// [wself.downloadingTasks setObject:downloadOperation forKey:url];
|
||||
|
||||
// start the task
|
||||
[sessionTask resume];
|
||||
}];
|
||||
|
||||
return downloadOperation;
|
||||
}
|
||||
|
||||
- (void)_addProgressCallback:(YYWebResourceDownloaderProgressBlock)progress
|
||||
andCompletionBlock:(YYWebResourceDownloaderCompletionBlock)completion
|
||||
forURL:(NSURL *)url
|
||||
createCallback:(dispatch_block_t)createCallback
|
||||
{
|
||||
NSParameterAssert(createCallback);
|
||||
|
||||
if (url == nil) {
|
||||
if (completion != nil) {
|
||||
completion(nil, nil, NO);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch_barrier_sync(self.barrierQueue, ^{
|
||||
|
||||
BOOL first = NO;
|
||||
if (!self.URLCallbacks[url]) {
|
||||
self.URLCallbacks[url] = [NSMutableArray new];
|
||||
first = YES;
|
||||
}
|
||||
|
||||
id task = [self.downloadingTasks objectForKey:url];
|
||||
// [YYLogger debug:TAG(THTTP,TNetSend) message:@"add Callbacks for url %@, existing task: %@, isFirst: %d", url, task, first];
|
||||
|
||||
// Handle single download of simulaneous download request for the same URL
|
||||
NSMutableArray *callbacksForURL = self.URLCallbacks[url];
|
||||
NSMutableDictionary *callbacks = [NSMutableDictionary new];
|
||||
if (progress) {
|
||||
callbacks[kProgressCallbackKey] = [progress copy];
|
||||
}
|
||||
if (completion) {
|
||||
callbacks[kCompletionCallbackKey] = [completion copy];
|
||||
}
|
||||
[callbacksForURL addObject:callbacks];
|
||||
self.URLCallbacks[url] = callbacksForURL;
|
||||
|
||||
if (first) {
|
||||
createCallback();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (NSArray *)_callbacksForURL:(NSURL *)url {
|
||||
__block NSArray *callbacksForURL;
|
||||
dispatch_sync(self.barrierQueue, ^{
|
||||
callbacksForURL = self.URLCallbacks[url];
|
||||
});
|
||||
return [callbacksForURL copy];
|
||||
}
|
||||
|
||||
- (void)_removeCallbacksForURL:(NSURL *)url {
|
||||
dispatch_barrier_async(self.barrierQueue, ^{
|
||||
[self.URLCallbacks removeObjectForKey:url];
|
||||
});
|
||||
}
|
||||
|
||||
#if TRAFFIC_DATA
|
||||
-(void) OnCarrierDataTrafficPackageSubscribeStateUpdate:(NSNotification*)notification
|
||||
{
|
||||
CarrierProxyConfiguration* httpProxyConfiguration = [notification object];
|
||||
if (httpProxyConfiguration && httpProxyConfiguration.serverAddress.length > 0)
|
||||
{
|
||||
NSURLSessionConfiguration *proxyConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration];
|
||||
proxyConfiguration.connectionProxyDictionary = @{ (NSString *)kCFStreamPropertyHTTPProxyHost: httpProxyConfiguration.serverAddress,
|
||||
(NSString *)kCFStreamPropertyHTTPProxyPort: @(httpProxyConfiguration.serverPort)};
|
||||
proxyConfiguration.HTTPAdditionalHeaders = @{@"Authorization": [NSString stringWithFormat:@"Basic %@", httpProxyConfiguration.authenticationString]};
|
||||
|
||||
|
||||
self.sessionConfiguration = proxyConfiguration;
|
||||
|
||||
if(!_sessionManager)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if([_sessionManager.tasks count] > 0)
|
||||
{
|
||||
[_sessionManager invalidateSessionCancelingTasks:false];
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:AFURLSessionDidInvalidateNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(__unused NSNotification *note) {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:AFURLSessionDidInvalidateNotification object:nil];
|
||||
_sessionManager = nil;
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
_sessionManager = nil;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!self.sessionConfiguration)
|
||||
return;
|
||||
|
||||
if([_sessionManager.tasks count] > 0)
|
||||
{
|
||||
[_sessionManager invalidateSessionCancelingTasks:false];
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:AFURLSessionDidInvalidateNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(__unused NSNotification *note) {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:AFURLSessionDidInvalidateNotification object:nil];
|
||||
self.sessionConfiguration = nil;
|
||||
_sessionManager = nil;
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
self.sessionConfiguration = nil;
|
||||
_sessionManager = nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@end
|
@@ -1,48 +0,0 @@
|
||||
//
|
||||
// FaceConfigModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/7.
|
||||
//
|
||||
|
||||
#import "NSObject+MJExtension.h"
|
||||
#import "GiftNobleInfoModel.h"
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
XCFaceDisplayTypeOnlyOne = 0,
|
||||
XCFaceDisplayTypeFlow = 1,
|
||||
XCFaceDisplayTypeOverLay = 2,
|
||||
XCFaceDisplayTypeOnlyOneLine = 3,
|
||||
} XCFaceDisplayType;
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
XCFaceType_Face = 1,//1 正常表情,需要在表情面板显示
|
||||
XCFaceType_Dragon = 2,// 2 龙珠
|
||||
XCFaceType_PlayTogether = 3, //一起玩
|
||||
} XCFaceType;
|
||||
|
||||
@interface FaceConfigInfo : NSObject
|
||||
|
||||
@property (nonatomic, assign) int id;
|
||||
@property (nonatomic, copy) NSString *name;
|
||||
@property (nonatomic, copy) NSString *pinyin;
|
||||
@property (nonatomic, assign) NSInteger animDuration;
|
||||
@property (nonatomic, assign) NSInteger animEndPos;
|
||||
@property (nonatomic, assign) NSInteger animStartPos;
|
||||
@property (nonatomic, assign) NSInteger iconPos;
|
||||
@property (nonatomic, assign) NSInteger animRepeatCount;
|
||||
@property (nonatomic, assign) NSInteger resultCount;
|
||||
@property (nonatomic, assign) BOOL canResultRepeat;
|
||||
@property (nonatomic, assign) NSInteger resultDuration;
|
||||
@property (nonatomic, assign) NSInteger resultEndPos;
|
||||
@property (nonatomic, assign) NSInteger resultStartPos;
|
||||
@property (nonatomic, assign) NSInteger imageCount;
|
||||
@property (nonatomic, assign) XCFaceDisplayType displayType;
|
||||
@property (nonatomic, assign) BOOL isNobleFace; //是否贵族表情
|
||||
@property (nonatomic, assign) int nobleId;//贵族等级
|
||||
@property (nonatomic, assign) XCFaceType faceType;//1 正常表情,需要在表情面板显示, 2 龙珠 3.一起玩
|
||||
@property (nonatomic, assign) BOOL isLuckFace;//YES 表示审核中需要隐藏的表情,NO 审核中不需要隐藏的表情
|
||||
///贵族表情信息
|
||||
@property (nonatomic, strong) GiftNobleInfoModel *faceVipInfo;
|
||||
|
||||
@end
|
@@ -1,12 +0,0 @@
|
||||
//
|
||||
// FaceConfigModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/7.
|
||||
//
|
||||
|
||||
#import "FaceConfigInfo.h"
|
||||
|
||||
@implementation FaceConfigInfo
|
||||
|
||||
@end
|
@@ -1,23 +0,0 @@
|
||||
//
|
||||
// FaceInfo.h
|
||||
// BberryCore
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface FaceInfo : NSObject
|
||||
|
||||
@property (assign, nonatomic) NSInteger faceId;
|
||||
@property (copy, nonatomic) NSString *faceName;
|
||||
@property (assign, nonatomic) NSInteger faceParentId;
|
||||
@property (copy, nonatomic) NSString *facePicUrl;
|
||||
@property (assign, nonatomic) BOOL hasGifUrl;
|
||||
@property (copy, nonatomic) NSString *faceGifUrl;
|
||||
@property (assign, nonatomic) BOOL show;
|
||||
@property (strong, nonatomic) NSArray *children;
|
||||
@property (assign, nonatomic) NSInteger faceValue;
|
||||
|
||||
@end
|
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// FaceInfo.m
|
||||
// BberryCore
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#import "FaceInfo.h"
|
||||
|
||||
@implementation FaceInfo
|
||||
|
||||
+ (nullable NSDictionary<NSString *, id> *)modelContainerPropertyGenericClass{
|
||||
return @{
|
||||
@"children" : FaceInfo.class,
|
||||
};
|
||||
}
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// FaceInfoStorage.h
|
||||
// BberryCore
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface FaceInfoStorage : NSObject
|
||||
|
||||
+ (NSMutableArray *)getFaceInfos;
|
||||
+ (void)saveFaceInfos:(NSString *)json;
|
||||
|
||||
@end
|
@@ -1,47 +0,0 @@
|
||||
//
|
||||
// FaceInfoStorage.m
|
||||
// BberryCore
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#define kFileName @"FaceInfoList.data"
|
||||
#define kDataKey @"faceInfos"
|
||||
#define EncodeKey @"1ea53d260ecf11e7b56e00163e046a26123"
|
||||
|
||||
|
||||
#import "FaceInfoStorage.h"
|
||||
#import "FaceInfo.h"
|
||||
#import "DESEncrypt.h"
|
||||
#import "SSKeychain.h"
|
||||
#import "FaceConfigInfo.h"
|
||||
#import <MJExtension/MJExtension.h>
|
||||
|
||||
@implementation FaceInfoStorage
|
||||
|
||||
+ (NSString *)getFilePath {
|
||||
NSArray *array = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
NSString *path = [[array objectAtIndex:0] stringByAppendingPathComponent:kFileName];
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
|
||||
[[NSFileManager defaultManager] createFileAtPath:path contents:nil attributes:nil];
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
+ (NSMutableArray *)getFaceInfos{
|
||||
NSMutableArray *faceInfos = [NSMutableArray array];
|
||||
NSString *encodeJson = [SSKeychain passwordForService:@"json" account:@"face"];
|
||||
NSString *decodeJson = [DESEncrypt decryptUseDES:encodeJson key:EncodeKey];
|
||||
if (decodeJson.length > 0) {
|
||||
faceInfos = [[FaceConfigInfo modelsWithArray:decodeJson] mutableCopy];
|
||||
}
|
||||
return faceInfos;
|
||||
}
|
||||
|
||||
+ (void)saveFaceInfos:(NSString *)json {
|
||||
NSString *encodeJson = [DESEncrypt encryptUseDES:json key:EncodeKey];
|
||||
[SSKeychain setPassword:encodeJson forService:@"json" account:@"face"];
|
||||
}
|
||||
|
||||
@end
|
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// FacePlayInfo.h
|
||||
// BberryCore
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "FaceReceiveInfo.h"
|
||||
|
||||
@interface FacePlayInfo : NSObject
|
||||
|
||||
@property (assign, nonatomic) double delay;
|
||||
@property (strong, nonatomic) NIMMessage *message;
|
||||
@property (strong, nonatomic) FaceReceiveInfo *faceReceiveInfo;
|
||||
|
||||
@end
|
@@ -1,13 +0,0 @@
|
||||
//
|
||||
// FacePlayInfo.m
|
||||
// BberryCore
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#import "FacePlayInfo.h"
|
||||
|
||||
@implementation FacePlayInfo
|
||||
|
||||
@end
|
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// FaceReceiveInfo.h
|
||||
// BberryCore
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "AttachmentModel.h"
|
||||
|
||||
@interface FaceReceiveInfo : NSObject
|
||||
|
||||
@property (assign, nonatomic)long long uid;
|
||||
@property (copy, nonatomic) NSString *nick;
|
||||
@property (assign, nonatomic) NSInteger faceId;
|
||||
@property (strong, nonatomic) UIImage *resultImage;
|
||||
@property (strong, nonatomic) NSMutableArray *resultIndexes;//骰子数
|
||||
@end
|
@@ -1,13 +0,0 @@
|
||||
//
|
||||
// FaceReceiveInfo.m
|
||||
// BberryCore
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#import "FaceReceiveInfo.h"
|
||||
|
||||
@implementation FaceReceiveInfo
|
||||
|
||||
@end
|
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// FaceSendInfo.h
|
||||
// BberryCore
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
|
||||
@interface FaceSendInfo : NSObject<NIMCustomAttachment>
|
||||
|
||||
@property (strong, nonatomic) NSArray *data; //faceRecieveInfos
|
||||
@property (assign, nonatomic) long long uid;
|
||||
@property (copy, nonatomic) NSDictionary *encodeAttachemt;
|
||||
@end
|
@@ -1,32 +0,0 @@
|
||||
//
|
||||
// FaceSendInfo.m
|
||||
// BberryCore
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#import "FaceSendInfo.h"
|
||||
#import "FaceInfo.h"
|
||||
#import "FaceReceiveInfo.h"
|
||||
//#import "NSObject+YYModel.h"
|
||||
|
||||
@implementation FaceSendInfo
|
||||
|
||||
|
||||
- (NSDictionary *)encodeAttachemt {
|
||||
NSDictionary *dict = @{
|
||||
@"data" : self.data,
|
||||
@"uid" : @(self.uid)
|
||||
};
|
||||
return dict;
|
||||
}
|
||||
|
||||
+ (nullable NSDictionary<NSString *, id> *)modelContainerPropertyGenericClass{
|
||||
return @{
|
||||
@"data" : [FaceReceiveInfo class],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@end
|
70
xplan-ios/Main/ModuleKit/FaceView/Model/RoomFaceInfoModel.h
Normal file
70
xplan-ios/Main/ModuleKit/FaceView/Model/RoomFaceInfoModel.h
Normal file
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// RoomFaceInfoModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef NS_ENUM(NSInteger, FaceDisplayType) {
|
||||
FaceDisplayType_OnlyOne = 0,
|
||||
FaceDisplayType_Flow = 1,
|
||||
FaceDisplayType_OverLay = 2,
|
||||
FaceDisplayType_OnlyOneLine = 3,
|
||||
};
|
||||
|
||||
|
||||
@class RoomVipFaceInfoModel;
|
||||
@interface RoomFaceInfoModel : NSObject
|
||||
///表情的id
|
||||
@property (nonatomic,assign) NSInteger fid;
|
||||
///动画的持续时间 需要除以1000
|
||||
@property (nonatomic, assign) NSInteger animDuration;
|
||||
///开始
|
||||
@property (nonatomic, assign) NSInteger animStartPos;
|
||||
///动画有多少张
|
||||
@property (nonatomic, assign) NSInteger animEndPos;
|
||||
///重复次数
|
||||
@property (nonatomic, assign) NSInteger animRepeatCount;
|
||||
///结果是否可以重复
|
||||
@property (nonatomic,assign) BOOL canResultRepeat;
|
||||
///展示的样式
|
||||
@property (nonatomic, assign) FaceDisplayType displayType;
|
||||
///目前应该只有普通表情
|
||||
@property (nonatomic,assign) NSInteger faceType;
|
||||
///当前要显示的表情的编号
|
||||
@property (nonatomic, assign) NSInteger iconPos;
|
||||
///是否是幸运表情
|
||||
@property (nonatomic,assign) BOOL isLuckFace;
|
||||
///是否是贵族表情
|
||||
@property (nonatomic,assign) BOOL isNobleFace;
|
||||
///表情的名字
|
||||
@property (nonatomic,copy) NSString *name;
|
||||
///表情名字的pinyin
|
||||
@property (nonatomic,copy) NSString *pinyin;
|
||||
///结果的表情的数量
|
||||
@property (nonatomic, assign) NSInteger resultCount;
|
||||
///结果表情的持续时间
|
||||
@property (nonatomic, assign) NSInteger resultDuration;
|
||||
///结果表情的结束
|
||||
@property (nonatomic, assign) NSInteger resultEndPos;
|
||||
///结果表情的开始
|
||||
@property (nonatomic, assign) NSInteger resultStartPos;
|
||||
///vip
|
||||
@property (nonatomic,strong) RoomVipFaceInfoModel *faceVipInfo;
|
||||
///本地字段 表情的图片
|
||||
@property (nonatomic,strong) UIImage *faceImage;
|
||||
@end
|
||||
|
||||
@interface RoomVipFaceInfoModel : NSObject
|
||||
///vip的类型
|
||||
@property (nonatomic,copy) NSString *vipIcon;
|
||||
///等级
|
||||
@property (nonatomic,assign) NSInteger vipLevel;
|
||||
///vip的名字
|
||||
@property (nonatomic,copy) NSString *vipName;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
21
xplan-ios/Main/ModuleKit/FaceView/Model/RoomFaceInfoModel.m
Normal file
21
xplan-ios/Main/ModuleKit/FaceView/Model/RoomFaceInfoModel.m
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// RoomFaceInfoModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import "RoomFaceInfoModel.h"
|
||||
|
||||
@implementation RoomFaceInfoModel
|
||||
///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name
|
||||
+ (NSDictionary *)replacedKeyFromPropertyName {
|
||||
return @{@"fid":@"id"};
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation RoomVipFaceInfoModel
|
||||
|
||||
|
||||
|
||||
@end
|
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// RoomSendFaceInfoModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/10.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RoomFaceSendInfoModel : NSObject
|
||||
///用户ID
|
||||
@property (assign, nonatomic) NSInteger uid;
|
||||
///用户昵称
|
||||
@property (copy, nonatomic) NSString *nick;
|
||||
///表情的id
|
||||
@property (assign, nonatomic) NSInteger faceId;
|
||||
///结果的图片
|
||||
@property (strong, nonatomic) UIImage *resultImage;
|
||||
///🎲数
|
||||
@property (strong, nonatomic) NSMutableArray *resultIndexes;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// RoomSendFaceInfoModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/10.
|
||||
//
|
||||
|
||||
#import "RoomFaceSendInfoModel.h"
|
||||
|
||||
@implementation RoomFaceSendInfoModel
|
||||
|
||||
@end
|
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// RoomFaceTitleItemModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef NS_ENUM(NSInteger, RoomFaceTitleItemType) {
|
||||
///普通的表情
|
||||
RoomFaceTitleItemType_Normal = 1,
|
||||
///贵族表情
|
||||
RoomFaceTitleItemType_Nobel,
|
||||
};
|
||||
|
||||
@interface RoomFaceTitleItemModel : NSObject
|
||||
///表情
|
||||
@property (nonatomic,copy) NSString *title;
|
||||
///是否选择
|
||||
@property (nonatomic,assign) BOOL isSelect;
|
||||
///类型
|
||||
@property (nonatomic,assign) RoomFaceTitleItemType faceType;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// RoomFaceTitleItemModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import "RoomFaceTitleItemModel.h"
|
||||
|
||||
@implementation RoomFaceTitleItemModel
|
||||
|
||||
@end
|
@@ -1,39 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceTitleDisplayModel.h
|
||||
// XCRoomMoudle
|
||||
//
|
||||
// Created by 卫明何 on 2018/8/23.
|
||||
// Copyright © 2018年 卫明何. All rights reserved.
|
||||
//
|
||||
|
||||
//#import "BaseObject.h"
|
||||
|
||||
//facemodel
|
||||
//#import "FaceInfo.h"
|
||||
//core
|
||||
//#import "FaceCore.h"
|
||||
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
RoomFaceTypeNormal,
|
||||
RoomFaceTypeNoble,
|
||||
} RoomFaceType;
|
||||
|
||||
@interface XCGameRoomFaceTitleDisplayModel : NSObject
|
||||
|
||||
/**
|
||||
该标题下的表情类型
|
||||
*/
|
||||
@property (nonatomic,assign) RoomFaceType type;
|
||||
|
||||
/**
|
||||
标题内容
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *title;
|
||||
|
||||
/**
|
||||
是否被选择
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL isSelected;
|
||||
|
||||
@end
|
@@ -1,13 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceTitleDisplayModel.m
|
||||
// XCRoomMoudle
|
||||
//
|
||||
// Created by 卫明何 on 2018/8/23.
|
||||
// Copyright © 2018年 卫明何. All rights reserved.
|
||||
//
|
||||
|
||||
#import "XCGameRoomFaceTitleDisplayModel.h"
|
||||
|
||||
@implementation XCGameRoomFaceTitleDisplayModel
|
||||
|
||||
@end
|
@@ -1,32 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceViewDisplayModel.h
|
||||
// XCRoomMoudle
|
||||
//
|
||||
// Created by 卫明何 on 2018/8/23.
|
||||
// Copyright © 2018年 卫明何. All rights reserved.
|
||||
//
|
||||
|
||||
//#import "BaseObject.h"
|
||||
|
||||
//submodel
|
||||
#import "XCGameRoomFaceTitleDisplayModel.h"
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
XCGameRoomFaceViewDisplayType_normal = 1, //普通视图,没有圆角
|
||||
XCGameRoomFaceViewDisplayType_Noble = 2, //有贵族表情的视图,需要titles不为空
|
||||
XCGameRoomFaceViewDisplayType_normal_corner = 3 //普通视图,顶部有两个圆角
|
||||
} XCGameRoomFaceViewDisplayType;
|
||||
|
||||
@interface XCGameRoomFaceViewDisplayModel : NSObject
|
||||
|
||||
/**
|
||||
标题模型数组
|
||||
*/
|
||||
@property (strong, nonatomic) NSMutableArray<XCGameRoomFaceTitleDisplayModel *> *titles;
|
||||
|
||||
/**
|
||||
显示布局类型
|
||||
*/
|
||||
@property (nonatomic,assign) XCGameRoomFaceViewDisplayType displayType;
|
||||
|
||||
@end
|
@@ -1,13 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceViewDisplayModel.m
|
||||
// XCRoomMoudle
|
||||
//
|
||||
// Created by 卫明何 on 2018/8/23.
|
||||
// Copyright © 2018年 卫明何. All rights reserved.
|
||||
//
|
||||
|
||||
#import "XCGameRoomFaceViewDisplayModel.h"
|
||||
|
||||
@implementation XCGameRoomFaceViewDisplayModel
|
||||
|
||||
@end
|
@@ -1,27 +0,0 @@
|
||||
//
|
||||
// XPFacePresenter.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2021/12/28.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class FaceConfigInfo, UserInfoModel;
|
||||
@interface XPFacePresenter : BaseMvpPresenter
|
||||
|
||||
/**
|
||||
单独发表情
|
||||
|
||||
@param faceInfo 表情信息
|
||||
@param roomId 房间ID
|
||||
@param sendUser 发送人信息
|
||||
*/
|
||||
- (void)sendFace:(FaceConfigInfo *)faceInfo roomId:(long long)roomId sendUser:(UserInfoModel *)sendUser member:(NIMChatroomMember *)member;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,194 +0,0 @@
|
||||
//
|
||||
// XPFacePresenter.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2021/12/28.
|
||||
//
|
||||
|
||||
#import "XPFacePresenter.h"
|
||||
///Tool
|
||||
#import "NSString+JsonToDic.h"
|
||||
#import "NSObject+MJExtension.h"
|
||||
#import <MJExtension/MJExtension.h>
|
||||
//#import "AccountInfoStorage.h"
|
||||
//#import "XPGiftStorage.h"
|
||||
//#import "Api+Gift.h"
|
||||
///Model
|
||||
#import "FaceReceiveInfo.h"
|
||||
#import "FaceConfigInfo.h"
|
||||
#import "FaceSendInfo.h"
|
||||
#import "UserInfoModel.h"
|
||||
///P
|
||||
#import "XPFaceProtocol.h"
|
||||
|
||||
@interface XPFacePresenter ()
|
||||
///
|
||||
@property (nonatomic,weak) id view;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPFacePresenter
|
||||
|
||||
///先这样写着 想好了在改
|
||||
- (void)attatchView:(id)view {
|
||||
self.view = view;
|
||||
}
|
||||
|
||||
- (id)getView {
|
||||
return self.view;
|
||||
}
|
||||
|
||||
// 单独发表情
|
||||
- (void)sendFace:(FaceConfigInfo *)faceInfo roomId:(long long)roomId sendUser:(UserInfoModel *)sendUser member:(NIMChatroomMember *)member {
|
||||
if (roomId) {
|
||||
FaceReceiveInfo *faceRecieveInfo = [[FaceReceiveInfo alloc]init];
|
||||
NSMutableArray *resultIndexs = [NSMutableArray array];
|
||||
if (faceInfo.resultStartPos > 0 && faceInfo.resultEndPos > 0) {
|
||||
int value;
|
||||
if (faceInfo.canResultRepeat) { //结果可以重复
|
||||
for (int i = 0; i < faceInfo.resultCount; i++) {
|
||||
value = [self getRandomNumber:(short)faceInfo.resultStartPos to:(short)faceInfo.resultEndPos];
|
||||
[resultIndexs addObject:@(value)];
|
||||
faceRecieveInfo.resultIndexes = [resultIndexs copy];
|
||||
}
|
||||
|
||||
}else {
|
||||
faceRecieveInfo.resultIndexes = [[self randomArray:(short)faceInfo.resultStartPos to:(short)faceInfo.resultEndPos count:(short)faceInfo.resultCount] mutableCopy];
|
||||
}
|
||||
|
||||
}
|
||||
NSMutableArray *faceRecieveInfos = [NSMutableArray array];
|
||||
|
||||
faceRecieveInfo.nick = sendUser.nick;
|
||||
faceRecieveInfo.faceId = faceInfo.id;
|
||||
faceRecieveInfo.uid = sendUser.uid;
|
||||
[faceRecieveInfos addObject:faceRecieveInfo];
|
||||
|
||||
FaceSendInfo *sendInfo = [[FaceSendInfo alloc]init];
|
||||
sendInfo.data = [FaceReceiveInfo mj_keyValuesArrayWithObjectArray:faceRecieveInfos];
|
||||
sendInfo.uid = sendUser.uid;
|
||||
|
||||
AttachmentModel *attachment = [[AttachmentModel alloc]init];
|
||||
attachment.first = CustomMessageType_Face;
|
||||
attachment.second = Custom_Message_Sub_Face_Send;
|
||||
attachment.data = [sendInfo encodeAttachemt];
|
||||
|
||||
NSString *sessionID = [NSString stringWithFormat:@"%lld",roomId];
|
||||
[self sendCustomMessageAttachement:attachment sessionId:sessionID type:NIMSessionTypeChatroom member:member];
|
||||
}
|
||||
}
|
||||
|
||||
///发送表情消息
|
||||
- (void)sendCustomMessageAttachement:(AttachmentModel *)attachment sessionId:(NSString *)sessionId type:(NIMSessionType)type member:(NIMChatroomMember *)member {
|
||||
NIMMessage *message = [[NIMMessage alloc]init];
|
||||
//yidun
|
||||
NIMAntiSpamOption *option = [NIMAntiSpamOption new];
|
||||
option.yidunEnabled = NO;
|
||||
|
||||
NSMutableDictionary *meRoomExt = nil;
|
||||
meRoomExt = [[NSString dictionaryWithJsonString:member.roomExt] mutableCopy];
|
||||
|
||||
NIMCustomObject *customObject = [[NIMCustomObject alloc]init];
|
||||
customObject.attachment = attachment;
|
||||
message.messageObject = customObject;
|
||||
|
||||
// NSMutableDictionary *memberExtDic = [GetCore(ImRoomCoreV2) queryOnMicroMemberExt];
|
||||
NSMutableDictionary *realMeExt = meRoomExt;
|
||||
[realMeExt removeObjectForKey:@"banner"];
|
||||
[realMeExt removeObjectForKey:@"open_effect"];
|
||||
[realMeExt removeObjectForKey:@"halo"];
|
||||
[realMeExt removeObjectForKey:@"headwear"];
|
||||
[realMeExt removeObjectForKey:@"recommend"];
|
||||
[realMeExt removeObjectForKey:@"pic"];
|
||||
[realMeExt removeObjectForKey:@"cardbg"];
|
||||
[realMeExt removeObjectForKey:@"zonebg"];
|
||||
|
||||
// [memberExtDic setValuesForKeysWithDictionary:meRoomExt];
|
||||
|
||||
if (type == NIMSessionTypeChatroom) {
|
||||
message.remoteExt = meRoomExt;
|
||||
}
|
||||
message.antiSpamOption = option;
|
||||
|
||||
NIMMessageSetting *setting = [[NIMMessageSetting alloc]init];
|
||||
message.setting = setting;
|
||||
//构造会话
|
||||
NIMSession *session = [NIMSession session:sessionId type:type];
|
||||
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil];
|
||||
}
|
||||
|
||||
- (void)sendMessageCollectionRequestWithMessage:(NIMMessage *)message firstAttachment:(int)firstAttachment {
|
||||
|
||||
// if (GetCore(ClientCore).reportSwitch) {
|
||||
//
|
||||
// int remoteDataLength;
|
||||
// if (message.remoteExt) {
|
||||
// NSData *remoteData = [NSJSONSerialization dataWithJSONObject:message.remoteExt options:0 error:nil];
|
||||
// remoteDataLength = (int)remoteData.length;
|
||||
// }else {
|
||||
// remoteDataLength = 0;
|
||||
// }
|
||||
//
|
||||
// int messageTextDataLength;
|
||||
// if (message.text) {
|
||||
// NSData *messageTextData = [message.text dataUsingEncoding:NSUTF8StringEncoding];
|
||||
// messageTextDataLength = (int)messageTextData.length;
|
||||
// }else {
|
||||
// messageTextDataLength = 0;
|
||||
// }
|
||||
//
|
||||
// int messageSize = (int)(messageTextDataLength + sizeof(message.messageObject) + remoteDataLength);
|
||||
//
|
||||
// self.messageCollectionDict = @{
|
||||
// @"uid":@([message.from intValue]),
|
||||
// @"sessionType":@(message.session.sessionType),
|
||||
// @"sessionId":@([message.session.sessionId intValue]),
|
||||
// @"packetSize":@(messageSize),
|
||||
// @"messageType":@(message.messageType),
|
||||
// @"chatroomMemberNumber":@(GetCore(ImRoomCoreV2).onlineNumber),
|
||||
// @"attachementId":@(firstAttachment)
|
||||
// };
|
||||
// }
|
||||
}
|
||||
#pragma mark - private
|
||||
/**
|
||||
生成随机数
|
||||
|
||||
@param from 最小值
|
||||
@param to 最大值
|
||||
@return 随机数
|
||||
*/
|
||||
- (int)getRandomNumber:(int)from to:(int)to {
|
||||
return (int)(from + (arc4random() % (to - from + 1)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
生成固定区间的不重复随机数
|
||||
|
||||
@param from 最小值
|
||||
@param to 最大值
|
||||
@param count 数量
|
||||
@return 返回值
|
||||
*/
|
||||
- (NSArray *)randomArray:(int)from to:(int)to count:(int)count {
|
||||
|
||||
//随机数从这里边产生
|
||||
NSMutableArray *startArray= [NSMutableArray array];
|
||||
for (int i = from; i <= to; i++) {
|
||||
[startArray addObject:@(i)];
|
||||
}
|
||||
|
||||
//随机数产生结果
|
||||
NSMutableArray *resultArray=[[NSMutableArray alloc] initWithCapacity:0];
|
||||
//随机数个数
|
||||
NSInteger m = count;
|
||||
for (int i=0; i<m; i++) {
|
||||
int t = arc4random()%startArray.count;
|
||||
resultArray[i]=startArray[t];
|
||||
startArray[t]=[startArray lastObject]; //为更好的乱序,故交换下位置
|
||||
[startArray removeLastObject];
|
||||
}
|
||||
return resultArray;
|
||||
}
|
||||
@end
|
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// XPRoomFacePresenter.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPRoomFacePresenter : BaseMvpPresenter
|
||||
///获取当前用户信息
|
||||
- (void)getUserInfo;
|
||||
///普通表情
|
||||
- (void)getRoomNormalFace;
|
||||
/// 规则表情
|
||||
- (void)getRoomNobelFace;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,92 @@
|
||||
//
|
||||
// XPRoomFacePresenter.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import "XPRoomFacePresenter.h"
|
||||
#import "Api.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "XPRoomFaceTool.h"
|
||||
#import "ClientConfig.h"
|
||||
#import "RoomFaceInfoModel.h"
|
||||
#import "UserInfoModel.h"
|
||||
#import "XPRoomFaceProtocol.h"
|
||||
|
||||
@implementation XPRoomFacePresenter
|
||||
|
||||
///获取当前用户信息
|
||||
- (void)getUserInfo {
|
||||
NSString * uid = [[AccountInfoStorage instance] getUid];
|
||||
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
UserInfoModel * userInfo = [UserInfoModel modelWithDictionary:data.data];
|
||||
[[self getView] getUserInfoSuccess:userInfo];
|
||||
}showLoading:YES] uid:uid];
|
||||
}
|
||||
|
||||
///普通表情
|
||||
- (void)getRoomNormalFace {
|
||||
NSDictionary * dic = [ClientConfig shareConfig].configInfo.faceInitData;
|
||||
NSArray * originArray = [RoomFaceInfoModel modelsWithArray:dic[@"faces"]];
|
||||
NSArray * sortArray = [self sortFaceInfosWithfaceInfoArr:originArray];
|
||||
NSString * faceFile = [XPRoomFaceTool shareFaceTool].faceDirectory;
|
||||
NSMutableArray * faceArray = [NSMutableArray array];
|
||||
for (int i = 0; i< sortArray.count; i++) {
|
||||
RoomFaceInfoModel * faceInfo = [sortArray objectAtIndex:i];
|
||||
if (!faceInfo.isNobleFace && faceInfo.faceType == 1) {
|
||||
NSString *faceName = [NSString stringWithFormat:@"%@_%ld_%ld",faceInfo.pinyin,faceInfo.fid,faceInfo.iconPos];
|
||||
NSString *dirName = [NSString stringWithFormat:@"%@_%ld",faceInfo.pinyin,faceInfo.fid];
|
||||
NSString *targetPath = [NSString stringWithFormat:@"%@/%@/%@",faceFile,dirName,faceName];
|
||||
UIImage * faceImage = [UIImage imageWithContentsOfFile:targetPath];
|
||||
if (faceImage) {
|
||||
faceInfo.faceImage = faceImage;
|
||||
}
|
||||
[faceArray addObject:faceInfo];
|
||||
}
|
||||
}
|
||||
[[self getView] getRoomNormalFaceListSuccess:faceArray];
|
||||
}
|
||||
|
||||
|
||||
/// 规则表情
|
||||
- (void)getRoomNobelFace {
|
||||
NSDictionary * dic = [ClientConfig shareConfig].configInfo.faceInitData;
|
||||
NSArray * originArray = [RoomFaceInfoModel modelsWithArray:dic[@"vipFaces"]];
|
||||
NSArray * sortArray = [self sortFaceInfosWithfaceInfoArr:originArray];
|
||||
NSString * faceFile = [XPRoomFaceTool shareFaceTool].faceDirectory;
|
||||
NSMutableArray * faceArray = [NSMutableArray array];
|
||||
for (int i = 0; i< sortArray.count; i++) {
|
||||
RoomFaceInfoModel * faceInfo = [sortArray objectAtIndex:i];
|
||||
if (faceInfo.faceType == 1) {
|
||||
NSString *faceName = [NSString stringWithFormat:@"%@_%ld_%ld",faceInfo.pinyin,faceInfo.fid,faceInfo.iconPos];
|
||||
NSString *dirName = [NSString stringWithFormat:@"%@_%ld",faceInfo.pinyin,faceInfo.fid];
|
||||
NSString *targetPath = [NSString stringWithFormat:@"%@/%@/%@",faceFile,dirName,faceName];
|
||||
UIImage * faceImage = [UIImage imageWithContentsOfFile:targetPath];
|
||||
if (faceImage) {
|
||||
faceInfo.faceImage = faceImage;
|
||||
}
|
||||
[faceArray addObject:faceInfo];
|
||||
}
|
||||
}
|
||||
[[self getView] getRoomVipFaceListSuccess:faceArray];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
///排序
|
||||
- (NSArray *)sortFaceInfosWithfaceInfoArr:(NSArray *)faceInfoArr {
|
||||
NSMutableArray *temp = [NSMutableArray array];
|
||||
NSMutableArray *temp2 = [NSMutableArray array]; //运气表情
|
||||
for (RoomFaceInfoModel *item in faceInfoArr) {
|
||||
if (item.resultCount <= 0) {
|
||||
[temp addObject:item];
|
||||
}else {
|
||||
[temp2 addObject:item];
|
||||
}
|
||||
}
|
||||
[temp addObjectsFromArray:temp2];
|
||||
return temp;
|
||||
}
|
||||
|
||||
@end
|
28
xplan-ios/Main/ModuleKit/FaceView/Presenter/XPRoomFaceTool.h
Normal file
28
xplan-ios/Main/ModuleKit/FaceView/Presenter/XPRoomFaceTool.h
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// XPRoomFaceTool.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
// 下载表情的工具 只是下载 不做其他的任何处理
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPRoomFaceTool : NSObject
|
||||
+ (instancetype)shareFaceTool;
|
||||
///判断和本地的versio是否相同
|
||||
@property (nonatomic,copy) NSString *version;
|
||||
///解压的地址MD5
|
||||
@property (nonatomic,copy) NSString *zipMd5;
|
||||
///资源所在的地址
|
||||
@property (nonatomic,copy) NSString *zipUrl;
|
||||
///解压缩之后 表情资源所在的位置 这个有值的时候才会有表情 如果没值 请使用的时候下载
|
||||
@property (nonatomic,copy,readonly) NSString *faceDirectory;
|
||||
///下载表情数据
|
||||
- (void)downFaceData;
|
||||
///下载表情数据 带完成的
|
||||
- (void)downFaceDataCompletion:(nullable void(^)(NSString * path))completion;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
213
xplan-ios/Main/ModuleKit/FaceView/Presenter/XPRoomFaceTool.m
Normal file
213
xplan-ios/Main/ModuleKit/FaceView/Presenter/XPRoomFaceTool.m
Normal file
@@ -0,0 +1,213 @@
|
||||
//
|
||||
// XPRoomFaceTool.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import "XPRoomFaceTool.h"
|
||||
#import <SSZipArchive.h>
|
||||
#import <AFNetworking.h>
|
||||
#import <CommonCrypto/CommonDigest.h>
|
||||
#define FileHashDefaultChunkSizeForReadingData 1024*8 // 8K
|
||||
|
||||
NSString * const kRoomFaceVersion = @"kRoomFaceVersion";
|
||||
|
||||
@interface XPRoomFaceTool ()
|
||||
///解压缩之后 表情资源所在的位置
|
||||
@property (nonatomic,copy) NSString *faceDirectory;
|
||||
///重试的次数
|
||||
@property (nonatomic,assign) NSInteger retryCount;
|
||||
@end
|
||||
|
||||
@implementation XPRoomFaceTool
|
||||
|
||||
+ (instancetype)shareFaceTool {
|
||||
static dispatch_once_t onceToken;
|
||||
static XPRoomFaceTool * tool;
|
||||
dispatch_once(&onceToken, ^{
|
||||
tool = [[XPRoomFaceTool alloc] init];
|
||||
tool.retryCount = 0;
|
||||
});
|
||||
return tool;
|
||||
}
|
||||
|
||||
- (void)downFaceData {
|
||||
[self downFaceDataCompletion:nil];
|
||||
}
|
||||
|
||||
- (void)downFaceDataCompletion:(nullable void (^)(NSString * nullable))completion {
|
||||
//获取沙盒doucument路径
|
||||
NSArray*pathsss =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
|
||||
NSString *documentsDirectory = [pathsss objectAtIndex:0];
|
||||
NSString*faceDirectory = [documentsDirectory stringByAppendingPathComponent:@"Face"];
|
||||
///首先判断 本地的数据是否 需要更新了
|
||||
NSString *version = [[NSUserDefaults standardUserDefaults]objectForKey: kRoomFaceVersion];
|
||||
if (version == nil || version.integerValue < self.version.integerValue) {///本地没有保存的话 就走下载
|
||||
if (self.zipUrl.length > 0 && [self.zipUrl hasPrefix:@"http"]) {
|
||||
NSURL *URL = [NSURL URLWithString:self.zipUrl];
|
||||
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
|
||||
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
|
||||
//请求
|
||||
NSURLRequest *request = [NSURLRequest requestWithURL:URL];
|
||||
//下载Task操作
|
||||
[[manager downloadTaskWithRequest:request progress:^(NSProgress * _Nonnull downloadProgress) {
|
||||
|
||||
} destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) {
|
||||
//要求返回一个URL, 返回的这个URL就是文件的位置的路径
|
||||
NSString *cachesPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject];
|
||||
NSString *path = [cachesPath stringByAppendingPathComponent:response.suggestedFilename];
|
||||
return [NSURL fileURLWithPath:path];
|
||||
} completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) {
|
||||
if (error == nil) {
|
||||
NSString *filePathStr = [filePath path];
|
||||
NSString *fileMD5Str = [self getFileMD5WithPath:filePathStr];
|
||||
fileMD5Str = [fileMD5Str uppercaseString];
|
||||
if (![self.zipMd5 isEqualToString:fileMD5Str]) { //MD5校验 如果不相等就重新下载
|
||||
[self performSelector:@selector(downFaceData) withObject:nil afterDelay:3];
|
||||
}else {
|
||||
// filePath就是你下载文件的位置,你可以解压,也可以直接拿来使用
|
||||
NSString *imgFilePath = [filePath path];
|
||||
NSLog(@"img == %@", imgFilePath);
|
||||
NSString *zipPath = imgFilePath;
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
//删除老的数据
|
||||
[[NSFileManager defaultManager] removeItemAtPath:faceDirectory error:nil];
|
||||
[fileManager createDirectoryAtPath:faceDirectory withIntermediateDirectories:YES attributes:nil error:nil];
|
||||
NSLog(@"test == %@",faceDirectory); //解压后的路径
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
//解压
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:faceDirectory overwrite:YES password:nil progressHandler:^(NSString * _Nonnull entry, unz_file_info zipInfo, long entryNumber, long total) {
|
||||
|
||||
} completionHandler:^(NSString * _Nonnull path, BOOL succeeded, NSError * _Nullable error) {
|
||||
if (error == nil) {
|
||||
self.retryCount = 0;
|
||||
///如果解压完成的话 就保存一下值
|
||||
[[NSUserDefaults standardUserDefaults]setObject:self.version forKey:kRoomFaceVersion];
|
||||
self.faceDirectory = faceDirectory;
|
||||
if (completion) {
|
||||
completion(faceDirectory);
|
||||
}
|
||||
} else {
|
||||
self.retryCount ++;
|
||||
if (self.retryCount <=10) {
|
||||
[self downFaceData];
|
||||
}
|
||||
if (completion) {
|
||||
completion(nil);
|
||||
}
|
||||
}
|
||||
}];
|
||||
});
|
||||
}
|
||||
} else {
|
||||
self.retryCount ++;
|
||||
if (self.retryCount <=10) {
|
||||
[self downFaceData];
|
||||
}
|
||||
if (completion) {
|
||||
completion(nil);
|
||||
}
|
||||
}
|
||||
|
||||
}] resume];
|
||||
} else {
|
||||
if (completion) {
|
||||
completion(nil);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self.faceDirectory = faceDirectory;
|
||||
if (completion) {
|
||||
completion(faceDirectory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (NSString*)getFileMD5WithPath:(NSString*)path {
|
||||
return (__bridge NSString *)FileMD5HashCreateWithPath((__bridge CFStringRef)path,FileHashDefaultChunkSizeForReadingData);
|
||||
}
|
||||
|
||||
CFStringRef FileMD5HashCreateWithPath(CFStringRef filePath,
|
||||
size_t chunkSizeForReadingData) {
|
||||
|
||||
// Declare needed variables
|
||||
CFStringRef result = NULL;
|
||||
CFReadStreamRef readStream = NULL;
|
||||
|
||||
// Get the file URL
|
||||
CFURLRef fileURL =
|
||||
CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
|
||||
(CFStringRef)filePath,
|
||||
kCFURLPOSIXPathStyle,
|
||||
(Boolean)false);
|
||||
|
||||
CC_MD5_CTX hashObject;
|
||||
bool hasMoreData = true;
|
||||
bool didSucceed;
|
||||
|
||||
if (!fileURL) goto done;
|
||||
|
||||
// Create and open the read stream
|
||||
readStream = CFReadStreamCreateWithFile(kCFAllocatorDefault,
|
||||
(CFURLRef)fileURL);
|
||||
if (!readStream) goto done;
|
||||
didSucceed = (bool)CFReadStreamOpen(readStream);
|
||||
if (!didSucceed) goto done;
|
||||
|
||||
// Initialize the hash object
|
||||
CC_MD5_Init(&hashObject);
|
||||
|
||||
// Make sure chunkSizeForReadingData is valid
|
||||
if (!chunkSizeForReadingData) {
|
||||
chunkSizeForReadingData = FileHashDefaultChunkSizeForReadingData;
|
||||
}
|
||||
|
||||
// Feed the data to the hash object
|
||||
while (hasMoreData) {
|
||||
uint8_t buffer[chunkSizeForReadingData];
|
||||
CFIndex readBytesCount = CFReadStreamRead(readStream,
|
||||
(UInt8 *)buffer,
|
||||
(CFIndex)sizeof(buffer));
|
||||
if (readBytesCount == -1)break;
|
||||
if (readBytesCount == 0) {
|
||||
hasMoreData =false;
|
||||
continue;
|
||||
}
|
||||
CC_MD5_Update(&hashObject,(const void *)buffer,(CC_LONG)readBytesCount);
|
||||
}
|
||||
|
||||
// Check if the read operation succeeded
|
||||
didSucceed = !hasMoreData;
|
||||
|
||||
// Compute the hash digest
|
||||
unsigned char digest[CC_MD5_DIGEST_LENGTH];
|
||||
CC_MD5_Final(digest, &hashObject);
|
||||
|
||||
// Abort if the read operation failed
|
||||
if (!didSucceed) goto done;
|
||||
|
||||
// Compute the string result
|
||||
char hash[2 *sizeof(digest) + 1];
|
||||
for (size_t i =0; i < sizeof(digest); ++i) {
|
||||
snprintf(hash + (2 * i),3, "%02x", (int)(digest[i]));
|
||||
}
|
||||
result = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
(const char *)hash,
|
||||
kCFStringEncodingUTF8);
|
||||
|
||||
done:
|
||||
|
||||
if (readStream) {
|
||||
CFReadStreamClose(readStream);
|
||||
CFRelease(readStream);
|
||||
}
|
||||
if (fileURL) {
|
||||
CFRelease(fileURL);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// XPFaceProtocol.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/8.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPFaceProtocol : NSObject
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,12 +0,0 @@
|
||||
//
|
||||
// XPFaceProtocol.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/8.
|
||||
//
|
||||
|
||||
#import "XPFaceProtocol.h"
|
||||
|
||||
@implementation XPFaceProtocol
|
||||
|
||||
@end
|
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// XPRoomFaceProtocol.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class UserInfoModel;
|
||||
@protocol XPRoomFaceProtocol <NSObject>
|
||||
|
||||
///获取房间普通礼物成功
|
||||
- (void)getRoomNormalFaceListSuccess:(NSArray *)list;
|
||||
///获取房间VIP礼物成功
|
||||
- (void)getRoomVipFaceListSuccess:(NSArray *)list;
|
||||
///用户用户信息成功
|
||||
- (void)getUserInfoSuccess:(UserInfoModel *)userInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,32 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceCell.h
|
||||
// XChat
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 XC. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "NetImageView.h"
|
||||
|
||||
@interface XCGameRoomFaceCell : UICollectionViewCell
|
||||
|
||||
/**
|
||||
表情图标
|
||||
*/
|
||||
@property (strong, nonatomic) UIImageView *faceImageView;
|
||||
|
||||
/**
|
||||
表情名
|
||||
*/
|
||||
@property (strong, nonatomic) UILabel *faceName;
|
||||
|
||||
/**
|
||||
贵族标识 tag
|
||||
*/
|
||||
@property (strong, nonatomic) NetImageView *nobleTagImageView;
|
||||
|
||||
///贵族表情锁
|
||||
@property (nonatomic, strong) UIImageView *lockImageView;
|
||||
|
||||
@end
|
@@ -1,97 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceCell.m
|
||||
// XChat
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 XC. All rights reserved.
|
||||
//
|
||||
|
||||
#import "XCGameRoomFaceCell.h"
|
||||
//third
|
||||
#import <Masonry/Masonry.h>
|
||||
//theme
|
||||
#import "ThemeColor.h"
|
||||
|
||||
@implementation XCGameRoomFaceCell
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initView];
|
||||
[self initConstrations];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)initView {
|
||||
[self.contentView addSubview:self.faceImageView];
|
||||
[self.contentView addSubview:self.faceName];
|
||||
[self.contentView addSubview:self.nobleTagImageView];
|
||||
[self.contentView addSubview:self.lockImageView];
|
||||
}
|
||||
|
||||
- (void)initConstrations {
|
||||
[self.faceImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.contentView.mas_top);
|
||||
make.width.height.mas_equalTo(36);
|
||||
make.centerX.mas_equalTo(self.contentView.mas_centerX);
|
||||
}];
|
||||
[self.nobleTagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.faceImageView.mas_top);
|
||||
make.right.mas_equalTo(self.contentView);
|
||||
make.width.mas_equalTo(20);
|
||||
make.height.mas_equalTo(20);
|
||||
}];
|
||||
[self.faceName mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.faceImageView.mas_bottom);
|
||||
make.centerX.mas_equalTo(self.faceImageView.mas_centerX);
|
||||
}];
|
||||
|
||||
[self.lockImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.bottom.mas_equalTo(self.contentView).mas_offset(-4);
|
||||
make.width.height.mas_equalTo(16);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - setter & getter
|
||||
|
||||
- (UIImageView *)faceImageView {
|
||||
if (!_faceImageView) {
|
||||
_faceImageView = [[UIImageView alloc]init];
|
||||
}
|
||||
return _faceImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)faceName {
|
||||
if (!_faceName) {
|
||||
_faceName = [[UILabel alloc]init];
|
||||
_faceName.font = [UIFont systemFontOfSize:12.f];
|
||||
_faceName.textColor = UIColorFromRGB(0xd6d6d6);
|
||||
_faceName.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _faceName;
|
||||
}
|
||||
|
||||
- (NetImageView *)nobleTagImageView {
|
||||
if (!_nobleTagImageView) {
|
||||
_nobleTagImageView = [[NetImageView alloc] init];
|
||||
_nobleTagImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _nobleTagImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)lockImageView {
|
||||
if (!_lockImageView) {
|
||||
_lockImageView = [self createImageView:@"room_gift_noble_lock"];
|
||||
_lockImageView.hidden = YES;
|
||||
}
|
||||
return _lockImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)createImageView:(NSString *)imageName {
|
||||
UIImageView * imageView = [[UIImageView alloc] init];
|
||||
imageView.userInteractionEnabled = YES;
|
||||
imageView.image = [UIImage imageNamed:imageName];
|
||||
return imageView;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,37 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceContainerCell.h
|
||||
// XChat
|
||||
//
|
||||
// Created by 卫明何 on 2017/12/12.
|
||||
// Copyright © 2017年 XC. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class FaceConfigInfo;
|
||||
|
||||
@protocol XCGameRoomFaceContainerCellDelegate <NSObject>
|
||||
|
||||
///选中的表情
|
||||
- (void)onSelectFace:(FaceConfigInfo *)faceInfo;
|
||||
|
||||
@end
|
||||
|
||||
@interface XCGameRoomFaceContainerCell : UICollectionViewCell
|
||||
|
||||
/**
|
||||
单页collectionview
|
||||
*/
|
||||
@property (strong, nonatomic) UICollectionView *collectionView;
|
||||
|
||||
/**
|
||||
单页表情数据
|
||||
*/
|
||||
@property (strong, nonatomic) NSMutableArray<FaceConfigInfo *> *faceInfos;
|
||||
|
||||
@property (nonatomic, weak) id<XCGameRoomFaceContainerCellDelegate> delegate;
|
||||
|
||||
///当前用户贵族等级
|
||||
@property (nonatomic, assign) NSInteger curUserNobleLevel;
|
||||
|
||||
@end
|
@@ -1,152 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceContainerCell.m
|
||||
// XChat
|
||||
//
|
||||
// Created by 卫明何 on 2017/12/12.
|
||||
// Copyright © 2017年 XC. All rights reserved.
|
||||
//
|
||||
|
||||
#import "XCGameRoomFaceContainerCell.h"
|
||||
#import "XCGameRoomFaceCell.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "XPFaceParser.h"
|
||||
#import "NSArray+Lookin.h"
|
||||
#import "TTPopup.h"
|
||||
|
||||
@interface XCGameRoomFaceContainerCell()
|
||||
<UICollectionViewDelegate,
|
||||
UICollectionViewDataSource,
|
||||
UICollectionViewDelegateFlowLayout
|
||||
>
|
||||
|
||||
//@property (nonatomic, strong) UserInfo *userInfo;
|
||||
@property (nonatomic, strong) NSIndexPath *currentIndexPath;
|
||||
@end
|
||||
|
||||
@implementation XCGameRoomFaceContainerCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
}
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initView];
|
||||
[self initConstrations];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)initView {
|
||||
[self.collectionView registerClass:[XCGameRoomFaceCell class] forCellWithReuseIdentifier:@"XCGameRoomFaceCell"];
|
||||
[self.contentView addSubview:self.collectionView];
|
||||
}
|
||||
|
||||
- (void)initConstrations {
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.contentView.mas_top);
|
||||
make.leading.mas_equalTo(self.contentView.mas_leading);
|
||||
make.trailing.mas_equalTo(self.contentView.mas_trailing);
|
||||
make.bottom.mas_equalTo(self.contentView.mas_bottom);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewDelegate
|
||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
self.currentIndexPath = indexPath;
|
||||
FaceConfigInfo *info = [self.faceInfos lookin_safeObjectAtIndex:indexPath.row];
|
||||
if (self.curUserNobleLevel < info.faceVipInfo.vipLevel) {
|
||||
[TTPopup dismiss];
|
||||
NSString *message = [NSString stringWithFormat:@"尚未达到发送%@所需贵族等级,所需贵族等级:%@", info.name, info.faceVipInfo.vipName];
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc] init];
|
||||
config.message = message;
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
} cancelHandler:^{
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if (![[XPFaceParser shareParser] getShowingFace]) {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(onSelectFace:)]) {
|
||||
[self.delegate onSelectFace:info];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewDataSource
|
||||
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
return self.faceInfos.count;
|
||||
}
|
||||
|
||||
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
XCGameRoomFaceCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"XCGameRoomFaceCell" forIndexPath:indexPath];
|
||||
[self configureCell:cell forItemAtIndexPath:indexPath];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)configureCell:(XCGameRoomFaceCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
FaceConfigInfo *info = self.faceInfos[indexPath.row];
|
||||
//读取图片
|
||||
UIImage *face = [[XPFaceParser shareParser] findFaceIconImageById:info.id];
|
||||
[cell.faceImageView setImage:face];
|
||||
[cell.faceName setText:info.name];
|
||||
if (info.faceVipInfo) {///贵族表情
|
||||
cell.lockImageView.hidden = self.curUserNobleLevel >= info.faceVipInfo.vipLevel;
|
||||
cell.nobleTagImageView.hidden = NO;
|
||||
cell.nobleTagImageView.imageUrl = info.faceVipInfo.vipIcon;
|
||||
} else {
|
||||
cell.lockImageView.hidden = YES;
|
||||
cell.nobleTagImageView.hidden = YES;
|
||||
}
|
||||
cell.lockImageView.hidden = self.curUserNobleLevel >= info.faceVipInfo.vipLevel;
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewDelegateFlowLayout
|
||||
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
return CGSizeMake((self.frame.size.width - 20) / 5, self.frame.size.height / 3);
|
||||
}
|
||||
|
||||
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
|
||||
return 0.01;
|
||||
}
|
||||
|
||||
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
|
||||
return 0.01;
|
||||
}
|
||||
|
||||
- (void)setFaceInfos:(NSMutableArray<FaceConfigInfo *> *)faceInfos{
|
||||
_faceInfos = faceInfos;
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
- (void)setCurUserNobleLevel:(NSInteger)curUserNobleLevel {
|
||||
_curUserNobleLevel = curUserNobleLevel;
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
#pragma mark - RoomQueueCoreClient
|
||||
- (void)onMicroQueueUpdate:(NSMutableDictionary *)micQueue{
|
||||
// [[GetCore(UserCore) getUserInfoByRac:GetCore(AuthCore).getUid.userIDValue refresh:NO] subscribeNext:^(id x) {
|
||||
// self.userInfo = (UserInfo *)x;
|
||||
// }];
|
||||
}
|
||||
|
||||
#pragma mark - Getter & Setter
|
||||
|
||||
- (UICollectionView *)collectionView {
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *flow = [[UICollectionViewFlowLayout alloc]init];
|
||||
flow.scrollDirection = UICollectionViewScrollDirectionVertical;
|
||||
_collectionView = [[UICollectionView alloc]initWithFrame:CGRectZero collectionViewLayout:flow];
|
||||
_collectionView.scrollEnabled = NO;
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -1,37 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceTitleButton.h
|
||||
// AFNetworking
|
||||
//
|
||||
// Created by lvjunhang on 2018/11/27.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XCGameRoomFaceTitleButton : UIButton
|
||||
/**
|
||||
标题
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *title;
|
||||
/**
|
||||
默认标题颜色,默认:[UIColor colorWithWhite:1 alpha:0.4]
|
||||
*/
|
||||
@property (nonatomic, strong) UIColor *normalTitleColor;
|
||||
/**
|
||||
选中标题颜色,默认:[UIColor colorWithWhite:1 alpha:1]
|
||||
*/
|
||||
@property (nonatomic, strong) UIColor *selectTitleColor;
|
||||
/**
|
||||
下划线颜色,默认:[UIColor colorWithWhite:1 alpha:0.4]
|
||||
*/
|
||||
@property (nonatomic, strong) UIColor *underlineColor;
|
||||
|
||||
/**
|
||||
是否显示下划线,默认:NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isShowUnderline;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,100 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceTitleButton.m
|
||||
// AFNetworking
|
||||
//
|
||||
// Created by lvjunhang on 2018/11/27.
|
||||
//
|
||||
|
||||
#import "XCGameRoomFaceTitleButton.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
|
||||
|
||||
|
||||
|
||||
@interface XCGameRoomFaceTitleButton ()
|
||||
@property (nonatomic, strong) UILabel *nameLabel;
|
||||
@property (nonatomic, strong) UIView *underlineView;
|
||||
@end
|
||||
|
||||
@implementation XCGameRoomFaceTitleButton
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
self.userInteractionEnabled = NO;
|
||||
|
||||
[self addSubview:self.nameLabel];
|
||||
[self addSubview:self.underlineView];
|
||||
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(0);
|
||||
make.left.right.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
[self.underlineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(2);
|
||||
make.centerX.mas_equalTo(0);
|
||||
make.width.mas_equalTo(9);
|
||||
make.height.mas_equalTo(2);
|
||||
}];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Override
|
||||
- (void)setSelected:(BOOL)selected {
|
||||
[super setSelected:selected];
|
||||
|
||||
self.nameLabel.textColor = selected ? self.selectTitleColor : self.normalTitleColor;
|
||||
self.underlineView.hidden = !self.isShowUnderline || !selected;
|
||||
}
|
||||
|
||||
- (void)setTitle:(NSString *)title {
|
||||
_title = title;
|
||||
|
||||
NSAssert(title, @"title can not be nil");
|
||||
self.nameLabel.text = title;
|
||||
}
|
||||
|
||||
#pragma mark - Getter Setter
|
||||
- (UILabel *)nameLabel {
|
||||
if (_nameLabel == nil) {
|
||||
_nameLabel = [[UILabel alloc] init];
|
||||
_nameLabel.textColor = self.normalTitleColor;
|
||||
_nameLabel.font = [UIFont systemFontOfSize:14];
|
||||
_nameLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _nameLabel;
|
||||
}
|
||||
|
||||
- (UIView *)underlineView {
|
||||
if (_underlineView == nil) {
|
||||
_underlineView = [[UIView alloc] init];
|
||||
_underlineView.backgroundColor = self.underlineColor;
|
||||
_underlineView.layer.cornerRadius = 2;
|
||||
}
|
||||
return _underlineView;
|
||||
}
|
||||
|
||||
- (UIColor *)normalTitleColor {
|
||||
if (_normalTitleColor == nil) {
|
||||
_normalTitleColor = [UIColor colorWithWhite:1 alpha:0.4];
|
||||
}
|
||||
return _normalTitleColor;
|
||||
}
|
||||
|
||||
- (UIColor *)selectTitleColor {
|
||||
if (_selectTitleColor == nil) {
|
||||
_selectTitleColor = [UIColor colorWithWhite:1 alpha:1];
|
||||
}
|
||||
return _selectTitleColor;
|
||||
}
|
||||
|
||||
- (UIColor *)underlineColor {
|
||||
if (_underlineColor == nil) {
|
||||
// _underlineColor = [XCTheme getMainDefaultColor];
|
||||
}
|
||||
return _underlineColor;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,20 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceTitleCell.h
|
||||
// XCRoomMoudle
|
||||
//
|
||||
// Created by 卫明何 on 2018/8/23.
|
||||
// Copyright © 2018年 卫明何. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "XCGameRoomFaceTitleDisplayModel.h"
|
||||
|
||||
@interface XCGameRoomFaceTitleCell : UICollectionViewCell
|
||||
|
||||
/**
|
||||
展示UI模型
|
||||
*/
|
||||
@property (strong, nonatomic) XCGameRoomFaceTitleDisplayModel *displayModel;
|
||||
|
||||
@end
|
@@ -1,79 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceTitleCell.m
|
||||
// XCRoomMoudle
|
||||
//
|
||||
// Created by 卫明何 on 2018/8/23.
|
||||
// Copyright © 2018年 卫明何. All rights reserved.
|
||||
//
|
||||
|
||||
#import "XCGameRoomFaceTitleCell.h"
|
||||
#import "XCGameRoomFaceTitleButton.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
|
||||
|
||||
|
||||
//3rd part
|
||||
|
||||
|
||||
@interface XCGameRoomFaceTitleCell ()
|
||||
|
||||
@property (strong, nonatomic) XCGameRoomFaceTitleButton *titleButton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XCGameRoomFaceTitleCell
|
||||
|
||||
#pragma mark - life cycle
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self initView];
|
||||
[self initConstrations];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - public methods
|
||||
|
||||
#pragma mark - [系统控件的Protocol] //注意要把名字改掉,这个MARK只做功能划分,不是一个真正的MARK,每个不一样的Protocol,需要一个新的MARK”
|
||||
|
||||
#pragma mark - [自定义控件的Protocol] //注意要把名字改掉,这个MARK只做功能划分,不是一个真正的MARK,每个不一样的Protocol,需要一个新的MARK”
|
||||
|
||||
#pragma mark - [core相关的Protocol] //注意要把名字改掉,这个MARK只做功能划分,不是一个真正的MARK,每个不一样的Protocol,需要一个新的MARK”
|
||||
|
||||
#pragma mark - event response
|
||||
|
||||
#pragma mark - private method
|
||||
|
||||
- (void)initView {
|
||||
[self.contentView addSubview:self.titleButton];
|
||||
}
|
||||
|
||||
- (void)initConstrations {
|
||||
|
||||
[self.titleButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(UIEdgeInsetsZero);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)setDisplayModel:(XCGameRoomFaceTitleDisplayModel *)displayModel {
|
||||
_displayModel = displayModel;
|
||||
NSAssert(displayModel.title.length > 0, @"XCGameRoomFaceTitleDisplayModel 's protype name title can'not be nil");
|
||||
|
||||
self.titleButton.title = displayModel.title;
|
||||
self.titleButton.selected = displayModel.isSelected;
|
||||
}
|
||||
|
||||
#pragma mark - getters and setters
|
||||
|
||||
- (XCGameRoomFaceTitleButton *)titleButton {
|
||||
if (!_titleButton) {
|
||||
_titleButton = [XCGameRoomFaceTitleButton buttonWithType:UIButtonTypeCustom];
|
||||
_titleButton.isShowUnderline = YES;
|
||||
|
||||
}
|
||||
return _titleButton;
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPRoomFaceCollectionFlowLayout.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/10.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPRoomFaceCollectionFlowLayout : UICollectionViewFlowLayout
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,150 @@
|
||||
//
|
||||
// XPRoomFaceCollectionFlowLayout.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/10.
|
||||
//
|
||||
|
||||
#import "XPRoomFaceCollectionFlowLayout.h"
|
||||
|
||||
@interface XPRoomFaceCollectionFlowLayout ()
|
||||
@property (nonatomic, copy) NSMutableDictionary *sectionDic;
|
||||
@property (nonatomic, strong) NSMutableArray *allAttributes;
|
||||
@end
|
||||
|
||||
@implementation XPRoomFaceCollectionFlowLayout
|
||||
#pragma mark - life cycle
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.scrollDirection = UICollectionViewScrollDirectionHorizontal;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - overload
|
||||
|
||||
- (void)prepareLayout {
|
||||
|
||||
[super prepareLayout];
|
||||
|
||||
_sectionDic = [NSMutableDictionary dictionary];
|
||||
self.allAttributes = [NSMutableArray array];
|
||||
//获取section的数量
|
||||
NSUInteger section = [self.collectionView numberOfSections];
|
||||
|
||||
for (int sec = 0; sec < section; sec++) {
|
||||
//获取每个section的cell个数
|
||||
NSUInteger count = [self.collectionView numberOfItemsInSection:sec];
|
||||
|
||||
for (NSUInteger item = 0; item<count; item++) {
|
||||
|
||||
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:item inSection:sec];
|
||||
//重新排列
|
||||
UICollectionViewLayoutAttributes *attributes = [self layoutAttributesForItemAtIndexPath:indexPath];
|
||||
[self.allAttributes addObject:attributes];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (CGSize)collectionViewContentSize {
|
||||
|
||||
//每个section的页码的总数
|
||||
NSInteger actualLo = 0;
|
||||
for (NSString *key in [_sectionDic allKeys]) {
|
||||
actualLo += [_sectionDic[key] integerValue];
|
||||
}
|
||||
return CGSizeMake(actualLo*self.collectionView.frame.size.width, self.collectionView.contentSize.height);
|
||||
}
|
||||
|
||||
- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
|
||||
UICollectionViewLayoutAttributes *attr = [super layoutAttributesForItemAtIndexPath:indexPath].copy;
|
||||
|
||||
[self applyLayoutAttributes:attr];
|
||||
return attr;
|
||||
}
|
||||
|
||||
- (NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect {
|
||||
|
||||
return self.allAttributes;
|
||||
}
|
||||
|
||||
#pragma mark - private method
|
||||
|
||||
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)attributes {
|
||||
|
||||
if(attributes.representedElementKind != nil){
|
||||
return;
|
||||
}
|
||||
CGFloat minLine = self.minimumLineSpacing;
|
||||
CGFloat minSpacing = self.minimumInteritemSpacing;
|
||||
|
||||
//attributes 的宽度
|
||||
CGFloat itemW = attributes.frame.size.width;
|
||||
//attributes 的高度
|
||||
CGFloat itemH = attributes.frame.size.height;
|
||||
UIEdgeInsets sectionInsets = self.sectionInset;
|
||||
//collectionView 的宽度
|
||||
CGFloat width = self.collectionView.frame.size.width;
|
||||
//collectionView 的高度
|
||||
CGFloat height = self.collectionView.frame.size.height;
|
||||
//每个attributes的下标值 从0开始
|
||||
NSInteger itemIndex = attributes.indexPath.item;
|
||||
|
||||
CGFloat stride = (self.scrollDirection == UICollectionViewScrollDirectionHorizontal) ? width : height;
|
||||
|
||||
|
||||
//获取现在的attributes是第几组
|
||||
NSInteger section = attributes.indexPath.section;
|
||||
//获取每个section的item的个数
|
||||
NSInteger itemCount = [self.collectionView numberOfItemsInSection:section];
|
||||
|
||||
|
||||
CGFloat offset = section * stride;
|
||||
|
||||
//计算x方向item个数
|
||||
NSInteger xCount = (width / itemW);
|
||||
//计算y方向item个数
|
||||
NSInteger yCount = (height / itemH);
|
||||
//计算一页总个数
|
||||
NSInteger allCount = (xCount * yCount);
|
||||
//获取每个section的页数,从0开始
|
||||
NSInteger page = itemIndex / allCount;
|
||||
|
||||
//余数,用来计算item的x的偏移量
|
||||
NSInteger remain = (itemIndex % xCount);
|
||||
//取商,用来计算item的y的偏移量
|
||||
NSInteger merchant = (itemIndex-page*allCount)/xCount;
|
||||
|
||||
|
||||
//x方向每个item的偏移量
|
||||
CGFloat xCellOffset = remain * (itemW + minLine)+ sectionInsets.left;
|
||||
//y方向每个item的偏移量
|
||||
CGFloat yCellOffset = merchant * (itemH + minSpacing);
|
||||
|
||||
//获取每个section中item占了几页
|
||||
NSInteger pageRe = (itemCount % allCount == 0)? (itemCount / allCount) : (itemCount / allCount) + 1;
|
||||
//将每个section与pageRe对应,计算下面的位置
|
||||
[_sectionDic setValue:@(pageRe) forKey:[NSString stringWithFormat:@"%ld", section]];
|
||||
|
||||
if(self.scrollDirection == UICollectionViewScrollDirectionHorizontal) {
|
||||
|
||||
NSInteger actualLo = 0;
|
||||
//将每个section中的页数相加
|
||||
for (NSString *key in [_sectionDic allKeys]) {
|
||||
actualLo += [_sectionDic[key] integerValue];
|
||||
}
|
||||
//获取到的最后的数减去最后一组的页码数
|
||||
actualLo -= [_sectionDic[[NSString stringWithFormat:@"%ld", [_sectionDic allKeys].count-1]] integerValue];
|
||||
xCellOffset += page*width + actualLo*width;
|
||||
|
||||
} else {
|
||||
|
||||
yCellOffset += offset;
|
||||
}
|
||||
|
||||
attributes.frame = CGRectMake(xCellOffset, yCellOffset, itemW, itemH);
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// XPRoomFaceCollectionViewCell.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class RoomFaceInfoModel;
|
||||
@interface XPRoomFaceCollectionViewCell : UICollectionViewCell
|
||||
///贵族的等级
|
||||
@property (nonatomic,assign) NSInteger vipLevel;
|
||||
///表情信息
|
||||
@property (nonatomic,strong) RoomFaceInfoModel *faceInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,143 @@
|
||||
//
|
||||
// XPRoomFaceCollectionViewCell.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import "XPRoomFaceCollectionViewCell.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "NetImageView.h"
|
||||
#import "ThemeColor.h"
|
||||
///Model
|
||||
#import "RoomFaceInfoModel.h"
|
||||
|
||||
@interface XPRoomFaceCollectionViewCell ()
|
||||
///表情的图片
|
||||
@property (nonatomic,strong) UIImageView *faceImageView;
|
||||
///表情的标题
|
||||
@property (nonatomic,strong) UILabel *faceTitleLabel;
|
||||
///贵族的类型
|
||||
@property (nonatomic,strong) NetImageView *nobleTypeImageView;
|
||||
///是否是贵族🔐
|
||||
@property (nonatomic,strong) UIImageView *nobleLockImageView;
|
||||
///覆盖的背景
|
||||
@property (nonatomic,strong) UIView * coverView;
|
||||
@end
|
||||
|
||||
@implementation XPRoomFaceCollectionViewCell
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self.contentView addSubview:self.faceImageView];
|
||||
[self.contentView addSubview:self.coverView];
|
||||
[self.contentView addSubview:self.nobleTypeImageView];
|
||||
[self.contentView addSubview:self.faceTitleLabel];
|
||||
[self.contentView addSubview:self.nobleLockImageView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.faceImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(60, 60));
|
||||
make.centerX.mas_equalTo(self.contentView);
|
||||
make.top.mas_equalTo(self.contentView);
|
||||
}];
|
||||
|
||||
[self.coverView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.faceImageView);
|
||||
}];
|
||||
|
||||
[self.nobleTypeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(12 * 1.4);
|
||||
make.height.mas_equalTo(10 * 1.4);
|
||||
make.left.top.mas_equalTo(self.contentView);
|
||||
}];
|
||||
|
||||
[self.faceTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.contentView);
|
||||
make.top.mas_equalTo(self.faceImageView.mas_bottom).offset(4);
|
||||
}];
|
||||
|
||||
[self.nobleLockImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(11, 11));
|
||||
make.bottom.right.mas_equalTo(self.faceImageView);
|
||||
}];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setFaceInfo:(RoomFaceInfoModel *)faceInfo {
|
||||
_faceInfo = faceInfo;
|
||||
if (_faceInfo) {
|
||||
self.faceImageView.image = _faceInfo.faceImage;
|
||||
self.faceTitleLabel.text = _faceInfo.name;
|
||||
if (_faceInfo.faceVipInfo) {
|
||||
self.nobleTypeImageView.imageUrl = _faceInfo.faceVipInfo.vipIcon;
|
||||
self.nobleTypeImageView.hidden = NO;
|
||||
if (_faceInfo.faceVipInfo.vipLevel < self.vipLevel) {
|
||||
self.nobleLockImageView.hidden = YES;
|
||||
} else {
|
||||
self.nobleLockImageView.hidden = NO;
|
||||
}
|
||||
} else {
|
||||
self.nobleTypeImageView.hidden = YES;
|
||||
self.nobleLockImageView.hidden = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImageView *)faceImageView {
|
||||
if (!_faceImageView) {
|
||||
_faceImageView = [[UIImageView alloc] init];
|
||||
_faceImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _faceImageView;
|
||||
}
|
||||
|
||||
- (NetImageView *)nobleTypeImageView {
|
||||
if (!_nobleTypeImageView) {
|
||||
_nobleTypeImageView = [[NetImageView alloc] init];
|
||||
_nobleTypeImageView.layer.masksToBounds = YES;
|
||||
_nobleTypeImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _nobleTypeImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)nobleLockImageView {
|
||||
if (!_nobleLockImageView) {
|
||||
_nobleLockImageView = [[UIImageView alloc] init];
|
||||
_nobleLockImageView.image = [UIImage imageNamed:@"room_face_nobel_lock"];
|
||||
}
|
||||
return _nobleLockImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)faceTitleLabel {
|
||||
if (!_faceTitleLabel) {
|
||||
_faceTitleLabel = [[UILabel alloc] init];
|
||||
_faceTitleLabel.font = [UIFont systemFontOfSize:10];
|
||||
_faceTitleLabel.textColor = [UIColor whiteColor];
|
||||
_faceTitleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _faceTitleLabel;
|
||||
}
|
||||
|
||||
- (UIView *)coverView {
|
||||
if (!_coverView) {
|
||||
_coverView = [[UIView alloc] init];
|
||||
_coverView.backgroundColor = UIColorRGBAlpha(0x000000, 0.3);
|
||||
}
|
||||
return _coverView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPRoomFaceTitleCollectionViewCell.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class RoomFaceTitleItemModel;
|
||||
@interface XPRoomFaceTitleCollectionViewCell : UICollectionViewCell
|
||||
@property (nonatomic,strong) RoomFaceTitleItemModel *titleModel;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// XPRoomFaceTitleCollectionViewCell.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import "XPRoomFaceTitleCollectionViewCell.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
///Model
|
||||
#import "RoomFaceTitleItemModel.h"
|
||||
|
||||
@interface XPRoomFaceTitleCollectionViewCell ()
|
||||
///标题
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
@end
|
||||
|
||||
@implementation XPRoomFaceTitleCollectionViewCell
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.contentView);
|
||||
}];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setTitleModel:(RoomFaceTitleItemModel *)titleModel {
|
||||
_titleModel = titleModel;
|
||||
if (_titleLabel) {
|
||||
self.titleLabel.text = _titleModel.title;
|
||||
self.titleLabel.textColor = _titleModel.isSelect ? [ThemeColor appMainColor] : [UIColor whiteColor];
|
||||
}
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,40 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceView.h
|
||||
// XChat
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 XC. All rights reserved.
|
||||
//
|
||||
// 发送表情view
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "RoomHostDelegate.h"
|
||||
|
||||
//displaymodel
|
||||
#import "XCGameRoomFaceViewDisplayModel.h"
|
||||
|
||||
|
||||
|
||||
@interface XPRoomFaceView : UIView
|
||||
|
||||
///房间内才需要
|
||||
@property (nonatomic,weak) id<RoomHostDelegate> delegate;
|
||||
|
||||
/**
|
||||
分组的表情数组
|
||||
*/
|
||||
@property (strong, nonatomic) NSMutableArray<NSMutableArray *> *faceInfos;
|
||||
|
||||
/**
|
||||
表情collection
|
||||
*/
|
||||
@property (strong, nonatomic) UICollectionView *faceCollectionView;
|
||||
|
||||
/**
|
||||
初始化方法,必须调用这个
|
||||
@param uid 房主uid
|
||||
@return self
|
||||
*/
|
||||
- (instancetype)initWithRoomUid:(NSString *)uid;
|
||||
|
||||
@end
|
@@ -1,485 +0,0 @@
|
||||
//
|
||||
// XCGameRoomFaceView.m
|
||||
// XChat
|
||||
//
|
||||
// Created by 卫明何 on 2017/9/29.
|
||||
// Copyright © 2017年 XC. All rights reserved.
|
||||
//
|
||||
|
||||
#import "XPRoomFaceView.h"
|
||||
//view
|
||||
#import "XCGameRoomFaceCell.h"
|
||||
#import "XCGameRoomFaceContainerCell.h"
|
||||
#import "XCGameRoomFaceTitleCell.h"
|
||||
#import "XPNobleCenterViewController.h"
|
||||
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "NSArray+Lookin.h"
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import "TTPopup.h"
|
||||
#import "StatisticsServiceHelper.h"
|
||||
///tool
|
||||
#import "XPMacro.h"
|
||||
#import "XPFaceParser.h"
|
||||
#import "THemeColor.h"
|
||||
///P
|
||||
#import "XPFacePresenter.h"
|
||||
//model
|
||||
#import "UserInfoModel.h"
|
||||
#import "RoomInfoModel.h"
|
||||
#import "XCGameRoomFaceViewDisplayModel.h"
|
||||
|
||||
@interface XPRoomFaceView()
|
||||
<
|
||||
UICollectionViewDelegate,
|
||||
UICollectionViewDataSource,
|
||||
UICollectionViewDelegateFlowLayout,
|
||||
UIScrollViewDelegate,
|
||||
XCGameRoomFaceContainerCellDelegate
|
||||
>
|
||||
|
||||
/**
|
||||
显示用模型
|
||||
*/
|
||||
@property (strong, nonatomic) XCGameRoomFaceViewDisplayModel *displayModel;
|
||||
|
||||
/**
|
||||
翻页控件
|
||||
*/
|
||||
@property (strong, nonatomic) UIPageControl *pageControl;
|
||||
|
||||
///贵族特权
|
||||
@property (nonatomic, strong) UIButton *nobleButton;
|
||||
|
||||
/**
|
||||
标题collection
|
||||
*/
|
||||
@property (strong, nonatomic) UICollectionView *titlesCollectionView;
|
||||
|
||||
/**
|
||||
高斯模糊view
|
||||
*/
|
||||
@property (strong, nonatomic) UIVisualEffectView *effectView;
|
||||
|
||||
/**
|
||||
如果displayType为展示Noble 这个view就会显示出来
|
||||
*/
|
||||
@property (strong, nonatomic) UIView *tabBarView;
|
||||
|
||||
/**
|
||||
选中的表情类型
|
||||
*/
|
||||
@property (nonatomic,assign) RoomFaceType selectedFaceType;
|
||||
|
||||
/**
|
||||
选中的indexpath
|
||||
*/
|
||||
@property (strong, nonatomic) NSIndexPath *selectedIndexPath;
|
||||
|
||||
/**
|
||||
当前用户信息
|
||||
*/
|
||||
//@property (nonatomic, strong) UserInfo *userInfo;
|
||||
///房主的uid
|
||||
@property (nonatomic,copy) NSString *roomUid;
|
||||
|
||||
@property (nonatomic,strong) XPFacePresenter *facePresenter;
|
||||
|
||||
@property (nonatomic, strong) NIMChatroomMember *myMember;
|
||||
///当前贵族等级
|
||||
@property (nonatomic, assign) NSInteger currentNobleLevel;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPRoomFaceView
|
||||
|
||||
- (instancetype)initWithRoomUid:(NSString *)uid {
|
||||
if (self = [super init]) {
|
||||
[self configDisplayModel];
|
||||
|
||||
self.roomUid = uid;
|
||||
[self initView];
|
||||
[self initConstrations];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)configDisplayModel {
|
||||
XCGameRoomFaceViewDisplayModel *faceDisplayModel = [[XCGameRoomFaceViewDisplayModel alloc] init];
|
||||
faceDisplayModel.displayType = XCGameRoomFaceViewDisplayType_Noble;
|
||||
faceDisplayModel.titles = [self getTitles];
|
||||
self.displayModel = faceDisplayModel;
|
||||
}
|
||||
|
||||
- (NSMutableArray *)getTitles{
|
||||
XCGameRoomFaceTitleDisplayModel *normalTitle = [[XCGameRoomFaceTitleDisplayModel alloc] init];
|
||||
normalTitle.type = RoomFaceTypeNormal;
|
||||
normalTitle.title = @"表情";
|
||||
normalTitle.isSelected = YES;
|
||||
XCGameRoomFaceTitleDisplayModel *nobleTitle = [[XCGameRoomFaceTitleDisplayModel alloc] init];
|
||||
nobleTitle.type = RoomFaceTypeNoble;
|
||||
nobleTitle.title = @"贵族表情";
|
||||
nobleTitle.isSelected = NO;
|
||||
return @[normalTitle, nobleTitle].mutableCopy;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UICollectionViewDataSource
|
||||
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
|
||||
if (collectionView == self.titlesCollectionView) {
|
||||
return 1;
|
||||
}else if (collectionView == self.faceCollectionView) {
|
||||
return self.faceInfos.count;
|
||||
}else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
if (collectionView == self.titlesCollectionView) {
|
||||
return self.displayModel.titles.count;
|
||||
}else if (collectionView == self.faceCollectionView) {
|
||||
return 1;
|
||||
}else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView
|
||||
cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
UICollectionViewCell *cell = nil;
|
||||
if (collectionView == self.titlesCollectionView) {
|
||||
cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"XCGameRoomFaceTitleCell" forIndexPath:indexPath];
|
||||
}else if (collectionView == self.faceCollectionView){
|
||||
cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"XCGameRoomFaceContainerCell" forIndexPath:indexPath];
|
||||
}
|
||||
|
||||
|
||||
[self configureCell:cell forItemAtIndexPath:indexPath];
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)configureCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if ([cell isKindOfClass:[XCGameRoomFaceTitleCell class]]) {
|
||||
XCGameRoomFaceTitleDisplayModel *displayModel = [self.displayModel.titles lookin_safeObjectAtIndex:indexPath.row];
|
||||
if (indexPath == self.selectedIndexPath) {
|
||||
displayModel.isSelected = YES;
|
||||
}else {
|
||||
displayModel.isSelected = NO;
|
||||
}
|
||||
((XCGameRoomFaceTitleCell *)cell).displayModel = [self.displayModel.titles lookin_safeObjectAtIndex:indexPath.row];
|
||||
}else if ([cell isKindOfClass:[XCGameRoomFaceContainerCell class]]) {
|
||||
((XCGameRoomFaceContainerCell *)cell).faceInfos = [self.faceInfos lookin_safeObjectAtIndex:indexPath.section];
|
||||
XCGameRoomFaceContainerCell *faceCell = (XCGameRoomFaceContainerCell *)cell;
|
||||
faceCell.delegate = self;
|
||||
faceCell.curUserNobleLevel = self.currentNobleLevel;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewDelegate
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (collectionView == self.faceCollectionView) {
|
||||
return CGSizeMake([UIScreen mainScreen].bounds.size.width, 190);
|
||||
}else if (collectionView == self.titlesCollectionView) {
|
||||
return CGSizeMake(70, 40);
|
||||
|
||||
}else {
|
||||
return CGSizeZero;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (collectionView == self.titlesCollectionView) {
|
||||
XCGameRoomFaceTitleDisplayModel *displayModel = [self.displayModel.titles lookin_safeObjectAtIndex:indexPath.row];
|
||||
if (self.selectedIndexPath != indexPath) {
|
||||
self.selectedIndexPath = indexPath;
|
||||
self.selectedFaceType = displayModel.type;
|
||||
[self.titlesCollectionView reloadData];
|
||||
[self loadFace];
|
||||
self.nobleButton.hidden = self.selectedFaceType != RoomFaceTypeNoble;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UIScrollViewDelegate
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
CGFloat doublePage = scrollView.contentOffset.x / scrollView.bounds.size.width;
|
||||
int intPage = (int)(doublePage + 0.5);
|
||||
self.pageControl.currentPage = intPage;
|
||||
}
|
||||
|
||||
#pragma mark - XCGameRoomFaceContainerCellDelegate
|
||||
///选中的表情
|
||||
- (void)onSelectFace:(FaceConfigInfo *)faceInfo {
|
||||
[self.facePresenter sendFace:faceInfo roomId:[self.delegate getRoomInfo].roomId sendUser:[self.delegate getUserInfo] member:self.myMember];
|
||||
}
|
||||
|
||||
#pragma mark - FaceSourceClient
|
||||
|
||||
- (void)loadFaceSourceSuccess {
|
||||
[self loadFace];
|
||||
}
|
||||
|
||||
#pragma mark - Event
|
||||
- (void)didClickNobleSegmentAction:(UIButton *)sender {
|
||||
[TTPopup dismiss];
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceFaceClick];
|
||||
XPNobleCenterViewController * nobleVC = [[XPNobleCenterViewController alloc] initWithRoomUid:self.delegate.getRoomInfo.uid];
|
||||
[self.delegate.getCurrentNav pushViewController:nobleVC animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - private method
|
||||
|
||||
- (void)initView {
|
||||
|
||||
NSAssert(self.displayModel, @"displayMode can not be nil");
|
||||
|
||||
[self addSubview:self.effectView];
|
||||
if (self.displayModel.displayType == XCGameRoomFaceViewDisplayType_Noble) {
|
||||
[self addSubview:self.tabBarView];
|
||||
[self.tabBarView addSubview:self.titlesCollectionView];
|
||||
self.selectedFaceType = RoomFaceTypeNormal;
|
||||
self.selectedIndexPath = [NSIndexPath indexPathForRow:0 inSection:0];
|
||||
[self.tabBarView addSubview:self.nobleButton];
|
||||
}
|
||||
|
||||
[self addSubview:self.faceCollectionView];
|
||||
[self addSubview:self.pageControl];
|
||||
|
||||
[self.titlesCollectionView registerClass:[XCGameRoomFaceTitleCell class] forCellWithReuseIdentifier:@"XCGameRoomFaceTitleCell"];
|
||||
[self.faceCollectionView registerClass:[XCGameRoomFaceCell class] forCellWithReuseIdentifier:@"XCGameRoomFaceCell"];
|
||||
[self.faceCollectionView registerClass:[XCGameRoomFaceContainerCell class] forCellWithReuseIdentifier:@"XCGameRoomFaceContainerCell"];
|
||||
|
||||
if ([XPFaceParser shareParser].isLoadFace) {
|
||||
[self loadFace];
|
||||
}else {
|
||||
// [UIView showToastInKeyWindow:@"表情准备中" duration:3.0 position:(YYToastPosition)YYToastPositionBottomWithRecordButton];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)initConstrations {
|
||||
[self.effectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.mas_leading);
|
||||
make.trailing.mas_equalTo(self.mas_trailing);
|
||||
make.top.mas_equalTo(self.mas_top);
|
||||
make.bottom.mas_equalTo(self.mas_bottom);
|
||||
}];
|
||||
if (self.displayModel.displayType == XCGameRoomFaceViewDisplayType_Noble) {
|
||||
[self.tabBarView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.mas_leading);
|
||||
make.trailing.mas_equalTo(self.mas_trailing);
|
||||
make.top.mas_equalTo(self.mas_top);
|
||||
make.height.mas_equalTo(40);
|
||||
}];
|
||||
[self.titlesCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.tabBarView.mas_leading);
|
||||
make.trailing.mas_equalTo(self.tabBarView.mas_trailing);
|
||||
make.top.mas_equalTo(self.tabBarView.mas_top);
|
||||
make.bottom.mas_equalTo(self.tabBarView.mas_bottom);
|
||||
}];
|
||||
[self.nobleButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.tabBarView).mas_offset(-15);
|
||||
make.centerY.mas_equalTo(self.tabBarView);
|
||||
make.width.mas_equalTo(84);
|
||||
make.height.mas_equalTo(26);
|
||||
}];
|
||||
[self.faceCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.mas_leading);
|
||||
make.trailing.mas_equalTo(self.mas_trailing);
|
||||
make.top.mas_equalTo(self.tabBarView.mas_bottom);
|
||||
make.bottom.mas_equalTo(self.pageControl.mas_top);
|
||||
}];
|
||||
[self.pageControl mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.mas_leading);
|
||||
make.trailing.mas_equalTo(self.mas_trailing);
|
||||
make.height.mas_equalTo(40);
|
||||
make.bottom.mas_equalTo(self.mas_bottom);
|
||||
}];
|
||||
}else {
|
||||
[self.faceCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.mas_leading);
|
||||
make.trailing.mas_equalTo(self.mas_trailing);
|
||||
make.top.mas_equalTo(self.mas_top).offset(15);
|
||||
make.bottom.mas_equalTo(self.pageControl.mas_top);
|
||||
}];
|
||||
[self.pageControl mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.mas_leading);
|
||||
make.trailing.mas_equalTo(self.mas_trailing);
|
||||
make.height.mas_equalTo(40);
|
||||
make.bottom.mas_equalTo(self.mas_bottom);
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)loadFace {
|
||||
self.faceInfos = [[XPFaceParser shareParser] getFaceInfosType:self.selectedFaceType];
|
||||
|
||||
self.pageControl.currentPage = 0;
|
||||
self.pageControl.hidden = self.faceInfos.count <= 1;
|
||||
self.pageControl.numberOfPages = self.faceInfos.count;
|
||||
[self.faceCollectionView reloadData];
|
||||
}
|
||||
|
||||
- (void)getMember {
|
||||
[[self rac_queryChartRoomMemberByUid:[NSString stringWithFormat:@"%zd",self.delegate.getUserInfo.uid]] subscribeNext:^(id x) {
|
||||
NIMChatroomMember *roomOwner = x;
|
||||
if (roomOwner.isOnline) {
|
||||
self.myMember = roomOwner;
|
||||
}
|
||||
}];
|
||||
}
|
||||
/**
|
||||
根据贵族等级筛选贵族表情,只获取不大于当前等级的表情
|
||||
|
||||
@param level 当前用户贵族等级
|
||||
@discussion 如果没有贵族等级,则默认获取最低贵族男爵的表情,这里 hard code =1
|
||||
@return 贵族表情列表
|
||||
*/
|
||||
- (NSArray<FaceConfigInfo *> *)nobleFaceFilterByNobleLevel:(NSUInteger)level {
|
||||
NSArray *faces = [[[[XPFaceParser shareParser] getFaceInfosType:RoomFaceTypeNoble] copy] firstObject];
|
||||
if (faces.count == 0) {
|
||||
return @[];
|
||||
}
|
||||
|
||||
//默认获取最低贵族男爵
|
||||
if (level < 1) {
|
||||
level = 1;
|
||||
}
|
||||
|
||||
NSMutableArray *mArray = [NSMutableArray array];
|
||||
for (FaceConfigInfo *face in faces) {
|
||||
if (face.nobleId <= level) {
|
||||
[mArray addObject:face];
|
||||
}
|
||||
}
|
||||
|
||||
NSArray *conbineArray = @[];
|
||||
if (mArray.count > 0) {
|
||||
conbineArray = @[[mArray copy]];
|
||||
}
|
||||
return conbineArray;
|
||||
}
|
||||
|
||||
//根据uid获取chartroommember
|
||||
- (RACSignal *)rac_queryChartRoomMemberByUid:(NSString *)uid {
|
||||
if (uid == nil || uid.length<=0) return nil;
|
||||
return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
|
||||
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
|
||||
request.roomId = [NSString stringWithFormat:@"%zd", self.delegate.getRoomInfo.roomId];
|
||||
request.userIds = @[uid];
|
||||
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
|
||||
if (error == nil) {
|
||||
[subscriber sendNext:members.firstObject];
|
||||
[subscriber sendCompleted];
|
||||
}else {
|
||||
[subscriber sendNext:nil];
|
||||
}
|
||||
|
||||
}];
|
||||
return nil;
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getter & Setter
|
||||
- (void)setDelegate:(id<RoomHostDelegate>)delegate {
|
||||
_delegate = delegate;
|
||||
self.currentNobleLevel = self.delegate.getUserInfo.userVipInfoVO.vipLevel;
|
||||
[self getMember];
|
||||
}
|
||||
|
||||
- (UICollectionView *)titlesCollectionView {
|
||||
if (!_titlesCollectionView) {
|
||||
UICollectionViewFlowLayout *flow = [[UICollectionViewFlowLayout alloc]init];
|
||||
flow.scrollDirection = UICollectionViewScrollDirectionHorizontal;
|
||||
|
||||
flow.sectionInset = UIEdgeInsetsMake(0, 10, 0, 0);
|
||||
|
||||
_titlesCollectionView = [[UICollectionView alloc]initWithFrame:CGRectZero collectionViewLayout:flow];
|
||||
_titlesCollectionView.delegate = self;
|
||||
_titlesCollectionView.dataSource = self;
|
||||
_titlesCollectionView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _titlesCollectionView;
|
||||
}
|
||||
|
||||
- (UICollectionView *)faceCollectionView {
|
||||
if (!_faceCollectionView) {
|
||||
UICollectionViewFlowLayout *flow = [[UICollectionViewFlowLayout alloc]init];
|
||||
flow.scrollDirection = UICollectionViewScrollDirectionHorizontal;
|
||||
_faceCollectionView = [[UICollectionView alloc]initWithFrame:CGRectZero collectionViewLayout:flow];
|
||||
_faceCollectionView.delegate = self;
|
||||
_faceCollectionView.dataSource = self;
|
||||
_faceCollectionView.pagingEnabled = YES;
|
||||
_faceCollectionView.backgroundColor = [UIColor clearColor];
|
||||
_faceCollectionView.showsVerticalScrollIndicator = NO;
|
||||
_faceCollectionView.showsHorizontalScrollIndicator = NO;
|
||||
}
|
||||
return _faceCollectionView;
|
||||
}
|
||||
|
||||
- (UIVisualEffectView *)effectView {
|
||||
if (!_effectView) {
|
||||
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
|
||||
_effectView = [[UIVisualEffectView alloc]initWithEffect:effect];
|
||||
_effectView.alpha = 1;
|
||||
}
|
||||
return _effectView;
|
||||
}
|
||||
|
||||
- (UIPageControl *)pageControl {
|
||||
if (!_pageControl) {
|
||||
_pageControl = [[UIPageControl alloc]init];
|
||||
_pageControl.userInteractionEnabled = NO;
|
||||
}
|
||||
return _pageControl;
|
||||
}
|
||||
|
||||
- (UIView *)tabBarView {
|
||||
if (!_tabBarView) {
|
||||
_tabBarView = [[UIView alloc]init];
|
||||
_tabBarView.backgroundColor = UIColorRGBAlpha(0x000000, 0.2);
|
||||
}
|
||||
return _tabBarView;
|
||||
}
|
||||
|
||||
- (void)setDisplayModel:(XCGameRoomFaceViewDisplayModel *)displayModel {
|
||||
_displayModel = displayModel;
|
||||
if (displayModel.displayType == XCGameRoomFaceViewDisplayType_Noble) {
|
||||
|
||||
NSAssert(displayModel.titles.count > 0, @"if displayType is XCGameRoomFaceViewDisplayType_Noble,titles property can not be nil");
|
||||
self.titlesCollectionView.hidden = NO;
|
||||
self.frame = CGRectMake(0, 0, KScreenWidth, 274);
|
||||
}else if (displayModel.displayType == XCGameRoomFaceViewDisplayType_normal_corner) {
|
||||
self.titlesCollectionView.hidden = YES;
|
||||
|
||||
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(5, 5)];
|
||||
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
|
||||
maskLayer.frame = self.bounds;
|
||||
maskLayer.path = maskPath.CGPath;
|
||||
self.layer.mask = maskLayer;
|
||||
|
||||
self.frame = CGRectMake(0, 0, KScreenWidth, 234);
|
||||
}
|
||||
}
|
||||
|
||||
- (XPFacePresenter *)facePresenter {
|
||||
if (!_facePresenter) {
|
||||
_facePresenter = [[XPFacePresenter alloc] init];
|
||||
[_facePresenter attatchView:self];
|
||||
}
|
||||
return _facePresenter;
|
||||
}
|
||||
|
||||
- (UIButton *)nobleButton {
|
||||
if (!_nobleButton) {
|
||||
_nobleButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_nobleButton setBackgroundImage:[UIImage imageNamed:@"room_gift_noble_entrance"] forState:UIControlStateNormal];
|
||||
[_nobleButton addTarget:self action:@selector(didClickNobleSegmentAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
_nobleButton.hidden = YES;
|
||||
}
|
||||
return _nobleButton;
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPRoomFaceViewController.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@interface XPRoomFaceViewController : MvpViewController
|
||||
///房间的id
|
||||
@property (nonatomic,copy) NSString *roomId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,464 @@
|
||||
//
|
||||
// XPRoomFaceViewController.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/9.
|
||||
//
|
||||
|
||||
#import "XPRoomFaceViewController.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "XPMacro.h"
|
||||
#import "ThemeColor.h"
|
||||
#import "XPRoomFaceTool.h"
|
||||
#import "TTPopup.h"
|
||||
///Model
|
||||
#import "RoomFaceTitleItemModel.h"
|
||||
#import "RoomFaceInfoModel.h"
|
||||
#import "UserInfoModel.h"
|
||||
#import "RoomFaceSendInfoModel.h"
|
||||
#import "AttachmentModel.h"
|
||||
///View
|
||||
#import "XPRoomFaceCollectionViewCell.h"
|
||||
#import "XPRoomFaceTitleCollectionViewCell.h"
|
||||
#import "XPRoomFaceCollectionFlowLayout.h"
|
||||
#import "XPNobleCenterViewController.h"
|
||||
///P
|
||||
#import "XPRoomFacePresenter.h"
|
||||
#import "XPRoomFaceProtocol.h"
|
||||
|
||||
@interface XPRoomFaceViewController ()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout, XPRoomFaceProtocol>
|
||||
///顶部的View
|
||||
@property (nonatomic,strong) UIView * topView;
|
||||
///显示的内容
|
||||
@property (nonatomic,strong) UIView * contentView;
|
||||
///蒙版
|
||||
@property (nonatomic,strong) UIVisualEffectView *effectView;
|
||||
///最外层的容器
|
||||
@property (nonatomic,strong) UIStackView *stackView;
|
||||
///标题的容器
|
||||
@property (nonatomic,strong) UIStackView *titleStackView;
|
||||
///列表
|
||||
@property (nonatomic,strong) UICollectionView *titleCollectionView;
|
||||
///贵族特权
|
||||
@property (nonatomic,strong) UIButton *noblePrivilButton;
|
||||
///列表
|
||||
@property (nonatomic,strong) UICollectionView *faceCollectionView;
|
||||
///分页控件
|
||||
@property (nonatomic, strong) UIPageControl *pageView;
|
||||
///滑块的内容
|
||||
@property (nonatomic,strong) NSArray<RoomFaceTitleItemModel *> *titleList;
|
||||
///当前选中的
|
||||
@property (nonatomic,strong) RoomFaceTitleItemModel *selectTitleItem;
|
||||
///表情
|
||||
@property (nonatomic,strong) NSArray<RoomFaceInfoModel *> *faceList;
|
||||
///贵族表情
|
||||
@property (nonatomic,strong) NSArray<RoomFaceInfoModel *> *nobelFaceList;
|
||||
///用户信息
|
||||
@property (nonatomic,strong) UserInfoModel *userInfo;
|
||||
@end
|
||||
|
||||
@implementation XPRoomFaceViewController
|
||||
|
||||
- (XPRoomFacePresenter *)createPresenter {
|
||||
return [[XPRoomFacePresenter alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initData];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initData {
|
||||
[self.presenter getUserInfo];
|
||||
if ([XPRoomFaceTool shareFaceTool].faceDirectory) {
|
||||
[self.presenter getRoomNormalFace];
|
||||
[self.presenter getRoomNobelFace];
|
||||
} else {
|
||||
[self showLoading];
|
||||
[[XPRoomFaceTool shareFaceTool] downFaceDataCompletion:^(NSString * _Nonnull path) {
|
||||
[self hideHUD];
|
||||
if (path.length > 0) {
|
||||
[self.presenter getRoomNormalFace];
|
||||
[self.presenter getRoomNobelFace];
|
||||
} else {
|
||||
[self showErrorToast:@"加载失败请重试"];
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)initSubViews {
|
||||
self.view.backgroundColor = [UIColor clearColor];
|
||||
[self.view addSubview:self.topView];
|
||||
[self.view addSubview:self.contentView];
|
||||
|
||||
[self.contentView addSubview:self.stackView];
|
||||
|
||||
[self.stackView addArrangedSubview:self.titleStackView];
|
||||
[self.stackView addArrangedSubview:self.faceCollectionView];
|
||||
[self.stackView addArrangedSubview:self.pageView];
|
||||
|
||||
[self.titleStackView addArrangedSubview:self.titleCollectionView];
|
||||
[self.titleStackView addArrangedSubview:self.noblePrivilButton];
|
||||
self.selectTitleItem = [self.titleList firstObject];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self.view);
|
||||
make.bottom.mas_equalTo(self.contentView.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.left.mas_equalTo(self.view);
|
||||
make.bottom.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(self.stackView).offset(42 + kSafeAreaBottomHeight);
|
||||
}];
|
||||
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.contentView).inset(15);
|
||||
make.top.mas_equalTo(self.contentView);
|
||||
}];
|
||||
|
||||
|
||||
[self.titleStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(53);
|
||||
}];
|
||||
|
||||
[self.pageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(10);
|
||||
}];
|
||||
|
||||
CGFloat itemHeight = (CGFloat)(KScreenWidth - 15 * 2 - 10 * 4) / (CGFloat)5 + 20;
|
||||
CGFloat collectionViewHeight = itemHeight * 3 + 10 * 2;
|
||||
[self.faceCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(collectionViewHeight);
|
||||
}];
|
||||
|
||||
|
||||
[self.noblePrivilButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(84, 26));
|
||||
}];
|
||||
|
||||
[self.titleCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(28);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)updatePageViewState:(NSArray *)array {
|
||||
NSInteger page = 0;
|
||||
if (array.count % 15 == 0) { //刚好满页
|
||||
page = array.count / 15;
|
||||
} else {
|
||||
page = array.count / 15 + 1;
|
||||
}
|
||||
[self.pageView setNumberOfPages:page];
|
||||
self.pageView.currentPage = 0;
|
||||
}
|
||||
|
||||
- (void)sendFaceCustomMessage:(RoomFaceInfoModel *)faceInfo {
|
||||
RoomFaceSendInfoModel *sendInfo = [[RoomFaceSendInfoModel alloc]init];
|
||||
NSMutableArray *resultIndexs = [NSMutableArray array];
|
||||
if (faceInfo.resultStartPos > 0 && faceInfo.resultEndPos > 0) {
|
||||
int value;
|
||||
if (faceInfo.canResultRepeat) { //结果可以重复
|
||||
for (int i = 0; i < faceInfo.resultCount; i++) {
|
||||
value = [self getRandomNumber:(short)faceInfo.resultStartPos to:(short)faceInfo.resultEndPos];
|
||||
[resultIndexs addObject:@(value)];
|
||||
sendInfo.resultIndexes = [resultIndexs copy];
|
||||
}
|
||||
|
||||
}else {
|
||||
sendInfo.resultIndexes = [[self randomArray:(short)faceInfo.resultStartPos to:(short)faceInfo.resultEndPos count:(short)faceInfo.resultCount] mutableCopy];
|
||||
}
|
||||
|
||||
}
|
||||
NSMutableArray *faceRecieveInfos = [NSMutableArray array];
|
||||
sendInfo.nick = self.userInfo.nick;
|
||||
sendInfo.faceId = faceInfo.fid;
|
||||
sendInfo.uid = self.userInfo.uid;
|
||||
[faceRecieveInfos addObject:sendInfo.model2dictionary];
|
||||
|
||||
AttachmentModel * attachment = [[AttachmentModel alloc] init];
|
||||
attachment.first = CustomMessageType_Face;
|
||||
attachment.second = Custom_Message_Sub_Face_Send;
|
||||
NSDictionary * dic = @{@"data":faceRecieveInfos, @"uid": @(self.userInfo.uid)};
|
||||
attachment.data = dic;
|
||||
NSString *sessionID = self.roomId;
|
||||
NIMMessage *message = [[NIMMessage alloc]init];
|
||||
NIMCustomObject *object = [[NIMCustomObject alloc] init];
|
||||
object.attachment = attachment;
|
||||
message.messageObject = object;
|
||||
//构造会话
|
||||
NIMSession *session = [NIMSession session:sessionID type:NIMSessionTypeChatroom];
|
||||
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
/// 生成随机数
|
||||
/// @param from 最小值
|
||||
/// @param to 最大值
|
||||
- (int)getRandomNumber:(int)from to:(int)to {
|
||||
return (int)(from + (arc4random() % (to - from + 1)));
|
||||
}
|
||||
|
||||
/// 生成固定区间的不重复随机数
|
||||
/// @param from 最小值
|
||||
/// @param to 最大值
|
||||
- (NSArray *)randomArray:(int)from to:(int)to count:(int)count {
|
||||
|
||||
//随机数从这里边产生
|
||||
NSMutableArray *startArray= [NSMutableArray array];
|
||||
for (int i = from; i <= to; i++) {
|
||||
[startArray addObject:@(i)];
|
||||
}
|
||||
//随机数产生结果
|
||||
NSMutableArray *resultArray=[[NSMutableArray alloc] initWithCapacity:0];
|
||||
//随机数个数
|
||||
NSInteger m = count;
|
||||
for (int i=0; i<m; i++) {
|
||||
int t = arc4random()%startArray.count;
|
||||
resultArray[i]=startArray[t];
|
||||
startArray[t]=[startArray lastObject]; //为更好的乱序,故交换下位置
|
||||
[startArray removeLastObject];
|
||||
}
|
||||
return resultArray;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - scrollviewdelegate
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
CGFloat offX = scrollView.contentOffset.x;
|
||||
CGFloat width = CGRectGetWidth(scrollView.frame);
|
||||
self.pageView.currentPage = ceilf(offX/width);
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewDelegate And UICollectionViewDatasource
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (collectionView == self.titleCollectionView) {
|
||||
RoomFaceTitleItemModel * itemModel = [self.titleList objectAtIndex:indexPath.row];
|
||||
CGSize size = [itemModel.title boundingRectWithSize:CGSizeMake(100, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine
|
||||
attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13]} context:nil].size;
|
||||
return CGSizeMake(size.width + 10, size.height);
|
||||
}
|
||||
CGFloat itemWidth = (CGFloat)(KScreenWidth - 15 * 2 - 10 * 4) / (CGFloat)5;
|
||||
return CGSizeMake(itemWidth, itemWidth + 20);
|
||||
}
|
||||
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
if (collectionView == self.titleCollectionView) {
|
||||
return self.titleList.count;
|
||||
}
|
||||
return self.selectTitleItem.faceType == RoomFaceTitleItemType_Normal? self.faceList.count : self.nobelFaceList.count;
|
||||
}
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (collectionView == self.titleCollectionView) {
|
||||
XPRoomFaceTitleCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPRoomFaceTitleCollectionViewCell class]) forIndexPath:indexPath];
|
||||
RoomFaceTitleItemModel * model = [self.titleList objectAtIndex:indexPath.item];
|
||||
if (model == self.selectTitleItem) {
|
||||
model.isSelect = YES;
|
||||
} else {
|
||||
model.isSelect = NO;
|
||||
}
|
||||
cell.titleModel = model;
|
||||
return cell;
|
||||
}
|
||||
|
||||
XPRoomFaceCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPRoomFaceCollectionViewCell class]) forIndexPath:indexPath];
|
||||
RoomFaceInfoModel * faceInfo;
|
||||
if (self.selectTitleItem.faceType == RoomFaceTitleItemType_Normal) {
|
||||
faceInfo = [self.faceList objectAtIndex:indexPath.row];
|
||||
} else {
|
||||
faceInfo = [self.nobelFaceList objectAtIndex:indexPath.row];
|
||||
}
|
||||
cell.vipLevel = self.userInfo.userVipInfoVO.vipLevel;
|
||||
cell.faceInfo =faceInfo;
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (collectionView == self.titleCollectionView) {
|
||||
RoomFaceTitleItemModel * titleModel = [self.titleList objectAtIndex:indexPath.row];
|
||||
self.selectTitleItem = titleModel;
|
||||
[self.titleCollectionView reloadData];
|
||||
NSArray * list = titleModel.faceType == RoomFaceTitleItemType_Normal ? self.faceList : self.nobelFaceList;
|
||||
[self updatePageViewState:list];
|
||||
[self.faceCollectionView reloadData];
|
||||
} else {
|
||||
if (self.selectTitleItem.faceType == RoomFaceTitleItemType_Normal) {
|
||||
RoomFaceInfoModel * faceInfo = [self.faceList objectAtIndex:indexPath.row];
|
||||
[self sendFaceCustomMessage:faceInfo];
|
||||
} else {
|
||||
if (indexPath.row < self.nobelFaceList.count) {
|
||||
RoomFaceInfoModel * faceInfo = [self.nobelFaceList objectAtIndex:indexPath.row];
|
||||
if (faceInfo.faceVipInfo.vipLevel > self.userInfo.userVipInfoVO.vipLevel) {
|
||||
NSString * title = [NSString stringWithFormat:@"尚未达到发送%@所需贵族等级,\n 所需贵族等级:%@", faceInfo.name,faceInfo.faceVipInfo.vipName];
|
||||
[TTPopup alertWithMessage:title confirmHandler:^{
|
||||
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
} else {
|
||||
[self sendFaceCustomMessage:faceInfo];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPRoomFaceProtocol
|
||||
- (void)getRoomNormalFaceListSuccess:(NSArray *)list {
|
||||
self.faceList = list;
|
||||
[self updatePageViewState:list];
|
||||
[self.faceCollectionView reloadData];
|
||||
}
|
||||
|
||||
- (void)getRoomVipFaceListSuccess:(NSArray *)list {
|
||||
self.nobelFaceList = list;
|
||||
[self.faceCollectionView reloadData];
|
||||
}
|
||||
|
||||
- (void)getUserInfoSuccess:(UserInfoModel *)userInfo {
|
||||
self.userInfo = userInfo;
|
||||
[self.faceCollectionView reloadData];
|
||||
}
|
||||
#pragma mark - Event Response
|
||||
- (void)noblePrivilButtonAction:(UIButton *)sender {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
XPNobleCenterViewController * nobleCenter = [[XPNobleCenterViewController alloc] init];
|
||||
[((UINavigationController *)self.presentingViewController) pushViewController:nobleCenter animated:YES];
|
||||
}
|
||||
|
||||
- (void)disMissViewRecognizer {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UIView *)topView {
|
||||
if (!_topView) {
|
||||
_topView = [[UIView alloc] init];
|
||||
_topView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.3];
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMissViewRecognizer)];
|
||||
[_topView addGestureRecognizer:tap];
|
||||
}
|
||||
return _topView;
|
||||
}
|
||||
|
||||
- (UIView *)contentView {
|
||||
if (!_contentView) {
|
||||
_contentView = [[UIView alloc] init];
|
||||
_contentView.backgroundColor = UIColorFromRGB(0x0D0C11);
|
||||
}
|
||||
return _contentView;
|
||||
}
|
||||
|
||||
- (UIVisualEffectView *)effectView {
|
||||
if (!_effectView) {
|
||||
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
|
||||
_effectView = [[UIVisualEffectView alloc]initWithEffect:effect];
|
||||
_effectView.alpha = 1;
|
||||
}
|
||||
return _effectView;
|
||||
}
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisVertical;
|
||||
_stackView.distribution = UIStackViewDistributionFill;
|
||||
_stackView.alignment = UIStackViewAlignmentFill;
|
||||
_stackView.spacing =10;
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
|
||||
- (UIStackView *)titleStackView {
|
||||
if (!_titleStackView) {
|
||||
_titleStackView = [[UIStackView alloc] init];
|
||||
_titleStackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_titleStackView.distribution = UIStackViewDistributionFill;
|
||||
_titleStackView.alignment = UIStackViewAlignmentBottom;
|
||||
_titleStackView.spacing = 10;
|
||||
CAShapeLayer * layer = [CAShapeLayer layer];
|
||||
UIBezierPath * path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, KScreenWidth, 53) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(12, 12)];
|
||||
layer.path = path.CGPath;
|
||||
_titleStackView.layer.masksToBounds = YES;
|
||||
_titleStackView.layer.mask = layer;;
|
||||
}
|
||||
return _titleStackView;
|
||||
}
|
||||
|
||||
- (UIButton *)noblePrivilButton {
|
||||
if (!_noblePrivilButton) {
|
||||
_noblePrivilButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_noblePrivilButton setImage:[UIImage imageNamed:@"room_face_nobel_privil"] forState:UIControlStateNormal];
|
||||
[_noblePrivilButton setImage:[UIImage imageNamed:@"room_face_nobel_privil"] forState:UIControlStateSelected];
|
||||
[_noblePrivilButton addTarget:self action:@selector(noblePrivilButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_noblePrivilButton setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
}
|
||||
return _noblePrivilButton;
|
||||
}
|
||||
|
||||
|
||||
- (UICollectionView *)titleCollectionView{
|
||||
if (!_titleCollectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
|
||||
layout.minimumLineSpacing = 15;
|
||||
_titleCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_titleCollectionView.dataSource = self;
|
||||
_titleCollectionView.delegate = self;
|
||||
_titleCollectionView.backgroundColor = [UIColor clearColor];
|
||||
[_titleCollectionView registerClass:[XPRoomFaceTitleCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPRoomFaceTitleCollectionViewCell class])];
|
||||
}
|
||||
return _titleCollectionView;
|
||||
}
|
||||
|
||||
- (UICollectionView *)faceCollectionView{
|
||||
if (!_faceCollectionView) {
|
||||
XPRoomFaceCollectionFlowLayout *layout = [[XPRoomFaceCollectionFlowLayout alloc] init];
|
||||
layout.minimumLineSpacing = 10;
|
||||
layout.minimumInteritemSpacing = 10;
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0);
|
||||
_faceCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_faceCollectionView.dataSource = self;
|
||||
_faceCollectionView.delegate = self;
|
||||
_faceCollectionView.backgroundColor = [UIColor clearColor];
|
||||
_faceCollectionView.pagingEnabled = YES;
|
||||
[_faceCollectionView registerClass:[XPRoomFaceCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPRoomFaceCollectionViewCell class])];
|
||||
}
|
||||
return _faceCollectionView;
|
||||
}
|
||||
|
||||
- (UIPageControl *)pageView {
|
||||
if (!_pageView) {
|
||||
_pageView = [[UIPageControl alloc] init];
|
||||
_pageView.currentPageIndicatorTintColor = [UIColor whiteColor];
|
||||
}
|
||||
return _pageView;
|
||||
}
|
||||
|
||||
- (NSArray<RoomFaceTitleItemModel *> *)titleList {
|
||||
if (!_titleList) {
|
||||
RoomFaceTitleItemModel * normalItem = [[RoomFaceTitleItemModel alloc] init];
|
||||
normalItem.title= @"表情";
|
||||
normalItem.isSelect = YES;
|
||||
normalItem.faceType = RoomFaceTitleItemType_Normal;
|
||||
|
||||
RoomFaceTitleItemModel * nobelItem = [[RoomFaceTitleItemModel alloc] init];
|
||||
nobelItem.title= @"贵族表情";
|
||||
nobelItem.isSelect = NO;
|
||||
nobelItem.faceType = RoomFaceTitleItemType_Nobel;
|
||||
_titleList = @[normalItem, nobelItem];
|
||||
}
|
||||
return _titleList;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -1,63 +0,0 @@
|
||||
//
|
||||
// FaceImageTool.h
|
||||
// BberryCore
|
||||
//
|
||||
// Created by 何卫明 on 2017/12/8.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "FaceConfigInfo.h"
|
||||
#import "FaceReceiveInfo.h"
|
||||
//#import "FaceCore.h"
|
||||
|
||||
typedef void(^IsFinish)(BOOL isFinish);
|
||||
|
||||
@interface FaceImageTool : NSObject
|
||||
|
||||
+ (instancetype)shareFaceImageTool;
|
||||
|
||||
|
||||
/**
|
||||
查询并生成结果图
|
||||
|
||||
@param receiveInfo 收到表情的对象
|
||||
@param imageView 展示表情的ImageView
|
||||
@param animation 是否展示表情动画
|
||||
@parm dragon 是否是龙珠
|
||||
@param success 成功
|
||||
@param failure 失败
|
||||
@param isFinish 动画是不是结束了
|
||||
*/
|
||||
- (void)queryImage:(FaceReceiveInfo *)receiveInfo
|
||||
imageView:(UIImageView *)imageView
|
||||
dragon:(BOOL)dragon
|
||||
needAniomation:(BOOL)animation
|
||||
success:(void (^)(FaceReceiveInfo *info,UIImage *lastImage))success
|
||||
failure:(void (^)(NSError *))failure
|
||||
isFinish:(void (^)(BOOL isFinish))isFinish;
|
||||
|
||||
/**
|
||||
查询并生成结果图
|
||||
|
||||
@param receiveInfo 收到表情的对象
|
||||
@param imageView 展示表情的ImageView
|
||||
@param animation 是否展示表情动画
|
||||
@parm dragon 是否是龙珠
|
||||
@param success 成功
|
||||
@param failure 失败
|
||||
*/
|
||||
|
||||
- (void)queryImage:(FaceReceiveInfo *)receiveInfo
|
||||
imageView:(UIImageView *)imageView
|
||||
dragon:(BOOL)dragon
|
||||
needAniomation:(BOOL)animation
|
||||
success:(void (^)(FaceReceiveInfo *info,UIImage *lastImage))success
|
||||
failure:(void (^)(NSError *))failure;
|
||||
|
||||
//- (void)saveImageWithArr:(NSMutableArray<FaceReceiveInfo *> *)faceRecieveInfos
|
||||
// imageView:(UIImageView *)imageView
|
||||
// success:(void (^)(NSMutableArray<FaceReceiveInfo *> *))success
|
||||
// failure:(void (^)(NSError *))failure;
|
||||
|
||||
@end
|
@@ -1,442 +0,0 @@
|
||||
//
|
||||
// FaceImageTool.m
|
||||
// BberryCore
|
||||
//
|
||||
// Created by 何卫明 on 2017/12/8.
|
||||
// Copyright © 2017年 chenran. All rights reserved.
|
||||
//
|
||||
|
||||
#import "FaceImageTool.h"
|
||||
//#import "FaceCoreClient.h"
|
||||
#import "GCDHelper.h"
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import "XPFaceParser.h"
|
||||
|
||||
#define SPACES 15
|
||||
@interface FaceImageTool () <CAAnimationDelegate>
|
||||
|
||||
@property (nonatomic, copy) IsFinish isFinish;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
@implementation FaceImageTool {
|
||||
dispatch_queue_t faceQueue;
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
faceQueue = dispatch_queue_create("com.yy.face.xcface.creatFace", DISPATCH_QUEUE_SERIAL);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
+ (instancetype)shareFaceImageTool
|
||||
{
|
||||
static dispatch_once_t onceToken = 0;
|
||||
static id instance;
|
||||
dispatch_once(&onceToken, ^{
|
||||
instance = [[self alloc] init];
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
|
||||
#pragma mark - CAAnimationDelegate
|
||||
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{
|
||||
@weakify(self);
|
||||
dispatch_main_sync_safe(^{
|
||||
@strongify(self);
|
||||
if (self.isFinish) {
|
||||
self.isFinish(flag);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
- (void)queryImage:(FaceReceiveInfo *)receiveInfo
|
||||
imageView:(UIImageView *)imageView
|
||||
dragon:(BOOL)dragon
|
||||
needAniomation:(BOOL)animation
|
||||
success:(void (^)(FaceReceiveInfo *info,UIImage *lastImage))success
|
||||
failure:(void (^)(NSError *))failure {
|
||||
|
||||
__block CGSize size = imageView.frame.size;
|
||||
UIImage * result;
|
||||
if (receiveInfo.resultIndexes.count > 0) {
|
||||
if (dragon) {
|
||||
result = [self dragoncombineImageInOne:receiveInfo size:size];
|
||||
}else {
|
||||
result = [self combineImageInOne:receiveInfo size:size];
|
||||
}
|
||||
|
||||
receiveInfo.resultImage = result;
|
||||
}
|
||||
dispatch_main_sync_safe(^{
|
||||
success(receiveInfo,result);
|
||||
if(animation){
|
||||
[self addAnimateInImageView:imageView receiveInfo:receiveInfo];
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
- (void)queryImage:(FaceReceiveInfo *)receiveInfo
|
||||
imageView:(UIImageView *)imageView
|
||||
dragon:(BOOL)dragon
|
||||
needAniomation:(BOOL)animation
|
||||
success:(void (^)(FaceReceiveInfo *info,UIImage *lastImage))success
|
||||
failure:(void (^)(NSError *))failure
|
||||
isFinish:(void (^)(BOOL isFinish))isFinish{
|
||||
self.isFinish = isFinish;
|
||||
[self queryImage:receiveInfo imageView:imageView dragon:dragon needAniomation:animation success:success failure:failure];
|
||||
}
|
||||
|
||||
|
||||
- (void)addAnimateInImageView:(UIImageView *)imageView receiveInfo:(FaceReceiveInfo *)receiveInfo {
|
||||
FaceConfigInfo *configInfo = [[XPFaceParser shareParser] findFaceInfoById:receiveInfo.faceId];
|
||||
if (receiveInfo.resultIndexes.count > 0) {
|
||||
/*==================== 动画数组 ================= */
|
||||
//创建CAKeyframeAnimation
|
||||
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"contents"];
|
||||
animation.duration = configInfo.animDuration / 1000.0;
|
||||
animation.delegate = self;
|
||||
animation.repeatCount = configInfo.animRepeatCount;
|
||||
animation.removedOnCompletion = YES;
|
||||
animation.calculationMode = kCAAnimationDiscrete;
|
||||
|
||||
//存放图片的数组
|
||||
NSMutableArray *faceArray = [NSMutableArray array];
|
||||
|
||||
for (int i = (short)configInfo.animStartPos; i <= (short)configInfo.animEndPos; i ++) {
|
||||
UIImage *image = [[XPFaceParser shareParser] findFaceImageByConfig:configInfo index:i];
|
||||
if (image) {
|
||||
CGImageRef cgimg = image.CGImage;
|
||||
[faceArray addObject:(__bridge UIImage *)cgimg];
|
||||
}else {
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if (faceArray.count > 0) {
|
||||
animation.values = faceArray;
|
||||
}else {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*==================== 结果数组 ================= */
|
||||
CAKeyframeAnimation *resultAnimation = [CAKeyframeAnimation animationWithKeyPath:@"contents"];
|
||||
resultAnimation.duration = 3;
|
||||
resultAnimation.delegate = self;
|
||||
resultAnimation.beginTime = configInfo.animRepeatCount * configInfo.animDuration / 1000.0;
|
||||
//存放图片的数组
|
||||
NSMutableArray *resultArray = [NSMutableArray array];
|
||||
|
||||
if (receiveInfo.resultImage) {
|
||||
[resultArray addObject:(__bridge UIImage *)receiveInfo.resultImage.CGImage];
|
||||
}else {
|
||||
return;
|
||||
}
|
||||
if (resultArray.count > 0) {
|
||||
resultAnimation.values = resultArray;
|
||||
}else {
|
||||
return;
|
||||
}
|
||||
|
||||
resultAnimation.removedOnCompletion = YES;
|
||||
|
||||
CAAnimationGroup *group = [CAAnimationGroup animation];
|
||||
group.animations = @[animation,resultAnimation];
|
||||
group.duration = 3 + (configInfo.animDuration / 1000.0) * configInfo.animRepeatCount;
|
||||
group.delegate = self;
|
||||
[imageView.layer addAnimation:group forKey:nil];
|
||||
|
||||
// [imageView setImage:receiveInfo.resultImage];
|
||||
} else {
|
||||
/*==================== 动画数组 ================= */
|
||||
//创建CAKeyframeAnimation
|
||||
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"contents"];
|
||||
animation.duration = configInfo.animDuration / 1000.0;
|
||||
animation.delegate = self;
|
||||
animation.repeatCount = configInfo.animRepeatCount;
|
||||
animation.removedOnCompletion = YES;
|
||||
animation.calculationMode = kCAAnimationDiscrete;
|
||||
//存放图片的数组
|
||||
NSMutableArray *faceArray = [NSMutableArray array];
|
||||
|
||||
for (int i = (short)configInfo.animStartPos; i <= (short)configInfo.animEndPos; i ++) {
|
||||
UIImage *image = [[XPFaceParser shareParser] findFaceImageByConfig:configInfo index:i];
|
||||
if (image) {
|
||||
CGImageRef cgimg = image.CGImage;
|
||||
[faceArray addObject:(__bridge UIImage *)cgimg];
|
||||
}else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (faceArray.count > 0) {
|
||||
animation.values = faceArray;
|
||||
[imageView.layer removeAnimationForKey:@"face"];
|
||||
[imageView.layer addAnimation:animation forKey:@"face"];
|
||||
}else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//- (void)saveImageWithArr:(NSMutableArray<FaceReceiveInfo *> *)faceRecieveInfos
|
||||
// imageView:(UIImageView *)imageView
|
||||
// success:(void (^)(NSMutableArray<FaceReceiveInfo *> *))success
|
||||
// failure:(void (^)(NSError *))failure{
|
||||
// __block CGSize size = imageView.frame.size;
|
||||
// @weakify(self);
|
||||
// dispatch_async(faceQueue, ^{
|
||||
// @strongify(self);
|
||||
// for (FaceReceiveInfo *item in faceRecieveInfos) {
|
||||
// if (item.resultIndexes.count > 0) { //运气表情
|
||||
//
|
||||
// __block UIImage * result = [self combineImageInOne:item size:size];
|
||||
// item.resultImage = result;
|
||||
// }else { //普通表情
|
||||
//// FaceConfigInfo *configInfo = [GetCore(FaceCore)findFaceInfoById:item.faceId];
|
||||
//// UIImage *singleImage = [GetCore(FaceCore)findFaceImageById:faceInfo.faceId index:index];
|
||||
//// item.resultImage =
|
||||
// }
|
||||
// }
|
||||
// dispatch_main_sync_safe(^{
|
||||
// success(faceRecieveInfos);
|
||||
// });
|
||||
// });
|
||||
//
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
- (UIImage *)combineImageInOne:(FaceReceiveInfo *)faceInfo size:(CGSize)size {
|
||||
UIImage *result;
|
||||
NSInteger faceCount = faceInfo.resultIndexes.count > 9 ? 9 : faceInfo.resultIndexes.count;
|
||||
|
||||
CGFloat x = 0;
|
||||
CGFloat y = 0;
|
||||
|
||||
CGFloat width = 0.0;
|
||||
CGFloat height;
|
||||
CGFloat whBit = 174.0 / 128.0;
|
||||
switch (faceInfo.resultIndexes.count) {
|
||||
case 1:
|
||||
{
|
||||
width = size.width;
|
||||
height = width / whBit;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
{
|
||||
width = size.width / 2;
|
||||
height = width / whBit;
|
||||
// height = size.height / 2;
|
||||
// height =
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
{
|
||||
width = size.width / 3;
|
||||
height = width / whBit;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
width = 0;
|
||||
height = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
CGFloat spaceX3 = 0; //三张图时的X间距
|
||||
CGFloat spaceX2 = (size.width - width * 2) / 2; //两张图时的X边距
|
||||
CGFloat spaceX1 = (size.width - width) / 2; //一张图时的X边距
|
||||
|
||||
CGFloat spaceY3 = 0; //三张图时的Y间距
|
||||
CGFloat spaceY2 = (size.height - height * 2) / 2; //两张图时的Y间距
|
||||
CGFloat spaceY1 = (size.height - height) / 2; //一张图时的Y间距
|
||||
|
||||
y = faceCount > 6 ? spaceY3 : (faceCount >= 3 ? spaceY2 : spaceY1);
|
||||
x = faceCount % 3 == 0 && faceCount > 3 ? spaceX3 : (faceCount % 3 == 2 ? spaceX2 : spaceX1);
|
||||
|
||||
|
||||
UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);
|
||||
for (int i = 0; i < faceCount; i++) {
|
||||
NSInteger index = [faceInfo.resultIndexes[i] integerValue];
|
||||
FaceConfigInfo *configInfo = [[XPFaceParser shareParser] findFaceInfoById:faceInfo.faceId];
|
||||
UIImage *singleImage = [[XPFaceParser shareParser] findFaceImageById:faceInfo.faceId index:index];
|
||||
|
||||
if (faceCount == 1) { //只有一张图片的时候直接返回不做处理
|
||||
return singleImage;
|
||||
break;
|
||||
}
|
||||
|
||||
if (configInfo.displayType == XCFaceDisplayTypeFlow) {
|
||||
[singleImage drawInRect:CGRectMake(x, y, width, height)];
|
||||
// x = width * (i % 3);
|
||||
if (i % 3 == 0) { // 换行
|
||||
y += (height + spaceY3);
|
||||
x = spaceX3;
|
||||
}
|
||||
else if (i == 2 && faceCount == 3) { // 换行,只有三个时
|
||||
y += (height + spaceY3);
|
||||
x = spaceX2;
|
||||
}
|
||||
else {
|
||||
x += (width + spaceX3);
|
||||
}
|
||||
// y =
|
||||
}else if (configInfo.displayType == XCFaceDisplayTypeOverLay) {
|
||||
CGFloat whBit = singleImage.size.width / singleImage.size.height;
|
||||
width = size.width - (faceInfo.resultIndexes.count - 1) * SPACES;
|
||||
height = width / whBit;
|
||||
x = 0 + i * SPACES;
|
||||
y = size.height / 2 - height / 2;
|
||||
[singleImage drawInRect:CGRectMake(x, y, width, height)];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
result = UIGraphicsGetImageFromCurrentImageContext();
|
||||
UIGraphicsEndImageContext();
|
||||
return result;
|
||||
}
|
||||
|
||||
//龙珠处理
|
||||
|
||||
|
||||
- (UIImage *)dragoncombineImageInOne:(FaceReceiveInfo *)faceInfo size:(CGSize)size {
|
||||
UIImage *result;
|
||||
NSInteger faceCount = faceInfo.resultIndexes.count > 9 ? 9 : faceInfo.resultIndexes.count;
|
||||
|
||||
CGFloat x = 0;
|
||||
CGFloat y = 0;
|
||||
|
||||
CGFloat width = 0.0;
|
||||
CGFloat height;
|
||||
// CGFloat whBit = 74 / 106.0;
|
||||
CGFloat whBit = 1;
|
||||
switch (faceInfo.resultIndexes.count) {
|
||||
case 1:
|
||||
{
|
||||
width = size.width;
|
||||
height = width / whBit;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
{
|
||||
width = size.width / 2;
|
||||
height = width / whBit;
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
{
|
||||
width = size.width / 3;
|
||||
height = width / whBit;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
width = 0;
|
||||
height = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
CGFloat spaceX3 = 0; //三张图时的X间距
|
||||
CGFloat spaceX2 = (size.width - width * 2) / 2; //两张图时的X边距
|
||||
CGFloat spaceX1 = (size.width - width) / 2; //一张图时的X边距
|
||||
|
||||
CGFloat spaceY3 = 0; //三张图时的Y间距
|
||||
CGFloat spaceY2 = (size.height - height * 2) / 2; //两张图时的Y间距
|
||||
CGFloat spaceY1 = (size.height - height) / 2; //一张图时的Y间距
|
||||
|
||||
y = faceCount > 6 ? spaceY3 : (faceCount >= 3 ? spaceY2 : spaceY1);
|
||||
x = faceCount % 3 == 0 && faceCount > 3 ? spaceX3 : (faceCount % 3 == 2 ? spaceX2 : spaceX1);
|
||||
|
||||
|
||||
UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);
|
||||
FaceConfigInfo *configInfo = [[XPFaceParser shareParser] findFaceInfoById:faceInfo.faceId];
|
||||
if (configInfo.displayType == XCFaceDisplayTypeOnlyOneLine) {
|
||||
UIImage *singleImage = [[XPFaceParser shareParser] findFaceImageById:faceInfo.faceId index:configInfo.animStartPos];
|
||||
[singleImage drawInRect:CGRectMake(0, 0, size.width, size.height)];
|
||||
}
|
||||
|
||||
for (int i = 0; i < faceCount; i++) {
|
||||
NSInteger index = [faceInfo.resultIndexes[i] integerValue];
|
||||
// FaceConfigInfo *configInfo = [GetCore(FaceCore)findFaceInfoById:faceInfo.faceId];
|
||||
UIImage *singleImage = [[XPFaceParser shareParser] findFaceImageById:faceInfo.faceId index:index];
|
||||
|
||||
if (faceCount == 1) { //只有一张图片的时候直接返回不做处理
|
||||
return singleImage;
|
||||
break;
|
||||
}
|
||||
|
||||
if (configInfo.displayType == XCFaceDisplayTypeFlow) {
|
||||
[singleImage drawInRect:CGRectMake(x, y, width, height)];
|
||||
|
||||
if (i % 3 == 0) { // 换行
|
||||
y += (height + spaceY3);
|
||||
x = spaceX3;
|
||||
}
|
||||
else if (i == 2 && faceCount == 3) { // 换行,只有三个时
|
||||
y += (height + spaceY3);
|
||||
x = spaceX2;
|
||||
}
|
||||
else {
|
||||
x += (width + spaceX3);
|
||||
}
|
||||
|
||||
}else if (configInfo.displayType == XCFaceDisplayTypeOverLay) {
|
||||
CGFloat whBit = singleImage.size.width / singleImage.size.height;
|
||||
width = size.width - (faceInfo.resultIndexes.count - 1) * SPACES;
|
||||
height = width / whBit;
|
||||
x = 0 + i * SPACES;
|
||||
y = size.height / 2 - height / 2;
|
||||
[singleImage drawInRect:CGRectMake(x, y, width, height)];
|
||||
}else if (configInfo.displayType == XCFaceDisplayTypeOnlyOneLine) {
|
||||
CGFloat whBit = singleImage.size.width / singleImage.size.height;
|
||||
width = (size.width-SPACES*2)/faceCount;
|
||||
height = width / whBit;
|
||||
x = width*i+SPACES;
|
||||
y = size.height / 2 - height / 2;
|
||||
[singleImage drawInRect:CGRectMake(x, y, width, height)];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
result = UIGraphicsGetImageFromCurrentImageContext();
|
||||
UIGraphicsEndImageContext();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
@@ -1,114 +0,0 @@
|
||||
//
|
||||
// XPFaceParser.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/8.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "FaceInfo.h"
|
||||
#import "FaceConfigInfo.h"
|
||||
#import "AttachmentModel.h"
|
||||
#import "XCGameRoomFaceTitleDisplayModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPFaceParser : NSObject
|
||||
|
||||
+ (instancetype)shareParser;
|
||||
|
||||
- (void)getFaceDataSuccess:(NSArray *)array;
|
||||
|
||||
@property (copy, nonatomic) NSString *version;
|
||||
@property (copy, nonatomic) NSString *zipMd5;
|
||||
@property (strong, nonatomic) NSURL *zipUrl;
|
||||
|
||||
@property (assign, nonatomic) BOOL isShowingFace;
|
||||
@property (copy, nonatomic) NSString *destinationUrl;
|
||||
@property (assign, nonatomic) BOOL isLoadFace;
|
||||
|
||||
/**
|
||||
清除表情的内存缓存(收到内存警告的时候使用)
|
||||
*/
|
||||
- (void)cleanFaceMemoryCache;
|
||||
|
||||
/**
|
||||
获取表情列表
|
||||
|
||||
@return 表情列表
|
||||
*/
|
||||
- (NSMutableArray *)getFaceInfosType:(RoomFaceType)faceType;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
是否正在播放表情
|
||||
|
||||
@return return value description
|
||||
*/
|
||||
- (BOOL)getShowingFace;
|
||||
|
||||
/**
|
||||
通过表情ID找表情
|
||||
|
||||
@param faceId 表情ID
|
||||
@return 表情信息
|
||||
*/
|
||||
- (FaceConfigInfo *)findFaceInfoById:(NSInteger)faceId;
|
||||
|
||||
|
||||
/**
|
||||
通过表情ID查到图片对象
|
||||
|
||||
@param faceId 表情ID
|
||||
@return 表情图片对象
|
||||
*/
|
||||
- (UIImage *)findFaceIconImageById:(NSInteger)faceId;
|
||||
|
||||
|
||||
/**
|
||||
通过表情ID与Index找图片对象
|
||||
|
||||
@param faceId 表情ID
|
||||
@param index 表情Index
|
||||
@return 表情对象
|
||||
*/
|
||||
- (UIImage *)findFaceImageById:(NSInteger)faceId index:(NSInteger)index;
|
||||
|
||||
|
||||
/**
|
||||
通过表情ConfigInfo查找图片
|
||||
|
||||
@param configInfo 表情配置
|
||||
@param index 位置pos
|
||||
@return 表情图片对象
|
||||
*/
|
||||
- (UIImage *)findFaceImageByConfig:(FaceConfigInfo *)configInfo index:(NSInteger)index;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
通过Config查找图片数组
|
||||
|
||||
@param configInfo 表情配置
|
||||
@return 表情图片对象数组
|
||||
*/
|
||||
- (NSMutableArray<UIImage *> *)findFaceFrameArrByConfig:(FaceConfigInfo *)configInfo;
|
||||
|
||||
|
||||
/**
|
||||
通过FaceId查找图片对象数组
|
||||
|
||||
@param faceId 表情ID
|
||||
@return 图片对象数组
|
||||
*/
|
||||
- (NSMutableArray<UIImage *> *)findFaceFrameArrByFaceId:(NSInteger)faceId;
|
||||
|
||||
/**
|
||||
测试使用接口,发送一起玩表情
|
||||
*/
|
||||
- (void)startFaceTimer;
|
||||
- (void)cancelFaceTimer;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,319 +0,0 @@
|
||||
//
|
||||
// XPFaceParser.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/8.
|
||||
//
|
||||
|
||||
#import "XPFaceParser.h"
|
||||
///tool
|
||||
#import "FaceInfoStorage.h"
|
||||
#import "YYWebResourceDownloader.h"
|
||||
#import "CommonFileUtils.h"
|
||||
#import "SSKeychain.h"
|
||||
#import "SSZipArchive.h"
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import "GCDHelper.h"
|
||||
///third
|
||||
#import "NSObject+MJExtension.h"
|
||||
#import <MJExtension/MJExtension.h>
|
||||
// model
|
||||
#import "AttachmentModel.h"
|
||||
#import "FacePlayInfo.h"
|
||||
#import "FaceConfigInfo.h"
|
||||
#import "FaceReceiveInfo.h"
|
||||
#import "FaceSendInfo.h"
|
||||
#import "FaceInfo.h"
|
||||
|
||||
@interface XPFaceParser()
|
||||
<
|
||||
SSZipArchiveDelegate
|
||||
>
|
||||
|
||||
#define RETRYCOUNT 5;
|
||||
|
||||
@property(nonatomic, strong)NSMutableArray *faceInfos; //FaceConfigInfo
|
||||
@property(nonatomic, strong)NSMutableArray *tempFaceInfos; //获取下来的新数据,需要等新的zip包下载完才会去复制到faceInfos
|
||||
@property (strong, nonatomic) NSCache *faceCache;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPFaceParser
|
||||
{
|
||||
dispatch_queue_t zipQueue;
|
||||
}
|
||||
|
||||
+ (instancetype)shareParser {
|
||||
static dispatch_once_t onceToken;
|
||||
static XPFaceParser * parser;
|
||||
dispatch_once(&onceToken, ^{
|
||||
parser = [[XPFaceParser alloc] init];
|
||||
});
|
||||
return parser;
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
zipQueue = dispatch_queue_create("com.yy.face.xcface.unzipFace", DISPATCH_QUEUE_SERIAL);
|
||||
_faceInfos = [FaceInfoStorage getFaceInfos];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)cleanFaceMemoryCache {
|
||||
[self.faceCache removeAllObjects];
|
||||
}
|
||||
|
||||
- (void)faceDownloadManager {
|
||||
NSString *version = [[NSUserDefaults standardUserDefaults]objectForKey:@"faceJsonVersion"];
|
||||
if (version) {
|
||||
if ([version integerValue] < [self.version integerValue]) {
|
||||
[self downloadZipForFace];
|
||||
return;
|
||||
}else {
|
||||
self.isLoadFace = YES;
|
||||
[self syncTheTmpJsonToNormalJson];//save
|
||||
self.destinationUrl = [self getDestinationUrlStr];
|
||||
}
|
||||
}else {
|
||||
[self downloadZipForFace];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)syncTheTmpJsonToNormalJson {
|
||||
self.faceInfos = [self.tempFaceInfos mutableCopy];
|
||||
NSArray *array = [FaceConfigInfo mj_keyValuesArrayWithObjectArray:self.faceInfos];
|
||||
[FaceInfoStorage saveFaceInfos:[array toJSONString]];
|
||||
}
|
||||
|
||||
- (void)downloadZipForFace {
|
||||
if ([self.zipUrl absoluteString].length > 0 && [[self.zipUrl absoluteString] containsString:@"http"]) {
|
||||
@weakify(self);
|
||||
[[YYWebResourceDownloader sharedDownloader]downloadWithURL:self.zipUrl fileName:@"face.zip" options:(YYWebResourceDownloaderOptions)YYWebResourceDownloaderProgressiveDownload progress:^(int64_t received, int64_t expected, CGFloat progress) {
|
||||
|
||||
} completion:^(NSURL *filePath, NSError *error, BOOL finished) {
|
||||
|
||||
@strongify(self);
|
||||
if (error == nil) {
|
||||
NSString *desPath = [self getFaceImagePath];
|
||||
[CommonFileUtils createDirForPath:desPath];
|
||||
NSString *filePathStr = [filePath path];
|
||||
NSString *fileMD5Str = [CommonFileUtils getFileMD5WithPath:filePathStr];
|
||||
fileMD5Str = [fileMD5Str uppercaseString];
|
||||
if (![self.zipMd5 isEqualToString:fileMD5Str]) { //MD5校验 如果不相等就重新下载
|
||||
[self performSelector:@selector(downloadZipForFace) withObject:nil afterDelay:3];
|
||||
}else {
|
||||
dispatch_async(self->zipQueue, ^{ //子线程解压
|
||||
|
||||
[SSZipArchive unzipFileAtPath:filePathStr toDestination:desPath overwrite:YES password:nil progressHandler:^(NSString * _Nonnull entry, unz_file_info zipInfo, long entryNumber, long total) {
|
||||
|
||||
} completionHandler:^(NSString * _Nonnull path, BOOL succeeded, NSError * _Nullable error) {
|
||||
dispatch_main_sync_safe(^{
|
||||
if (succeeded) {
|
||||
self.isLoadFace = YES;
|
||||
[self syncTheTmpJsonToNormalJson];
|
||||
self.destinationUrl = [self getDestinationUrlStr];
|
||||
[[NSUserDefaults standardUserDefaults]setObject:self.version forKey:@"faceJsonVersion"];
|
||||
}else {
|
||||
[self performSelector:@selector(downloadZipForFace) withObject:nil afterDelay:3];
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}];
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}else {
|
||||
[self performSelector:@selector(downloadZipForFace) withObject:nil afterDelay:3];
|
||||
}
|
||||
}];
|
||||
}else {
|
||||
self.isLoadFace = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)getFaceImagePath {
|
||||
NSString *path = @"Documents/Face/";
|
||||
NSString *savePath = [NSHomeDirectory() stringByAppendingPathComponent:path];
|
||||
return savePath;
|
||||
}
|
||||
|
||||
- (NSString *)getDestinationUrlStr {
|
||||
NSString *path = @"Documents/Face/";
|
||||
NSString *savePath = [NSHomeDirectory() stringByAppendingPathComponent:path];
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
NSArray *arr = [fm contentsOfDirectoryAtPath:savePath error:nil];
|
||||
NSMutableArray *tempArr = [NSMutableArray array];
|
||||
|
||||
for (NSString *item in arr) {
|
||||
if (![item containsString:@"."]) {
|
||||
[tempArr addObject:item];
|
||||
}
|
||||
}
|
||||
|
||||
while(tempArr.count < 5 && tempArr){
|
||||
if (tempArr.count > 0) {
|
||||
for (NSString *item in arr) {
|
||||
if (![item containsString:@"."]) {
|
||||
savePath = [savePath stringByAppendingString:[NSString stringWithFormat:@"/%@",tempArr[0]]];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
tempArr = [[fm contentsOfDirectoryAtPath:savePath error:nil] mutableCopy];
|
||||
}
|
||||
|
||||
return savePath;
|
||||
}
|
||||
|
||||
|
||||
- (FaceConfigInfo *)findFaceInfoById:(NSInteger)faceId{
|
||||
if (self.faceInfos != nil) {
|
||||
for (int i = 0; i < self.faceInfos.count; i++) {
|
||||
FaceConfigInfo *faceInfo = self.faceInfos[i];
|
||||
if (faceInfo.id == faceId) {
|
||||
return faceInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
//根据id查找表情iCON图片对象
|
||||
- (UIImage *)findFaceIconImageById:(NSInteger)faceId {
|
||||
FaceConfigInfo *configInfo = [self findFaceInfoById:faceId];
|
||||
NSString *faceName = [NSString stringWithFormat:@"%@_%d_%ld",configInfo.pinyin,configInfo.id,configInfo.iconPos];
|
||||
UIImage *face;
|
||||
face = [self.faceCache objectForKey:faceName];
|
||||
if (face) {
|
||||
return face;
|
||||
}else {
|
||||
NSString *dirName = [NSString stringWithFormat:@"%@_%d",configInfo.pinyin,configInfo.id];
|
||||
NSString *targetPath = [NSString stringWithFormat:@"%@/%@/%@",self.destinationUrl,dirName,faceName];
|
||||
face = [UIImage imageWithContentsOfFile:targetPath];
|
||||
if (face) {
|
||||
[self.faceCache setObject:face forKey:faceName];
|
||||
}
|
||||
return face;
|
||||
}
|
||||
}
|
||||
|
||||
//查找图片数组
|
||||
- (NSMutableArray<UIImage *> *)findFaceFrameArrByFaceId:(NSInteger)faceId {
|
||||
FaceConfigInfo *configInfo = [self findFaceInfoById:faceId];
|
||||
return [self findFaceFrameArrByConfig:configInfo];
|
||||
}
|
||||
|
||||
//查找图片数组
|
||||
- (NSMutableArray<UIImage *> *)findFaceFrameArrByConfig:(FaceConfigInfo *)configInfo {
|
||||
NSMutableArray *faceArr = [NSMutableArray array];
|
||||
for (int i = (short)configInfo.animStartPos; i <= (short)configInfo.animEndPos; i++) {
|
||||
[faceArr addObject:[self findFaceImageByConfig:configInfo index:i]];
|
||||
}
|
||||
return faceArr;
|
||||
}
|
||||
|
||||
//查找图片
|
||||
- (UIImage *)findFaceImageById:(NSInteger)faceId index:(NSInteger)index {
|
||||
FaceConfigInfo *configInfo = [self findFaceInfoById:faceId];
|
||||
return [self findFaceImageByConfig:configInfo index:index];
|
||||
}
|
||||
|
||||
//查找图片
|
||||
- (UIImage *)findFaceImageByConfig:(FaceConfigInfo *)configInfo index:(NSInteger)index {
|
||||
NSString *faceName = [NSString stringWithFormat:@"%@_%d_%ld",configInfo.pinyin,configInfo.id,(long)index];
|
||||
UIImage *face;
|
||||
face = [self.faceCache objectForKey:faceName];
|
||||
if (face) {
|
||||
return face;
|
||||
}else {
|
||||
NSString *dirName = [NSString stringWithFormat:@"%@_%d",configInfo.pinyin,configInfo.id];
|
||||
NSString *targetPath = [NSString stringWithFormat:@"%@/%@/%@",self.destinationUrl,dirName,faceName];
|
||||
face = [UIImage imageWithContentsOfFile:targetPath];
|
||||
if (face) {
|
||||
[self.faceCache setObject:face forKey:faceName];
|
||||
}
|
||||
return face;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSMutableArray *)sortFaceInfosWithfaceInfoArr:(NSMutableArray *)faceInfoArr {
|
||||
NSMutableArray *temp = [NSMutableArray array];
|
||||
NSMutableArray *temp2 = [NSMutableArray array]; //运气表情
|
||||
for (FaceConfigInfo *item in faceInfoArr) {
|
||||
if (item.resultCount <= 0) {
|
||||
[temp addObject:item];
|
||||
}else {
|
||||
[temp2 addObject:item];
|
||||
}
|
||||
}
|
||||
[temp addObjectsFromArray:temp2];
|
||||
return temp;
|
||||
}
|
||||
|
||||
- (NSMutableArray *)getFaceInfosType:(RoomFaceType)faceType {
|
||||
NSMutableArray *arr = [NSMutableArray array];
|
||||
NSMutableArray *resultArr = [NSMutableArray array];
|
||||
|
||||
for (int i = 0; i < self.faceInfos.count; i++) {
|
||||
FaceConfigInfo *item = self.faceInfos[i];
|
||||
if (faceType == RoomFaceTypeNormal && !item.faceVipInfo) {
|
||||
if (!item.isLuckFace && item.faceType == XCFaceType_Face) {
|
||||
[arr addObject:item];
|
||||
}
|
||||
}else if(faceType == RoomFaceTypeNoble && item.faceVipInfo){///贵族表情
|
||||
if (item.nobleId<=1) {
|
||||
[arr addObject:item];
|
||||
}
|
||||
}
|
||||
if (arr.count == 15) {
|
||||
[resultArr addObject:arr];
|
||||
arr = [NSMutableArray array];
|
||||
}
|
||||
if ( i%15 != 0 && i == self.faceInfos.count - 1) {
|
||||
if (arr.count) {
|
||||
[resultArr addObject:arr];
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultArr;
|
||||
}
|
||||
|
||||
#pragma mark - AppInitClient
|
||||
- (void)getFaceDataSuccess:(NSArray *)faceArr {
|
||||
self.tempFaceInfos = [self sortFaceInfosWithfaceInfoArr:[faceArr mutableCopy]]; //表情排序
|
||||
[self faceDownloadManager];
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
|
||||
- (BOOL)isEnableFace:(FaceConfigInfo *)info {
|
||||
if (info.displayType != XCFaceDisplayTypeOnlyOne && info.displayType != XCFaceDisplayTypeFlow && info.displayType != XCFaceDisplayTypeOverLay) {
|
||||
return NO;
|
||||
}else {
|
||||
return YES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Getter
|
||||
|
||||
|
||||
- (BOOL)getShowingFace {
|
||||
return self.isShowingFace;
|
||||
}
|
||||
|
||||
- (NSCache *)faceCache {
|
||||
if (_faceCache == nil) {
|
||||
_faceCache = [[NSCache alloc]init];
|
||||
}
|
||||
return _faceCache;
|
||||
}
|
||||
|
||||
@end
|
@@ -24,12 +24,14 @@
|
||||
///View
|
||||
#import "XPRoomSendTextView.h"
|
||||
#import "XPSendGiftView.h"
|
||||
#import "XPRoomFaceView.h"
|
||||
#import "SessionListViewController.h"
|
||||
#import "XPRoomMoreMenuViewController.h"
|
||||
#import "XPNobleCenterViewController.h"
|
||||
#import "XPRoomFaceViewController.h"
|
||||
|
||||
@interface XPRoomMenuContainerView ()
|
||||
///滚动的容器
|
||||
@property (nonatomic,strong) UIScrollView *scrollView;
|
||||
///
|
||||
@property (nonatomic,strong) UIStackView *stackView;
|
||||
///输入框
|
||||
@@ -50,8 +52,6 @@
|
||||
@property (nonatomic,strong) UIButton *arrangeMicButton;
|
||||
///贵族
|
||||
@property (nonatomic,strong) UIButton *nobleButton;
|
||||
///占位的
|
||||
@property (nonatomic,strong) UIView * placeHolderView;
|
||||
///代理
|
||||
@property (nonatomic,weak) id<RoomHostDelegate> delegate;
|
||||
@end
|
||||
@@ -95,10 +95,10 @@
|
||||
break;
|
||||
|
||||
case XPRoomMenuItemType_Face: {
|
||||
NSString * roomUid = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].uid];
|
||||
XPRoomFaceView * faceView = [[XPRoomFaceView alloc] initWithRoomUid:roomUid];
|
||||
faceView.delegate = self.delegate;
|
||||
[TTPopup popupView:faceView style:TTPopupStyleActionSheet];
|
||||
XPRoomFaceViewController * faceVC = [[XPRoomFaceViewController alloc] init];
|
||||
faceVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
faceVC.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
|
||||
[self.delegate.getCurrentNav presentViewController:faceVC animated:YES completion:nil];
|
||||
}
|
||||
break;
|
||||
case XPRoomMenuItemType_Gift: {
|
||||
@@ -158,7 +158,11 @@
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.stackView];
|
||||
[self addSubview:self.scrollView];
|
||||
[self addSubview:self.giftButton];
|
||||
|
||||
[self.scrollView addSubview:self.stackView];
|
||||
|
||||
[self.stackView addArrangedSubview:self.inputButton];
|
||||
[self.stackView addArrangedSubview:self.micButton];
|
||||
[self.stackView addArrangedSubview:self.voiceButton];
|
||||
@@ -167,21 +171,26 @@
|
||||
[self.stackView addArrangedSubview:self.messageButton];
|
||||
[self.stackView addArrangedSubview:self.moreButton];
|
||||
[self.stackView addArrangedSubview:self.nobleButton];
|
||||
[self.stackView addArrangedSubview:self.placeHolderView];
|
||||
[self.stackView addArrangedSubview:self.giftButton];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self).inset(15);
|
||||
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self).offset(15);
|
||||
make.right.mas_equalTo(self.giftButton.mas_left).offset(-10);
|
||||
make.top.bottom.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.leading.trailing.height.mas_equalTo(self.scrollView);
|
||||
}];
|
||||
|
||||
[self.inputButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(100, 30));
|
||||
}];
|
||||
|
||||
[self.giftButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.right.mas_equalTo(self).offset(-15);
|
||||
make.size.mas_equalTo(CGSizeMake(38, 38));
|
||||
}];
|
||||
}
|
||||
@@ -440,15 +449,6 @@
|
||||
return _giftButton;
|
||||
}
|
||||
|
||||
- (UIView *)placeHolderView {
|
||||
if (!_placeHolderView) {
|
||||
_placeHolderView = [[UIView alloc] init];
|
||||
_placeHolderView.backgroundColor = [UIColor clearColor];
|
||||
[_placeHolderView setContentHuggingPriority:UILayoutPriorityDragThatCanResizeScene forAxis:UILayoutConstraintAxisHorizontal];
|
||||
}
|
||||
return _placeHolderView;
|
||||
}
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
@@ -472,4 +472,13 @@
|
||||
return _arrangeMicButton;
|
||||
}
|
||||
|
||||
- (UIScrollView *)scrollView {
|
||||
if (!_scrollView) {
|
||||
_scrollView = [[UIScrollView alloc] init];
|
||||
_scrollView.backgroundColor = [UIColor clearColor];
|
||||
_scrollView.showsHorizontalScrollIndicator = NO;
|
||||
}
|
||||
return _scrollView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -9,11 +9,11 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class FaceReceiveInfo;
|
||||
//@class FaceReceiveInfo;
|
||||
@interface MicroFaceView : UIView
|
||||
|
||||
///开始展示表情动画
|
||||
- (void)startFaceAnimationWithReciveInfo:(FaceReceiveInfo *)receiveInfo;
|
||||
//- (void)startFaceAnimationWithReciveInfo:(FaceReceiveInfo *)receiveInfo;
|
||||
|
||||
///停止表情动画
|
||||
- (void)stopFaceAnimation;
|
||||
|
@@ -9,10 +9,10 @@
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <FLAnimatedImage/FLAnimatedImageView.h>
|
||||
///Model
|
||||
#import "FaceReceiveInfo.h"
|
||||
///Tool
|
||||
#import "FaceImageTool.h"
|
||||
/////Model
|
||||
//#import "FaceReceiveInfo.h"
|
||||
/////Tool
|
||||
//#import "FaceImageTool.h"
|
||||
|
||||
@interface MicroFaceView()
|
||||
|
||||
@@ -45,14 +45,14 @@
|
||||
}];
|
||||
}
|
||||
|
||||
///开始展示表情动画
|
||||
- (void)startFaceAnimationWithReciveInfo:(FaceReceiveInfo *)receiveInfo {
|
||||
self.imageView.hidden = NO;
|
||||
[[FaceImageTool shareFaceImageTool] queryImage:receiveInfo imageView:self.imageView dragon:NO needAniomation:YES success:^(FaceReceiveInfo *info,UIImage *lastImage) {
|
||||
} failure:^(NSError *error) {
|
||||
|
||||
}];
|
||||
}
|
||||
/////开始展示表情动画
|
||||
//- (void)startFaceAnimationWithReciveInfo:(FaceReceiveInfo *)receiveInfo {
|
||||
// self.imageView.hidden = NO;
|
||||
// [[FaceImageTool shareFaceImageTool] queryImage:receiveInfo imageView:self.imageView dragon:NO needAniomation:YES success:^(FaceReceiveInfo *info,UIImage *lastImage) {
|
||||
// } failure:^(NSError *error) {
|
||||
//
|
||||
// }];
|
||||
//}
|
||||
|
||||
///停止表情动画
|
||||
- (void)stopFaceAnimation {
|
||||
|
@@ -175,9 +175,9 @@
|
||||
[self.nobleWaveView startWaveAnimationWithUrl:userInfo.micCircle];
|
||||
}
|
||||
|
||||
- (void)showingFace:(FaceReceiveInfo *)receiveInfo {
|
||||
[self.faceView startFaceAnimationWithReciveInfo:receiveInfo];
|
||||
}
|
||||
//- (void)showingFace:(FaceReceiveInfo *)receiveInfo {
|
||||
// [self.faceView startFaceAnimationWithReciveInfo:receiveInfo];
|
||||
//}
|
||||
|
||||
- (void)configMicroView:(MicroQueueModel *)model {
|
||||
self.microModel = model;
|
||||
|
@@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 展示用户表情
|
||||
*/
|
||||
- (void)showingFace:(FaceReceiveInfo *)receiveInfo;
|
||||
//- (void)showingFace:(FaceReceiveInfo *)receiveInfo;
|
||||
|
||||
/**
|
||||
* 礼物值。
|
||||
|
@@ -28,9 +28,9 @@
|
||||
#import "GiftReceiveInfoModel.h"
|
||||
#import "GiftValueInfoModel.h"
|
||||
#import "MicroExtModel.h"
|
||||
#import "FaceSendInfo.h"
|
||||
#import "FaceReceiveInfo.h"
|
||||
#import "FaceConfigInfo.h"
|
||||
//#import "FaceSendInfo.h"
|
||||
//#import "FaceReceiveInfo.h"
|
||||
//#import "FaceConfigInfo.h"
|
||||
// Views
|
||||
#import "NetImageView.h"
|
||||
#import "XPUserCardViewController.h"
|
||||
@@ -428,15 +428,15 @@
|
||||
|
||||
#pragma mark - 表情
|
||||
- (void)showUserFace:(NSDictionary *)uids {
|
||||
FaceSendInfo *faceattachement = [FaceSendInfo modelWithDictionary:uids];
|
||||
NSMutableArray *arr = [faceattachement.data mutableCopy];
|
||||
for (int i = 0; i < arr.count; i++) {
|
||||
NSDictionary *dict = [arr objectAtIndex:i];
|
||||
FaceReceiveInfo * receiveInfo = [FaceReceiveInfo modelWithDictionary:dict];
|
||||
UIView<MicroViewProtocol> * view = [self findMicroViewByUid:[NSString stringWithFormat:@"%lld",receiveInfo.uid]];
|
||||
if (view == nil) continue;
|
||||
[view showingFace:receiveInfo];
|
||||
}
|
||||
// FaceSendInfo *faceattachement = [FaceSendInfo modelWithDictionary:uids];
|
||||
// NSMutableArray *arr = [faceattachement.data mutableCopy];
|
||||
// for (int i = 0; i < arr.count; i++) {
|
||||
// NSDictionary *dict = [arr objectAtIndex:i];
|
||||
// FaceReceiveInfo * receiveInfo = [FaceReceiveInfo modelWithDictionary:dict];
|
||||
// UIView<MicroViewProtocol> * view = [self findMicroViewByUid:[NSString stringWithFormat:@"%lld",receiveInfo.uid]];
|
||||
// if (view == nil) continue;
|
||||
// [view showingFace:receiveInfo];
|
||||
// }
|
||||
}
|
||||
|
||||
#pragma mark - StageViewDelegate - 留给子 View 重写的模板方法
|
||||
|
@@ -10,11 +10,8 @@
|
||||
/// tool
|
||||
#import "DESEncrypt.h"
|
||||
#import "XPConstant.h"
|
||||
#import "NSString+JsonToDic.h"
|
||||
#import <MJExtension/MJExtension.h>
|
||||
#import "XPFaceParser.h"
|
||||
///Model
|
||||
#import "FaceConfigInfo.h"
|
||||
#import "XPRoomFaceTool.h"
|
||||
|
||||
@interface ClientConfig ()
|
||||
///重试的次数 10次 如果你还是失败的话 那就算了 没办法了
|
||||
@@ -42,22 +39,19 @@
|
||||
self.openCandyTree = [initData[@"openBoxSwitch"] boolValue];
|
||||
self.openCandyTreeLimitLevel = [initData[@"openBoxSwitchLevelNo"] intValue];
|
||||
ClientDataModel * model = [ClientDataModel modelWithDictionary:data.data];
|
||||
self.configInfo = model;
|
||||
/* 表情包 */
|
||||
//表情包
|
||||
NSString *json = initData[@"faceJson"][@"json"];
|
||||
NSString *deJson = [DESEncrypt decryptUseDES:json key:KeyWithType(KeyType_FacePwdEncode)];
|
||||
NSDictionary *faceInitData = [NSString dictionaryWithJsonString:deJson];
|
||||
NSDictionary *faceInitData = [deJson toJSONObject];
|
||||
model.faceInitData = faceInitData;
|
||||
if (faceInitData) {
|
||||
NSArray *arr = [FaceConfigInfo modelsWithArray:faceInitData[@"faces"]];
|
||||
NSArray *nobleArray = [FaceConfigInfo modelsWithArray:faceInitData[@"vipFaces"]];
|
||||
NSMutableArray *array = [NSMutableArray arrayWithArray:arr];
|
||||
[array addObjectsFromArray:nobleArray];
|
||||
[XPFaceParser shareParser].version = [NSString stringWithFormat:@"%@",faceInitData[@"version"]];
|
||||
[XPFaceParser shareParser].zipMd5 = [[NSString stringWithFormat:@"%@",faceInitData[@"zipMd5"]] uppercaseString];
|
||||
[XPFaceParser shareParser].zipUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@",faceInitData[@"zipUrl"]]];
|
||||
[[XPFaceParser shareParser] getFaceDataSuccess:array];
|
||||
// NotifyCoreClient(AppInitClient, @selector(onGetFaceDataSuccess:), onGetFaceDataSuccess:arr);
|
||||
[XPRoomFaceTool shareFaceTool].version = [NSString stringWithFormat:@"%@",faceInitData[@"version"]];
|
||||
[XPRoomFaceTool shareFaceTool].zipMd5 = [[NSString stringWithFormat:@"%@",faceInitData[@"zipMd5"]] uppercaseString];
|
||||
[XPRoomFaceTool shareFaceTool].zipUrl = [NSString stringWithFormat:@"%@",faceInitData[@"zipUrl"]];
|
||||
///开始下载
|
||||
[[XPRoomFaceTool shareFaceTool] downFaceData];
|
||||
}
|
||||
self.configInfo = model;
|
||||
} else {
|
||||
if (self.retryCount < 10) {
|
||||
[self clientInit];
|
||||
|
@@ -12,7 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface ClientDataModel : NSObject
|
||||
///首页tag 配置
|
||||
@property (nonatomic,strong) NSArray<NSString *> *homeTabList;
|
||||
|
||||
///房间表情的数据
|
||||
@property (nonatomic,copy) NSDictionary *faceInitData;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
Reference in New Issue
Block a user