commit 9712419ca94c14dd3e17bab05d70bc472e1a1cf9 Author: ci-gitlab Date: Thu May 25 16:52:00 2023 +0800 feat:update upm diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..63bff00 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,110 @@ +# ChangeLog + +## 3.11.1 + +### Fixed bugs +- iOS: 修复授权模块对系统 URL 回调的使用方式 + +## 3.11.0 + +## 3.10.0 + +## 3.9.0 + +## 3.8.0 + +## 3.7.1 + +## 3.7.0 + +## 3.6.3 + +### Optimization and fixed bugs +- Android 修复特定机型上繁体中文的识别 +- Android 修复初始化时未配置 TapDBConfig 会初始化失败的问题 + +## 3.6.1 + +## 3.6.0 + +## 3.5.2 + +### New Feature +- 新增多语言配置 + +## 3.5.0 + +### Optimization and fixed bugs +- 支持性更新 + +## 3.4.0 + +## 3.3.0 + +- Native Update + +## 3.2.0 + +- Native Update + +## 3.1.0 + +- Native Update + +## 3.0.0 + +### Optimization + +- Bridge 新增 Task 桥接 + +## 2.1.7 + +### None + +## 2.1.6 + +### BreakingChanges + +- 修改 **TapCommon.OpenReviewInTapGlobal()** 方法命名 + +## 2.1.5 + +### Optimization and fixed bugs + +- 内部优化 + +## 2.1.4 + +### Optimization and fixed bugs + +- 优化多语言相关 +- 修复 JSON 解析错误 + +## 2.1.3 + +### New Feature + +* iOS 新增 TapTap 以及 Tap.IO 客户端安装判断 + +## 2.1.2 + +### Optimization and fixed bugs + +* 修复 iOS ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES 设置问题可能导致的 AppStore 审核无法通过 + +## 2.1.1 + +### Feature + +* Android 新增 TapTap App 相关支持功能 + +## 2.1.0 + +* 新增长链接支持 TapTap.Friends +* 海内外域名切换 + +## 2.0.0 + +### Feature + +* TapTap Common \ No newline at end of file diff --git a/CHANGELOG.md.meta b/CHANGELOG.md.meta new file mode 100644 index 0000000..904fb55 --- /dev/null +++ b/CHANGELOG.md.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 89a2f2ba3f4d4cf0b55f2f992c6b6afb +timeCreated: 1616744142 \ No newline at end of file diff --git a/Documentation.meta b/Documentation.meta new file mode 100644 index 0000000..345bff8 --- /dev/null +++ b/Documentation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e5655844e77cd49d8a69c4a299e31419 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Documentation/Bridge.md b/Documentation/Bridge.md new file mode 100644 index 0000000..920447b --- /dev/null +++ b/Documentation/Bridge.md @@ -0,0 +1,178 @@ +# TapCommon 用于支持 TapSDK 其他模块中 Android、iOS 与 Unity 的通信 + +> 目前 TapSDK 业务中,Unity 业务层实现的功能不多,主要作为桥接来调用 Android、iOS SDK 中的方法。 + +## 一、实现 Unity 调用 Android、iOS 方法 + +> 为了方便 Unity 一套代码可以调用双端方法,所以定义原生接口时,需要考虑 Android、iOS 语言之间的差异。 + +### Android 接口定义 + +- 使用 `@BridgeService` 、`@BridgeMethod` 、`@BridgeParam` 注解修饰 `类`、`方法`、`参数`。 +- `Activity`、`BridgeCallback` 这两个类型参数不需要 `@BridgeParam` 注解。 +- `@BridgeParam` 仅支持基本数据类型(包含 `String`)。 + +```java +@BridgeService("TestService") +public class TestService implementation IBridgeService { + + @BridgeMethod("testMethodWithCallback") + void testMethodWithCallback(BridgeCallback callback); + + @BridgeMethod("testMethodWithArgsAndCallback") + void testMethodWithArgsAndCallback(Activity activity, @BridgeParam("args1") String appId, @BridgeParam("args2") int args2, BridgeCallback callback); + +} + +``` + +### Android 接口实现 + +```java +public class TestService implementation TestService { + + @Override + public void testMethodWithCallback(BridgeCallback callback){ + callback.onResult("testMethodWithCallback 回调给 Unity 的参数"); + } + + @Override + public void testMethodWithArgsAndCallback(Activity activity, String appId,int args2, BridgeCallback callback){ + callback.onResult("testMethodWithArgsAndCallback 回调给 Unity 的参数"); + } + +} + +``` + +### iOS 接口定义 + +> iOS 方法名通过反射获取到的为 `args1:args2:bridgeCallback` ,所以 iOS 的方法定义与 Android 略有不同。 + +- 类名必须同 Android `@BridgeService` 所修饰的类名一致。 +- 参数名例如 `args1`、`args2` 必须同 Android `@BridgeParam` 修饰的一致,用于回调的 `iOS` 闭包的参数名必须为 `bridgeCallback`。 +- 当参数个数仅为 0 或者 仅为 闭包时,方法名必须同 Android `@BridgeMethod` 修饰的方法一致。 + +```objectivec +@interface TestService + +// 匹配的是 Android 中 testMethodWithCallback 方法 ++(void) testMethodWithCallback:(void (^)(NSString *result))callback; + +// 匹配的是 Android 中 testMethodWithArgsAndCallback 方法 ++(void) args1:(NSString*)args1 args2:(NSNumber*)args2 bridgeCallback:(void (^)(NSString *result))callback; + +@end +``` + +### iOS 接口实现 + +```objectivec +@implementation TestService + ++(void) testMethodWithCallback:(void (^)(NSString *result)) callback{ + callback(@"testMethodWithCallback 回调给 Unity 的参数"); +} + ++(void) args1:(NSString*)args1 args2:(NSNumber*)args2 bridgeCallback:(void (^)(NSString *result))callback{ + callback(@"testMethodWithArgsAndCallback 回调给 Unity 的参数"); +} + +@end +``` + +### Unity 调用上文中定义的 Android、iOS 接口 + +#### 1.初始化 + +```c# +// Android 初始化 +//CLZ_NAME 和IMP_NAME为 接口以及实现类的全路径包名 例如:com.tds.bridge.TestService,com.tds.bridge.TestServiceImpl +EngineBridge.GetInstance().Register(CLZ_NAME, IMP_NAME); + +// iOS 无需初始化 +``` +#### 2.调用方法 + +`Bridge.CallHandler` 为异步方法,执行线程的流程为: + +Unity Thread -> Native MainThread -> Execute Function -> Unity Thread + +所以执行 `CallHandler` 的 Thread 和 `Action` 的 Thread 都为 Unity 当前 Thread。 + +```c# + var command = new Command.Builder() + .Service("TestService") // @BridgeService 值以及 iOS 类名 + .Method("testMethodWithArgsAndCallback") // @BridgeMethod 值 以及 iOS 方法名 + .Args("args1","value") // @BridgeParam 值 以及 iOS 参数名 + .Args("args2",1) // 同上 + .Callback(true) // 是否需要添加 BridgeCallback + .OnceTime(true) // 当前 BridgeCallback 是否常驻内存 + .CommandBuilder(); + + // 需要回调 + EngineBridge.GetInstance().CallHandler(command,result=>{ + if(EngineBridge.CheckResult(result)){ + // 桥接调用成功 + // 当前 Content 则为 Android、iOS 通过 BridgeCallback 传给 Unity 的值 + var content = result.content; + } + }); + + // 不需要回调 + EngineBridge.GetInstance().CallHandler(command); +``` + +## 二、Android 、iOS 调用 Unity + +鉴于 TapSDK 3.1.+ 之后,Android 与 iOS 需要同步 `TapBootstrap` 中 `TDSUser` 的部分参数,所以 `TapCommon` 在当前版本支持了原生简单的调用 Unity 接口。 + +以下以 Android、iOS 需要 Unity 提供 `sessionToken` 以及 `objectId` 为例 + +### Unity 实现 ITapPropertiesProxy 接口并注册 + +```c# +public class SessionTokenProxy:ITapPropertiesProxy{ + + public string GetProperties(){ + return "sessionToken-kafjaskldfjasjdhfajkdfajdfas"; + } + +} + +public class ObjectIdProxy:ITapPropertiesProxy { + + public string GetProperties(){ + return "objectId-dafasdfad"; + } + +} + +// 通过 TapCommon 注册 Native 需要调用的接口 +TapCommon.RegisterProperties("sessionToken",new SessionTokenProxy()); + +TapCommon.RegisterProperties("objectid",new ObjectIdProxy()); +``` + +### Android、iOS 调用 Unity 实现的 ITapPropertiesProxy 来获取所需要的值 + +Android 获取 `sessionToken` 以及 `objectId` + +```java +String sessionToken = TapPropertiesHolder.INSTANCE.getProperty("sessionToken"); +String objectId = TapPropertiesHolder.INSTANCE.getProperty("objectId"); +``` + +iOS 获取 `sessionToken` 以及 `objectId` + +```objectivec +NSString* sessionToken = [[TapPropertiesHolder shareInstance] getProperty:@"sessionToken"]; +NSString* objectId = [[TapPropertiesHolder shareInstance] getProperty:@"objectId"]; +``` + + + + + + + diff --git a/Documentation/Bridge.md.meta b/Documentation/Bridge.md.meta new file mode 100644 index 0000000..e8f8eec --- /dev/null +++ b/Documentation/Bridge.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c2be0874429944a43820d92aa06185f4 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Documentation/README.md b/Documentation/README.md new file mode 100644 index 0000000..bf7679e --- /dev/null +++ b/Documentation/README.md @@ -0,0 +1,89 @@ +## TapTap.Common + +### 接口描述 + +#### 1.获取地区 + +```c# +TapCommon.GetRegionCode(isMainland => +{ + // true 中国大陆 false 非中国大陆 +}); +``` + +#### 2. TapTap 是否安装 + +```c# +TapCommon.IsTapTapInstalled(installed => +{ + // true 安装 false 未安装 +}); +``` + +#### 3. TapTap IO 是否安装 + +```c# +TapCommon.IsTapTapGlobalInstalled(installed => +{ + // true 安装 false 未安装 +}); +``` + +### Android 独占方法 + +#### 4. 在 TapTap 更新游戏 + +```c# +TapCommon.UpdateGameInTapTap(appId,updateSuccess => +{ + // true 更新成功 false 更新失败 +}); +``` + +#### 5. 在 TapTap IO 更新游戏 + +```c# +TapCommon.UpdateGameInTapGlobal(appId,updateSuccess => +{ + // true 更新成功 false 更新失败 +}); +``` + +#### 6. 在 TapTap 打开当前游戏的评论区 + +```c# +TapCommon.OpenReviewInTapTap(appId,openSuccess => +{ + // true 打开评论区 false 打开失败 +}); +``` + +#### 6. 在 TapTap IO 打开当前游戏的评论区 + +```c# +TapCommon.OpenReviewInTapGlobal(appId,openSuccess => +{ + // true 打开评论区 false 打开失败 +}); +``` + +#### 7. 唤起 TapTap 客户端更新游戏 + +appId: 游戏在 TapTap 商店的唯一身份标识 + +例如:https://www.taptap.com/app/187168 ,其中 187168 是 appid. + +```c# +// 在 TapTap 客户端更新游戏,失败时通过浏览器打开 Tap 网站对应的游戏页面 +// 当你在国内区上架时使用 +bool isSuccess = await TapCommon.UpdateGameAndFailToWebInTapTap(string appId); +// 当你在海外区上架时使用 +bool isSuccess = await TapCommon.UpdateGameAndFailToWebInTapGlobal(string appId): +``` + +如果你需要在唤起 Tap 客户端失败时跳转到自己的网页 + +```c# +bool isSuccess = await TapCommon.UpdateGameAndFailToWebInTapTap(string appId, string webUrl) +bool isSuccess = await TapCommon.UpdateGameAndFailToWebInTapGlobal(string appId, string webUrl) +``` \ No newline at end of file diff --git a/Documentation/README.md.meta b/Documentation/README.md.meta new file mode 100644 index 0000000..1a6d5ca --- /dev/null +++ b/Documentation/README.md.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1d7008a3a22e45a4bfe9605e6d050a29 +timeCreated: 1616744132 \ No newline at end of file diff --git a/Editor.meta b/Editor.meta new file mode 100644 index 0000000..323556b --- /dev/null +++ b/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 28e2e71fed1414ad3978a4e5575065f6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/BuildTargetUtils.cs b/Editor/BuildTargetUtils.cs new file mode 100644 index 0000000..f50f379 --- /dev/null +++ b/Editor/BuildTargetUtils.cs @@ -0,0 +1,14 @@ +using UnityEditor; + +namespace TapTap.Common.Editor { + public static class BuildTargetUtils { + public static bool IsSupportMobile(BuildTarget platform) { + return platform == BuildTarget.iOS || platform == BuildTarget.Android; + } + + public static bool IsSupportStandalone(BuildTarget platform) { + return platform == BuildTarget.StandaloneOSX || + platform == BuildTarget.StandaloneWindows || platform == BuildTarget.StandaloneWindows64; + } + } +} diff --git a/Editor/BuildTargetUtils.cs.meta b/Editor/BuildTargetUtils.cs.meta new file mode 100644 index 0000000..1d96eac --- /dev/null +++ b/Editor/BuildTargetUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: da005b5e251334d388fe38e6978890cc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/LinkXMLGenerator.cs b/Editor/LinkXMLGenerator.cs new file mode 100644 index 0000000..06fdb52 --- /dev/null +++ b/Editor/LinkXMLGenerator.cs @@ -0,0 +1,70 @@ +using System.Collections.Generic; +using System.IO; +using System.Xml; +using UnityEngine; +using UnityEditor; + +namespace TapTap.Common.Editor { + public class LinkedAssembly { + public string Fullname { get; set; } + public string[] Types { get; set; } + } + + public class LinkXMLGenerator { + public static void Generate(string path, IEnumerable assemblies) { + DirectoryInfo parent = Directory.GetParent(path); + if (!parent.Exists) { + Directory.CreateDirectory(parent.FullName); + } + + XmlDocument doc = new XmlDocument(); + + XmlNode rootNode = doc.CreateElement("linker"); + doc.AppendChild(rootNode); + + foreach (LinkedAssembly assembly in assemblies) { + XmlNode assemblyNode = doc.CreateElement("assembly"); + + XmlAttribute fullnameAttr = doc.CreateAttribute("fullname"); + fullnameAttr.Value = assembly.Fullname; + assemblyNode.Attributes.Append(fullnameAttr); + + if (assembly.Types?.Length > 0) { + foreach (string type in assembly.Types) { + XmlNode typeNode = doc.CreateElement("type"); + XmlAttribute typeFullnameAttr = doc.CreateAttribute("fullname"); + typeFullnameAttr.Value = type; + typeNode.Attributes.Append(typeFullnameAttr); + + XmlAttribute typePreserveAttr = doc.CreateAttribute("preserve"); + typePreserveAttr.Value = "all"; + typeNode.Attributes.Append(typePreserveAttr); + + assemblyNode.AppendChild(typeNode); + } + } else { + XmlAttribute preserveAttr = doc.CreateAttribute("preserve"); + preserveAttr.Value = "all"; + assemblyNode.Attributes.Append(preserveAttr); + } + + rootNode.AppendChild(assemblyNode); + } + + doc.Save(path); + AssetDatabase.Refresh(); + + Debug.Log($"Generate {path} done."); + Debug.Log(doc.OuterXml); + } + + public static void Delete(string path) { + if (File.Exists(path)) { + File.Delete(path); + AssetDatabase.Refresh(); + } + + Debug.Log($"Delete {path} done."); + } + } +} diff --git a/Editor/LinkXMLGenerator.cs.meta b/Editor/LinkXMLGenerator.cs.meta new file mode 100644 index 0000000..0467446 --- /dev/null +++ b/Editor/LinkXMLGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c63ed7a6afba54761aca6c388df097e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Plist.cs b/Editor/Plist.cs new file mode 100644 index 0000000..e4bed47 --- /dev/null +++ b/Editor/Plist.cs @@ -0,0 +1,954 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Xml; + +namespace TapTap.Common.Editor +{ + public static class Plist + { + private static List offsetTable = new List(); + private static List objectTable = new List(); + private static int refCount; + private static int objRefSize; + private static int offsetByteSize; + private static long offsetTableOffset; + + #region Public Functions + + public static object readPlist(string path) + { + using (FileStream f = new FileStream(path, FileMode.Open, FileAccess.Read)) + { + return readPlist(f, plistType.Auto); + } + } + + public static object readPlistSource(string source) + { + return readPlist(System.Text.Encoding.UTF8.GetBytes(source)); + } + + public static object readPlist(byte[] data) + { + return readPlist(new MemoryStream(data), plistType.Auto); + } + + public static plistType getPlistType(Stream stream) + { + byte[] magicHeader = new byte[8]; + stream.Read(magicHeader, 0, 8); + + if (BitConverter.ToInt64(magicHeader, 0) == 3472403351741427810) + { + return plistType.Binary; + } + else + { + return plistType.Xml; + } + } + + public static object readPlist(Stream stream, plistType type) + { + if (type == plistType.Auto) + { + type = getPlistType(stream); + stream.Seek(0, SeekOrigin.Begin); + } + + if (type == plistType.Binary) + { + using (BinaryReader reader = new BinaryReader(stream)) + { + byte[] data = reader.ReadBytes((int) reader.BaseStream.Length); + return readBinary(data); + } + } + else + { + XmlDocument xml = new XmlDocument(); + xml.XmlResolver = null; + xml.Load(stream); + return readXml(xml); + } + } + + public static void writeXml(object value, string path) + { + using (StreamWriter writer = new StreamWriter(path)) + { + writer.Write(writeXml(value)); + } + } + + public static void writeXml(object value, Stream stream) + { + using (StreamWriter writer = new StreamWriter(stream)) + { + writer.Write(writeXml(value)); + } + } + + public static string writeXml(object value) + { + using (MemoryStream ms = new MemoryStream()) + { + XmlWriterSettings xmlWriterSettings = new XmlWriterSettings(); + xmlWriterSettings.Encoding = new System.Text.UTF8Encoding(false); + xmlWriterSettings.ConformanceLevel = ConformanceLevel.Document; + xmlWriterSettings.Indent = true; + + using (XmlWriter xmlWriter = XmlWriter.Create(ms, xmlWriterSettings)) + { + xmlWriter.WriteStartDocument(); + //xmlWriter.WriteComment("DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" " + "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\""); + xmlWriter.WriteDocType("plist", "-//Apple Computer//DTD PLIST 1.0//EN", + "http://www.apple.com/DTDs/PropertyList-1.0.dtd", null); + xmlWriter.WriteStartElement("plist"); + xmlWriter.WriteAttributeString("version", "1.0"); + compose(value, xmlWriter); + xmlWriter.WriteEndElement(); + xmlWriter.WriteEndDocument(); + xmlWriter.Flush(); + xmlWriter.Close(); + return System.Text.Encoding.UTF8.GetString(ms.ToArray()); + } + } + } + + public static void writeBinary(object value, string path) + { + using (BinaryWriter writer = new BinaryWriter(new FileStream(path, FileMode.Create))) + { + writer.Write(writeBinary(value)); + } + } + + public static void writeBinary(object value, Stream stream) + { + using (BinaryWriter writer = new BinaryWriter(stream)) + { + writer.Write(writeBinary(value)); + } + } + + public static byte[] writeBinary(object value) + { + offsetTable.Clear(); + objectTable.Clear(); + refCount = 0; + objRefSize = 0; + offsetByteSize = 0; + offsetTableOffset = 0; + + //Do not count the root node, subtract by 1 + int totalRefs = countObject(value) - 1; + + refCount = totalRefs; + + objRefSize = RegulateNullBytes(BitConverter.GetBytes(refCount)).Length; + + composeBinary(value); + + writeBinaryString("bplist00", false); + + offsetTableOffset = (long) objectTable.Count; + + offsetTable.Add(objectTable.Count - 8); + + offsetByteSize = RegulateNullBytes(BitConverter.GetBytes(offsetTable[offsetTable.Count - 1])).Length; + + List offsetBytes = new List(); + + offsetTable.Reverse(); + + for (int i = 0; i < offsetTable.Count; i++) + { + offsetTable[i] = objectTable.Count - offsetTable[i]; + byte[] buffer = RegulateNullBytes(BitConverter.GetBytes(offsetTable[i]), offsetByteSize); + Array.Reverse(buffer); + offsetBytes.AddRange(buffer); + } + + objectTable.AddRange(offsetBytes); + + objectTable.AddRange(new byte[6]); + objectTable.Add(Convert.ToByte(offsetByteSize)); + objectTable.Add(Convert.ToByte(objRefSize)); + + var a = BitConverter.GetBytes((long) totalRefs + 1); + Array.Reverse(a); + objectTable.AddRange(a); + + objectTable.AddRange(BitConverter.GetBytes((long) 0)); + a = BitConverter.GetBytes(offsetTableOffset); + Array.Reverse(a); + objectTable.AddRange(a); + + return objectTable.ToArray(); + } + + #endregion + + #region Private Functions + + private static object readXml(XmlDocument xml) + { + XmlNode rootNode = xml.DocumentElement.ChildNodes[0]; + return parse(rootNode); + } + + private static object readBinary(byte[] data) + { + offsetTable.Clear(); + List offsetTableBytes = new List(); + objectTable.Clear(); + refCount = 0; + objRefSize = 0; + offsetByteSize = 0; + offsetTableOffset = 0; + + List bList = new List(data); + + List trailer = bList.GetRange(bList.Count - 32, 32); + + parseTrailer(trailer); + + objectTable = bList.GetRange(0, (int) offsetTableOffset); + + offsetTableBytes = bList.GetRange((int) offsetTableOffset, bList.Count - (int) offsetTableOffset - 32); + + parseOffsetTable(offsetTableBytes); + + return parseBinary(0); + } + + private static Dictionary parseDictionary(XmlNode node) + { + XmlNodeList children = node.ChildNodes; + if (children.Count % 2 != 0) + { + throw new DataMisalignedException("Dictionary elements must have an even number of child nodes"); + } + + Dictionary dict = new Dictionary(); + + for (int i = 0; i < children.Count; i += 2) + { + XmlNode keynode = children[i]; + XmlNode valnode = children[i + 1]; + + if (keynode.Name != "key") + { + throw new ApplicationException("expected a key node"); + } + + object result = parse(valnode); + + if (result != null) + { + dict.Add(keynode.InnerText, result); + } + } + + return dict; + } + + private static List parseArray(XmlNode node) + { + List array = new List(); + + foreach (XmlNode child in node.ChildNodes) + { + object result = parse(child); + if (result != null) + { + array.Add(result); + } + } + + return array; + } + + private static void composeArray(List value, XmlWriter writer) + { + writer.WriteStartElement("array"); + foreach (object obj in value) + { + compose(obj, writer); + } + + writer.WriteEndElement(); + } + + private static object parse(XmlNode node) + { + switch (node.Name) + { + case "dict": + return parseDictionary(node); + case "array": + return parseArray(node); + case "string": + return node.InnerText; + case "integer": + // int result; + //int.TryParse(node.InnerText, System.Globalization.NumberFormatInfo.InvariantInfo, out result); + return Convert.ToInt32(node.InnerText, System.Globalization.NumberFormatInfo.InvariantInfo); + case "real": + return Convert.ToDouble(node.InnerText, System.Globalization.NumberFormatInfo.InvariantInfo); + case "false": + return false; + case "true": + return true; + case "null": + return null; + case "date": + return XmlConvert.ToDateTime(node.InnerText, XmlDateTimeSerializationMode.Utc); + case "data": + return Convert.FromBase64String(node.InnerText); + } + + throw new ApplicationException(String.Format("Plist Node `{0}' is not supported", node.Name)); + } + + private static void compose(object value, XmlWriter writer) + { + if (value == null || value is string) + { + writer.WriteElementString("string", value as string); + } + else if (value is int || value is long) + { + writer.WriteElementString("integer", + ((int) value).ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); + } + else if (value is System.Collections.Generic.Dictionary || + value.GetType().ToString().StartsWith("System.Collections.Generic.Dictionary`2[System.String")) + { + //Convert to Dictionary + Dictionary dic = value as Dictionary; + if (dic == null) + { + dic = new Dictionary(); + IDictionary idic = (IDictionary) value; + foreach (var key in idic.Keys) + { + dic.Add(key.ToString(), idic[key]); + } + } + + writeDictionaryValues(dic, writer); + } + else if (value is List) + { + composeArray((List) value, writer); + } + else if (value is byte[]) + { + writer.WriteElementString("data", Convert.ToBase64String((Byte[]) value)); + } + else if (value is float || value is double) + { + writer.WriteElementString("real", + ((double) value).ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); + } + else if (value is DateTime) + { + DateTime time = (DateTime) value; + string theString = XmlConvert.ToString(time, XmlDateTimeSerializationMode.Utc); + writer.WriteElementString("date", theString); //, "yyyy-MM-ddTHH:mm:ssZ")); + } + else if (value is bool) + { + writer.WriteElementString(value.ToString().ToLower(), ""); + } + else + { + throw new Exception(String.Format("Value type '{0}' is unhandled", value.GetType().ToString())); + } + } + + private static void writeDictionaryValues(Dictionary dictionary, XmlWriter writer) + { + writer.WriteStartElement("dict"); + foreach (string key in dictionary.Keys) + { + object value = dictionary[key]; + writer.WriteElementString("key", key); + compose(value, writer); + } + + writer.WriteEndElement(); + } + + private static int countObject(object value) + { + int count = 0; + switch (value.GetType().ToString()) + { + case "System.Collections.Generic.Dictionary`2[System.String,System.Object]": + Dictionary dict = (Dictionary) value; + foreach (string key in dict.Keys) + { + count += countObject(dict[key]); + } + + count += dict.Keys.Count; + count++; + break; + case "System.Collections.Generic.List`1[System.Object]": + List list = (List) value; + foreach (object obj in list) + { + count += countObject(obj); + } + + count++; + break; + default: + count++; + break; + } + + return count; + } + + private static byte[] writeBinaryDictionary(Dictionary dictionary) + { + List buffer = new List(); + List header = new List(); + List refs = new List(); + for (int i = dictionary.Count - 1; i >= 0; i--) + { + var o = new object[dictionary.Count]; + dictionary.Values.CopyTo(o, 0); + composeBinary(o[i]); + offsetTable.Add(objectTable.Count); + refs.Add(refCount); + refCount--; + } + + for (int i = dictionary.Count - 1; i >= 0; i--) + { + var o = new string[dictionary.Count]; + dictionary.Keys.CopyTo(o, 0); + composeBinary(o[i]); //); + offsetTable.Add(objectTable.Count); + refs.Add(refCount); + refCount--; + } + + if (dictionary.Count < 15) + { + header.Add(Convert.ToByte(0xD0 | Convert.ToByte(dictionary.Count))); + } + else + { + header.Add(0xD0 | 0xf); + header.AddRange(writeBinaryInteger(dictionary.Count, false)); + } + + + foreach (int val in refs) + { + byte[] refBuffer = RegulateNullBytes(BitConverter.GetBytes(val), objRefSize); + Array.Reverse(refBuffer); + buffer.InsertRange(0, refBuffer); + } + + buffer.InsertRange(0, header); + + + objectTable.InsertRange(0, buffer); + + return buffer.ToArray(); + } + + private static byte[] composeBinaryArray(List objects) + { + List buffer = new List(); + List header = new List(); + List refs = new List(); + + for (int i = objects.Count - 1; i >= 0; i--) + { + composeBinary(objects[i]); + offsetTable.Add(objectTable.Count); + refs.Add(refCount); + refCount--; + } + + if (objects.Count < 15) + { + header.Add(Convert.ToByte(0xA0 | Convert.ToByte(objects.Count))); + } + else + { + header.Add(0xA0 | 0xf); + header.AddRange(writeBinaryInteger(objects.Count, false)); + } + + foreach (int val in refs) + { + byte[] refBuffer = RegulateNullBytes(BitConverter.GetBytes(val), objRefSize); + Array.Reverse(refBuffer); + buffer.InsertRange(0, refBuffer); + } + + buffer.InsertRange(0, header); + + objectTable.InsertRange(0, buffer); + + return buffer.ToArray(); + } + + private static byte[] composeBinary(object obj) + { + byte[] value; + switch (obj.GetType().ToString()) + { + case "System.Collections.Generic.Dictionary`2[System.String,System.Object]": + value = writeBinaryDictionary((Dictionary) obj); + return value; + + case "System.Collections.Generic.List`1[System.Object]": + value = composeBinaryArray((List) obj); + return value; + + case "System.Byte[]": + value = writeBinaryByteArray((byte[]) obj); + return value; + + case "System.Double": + value = writeBinaryDouble((double) obj); + return value; + + case "System.Int32": + value = writeBinaryInteger((int) obj, true); + return value; + + case "System.String": + value = writeBinaryString((string) obj, true); + return value; + + case "System.DateTime": + value = writeBinaryDate((DateTime) obj); + return value; + + case "System.Boolean": + value = writeBinaryBool((bool) obj); + return value; + + default: + return new byte[0]; + } + } + + public static byte[] writeBinaryDate(DateTime obj) + { + List buffer = + new List(RegulateNullBytes(BitConverter.GetBytes(PlistDateConverter.ConvertToAppleTimeStamp(obj)), + 8)); + buffer.Reverse(); + buffer.Insert(0, 0x33); + objectTable.InsertRange(0, buffer); + return buffer.ToArray(); + } + + public static byte[] writeBinaryBool(bool obj) + { + List buffer = new List(new byte[1] {(bool) obj ? (byte) 9 : (byte) 8}); + objectTable.InsertRange(0, buffer); + return buffer.ToArray(); + } + + private static byte[] writeBinaryInteger(int value, bool write) + { + List buffer = new List(BitConverter.GetBytes((long) value)); + buffer = new List(RegulateNullBytes(buffer.ToArray())); + while (buffer.Count != Math.Pow(2, Math.Log(buffer.Count) / Math.Log(2))) + buffer.Add(0); + int header = 0x10 | (int) (Math.Log(buffer.Count) / Math.Log(2)); + + buffer.Reverse(); + + buffer.Insert(0, Convert.ToByte(header)); + + if (write) + objectTable.InsertRange(0, buffer); + + return buffer.ToArray(); + } + + private static byte[] writeBinaryDouble(double value) + { + List buffer = new List(RegulateNullBytes(BitConverter.GetBytes(value), 4)); + while (buffer.Count != Math.Pow(2, Math.Log(buffer.Count) / Math.Log(2))) + buffer.Add(0); + int header = 0x20 | (int) (Math.Log(buffer.Count) / Math.Log(2)); + + buffer.Reverse(); + + buffer.Insert(0, Convert.ToByte(header)); + + objectTable.InsertRange(0, buffer); + + return buffer.ToArray(); + } + + private static byte[] writeBinaryByteArray(byte[] value) + { + List buffer = new List(value); + List header = new List(); + if (value.Length < 15) + { + header.Add(Convert.ToByte(0x40 | Convert.ToByte(value.Length))); + } + else + { + header.Add(0x40 | 0xf); + header.AddRange(writeBinaryInteger(buffer.Count, false)); + } + + buffer.InsertRange(0, header); + + objectTable.InsertRange(0, buffer); + + return buffer.ToArray(); + } + + private static byte[] writeBinaryString(string value, bool head) + { + List buffer = new List(); + List header = new List(); + foreach (char chr in value.ToCharArray()) + buffer.Add(Convert.ToByte(chr)); + + if (head) + { + if (value.Length < 15) + { + header.Add(Convert.ToByte(0x50 | Convert.ToByte(value.Length))); + } + else + { + header.Add(0x50 | 0xf); + header.AddRange(writeBinaryInteger(buffer.Count, false)); + } + } + + buffer.InsertRange(0, header); + + objectTable.InsertRange(0, buffer); + + return buffer.ToArray(); + } + + private static byte[] RegulateNullBytes(byte[] value) + { + return RegulateNullBytes(value, 1); + } + + private static byte[] RegulateNullBytes(byte[] value, int minBytes) + { + Array.Reverse(value); + List bytes = new List(value); + for (int i = 0; i < bytes.Count; i++) + { + if (bytes[i] == 0 && bytes.Count > minBytes) + { + bytes.Remove(bytes[i]); + i--; + } + else + break; + } + + if (bytes.Count < minBytes) + { + int dist = minBytes - bytes.Count; + for (int i = 0; i < dist; i++) + bytes.Insert(0, 0); + } + + value = bytes.ToArray(); + Array.Reverse(value); + return value; + } + + private static void parseTrailer(List trailer) + { + offsetByteSize = BitConverter.ToInt32(RegulateNullBytes(trailer.GetRange(6, 1).ToArray(), 4), 0); + objRefSize = BitConverter.ToInt32(RegulateNullBytes(trailer.GetRange(7, 1).ToArray(), 4), 0); + byte[] refCountBytes = trailer.GetRange(12, 4).ToArray(); + Array.Reverse(refCountBytes); + refCount = BitConverter.ToInt32(refCountBytes, 0); + byte[] offsetTableOffsetBytes = trailer.GetRange(24, 8).ToArray(); + Array.Reverse(offsetTableOffsetBytes); + offsetTableOffset = BitConverter.ToInt64(offsetTableOffsetBytes, 0); + } + + private static void parseOffsetTable(List offsetTableBytes) + { + for (int i = 0; i < offsetTableBytes.Count; i += offsetByteSize) + { + byte[] buffer = offsetTableBytes.GetRange(i, offsetByteSize).ToArray(); + Array.Reverse(buffer); + offsetTable.Add(BitConverter.ToInt32(RegulateNullBytes(buffer, 4), 0)); + } + } + + private static object parseBinaryDictionary(int objRef) + { + Dictionary buffer = new Dictionary(); + List refs = new List(); + int refCount = 0; + + int refStartPosition; + refCount = getCount(offsetTable[objRef], out refStartPosition); + + + if (refCount < 15) + refStartPosition = offsetTable[objRef] + 1; + else + refStartPosition = offsetTable[objRef] + 2 + + RegulateNullBytes(BitConverter.GetBytes(refCount), 1).Length; + + for (int i = refStartPosition; i < refStartPosition + refCount * 2 * objRefSize; i += objRefSize) + { + byte[] refBuffer = objectTable.GetRange(i, objRefSize).ToArray(); + Array.Reverse(refBuffer); + refs.Add(BitConverter.ToInt32(RegulateNullBytes(refBuffer, 4), 0)); + } + + for (int i = 0; i < refCount; i++) + { + buffer.Add((string) parseBinary(refs[i]), parseBinary(refs[i + refCount])); + } + + return buffer; + } + + private static object parseBinaryArray(int objRef) + { + List buffer = new List(); + List refs = new List(); + int refCount = 0; + + int refStartPosition; + refCount = getCount(offsetTable[objRef], out refStartPosition); + + + if (refCount < 15) + refStartPosition = offsetTable[objRef] + 1; + else + //The following integer has a header aswell so we increase the refStartPosition by two to account for that. + refStartPosition = offsetTable[objRef] + 2 + + RegulateNullBytes(BitConverter.GetBytes(refCount), 1).Length; + + for (int i = refStartPosition; i < refStartPosition + refCount * objRefSize; i += objRefSize) + { + byte[] refBuffer = objectTable.GetRange(i, objRefSize).ToArray(); + Array.Reverse(refBuffer); + refs.Add(BitConverter.ToInt32(RegulateNullBytes(refBuffer, 4), 0)); + } + + for (int i = 0; i < refCount; i++) + { + buffer.Add(parseBinary(refs[i])); + } + + return buffer; + } + + private static int getCount(int bytePosition, out int newBytePosition) + { + byte headerByte = objectTable[bytePosition]; + byte headerByteTrail = Convert.ToByte(headerByte & 0xf); + int count; + if (headerByteTrail < 15) + { + count = headerByteTrail; + newBytePosition = bytePosition + 1; + } + else + count = (int) parseBinaryInt(bytePosition + 1, out newBytePosition); + + return count; + } + + private static object parseBinary(int objRef) + { + byte header = objectTable[offsetTable[objRef]]; + switch (header & 0xF0) + { + case 0: + { + //If the byte is + //0 return null + //9 return true + //8 return false + return (objectTable[offsetTable[objRef]] == 0) + ? (object) null + : ((objectTable[offsetTable[objRef]] == 9) ? true : false); + } + case 0x10: + { + return parseBinaryInt(offsetTable[objRef]); + } + case 0x20: + { + return parseBinaryReal(offsetTable[objRef]); + } + case 0x30: + { + return parseBinaryDate(offsetTable[objRef]); + } + case 0x40: + { + return parseBinaryByteArray(offsetTable[objRef]); + } + case 0x50: //String ASCII + { + return parseBinaryAsciiString(offsetTable[objRef]); + } + case 0x60: //String Unicode + { + return parseBinaryUnicodeString(offsetTable[objRef]); + } + case 0xD0: + { + return parseBinaryDictionary(objRef); + } + case 0xA0: + { + return parseBinaryArray(objRef); + } + } + + throw new Exception("This type is not supported"); + } + + public static object parseBinaryDate(int headerPosition) + { + byte[] buffer = objectTable.GetRange(headerPosition + 1, 8).ToArray(); + Array.Reverse(buffer); + double appleTime = BitConverter.ToDouble(buffer, 0); + DateTime result = PlistDateConverter.ConvertFromAppleTimeStamp(appleTime); + return result; + } + + private static object parseBinaryInt(int headerPosition) + { + int output; + return parseBinaryInt(headerPosition, out output); + } + + private static object parseBinaryInt(int headerPosition, out int newHeaderPosition) + { + byte header = objectTable[headerPosition]; + int byteCount = (int) Math.Pow(2, header & 0xf); + byte[] buffer = objectTable.GetRange(headerPosition + 1, byteCount).ToArray(); + Array.Reverse(buffer); + //Add one to account for the header byte + newHeaderPosition = headerPosition + byteCount + 1; + return BitConverter.ToInt32(RegulateNullBytes(buffer, 4), 0); + } + + private static object parseBinaryReal(int headerPosition) + { + byte header = objectTable[headerPosition]; + int byteCount = (int) Math.Pow(2, header & 0xf); + byte[] buffer = objectTable.GetRange(headerPosition + 1, byteCount).ToArray(); + Array.Reverse(buffer); + + return BitConverter.ToDouble(RegulateNullBytes(buffer, 8), 0); + } + + private static object parseBinaryAsciiString(int headerPosition) + { + int charStartPosition; + int charCount = getCount(headerPosition, out charStartPosition); + + var buffer = objectTable.GetRange(charStartPosition, charCount); + return buffer.Count > 0 ? Encoding.ASCII.GetString(buffer.ToArray()) : string.Empty; + } + + private static object parseBinaryUnicodeString(int headerPosition) + { + int charStartPosition; + int charCount = getCount(headerPosition, out charStartPosition); + charCount = charCount * 2; + + byte[] buffer = new byte[charCount]; + byte one, two; + + for (int i = 0; i < charCount; i += 2) + { + one = objectTable.GetRange(charStartPosition + i, 1)[0]; + two = objectTable.GetRange(charStartPosition + i + 1, 1)[0]; + + if (BitConverter.IsLittleEndian) + { + buffer[i] = two; + buffer[i + 1] = one; + } + else + { + buffer[i] = one; + buffer[i + 1] = two; + } + } + + return Encoding.Unicode.GetString(buffer); + } + + private static object parseBinaryByteArray(int headerPosition) + { + int byteStartPosition; + int byteCount = getCount(headerPosition, out byteStartPosition); + return objectTable.GetRange(byteStartPosition, byteCount).ToArray(); + } + + #endregion + } + + public enum plistType + { + Auto, + Binary, + Xml + } + + public static class PlistDateConverter + { + public static long timeDifference = 978307200; + + public static long GetAppleTime(long unixTime) + { + return unixTime - timeDifference; + } + + public static long GetUnixTime(long appleTime) + { + return appleTime + timeDifference; + } + + public static DateTime ConvertFromAppleTimeStamp(double timestamp) + { + DateTime origin = new DateTime(2001, 1, 1, 0, 0, 0, 0); + return origin.AddSeconds(timestamp); + } + + public static double ConvertToAppleTimeStamp(DateTime date) + { + DateTime begin = new DateTime(2001, 1, 1, 0, 0, 0, 0); + TimeSpan diff = date - begin; + return Math.Floor(diff.TotalSeconds); + } + } +} \ No newline at end of file diff --git a/Editor/Plist.cs.meta b/Editor/Plist.cs.meta new file mode 100644 index 0000000..a99b2d9 --- /dev/null +++ b/Editor/Plist.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 66eefeda055244c784769597b08e679e +timeCreated: 1617120740 \ No newline at end of file diff --git a/Editor/SDKLinkProcessBuild.cs b/Editor/SDKLinkProcessBuild.cs new file mode 100644 index 0000000..23b6f3e --- /dev/null +++ b/Editor/SDKLinkProcessBuild.cs @@ -0,0 +1,119 @@ +using System; +using System.IO; +using UnityEngine; +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.Build.Reporting; + +namespace TapTap.Common.Editor { + /// + /// 模块 SDK 生成 link.xml 构建过程 + /// + public abstract class SDKLinkProcessBuild : IPreprocessBuildWithReport, IPostprocessBuildWithReport { + /// + /// 执行顺序 + /// + public abstract int callbackOrder { get; } + + /// + /// 生成 link.xml 路径 + /// + public abstract string LinkPath { get; } + + /// + /// 防止被裁剪的 Assembly + /// + public abstract LinkedAssembly[] LinkedAssemblies { get; } + + /// + /// 执行平台委托 + /// + public abstract Func IsTargetPlatform { get; } + + /// + /// 构建时忽略目录,目前主要是 PC 内置浏览器 Vuplex + /// + public virtual string[] BuildingIgnorePaths => null; + + /// + /// 构建前处理 + /// + /// + public void OnPreprocessBuild(BuildReport report) { + if (!IsTargetPlatform.Invoke(report)) { + return; + } + + Application.logMessageReceived += OnBuildError; + IgnorePaths(); + + string linkPath = Path.Combine(Application.dataPath, LinkPath); + LinkXMLGenerator.Generate(linkPath, LinkedAssemblies); + } + + /// + /// 构建后处理 + /// + /// + public void OnPostprocessBuild(BuildReport report) { + if (!IsTargetPlatform.Invoke(report)) { + return; + } + + Application.logMessageReceived -= OnBuildError; + RecoverIgnoredPaths(); + + string linkPath = Path.Combine(Application.dataPath, LinkPath); + LinkXMLGenerator.Delete(linkPath); + } + + /// + /// 错误日志回调 + /// + /// + /// + /// + private void OnBuildError(string condition, string stacktrace, LogType logType) { + // TRICK: 通过捕获错误日志来监听打包错误事件 + if (logType == LogType.Error) { + Application.logMessageReceived -= OnBuildError; + RecoverIgnoredPaths(); + } + } + + /// + /// 忽略目录 + /// + private void IgnorePaths() { + if (BuildingIgnorePaths == null) { + return; + } + + foreach (string ignorePath in BuildingIgnorePaths) { + if (!Directory.Exists(Path.Combine(Application.dataPath, ignorePath))) { + continue; + } + string ignoreName = Path.GetFileName(ignorePath); + AssetDatabase.RenameAsset(Path.Combine("Assets", ignorePath), $"{ignoreName}~"); + } + } + + /// + /// 恢复目录 + /// + private void RecoverIgnoredPaths() { + if (BuildingIgnorePaths == null) { + return; + } + + foreach (string ignorePath in BuildingIgnorePaths) { + if (!Directory.Exists(Path.Combine(Application.dataPath, $"{ignorePath}~"))) { + continue; + } + Directory.Move(Path.Combine(Application.dataPath, $"{ignorePath}~"), + Path.Combine(Application.dataPath, $"{ignorePath}")); + AssetDatabase.ImportAsset(Path.Combine("Assets", ignorePath)); + } + } + } +} diff --git a/Editor/SDKLinkProcessBuild.cs.meta b/Editor/SDKLinkProcessBuild.cs.meta new file mode 100644 index 0000000..0d3cdf1 --- /dev/null +++ b/Editor/SDKLinkProcessBuild.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8566d22eb15da4629a4ae0deae37b0fa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/TapCommonCompile.cs b/Editor/TapCommonCompile.cs new file mode 100644 index 0000000..428fcbb --- /dev/null +++ b/Editor/TapCommonCompile.cs @@ -0,0 +1,232 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEditor; +using UnityEngine; +#if UNITY_IOS +using UnityEditor.iOS.Xcode; + +#endif + +namespace TapTap.Common.Editor +{ + public static class TapCommonCompile + { +#if UNITY_IOS + public static string GetProjPath(string path) + { + return PBXProject.GetPBXProjectPath(path); + } + + public static PBXProject ParseProjPath(string path) + { + var proj = new PBXProject(); + proj.ReadFromString(File.ReadAllText(path)); + return proj; + } + + public static string GetUnityFrameworkTarget(PBXProject proj) + { +#if UNITY_2019_3_OR_NEWER + string target = proj.GetUnityFrameworkTargetGuid(); + return target; +#endif + var unityPhoneTarget = proj.TargetGuidByName("Unity-iPhone"); + return unityPhoneTarget; + } + + public static string GetUnityTarget(PBXProject proj) + { +#if UNITY_2019_3_OR_NEWER + string target = proj.GetUnityMainTargetGuid(); + return target; +#endif + var unityPhoneTarget = proj.TargetGuidByName("Unity-iPhone"); + return unityPhoneTarget; + } + + + public static bool CheckTarget(string target) + { + return string.IsNullOrEmpty(target); + } + + public static bool HandlerIOSSetting(string path, string appDataPath, string resourceName, + string modulePackageName, + string moduleName, string[] bundleNames, string target, string projPath, PBXProject proj) + { + var resourcePath = Path.Combine(path, resourceName); + + var parentFolder = Directory.GetParent(appDataPath).FullName; + + Debug.Log($"ProjectFolder path:{parentFolder}"); + + if (Directory.Exists(resourcePath)) + { + Directory.Delete(resourcePath, true); + } + + Directory.CreateDirectory(resourcePath); + + var remotePackagePath = + TapFileHelper.FilterFileByPrefix(parentFolder + "/Library/PackageCache/", $"{modulePackageName}@"); + + var assetLocalPackagePath = TapFileHelper.FilterFileByPrefix(parentFolder + "/Assets/TapTap/", moduleName); + + var localPackagePath = TapFileHelper.FilterFileByPrefix(parentFolder, moduleName); + + var tdsResourcePath = ""; + + if (!string.IsNullOrEmpty(remotePackagePath)) + { + tdsResourcePath = remotePackagePath; + } + else if (!string.IsNullOrEmpty(assetLocalPackagePath)) + { + tdsResourcePath = assetLocalPackagePath; + } + else if (!string.IsNullOrEmpty(localPackagePath)) + { + tdsResourcePath = localPackagePath; + } + + if (string.IsNullOrEmpty(tdsResourcePath)) + { + Debug.LogError("tdsResourcePath is NUll"); + return false; + } + + tdsResourcePath = $"{tdsResourcePath}/Plugins/iOS/Resource"; + + Debug.Log($"Find {moduleName} path:{tdsResourcePath}"); + + if (!Directory.Exists(tdsResourcePath)) + { + Debug.LogError($"Can't Find {bundleNames}"); + return false; + } + + TapFileHelper.CopyAndReplaceDirectory(tdsResourcePath, resourcePath); + foreach (var name in bundleNames) + { + proj.AddFileToBuild(target, + proj.AddFile(Path.Combine(resourcePath, name), Path.Combine(resourcePath, name), + PBXSourceTree.Source)); + } + + File.WriteAllText(projPath, proj.WriteToString()); + return true; + } + + public static bool HandlerPlist(string pathToBuildProject, string infoPlistPath, bool macos = false) + { +// #if UNITY_2020_1_OR_NEWER +// var macosXCodePlistPath = +// $"{pathToBuildProject}/{PlayerSettings.productName}/Info.plist"; +// #elif UNITY_2019_1_OR_NEWER +// var macosXCodePlistPath = +// $"{Path.GetDirectoryName(pathToBuildProject)}/{PlayerSettings.productName}/Info.plist"; +// #endif + + string plistPath; + + if (pathToBuildProject.EndsWith(".app")) + { + plistPath = $"{pathToBuildProject}/Contents/Info.plist"; + } + else + { + var macosXCodePlistPath = + $"{Path.GetDirectoryName(pathToBuildProject)}/{PlayerSettings.productName}/Info.plist"; + if (!File.Exists(macosXCodePlistPath)) + { + macosXCodePlistPath = $"{pathToBuildProject}/{PlayerSettings.productName}/Info.plist"; + } + + plistPath = !macos + ? pathToBuildProject + "/Info.plist" + : macosXCodePlistPath; + } + + Debug.Log($"plist path:{plistPath}"); + + var plist = new PlistDocument(); + plist.ReadFromString(File.ReadAllText(plistPath)); + var rootDic = plist.root; + + var items = new List + { + "tapsdk", + "tapiosdk", + }; + + if (!(rootDic["LSApplicationQueriesSchemes"] is PlistElementArray plistElementList)) + { + plistElementList = rootDic.CreateArray("LSApplicationQueriesSchemes"); + } + + foreach (var t in items) + { + plistElementList.AddString(t); + } + + if (string.IsNullOrEmpty(infoPlistPath)) return false; + var dic = (Dictionary) Plist.readPlist(infoPlistPath); + var taptapId = ""; + + foreach (var item in dic) + { + if (item.Key.Equals("taptap")) + { + var taptapDic = (Dictionary) item.Value; + foreach (var taptapItem in taptapDic.Where(taptapItem => taptapItem.Key.Equals("client_id"))) + { + taptapId = (string) taptapItem.Value; + } + } + else + { + rootDic.SetString(item.Key, item.Value.ToString()); + } + } + + //添加url + var dict = plist.root.AsDict(); + if (!(dict["CFBundleURLTypes"] is PlistElementArray array)) + { + array = dict.CreateArray("CFBundleURLTypes"); + } + + if (!macos) + { + var dict2 = array.AddDict(); + dict2.SetString("CFBundleURLName", "TapTap"); + var array2 = dict2.CreateArray("CFBundleURLSchemes"); + array2.AddString($"tt{taptapId}"); + } + else + { + var dict2 = array.AddDict(); + dict2.SetString("CFBundleURLName", "TapWeb"); + var array2 = dict2.CreateArray("CFBundleURLSchemes"); + array2.AddString($"open-taptap-{taptapId}"); + } + + Debug.Log("TapSDK change plist Success"); + File.WriteAllText(plistPath, plist.WriteToString()); + return true; + } + + public static string GetValueFromPlist(string infoPlistPath, string key) + { + if (infoPlistPath == null) + { + return null; + } + + var dic = (Dictionary) Plist.readPlist(infoPlistPath); + return (from item in dic where item.Key.Equals(key) select (string) item.Value).FirstOrDefault(); + } +#endif + } +} \ No newline at end of file diff --git a/Editor/TapCommonCompile.cs.meta b/Editor/TapCommonCompile.cs.meta new file mode 100644 index 0000000..77e4114 --- /dev/null +++ b/Editor/TapCommonCompile.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c5475af505e04119831448fe963f9c2c +timeCreated: 1617120740 \ No newline at end of file diff --git a/Editor/TapCommonIOSProcessor.cs b/Editor/TapCommonIOSProcessor.cs new file mode 100644 index 0000000..4984825 --- /dev/null +++ b/Editor/TapCommonIOSProcessor.cs @@ -0,0 +1,71 @@ +using System.IO; +using UnityEditor; +# if UNITY_IOS +using UnityEditor.Callbacks; +using UnityEditor.iOS.Xcode; +#endif +using UnityEngine; + +namespace TapTap.Common.Editor +{ +# if UNITY_IOS + public static class TapCommonIOSProcessor + { + // 添加标签,unity导出工程后自动执行该函数 + [PostProcessBuild(99)] + public static void OnPostprocessBuild(BuildTarget buildTarget, string path) + { + if (buildTarget != BuildTarget.iOS) return; + + // 获得工程路径 + var projPath = TapCommonCompile.GetProjPath(path); + var proj = TapCommonCompile.ParseProjPath(projPath); + var target = TapCommonCompile.GetUnityTarget(proj); + var unityFrameworkTarget = TapCommonCompile.GetUnityFrameworkTarget(proj); + + if (TapCommonCompile.CheckTarget(target)) + { + Debug.LogError("Unity-iPhone is NUll"); + return; + } + + proj.AddBuildProperty(target, "OTHER_LDFLAGS", "-ObjC"); + proj.AddBuildProperty(unityFrameworkTarget, "OTHER_LDFLAGS", "-ObjC"); + + proj.SetBuildProperty(target, "ENABLE_BITCODE", "NO"); + proj.SetBuildProperty(target, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES"); + proj.SetBuildProperty(target, "SWIFT_VERSION", "5.0"); + proj.SetBuildProperty(target, "CLANG_ENABLE_MODULES", "YES"); + + proj.SetBuildProperty(unityFrameworkTarget, "ENABLE_BITCODE", "NO"); + proj.SetBuildProperty(unityFrameworkTarget, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "NO"); + proj.SetBuildProperty(unityFrameworkTarget, "SWIFT_VERSION", "5.0"); + proj.SetBuildProperty(unityFrameworkTarget, "CLANG_ENABLE_MODULES", "YES"); + + proj.AddFrameworkToProject(unityFrameworkTarget, "MobileCoreServices.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "WebKit.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "Security.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "SystemConfiguration.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "CoreTelephony.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "SystemConfiguration.framework", false); + + proj.AddFileToBuild(unityFrameworkTarget, + proj.AddFile("usr/lib/libc++.tbd", "libc++.tbd", PBXSourceTree.Sdk)); + + if (TapCommonCompile.HandlerIOSSetting(path, + Application.dataPath, + "TapCommonResource", + "com.taptap.tds.common", + "Common", + new[] {"TapCommonResource.bundle"}, + target, projPath, proj)) + { + Debug.Log("TapCommon add Bundle Success!"); + return; + } + + Debug.LogError("TapCommon add Bundle Failed!"); + } + } +#endif +} \ No newline at end of file diff --git a/Editor/TapCommonIOSProcessor.cs.meta b/Editor/TapCommonIOSProcessor.cs.meta new file mode 100644 index 0000000..7ed37ba --- /dev/null +++ b/Editor/TapCommonIOSProcessor.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 28d4870389ed406eac7c8849da60c644 +timeCreated: 1617120740 \ No newline at end of file diff --git a/Editor/TapCommonProcessBuild.cs b/Editor/TapCommonProcessBuild.cs new file mode 100644 index 0000000..cb4a420 --- /dev/null +++ b/Editor/TapCommonProcessBuild.cs @@ -0,0 +1,19 @@ +using System; +using UnityEditor.Build.Reporting; + +namespace TapTap.Common.Editor { + public class TapCommonProcessBuild : SDKLinkProcessBuild { + public override int callbackOrder => 0; + + public override string LinkPath => "TapTap/Common/link.xml"; + + public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] { + new LinkedAssembly { Fullname = "TapTap.Common" }, + }; + + public override Func IsTargetPlatform => (report) => { + return BuildTargetUtils.IsSupportMobile(report.summary.platform) || + BuildTargetUtils.IsSupportStandalone(report.summary.platform); + }; + } +} diff --git a/Editor/TapCommonProcessBuild.cs.meta b/Editor/TapCommonProcessBuild.cs.meta new file mode 100644 index 0000000..79280c2 --- /dev/null +++ b/Editor/TapCommonProcessBuild.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a6e2faf8fdae4ea69cc6fb06b69d097 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/TapFileHelper.cs b/Editor/TapFileHelper.cs new file mode 100644 index 0000000..3612f61 --- /dev/null +++ b/Editor/TapFileHelper.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using System.IO; +using UnityEngine; + +namespace TapTap.Common.Editor +{ + public class TapFileHelper : System.IDisposable + { + private string filePath; + + public TapFileHelper(string fPath) + { + filePath = fPath; + if (!System.IO.File.Exists(filePath)) + { + Debug.LogError(filePath + "路径下文件不存在"); + return; + } + } + + public void WriteBelow(string below, string text) + { + StreamReader streamReader = new StreamReader(filePath); + string all = streamReader.ReadToEnd(); + streamReader.Close(); + int beginIndex = all.IndexOf(below, StringComparison.Ordinal); + if (beginIndex == -1) + { + Debug.LogError(filePath + "中没有找到字符串" + below); + return; + } + + int endIndex = all.LastIndexOf("\n", beginIndex + below.Length, StringComparison.Ordinal); + all = all.Substring(0, endIndex) + "\n" + text + "\n" + all.Substring(endIndex); + StreamWriter streamWriter = new StreamWriter(filePath); + streamWriter.Write(all); + streamWriter.Close(); + } + + public void Replace(string below, string newText) + { + StreamReader streamReader = new StreamReader(filePath); + string all = streamReader.ReadToEnd(); + streamReader.Close(); + int beginIndex = all.IndexOf(below, StringComparison.Ordinal); + if (beginIndex == -1) + { + Debug.LogError(filePath + "中没有找到字符串" + below); + return; + } + + all = all.Replace(below, newText); + StreamWriter streamWriter = new StreamWriter(filePath); + streamWriter.Write(all); + streamWriter.Close(); + } + + public void Dispose() + { + } + + public static void CopyAndReplaceDirectory(string srcPath, string dstPath) + { + if (Directory.Exists(dstPath)) + Directory.Delete(dstPath, true); + if (File.Exists(dstPath)) + File.Delete(dstPath); + + Directory.CreateDirectory(dstPath); + + foreach (var file in Directory.GetFiles(srcPath)) + File.Copy(file, Path.Combine(dstPath, Path.GetFileName(file))); + + foreach (var dir in Directory.GetDirectories(srcPath)) + CopyAndReplaceDirectory(dir, Path.Combine(dstPath, Path.GetFileName(dir))); + } + + + public static void DeleteFileBySuffix(string dir, string[] suffix) + { + if (!Directory.Exists(dir)) + { + return; + } + + foreach (var file in Directory.GetFiles(dir)) + { + foreach (var suffixName in suffix) + { + if (file.Contains(suffixName)) + { + File.Delete(file); + } + } + } + } + + public static string FilterFileByPrefix(string srcPath, string filterName) + { + if (!Directory.Exists(srcPath)) + { + return null; + } + + foreach (var dir in Directory.GetDirectories(srcPath)) + { + string fileName = Path.GetFileName(dir); + if (fileName.StartsWith(filterName)) + { + return Path.Combine(srcPath, Path.GetFileName(dir)); + } + } + + return null; + } + + public static string FilterFileBySuffix(string srcPath, string suffix) + { + if (!Directory.Exists(srcPath)) + { + return null; + } + + foreach (var dir in Directory.GetDirectories(srcPath)) + { + string fileName = Path.GetFileName(dir); + if (fileName.StartsWith(suffix)) + { + return Path.Combine(srcPath, Path.GetFileName(dir)); + } + } + + return null; + } + + public static FileInfo RecursionFilterFile(string dir, string fileName) + { + List fileInfoList = new List(); + Director(dir, fileInfoList); + foreach (FileInfo item in fileInfoList) + { + if (fileName.Equals(item.Name)) + { + return item; + } + } + + return null; + } + + public static void Director(string dir, List list) + { + DirectoryInfo d = new DirectoryInfo(dir); + FileInfo[] files = d.GetFiles(); + DirectoryInfo[] directs = d.GetDirectories(); + foreach (FileInfo f in files) + { + list.Add(f); + } + + foreach (DirectoryInfo dd in directs) + { + Director(dd.FullName, list); + } + } + } +} \ No newline at end of file diff --git a/Editor/TapFileHelper.cs.meta b/Editor/TapFileHelper.cs.meta new file mode 100644 index 0000000..4544e0a --- /dev/null +++ b/Editor/TapFileHelper.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d1556fcb81944af6a42170d3e1c99269 +timeCreated: 1617120740 \ No newline at end of file diff --git a/Editor/TapTap.Common.Editor.asmdef b/Editor/TapTap.Common.Editor.asmdef new file mode 100644 index 0000000..420cdd9 --- /dev/null +++ b/Editor/TapTap.Common.Editor.asmdef @@ -0,0 +1,18 @@ +{ + "name": "TapTap.Common.Editor", + "references": [ + "GUID:343deaaf83e0cee4ca978e7df0b80d21", + "GUID:2bafac87e7f4b9b418d9448d219b01ab" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Editor/TapTap.Common.Editor.asmdef.meta b/Editor/TapTap.Common.Editor.asmdef.meta new file mode 100644 index 0000000..35eb2db --- /dev/null +++ b/Editor/TapTap.Common.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 616cea76def2d4f059b94440fc8cc03d +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins.meta b/Plugins.meta new file mode 100644 index 0000000..4643bb3 --- /dev/null +++ b/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 72ddac62e7598413680ccc6ef4858979 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Android.meta b/Plugins/Android.meta new file mode 100644 index 0000000..1ef290c --- /dev/null +++ b/Plugins/Android.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c40d795a083b457fa3d923415533822c +timeCreated: 1616744098 \ No newline at end of file diff --git a/Plugins/Android/libs.meta b/Plugins/Android/libs.meta new file mode 100644 index 0000000..c2589e0 --- /dev/null +++ b/Plugins/Android/libs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9c15be9bece843a4b6998999a603f389 +timeCreated: 1616744107 \ No newline at end of file diff --git a/Plugins/Android/libs/TapCommon_3.18.7.aar b/Plugins/Android/libs/TapCommon_3.18.7.aar new file mode 100644 index 0000000..21b44f7 Binary files /dev/null and b/Plugins/Android/libs/TapCommon_3.18.7.aar differ diff --git a/Plugins/Android/libs/TapCommon_3.18.7.aar.meta b/Plugins/Android/libs/TapCommon_3.18.7.aar.meta new file mode 100644 index 0000000..9b8914d --- /dev/null +++ b/Plugins/Android/libs/TapCommon_3.18.7.aar.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: 3b878a75f3eb6458c91e4aed1aada067 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/TapTap.Common.deps.json b/Plugins/TapTap.Common.deps.json new file mode 100644 index 0000000..5091e20 --- /dev/null +++ b/Plugins/TapTap.Common.deps.json @@ -0,0 +1,75 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "TapTap.Common/1.0.0": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "UnityEditor": "0.0.0.0", + "UnityEngine": "0.0.0.0" + }, + "runtime": { + "TapTap.Common.dll": {} + } + }, + "Microsoft.NETCore.Platforms/1.1.0": {}, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "UnityEditor/0.0.0.0": { + "runtime": { + "UnityEditor.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine/0.0.0.0": { + "runtime": { + "UnityEngine.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + } + } + }, + "libraries": { + "TapTap.Common/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "path": "microsoft.netcore.platforms/1.1.0", + "hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "UnityEditor/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Plugins/TapTap.Common.deps.json.meta b/Plugins/TapTap.Common.deps.json.meta new file mode 100644 index 0000000..b7df757 --- /dev/null +++ b/Plugins/TapTap.Common.deps.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 73783fbd0117e4f6088bf812d1a568b0 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/TapTap.Common.dll b/Plugins/TapTap.Common.dll new file mode 100644 index 0000000..1d9acc6 Binary files /dev/null and b/Plugins/TapTap.Common.dll differ diff --git a/Plugins/TapTap.Common.dll.meta b/Plugins/TapTap.Common.dll.meta new file mode 100644 index 0000000..d9ea908 --- /dev/null +++ b/Plugins/TapTap.Common.dll.meta @@ -0,0 +1,86 @@ +fileFormatVersion: 2 +guid: 75f4d9bf431824223b16a7cb0de56fd3 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 0 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude Win: 0 + Exclude Win64: 0 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/TapTap.Common.pdb b/Plugins/TapTap.Common.pdb new file mode 100644 index 0000000..2bae415 Binary files /dev/null and b/Plugins/TapTap.Common.pdb differ diff --git a/Plugins/TapTap.Common.pdb.meta b/Plugins/TapTap.Common.pdb.meta new file mode 100644 index 0000000..63ea256 --- /dev/null +++ b/Plugins/TapTap.Common.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0f443a727b2704d32966d84ec19ee8ee +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS.meta b/Plugins/iOS.meta new file mode 100644 index 0000000..9ba314a --- /dev/null +++ b/Plugins/iOS.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e935f15b899147eaa8b62cdef502046 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource.meta b/Plugins/iOS/Resource.meta new file mode 100644 index 0000000..9f336ae --- /dev/null +++ b/Plugins/iOS/Resource.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2192f0da58ae410089b7aabfc9375ca4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle.meta b/Plugins/iOS/Resource/TapCommonResource.bundle.meta new file mode 100644 index 0000000..9eea277 --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle.meta @@ -0,0 +1,69 @@ +fileFormatVersion: 2 +guid: 862aa0341df21484eb4a08a6ee21f9c3 +folderAsset: yes +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/TapCommonLanguage.json b/Plugins/iOS/Resource/TapCommonResource.bundle/TapCommonLanguage.json new file mode 100644 index 0000000..3507668 --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/TapCommonLanguage.json @@ -0,0 +1,23 @@ +{ + "zh_hans":{ + "network_error_click_retry":"网络异常,点击重试" + }, + "en":{ + "network_error_click_retry":"Network error, click to retry" + }, + "zh_hant":{ + "network_error_click_retry":"網路異常,點擊重試" + }, + "ja":{ + "network_error_click_retry":"ネットワークエラーです。もう一度やり直してください" + }, + "ko":{ + "network_error_click_retry":"네트워크 오류, 다시 시도하기" + }, + "th":{ + "network_error_click_retry":"พบข้อผิดพลาดในการเชื่อมต่อ กรุณาลองอีกครั้ง" + }, + "id":{ + "network_error_click_retry":"Jaringan error. Harap coba lagi." + } +} diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/TapCommonLanguage.json.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/TapCommonLanguage.json.meta new file mode 100644 index 0000000..acd3dca --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/TapCommonLanguage.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 79e4f9ebbd71047bb9ab9a85daeb9193 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/images.meta new file mode 100644 index 0000000..7223220 --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/images.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b90cb19a0ccd14069b203014806a6748 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_close@2x.png b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_close@2x.png new file mode 100644 index 0000000..60119f8 Binary files /dev/null and b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_close@2x.png differ diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_close@2x.png.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_close@2x.png.meta new file mode 100644 index 0000000..3378791 --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_close@2x.png.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 19fc6b14a3c6245fb80d172e19bc459f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_close@3x.png b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_close@3x.png new file mode 100644 index 0000000..f88ef81 Binary files /dev/null and b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_close@3x.png differ diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_close@3x.png.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_close@3x.png.meta new file mode 100644 index 0000000..1f333e4 --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_close@3x.png.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6b195edcbdd694b0bb422b2f2c4423b9 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_cancel@2x.png b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_cancel@2x.png new file mode 100644 index 0000000..0361994 Binary files /dev/null and b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_cancel@2x.png differ diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_cancel@2x.png.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_cancel@2x.png.meta new file mode 100644 index 0000000..3e03261 --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_cancel@2x.png.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 21fdeeca33c2d48258227cea39860103 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_cancel@3x.png b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_cancel@3x.png new file mode 100644 index 0000000..63c3b56 Binary files /dev/null and b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_cancel@3x.png differ diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_cancel@3x.png.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_cancel@3x.png.meta new file mode 100644 index 0000000..d1b9a56 --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_cancel@3x.png.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2f74478f5ddcc4628ad879e8c8f1cc22 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_close@2x.png b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_close@2x.png new file mode 100644 index 0000000..6251d3d Binary files /dev/null and b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_close@2x.png differ diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_close@2x.png.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_close@2x.png.meta new file mode 100644 index 0000000..b7852c8 --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_close@2x.png.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fbf577ace10714238ac825fb2069a5f5 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_close@3x.png b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_close@3x.png new file mode 100644 index 0000000..f26bec3 Binary files /dev/null and b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_close@3x.png differ diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_close@3x.png.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_close@3x.png.meta new file mode 100644 index 0000000..538891f --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_close@3x.png.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 269ea3a1cfd224d50bbfc20e0b529eb0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_confirm@2x.png b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_confirm@2x.png new file mode 100644 index 0000000..371bf8d Binary files /dev/null and b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_confirm@2x.png differ diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_confirm@2x.png.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_confirm@2x.png.meta new file mode 100644 index 0000000..79f515f --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_confirm@2x.png.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4ef285809644943588a98cc1bad12d80 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_confirm@3x.png b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_confirm@3x.png new file mode 100644 index 0000000..1db710b Binary files /dev/null and b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_confirm@3x.png differ diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_confirm@3x.png.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_confirm@3x.png.meta new file mode 100644 index 0000000..6f65ad0 --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_dialog_confirm@3x.png.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 497164c4329b345dc9fcf9a603822bd4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_reload@2x.png b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_reload@2x.png new file mode 100644 index 0000000..f4b63f4 Binary files /dev/null and b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_reload@2x.png differ diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_reload@2x.png.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_reload@2x.png.meta new file mode 100644 index 0000000..c28aee4 --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_reload@2x.png.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6e4c19f7cee284504ba294c04ddc21ff +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_reload@3x.png b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_reload@3x.png new file mode 100644 index 0000000..4f2ea9e Binary files /dev/null and b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_reload@3x.png differ diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_reload@3x.png.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_reload@3x.png.meta new file mode 100644 index 0000000..4df7c85 --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/images/ic_reload@3x.png.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 440bced484e8f4ab28accda051d448f0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonDelegate.h b/Plugins/iOS/TapCommonDelegate.h new file mode 100644 index 0000000..e2dc244 --- /dev/null +++ b/Plugins/iOS/TapCommonDelegate.h @@ -0,0 +1,16 @@ +// +// TapDelegate.h +// Unity-iPhone +// +// Created by xe on 2021/7/14. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TapCommonDelegate : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonDelegate.h.meta b/Plugins/iOS/TapCommonDelegate.h.meta new file mode 100644 index 0000000..9295b2c --- /dev/null +++ b/Plugins/iOS/TapCommonDelegate.h.meta @@ -0,0 +1,27 @@ +fileFormatVersion: 2 +guid: 194ed5d2453144ac9b98c5c7cf599e9c +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonDelegate.mm b/Plugins/iOS/TapCommonDelegate.mm new file mode 100644 index 0000000..17b306d --- /dev/null +++ b/Plugins/iOS/TapCommonDelegate.mm @@ -0,0 +1,33 @@ +// +// TapDelegate.m +// Unity-iPhone +// +// Created by xe on 2021/7/14. +// + +#import +#import +#import +#include "AppDelegateListener.h" +#include "LifeCycleListener.h" +#import "TapCommonDelegate.h" +#import + +@implementation TapCommonDelegate + ++(void) load{ + static dispatch_once_t onceToken; + dispatch_once(&onceToken,^{ + + NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; + [nc addObserverForName:kUnityOnOpenURL object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) { + if ([note.userInfo isKindOfClass: [NSMutableDictionary class]]) { + NSURL* url = [note.userInfo objectForKey:@"url"]; + [TDSHandleUrl handleOpenURL:url]; + } + }]; + + }); +} + +@end diff --git a/Plugins/iOS/TapCommonDelegate.mm.meta b/Plugins/iOS/TapCommonDelegate.mm.meta new file mode 100644 index 0000000..ea0e182 --- /dev/null +++ b/Plugins/iOS/TapCommonDelegate.mm.meta @@ -0,0 +1,37 @@ +fileFormatVersion: 2 +guid: 04967bfc53c484d1c81447df7cb1822b +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + - first: + tvOS: tvOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework.meta b/Plugins/iOS/TapCommonSDK.framework.meta new file mode 100644 index 0000000..c5c8b68 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework.meta @@ -0,0 +1,69 @@ +fileFormatVersion: 2 +guid: 2a236b3c23efa4a80b48d344322d8741 +folderAsset: yes +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers.meta b/Plugins/iOS/TapCommonSDK.framework/Headers.meta new file mode 100644 index 0000000..0d42b84 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a8a28609820814ef6a5258f3f0dae820 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/ActionModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/ActionModel.h new file mode 100644 index 0000000..9523395 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/ActionModel.h @@ -0,0 +1,20 @@ +// +// ActionModel.h +// TDSCommon +// +// Created by TapTap-David on 2021/1/19. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ActionModel : NSObject +@property (nonatomic, copy) NSString *click; +@property (nonatomic, copy) NSString *like; +@property (nonatomic, copy) NSString *comment; +@property (nonatomic, copy) NSString *collect; +@property (nonatomic, copy) NSString *impression; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/ActionModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/ActionModel.h.meta new file mode 100644 index 0000000..2242e76 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/ActionModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c60758f5bcbe240cf8b34f0b5b3bdd2f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h b/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h new file mode 100644 index 0000000..e163f5f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h @@ -0,0 +1,16 @@ +// +// ComponentMessageDelegate.h +// TapCommonSDK +// +// Created by Bottle K on 2021/5/11. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@protocol ComponentMessageDelegate + +- (void)onMessageWithCode:(NSInteger)code extras:(NSDictionary *)extras; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h.meta new file mode 100644 index 0000000..2584262 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d84298df76b5b4d58a00af70a4643d01 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/EngineBridgeError.h b/Plugins/iOS/TapCommonSDK.framework/Headers/EngineBridgeError.h new file mode 100644 index 0000000..cc6396e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/EngineBridgeError.h @@ -0,0 +1,19 @@ +// +// EngineBridgeError.h +// EngineBridge +// +// Created by xe on 2020/9/28. +// Copyright © 2020 xe. All rights reserved. +// +#import + +typedef NSString *KLTypeStr NS_STRING_ENUM; + +FOUNDATION_EXPORT KLTypeStr const COMMAND_PARSE_ERROR; + +FOUNDATION_EXPORT KLTypeStr const COMMAND_SERVICE_ERROR; + +FOUNDATION_EXPORT KLTypeStr const COMMAND_METHOD_ERROR; + +FOUNDATION_EXPORT KLTypeStr const COMMAND_ARGS_ERROR; + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/EngineBridgeError.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/EngineBridgeError.h.meta new file mode 100644 index 0000000..af545f5 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/EngineBridgeError.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6ee69e4d2a9a242548b6c26e8fafe5e0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/LoginModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/LoginModel.h new file mode 100644 index 0000000..f2fff07 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/LoginModel.h @@ -0,0 +1,44 @@ +// +// LoginModel.h +// TapCommonSDK +// +// Created by Bottle K on 2021/6/21. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +//登录流程中触发的事件 +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_AUTHORIZE_START; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_OPEN; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_BACK; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_TOKEN; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_PROFILE; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_SUCCESS; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_FAIL; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_CANCEL; + +//登录类型 +FOUNDATION_EXPORT NSString *const LOGIN_TYPE_TAPTAP; +FOUNDATION_EXPORT NSString *const LOGIN_TYPE_WEBVIEW; +FOUNDATION_EXPORT NSString *const LOGIN_TYPE_AUTO; + +@interface LoginModel : NSObject +//每次登录流程唯一ID +@property (nonatomic, copy) NSString *login_session_id; + +//登录流程中触发的事件 +@property (nonatomic, copy) NSString *login_action; + +//登录类型 +@property (nonatomic, copy, nullable) NSString *login_type; + +//错误code +@property (nonatomic, copy, nullable) NSString *login_error_code; + +//错误message +@property (nonatomic, copy, nullable) NSString *login_error_msg; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/LoginModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/LoginModel.h.meta new file mode 100644 index 0000000..f966ac8 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/LoginModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7b5690c16bbbd48299132d7d8b03d8b2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSArray+Safe.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSArray+Safe.h new file mode 100644 index 0000000..0e495b7 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSArray+Safe.h @@ -0,0 +1,25 @@ +// +// NSArray+Safe.h +// TapAchievement +// +// Created by TapTap-David on 2020/9/15. +// Copyright © 2020 taptap. All rights reserved. +// + +#import + +@interface NSArray (Safe) + +- (void)tds_each:(void (^)(id object, NSUInteger index))block; + +- (void)tds_apply:(void (^)(id object, NSUInteger index))block; + +- (NSArray *)tds_map:(id (^)(id object, NSUInteger index))block; + +- (id)tds_reduce:(id (^)(id accumulated, id object))block; + +- (NSArray *)tds_filter:(BOOL (^)(id object, NSUInteger index))block; + +- (id)tds_safeObjectAtIndex:(NSUInteger)index; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSArray+Safe.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSArray+Safe.h.meta new file mode 100644 index 0000000..e60e617 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSArray+Safe.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8e9453fbfc622476a9a415907ee7445c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSBundle+Tools.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSBundle+Tools.h new file mode 100644 index 0000000..8580684 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSBundle+Tools.h @@ -0,0 +1,16 @@ +// +// NSBundle+Tools.h +// TDSAchievement +// +// Created by TapTap-David on 2020/8/26. +// Copyright © 2020 taptap. All rights reserved. +// +#import + +@interface NSBundle (Tools) ++ (instancetype)tds_bundleName:(NSString *)bundleName aClass:(Class)aClass; +- (NSString *)tds_localizedStringForKey:(NSString *)key value:(NSString *)value; +- (NSString *)tds_localizedStringForKey:(NSString *)key; + +- (UIImage *)tds_imageName:(NSString *)imageName; +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSBundle+Tools.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSBundle+Tools.h.meta new file mode 100644 index 0000000..a8d5080 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSBundle+Tools.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cea491a5e3e014fd78b6494c9953e959 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSData+Tools.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSData+Tools.h new file mode 100644 index 0000000..179ce72 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSData+Tools.h @@ -0,0 +1,22 @@ +// +// NSData+JSON.h +// NativeApp +// +// Created by JiangJiahao on 2018/3/9. +// Copyright © 2018年 JiangJiahao. All rights reserved. +// + +#import + +@interface NSData (JSON) + +- (NSArray *)tds_arrayFromJsonData; + +- (NSDictionary *)tds_dictionaryFromJsonData; + +- (NSString *)tds_stringFromData; + +- (NSData *)tds_aes256Encrypt:(NSString *)key; +- (NSData *)tds_aes256Decrypt:(NSString *)key; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSData+Tools.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSData+Tools.h.meta new file mode 100644 index 0000000..94dc8b0 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSData+Tools.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1ca1102d9e9ad4aff9e640edc5acab06 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+JSON.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+JSON.h new file mode 100644 index 0000000..57fa4af --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+JSON.h @@ -0,0 +1,18 @@ +// +// NSDictionary+JSON.h +// NativeApp +// +// Created by JiangJiahao on 2018/10/11. +// Copyright © 2018 JiangJiahao. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSDictionary (JSON) +- (NSString *)tds_jsonString; +- (NSString *)tds_jsonStringWithoutOptions:(NSJSONWritingOptions)opt; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+JSON.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+JSON.h.meta new file mode 100644 index 0000000..f2d305b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+JSON.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9b35f6ea3f49c443f864bbdeb7b22dff +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+TDSSafe.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+TDSSafe.h new file mode 100644 index 0000000..94c23d6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+TDSSafe.h @@ -0,0 +1,24 @@ +// +// NSDictionary+TDSSafe.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSDictionary (TDSSafe) + +- (BOOL)tds_boolForKey:(NSString *)key; +- (NSInteger)tds_integerForKey:(NSString *)key; +- (NSDictionary *)tds_dicForKey:(NSString *)key; +- (NSString *)tds_stringForKey:(NSString *)key; +- (NSArray *)tds_arrayForKey:(NSString *)key; +- (NSSet *)tds_setForKey:(NSString *)key; +- (NSNumber *)tds_numberForKey:(NSString *)key; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+TDSSafe.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+TDSSafe.h.meta new file mode 100644 index 0000000..a477eb9 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+TDSSafe.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b467f285b95e94068a72953ec87e6f22 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h new file mode 100644 index 0000000..f597867 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h @@ -0,0 +1,19 @@ +// +// NSError+Ext.h +// TapAchievement +// +// Created by TapTap-David on 2020/9/22. +// Copyright © 2020 taptap. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSError (Ext) ++ (instancetype)errorWithMessage:(NSString *)errorMsg code:(NSInteger)code; + ++ (instancetype)errorWithContent:(NSString *)content message:(NSString *)message code:(NSInteger)code; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h.meta new file mode 100644 index 0000000..1f4f0af --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4db9c272ffe484a029612a3ddfb1a192 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSMutableArray+Safe.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSMutableArray+Safe.h new file mode 100644 index 0000000..1c3f0d9 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSMutableArray+Safe.h @@ -0,0 +1,23 @@ +// +// NSMutableArray+Safe.h +// TapAchievement +// +// Created by TapTap-David on 2020/9/24. +// Copyright © 2020 taptap. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSMutableArray (Safe) +- (void)tt_safeAddObject:(id)anObject; + +- (void)tt_addNonNullObject:(id)anObject; + +- (void)tt_safeInsertObject:(id)anObject atIndex:(NSUInteger)index; + +- (void)tt_safeReplaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSMutableArray+Safe.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSMutableArray+Safe.h.meta new file mode 100644 index 0000000..7133914 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSMutableArray+Safe.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 07a4d45a85cf24329b490526e5a364b4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSCoding.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSCoding.h new file mode 100644 index 0000000..08a080d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSCoding.h @@ -0,0 +1,23 @@ +// +// NSObject+TDSCoding.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSObject (TDSCoding) +/** + * 解码(从文件中解析对象) + */ +- (void)tds_decode:(NSCoder *)decoder; +/** + * 编码(将对象写入文件中) + */ +- (void)tds_encode:(NSCoder *)encoder; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSCoding.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSCoding.h.meta new file mode 100644 index 0000000..13dbff7 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSCoding.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4071796dc0d4e44aea5e286527e687fc +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSModel.h new file mode 100644 index 0000000..72498f5 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSModel.h @@ -0,0 +1,30 @@ +// +// NSObject+TDSModel.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol TDSModel +@optional + ++ (NSDictionary *)replacedKeyFromPropertyName; ++ (NSString *)replacedKeyFromPropertyName:(NSString *)propertyName; ++ (NSDictionary *)objectClassInArray; ++ (Class)objectClassInArray:(NSString *)propertyName; + +@end + +@interface NSObject (TDSModel) + ++ (instancetype)tds_modelWithKeyValues:(id)keyValues; + +- (NSDictionary *)tds_keyValues; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSModel.h.meta new file mode 100644 index 0000000..2f20f81 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ccb70cb2bd98b46ffb194624b97a86b0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSProperty.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSProperty.h new file mode 100644 index 0000000..d86dcf6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSProperty.h @@ -0,0 +1,25 @@ +// +// NSObject+TDSProperty.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void (^TDSClassesEnumerator) (Class cls, BOOL *stop); + +typedef void (^TDSPropertiesEnumerator) (TDSProperty *property, BOOL *stop); + +@interface NSObject (TDSProperty) ++ (void)tds_enumerateProperties:(TDSPropertiesEnumerator)enumerator; + ++ (void)tds_enumerateClasses:(TDSClassesEnumerator)enumerator; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSProperty.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSProperty.h.meta new file mode 100644 index 0000000..ccc517d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSProperty.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 83df67718bc1d4c6bae0aa79e1112d49 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSString+Tools.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSString+Tools.h new file mode 100644 index 0000000..48d156f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSString+Tools.h @@ -0,0 +1,34 @@ +// +// NSString+Tools.h +// TDS +// +// Created by JiangJiahao on 2018/4/24. +// Copyright © 2018年 dyy. All rights reserved. +// + +#import + +@interface NSString (Tools) +- (NSString *)tds_URLEncodedString; +- (NSString *)tds_URLDecodedString; +///反转字符串 +- (NSString *)tds_reverse; + +// MD5 hash of the file on the filesystem specified by path ++ (NSString *)tds_stringWithMD5OfFile:(NSString *)path; +// The string's MD5 hash +- (NSString *)tds_MD5Hash; + +// base64 +- (NSString *)tds_base64Encode; +- (NSString *)tds_base64Decode; + +// aes256 +- (NSString *)tds_aes256Encrypt:(NSString *)key; +- (NSString *)tds_aes256Decrypt:(NSString *)key; + +/// 是否是空字符串 ++ (BOOL)tds_isEmpty:(NSString *)string; + +- (NSDictionary *)tds_toDictionary; +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSString+Tools.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSString+Tools.h.meta new file mode 100644 index 0000000..1f79c99 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSString+Tools.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cb092511994224303b56840187ff84b1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NetworkStateModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NetworkStateModel.h new file mode 100644 index 0000000..cf37c6b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NetworkStateModel.h @@ -0,0 +1,20 @@ +// +// NetworkStateModel.h +// TDSCommon +// +// Created by TapTap-David on 2021/3/23. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NetworkStateModel : NSObject +@property (nonatomic, copy) NSString *session_id; //每次启动唯一ID +@property (nonatomic, copy) NSString *host; //服务器 +@property (nonatomic, assign) NSInteger code; //返回码200成功 +@property (nonatomic, assign) CGFloat delay; //网络延迟时间(毫秒) +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NetworkStateModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NetworkStateModel.h.meta new file mode 100644 index 0000000..89f756d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NetworkStateModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3191a9f6359254952bab456ed877c19d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/PageModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/PageModel.h new file mode 100644 index 0000000..636f720 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/PageModel.h @@ -0,0 +1,37 @@ +// +// PageModel.h +// TDSCommon +// +// Created by TapTap-David on 2021/1/19. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +//页面唯一id +FOUNDATION_EXPORT NSString *const PAGE_ID_TAPTAP_AUTHORIZE_WEB; +FOUNDATION_EXPORT NSString *const PAGE_ID_TAPTAP_AUTHORIZE_TAPTAPCLIENT; +FOUNDATION_EXPORT NSString *const PAGE_ID_GAME; +//页面别名 +FOUNDATION_EXPORT NSString *const PAGE_NAME_TAPTAP_AUTHORIZE_WEB; +FOUNDATION_EXPORT NSString *const PAGE_NAME_TAPTAP_AUTHORIZE_TAPTAPCLIENT; +FOUNDATION_EXPORT NSString *const PAGE_NAME_GAME; + +//页面事件名 +FOUNDATION_EXPORT NSString *const PAGE_ACTION_APPEAR; +FOUNDATION_EXPORT NSString *const PAGE_ACTION_DISAPPEAR; + +@interface PageModel : NSObject +//页面唯一id +@property (nonatomic, copy, nullable) NSString *page_id; + +//页面别名 +@property (nonatomic, copy, nullable) NSString *page_name; + +//页面事件名 +@property (nonatomic, copy, nullable) NSString *page_action; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/PageModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/PageModel.h.meta new file mode 100644 index 0000000..9c50eef --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/PageModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9a317684e439240f98a127a830d72c2c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h b/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h new file mode 100644 index 0000000..a3e4a25 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h @@ -0,0 +1,17 @@ +// +// PlatformXUA.h +// TapCommonSDK +// +// Created by Bottle K on 2021/6/21. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface PlatformXUA : NSObject +@property (nonatomic, copy) NSDictionary *xuaMap; ++ (instancetype)shareInstance; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h.meta new file mode 100644 index 0000000..7cefc4b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5b123045b3035401ea43efa755baa781 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccount.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccount.h new file mode 100644 index 0000000..6d995b7 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccount.h @@ -0,0 +1,45 @@ +// +// TDSAccount.h +// TDSCommon +// +// Created by Bottle K on 2020/9/29. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM (NSInteger, TDSAccountType) { + TAP, + XD, + XDG, + TYPE_TDS, +LC +}; + +@interface TDSAccount : NSObject + +/// xd token +@property (nonatomic, copy, readonly) NSString *token; +/// tap/tds +@property (nonatomic, copy, readonly) NSString *kid; +@property (nonatomic, copy, readonly) NSString *accessToken; +@property (nonatomic, copy, readonly) NSString *tokenType; +@property (nonatomic, copy, readonly) NSString *macKey; +@property (nonatomic, copy, readonly) NSString *macAlgorithm; +/// tds +@property (nonatomic, assign, readonly) long expireIn; +/// lc +@property (nonatomic, copy, readonly) NSString *clientId; +@property (nonatomic, copy, readonly) NSString *clientToken; +@property (nonatomic, copy, readonly) NSString *sessionToken; + +- (instancetype)initWithToken:(NSString *)token type:(TDSAccountType)type; + +- (instancetype)initWithLC:(NSString *)token type:(TDSAccountType)type; + +- (TDSAccountType)getAccountType; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccount.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccount.h.meta new file mode 100644 index 0000000..58b2d64 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccount.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c328ad44f598147f18b61d0de5b27dca +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountNotification.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountNotification.h new file mode 100644 index 0000000..813fae7 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountNotification.h @@ -0,0 +1,19 @@ +// +// TDSAccountNotification.h +// TapBootstrapSDK +// +// Created by Bottle K on 2021/4/26. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const TAP_LOGIN_SUCCESS_NOTIFICATION; +extern NSString *const TAP_LOGIN_FAIL_NOTIFICATION; + +@interface TDSAccountNotification : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountNotification.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountNotification.h.meta new file mode 100644 index 0000000..ed544f6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountNotification.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ca668e8869c184d8b83aff7363e2be0b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountProvider.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountProvider.h new file mode 100644 index 0000000..2e3c970 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountProvider.h @@ -0,0 +1,22 @@ +// +// TDSAccountProvider.h +// TapCommonSDK +// +// Created by Bottle K on 2021/3/30. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol TDSAccountProvider + +- (nullable TDSAccount *)getAccount; + +- (nullable NSDictionary *)getLocalUserInfo; + +- (void)getAccountUser:(void (^)(NSDictionary *_Nullable userInfo, NSError *_Nullable error))handler; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountProvider.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountProvider.h.meta new file mode 100644 index 0000000..f9f492d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountProvider.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f6b2ad62577cd473a8912fe88e841275 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAsyncHttp.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAsyncHttp.h new file mode 100644 index 0000000..f0f5476 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAsyncHttp.h @@ -0,0 +1,80 @@ +// +// AsyncHttp.h +// +// Created by JiangJiahao on 2018/3/9. +// Copyright © 2018年 JiangJiahao. All rights reserved. +// 简单HTTP请求 + +#import +#import + +extern NSString *const TDS_TIMEOUTKEY; +extern NSString *const TDS_HTTPMETHODKEY; +extern NSString *const TDS_HTTPBODYKEY; +extern NSString *const TDS_DATAFORMAT; +extern NSString *const TDS_CACHE_POLICY_KEY; +extern NSString *const TDS_PROTOBUF_KEY; + +/** + header + */ +extern NSString *const TDS_AUTH_KEY; + + +typedef void(^CallBackBlock)(TDSHttpResult *result); +typedef void(^GetAllCallBack)(NSArray *resultArr,BOOL successAll); + + +@interface TDSAsyncHttp : NSObject +@property (nonatomic,copy) CallBackBlock callBackBlock; +@property (nonatomic,copy) CallBackBlock failedCallback; + +- (void)stopTask; +- (void)retryTask; + +- (void)handleSuccessResult:(TDSHttpResult *)result; +- (void)handleFailResult:(TDSHttpResult *)result; + +/// GET请求 +/// @param urlStr url +/// @param requestParams 网络请求参数,如超时、格式等 +/// @param customHeaderParams 自定义请求头参数 +/// @param params 本次请求参数 +/// @param callBackBlock 成功回调 +/// @param failedCallback 失败回调 +- (TDSAsyncHttp *)httpGet:(NSString *)urlStr + requestParams:(NSDictionary *)requestParams + customHeader:(NSDictionary *)customHeaderParams + params:(NSDictionary *)params + callBack:(CallBackBlock)callBackBlock failedCallback:(CallBackBlock)failedCallback; + +/** + 多个get请求并发,同时返回 + + @param urlStrArr URL数组 + @param requestParamsArr 请求参数数组 + @param customHeaderParamsArr 自定义请求头数组 + @param paramsDicArr 参数数组 + @param callback 回掉 + */ +- (void)httpGetAll:(NSArray *)urlStrArr + requestParamsArr:(NSArray *)requestParamsArr + customHeadersArr:(NSArray *)customHeaderParamsArr + params:(NSArray *)paramsDicArr + callback:(GetAllCallBack)callback; + +/// POST请求 +/// @param urlStr URL +/// @param requestParams 网络请求参数,如超时、数据格式、请求头等 +/// @param customHeaderParams 自定义请求头参数 +/// @param params 本次请求参数 +/// @param callBackBlock 成功回调 +/// @param failedCallback 失败回调 +- (TDSAsyncHttp *)httpPost:(NSString *)urlStr + requestParams:(NSDictionary *)requestParams + customHeader:(NSDictionary *)customHeaderParams + params:(NSDictionary *)params + callBack:(CallBackBlock)callBackBlock + failedCallback:(CallBackBlock)failedCallback; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAsyncHttp.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAsyncHttp.h.meta new file mode 100644 index 0000000..f463d71 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAsyncHttp.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fe31494f73ab24d37bc06392a8e208d8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAutoLayout.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAutoLayout.h new file mode 100644 index 0000000..04fc30d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAutoLayout.h @@ -0,0 +1,78 @@ +// +// XDGAutoLayout.h +// XDG +// +// Created by JiangJiahao on 2020/8/20. +// Copyright © 2020 JiangJiahao. All rights reserved. +// 简单自动布局类 + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSAutoLayout : NSObject + ++ (void)openAutoLayout:(UIView *)targetView; ++ (void)safeAreaLayout:(BOOL)safe; + ++ (NSLayoutConstraint *)layoutHeight:(UIView *)targetView height:(CGFloat)height; ++ (NSLayoutConstraint *)layoutWidth:(UIView *)targetView width:(CGFloat)width; + +/// 相等约束相等布局 +/// @param view1 view1 +/// @param view2 view2 ++ (void)layoutViewEqual:(UIView *)view1 toView:(UIView *)view2; + ++ (NSLayoutConstraint *)layoutViewEqual:(UIView *)view1 + toView:(UIView *)view2 + attribute:(NSLayoutAttribute)attr; + ++ (NSLayoutConstraint *)layoutViewEqual:(UIView *)view1 + toView:(UIView *)view2 + attribute:(NSLayoutAttribute)attr + offset:(CGFloat)offset; + ++ (NSLayoutConstraint *)layoutViewEqual:(UIView *)view1 + attribute:(NSLayoutAttribute)attr1 + toView:(UIView *)view2 + attribute:(NSLayoutAttribute)attr2; + +/// 约束两个view相等 +/// @param view1 view1 +/// @param attr1 view1约束 +/// @param view2 view2 +/// @param attr2 view2约束 +/// @param constant 距离 ++ (NSLayoutConstraint *)layoutViewEqual:(UIView *)view1 + attribute:(NSLayoutAttribute)attr1 + toView:(UIView *)view2 + attribute:(NSLayoutAttribute)attr2 + constant:(CGFloat)constant; + +/// 约束两个view,更大 +/// @param view1 view1 +/// @param attr1 view1约束 +/// @param view2 view2 +/// @param attr2 view2约束 +/// @param constant 距离 ++ (NSLayoutConstraint *)layoutViewGreater:(UIView *)view1 + attribute:(NSLayoutAttribute)attr1 + toView:(nullable UIView *)view2 + attribute:(NSLayoutAttribute)attr2 + constant:(CGFloat)constant; + +/// 约束两个view,更小 +/// @param view1 view1 +/// @param attr1 view1约束 +/// @param view2 view2 +/// @param attr2 view2约束 +/// @param constant 距离 ++ (NSLayoutConstraint *)layoutViewLesser:(UIView *)view1 + attribute:(NSLayoutAttribute)attr1 + toView:(nullable UIView *)view2 + attribute:(NSLayoutAttribute)attr2 + constant:(CGFloat)constant; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAutoLayout.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAutoLayout.h.meta new file mode 100644 index 0000000..bf03a86 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAutoLayout.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d7f4c9451a5e4425b92d94bb24a01646 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBaseManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBaseManager.h new file mode 100644 index 0000000..56d377d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBaseManager.h @@ -0,0 +1,21 @@ +// +// TDSSDK.h +// TDSCommon +// +// Created by Bottle K on 2020/10/13. +// + +#import +#import + +#define TapCommonSDK @"TapCommon" +#define TapCommonSDK_VERSION_NUMBER @"31807001" +#define TapCommonSDK_VERSION @"3.18.7" + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSBaseManager : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBaseManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBaseManager.h.meta new file mode 100644 index 0000000..3802749 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBaseManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: db42cba90fcc14a009800ba974274120 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridge.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridge.h new file mode 100644 index 0000000..5cca4f9 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridge.h @@ -0,0 +1,39 @@ +// +// bridge.h +// bridge +// +// Created by xe on 2020/10/15. +// Copyright © 2020 xe. All rights reserved. +// + +#import + +#import +#import +#import +#import +#import +#import + +//! Project version number for bridge. +FOUNDATION_EXPORT double bridgeVersionNumber; + +//! Project version string for bridge. +FOUNDATION_EXPORT const unsigned char bridgeVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +@interface TDSBridge : NSObject + +@property (nonatomic, weak) iddelegte; + ++ (instancetype)instance; + +- (void)callHandler:(NSString*) command; + +- (void)registerHandler:(NSString*) command + bridgeCallback:(id) callback; + +@end + + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridge.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridge.h.meta new file mode 100644 index 0000000..cfae636 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridge.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fc5ca217933f44e4080588a101983022 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h new file mode 100644 index 0000000..46902f7 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h @@ -0,0 +1,16 @@ +// +// BridgeCallback.h +// Bridge +// +// Created by xe on 2020/10/16. +// Copyright © 2020 xe. All rights reserved. +// +#import + +@protocol TDSBridgeCallback + +@optional + +- (void)onResult:(NSString *)msg; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h.meta new file mode 100644 index 0000000..28ddee3 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8bf269a1cc2b64a6ba437241d2686903 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeException.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeException.h new file mode 100644 index 0000000..3efde93 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeException.h @@ -0,0 +1,13 @@ +// +// BridgeException.h +// EngineBridge +// +// Created by xe on 2020/10/9. +// Copyright © 2020 xe. All rights reserved. +// + +#import + +@interface TDSBridgeException : NSException +@end + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeException.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeException.h.meta new file mode 100644 index 0000000..a6ba213 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeException.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 127acfa29c9364caeb4ba9f68a9eeb3b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeProxy.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeProxy.h new file mode 100644 index 0000000..69c4c66 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeProxy.h @@ -0,0 +1,19 @@ +// +// EngineBridgeProxy.h +// Bridge +// +// Created by xe on 2020/10/15. +// Copyright © 2020 xe. All rights reserved. +// + +#import +#import +#import + +@interface TDSBridgeProxy : NSObject + ++ (TDSBridgeProxy *)shareInstance; + +- (void)onResult:(NSString*) result; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeProxy.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeProxy.h.meta new file mode 100644 index 0000000..9b75f5e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeProxy.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fee7a334994df4f87adf11fadb1378fc +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeTool.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeTool.h new file mode 100644 index 0000000..32a21b6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeTool.h @@ -0,0 +1,28 @@ +// +// BridgeTool.h +// EngineBridge +// +// Created by xe on 2020/10/9. +// Copyright © 2020 xe. All rights reserved. +// + +#import + +@interface TDSBridgeTool : NSObject + ++ (BOOL)isEmpty:(NSString *)str; + ++ (NSString *)jsonStringWithString:(NSString *)string; + ++ (NSString *)jsonStringWithArray:(NSArray *)array; + ++ (NSString *)jsonStringWithDictionary:(NSDictionary *)dictionary; + ++ (NSString *)jsonStringWithObject:(id)model; + ++ (NSString *)jsonStringWithMutaDic:(NSDictionary *)dic; + ++ (NSDictionary *)dictionaryWithModel:(id)model; + +@end + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeTool.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeTool.h.meta new file mode 100644 index 0000000..d14bba5 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeTool.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5073715c6443042b5affd00496c3ff2e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSButton.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSButton.h new file mode 100644 index 0000000..a709a8b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSButton.h @@ -0,0 +1,21 @@ +// +// TDSButton.h +// TapCommonSDK +// +// Created by Bottle K on 2021/4/27. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSButton : UIButton + +@property (nonatomic, assign) NSInteger mode; + +- (void)confirmMode; + +- (void)cancelMode; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSButton.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSButton.h.meta new file mode 100644 index 0000000..0712fb6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSButton.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2f78c634353604e428c0ec650fe8ca9f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommand.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommand.h new file mode 100644 index 0000000..2cf42ba --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommand.h @@ -0,0 +1,29 @@ +// +// Command.h +// EngineBridge +// +// Created by xe on 2020/9/28. +// Copyright © 2020 xe. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + + +@interface TDSCommand : NSObject + +@property (nonatomic,copy) NSString* service; +@property (nonatomic,copy) NSString* method; +@property (nonatomic,copy) NSString* args; +@property (nonatomic,copy) NSString* callbackId; +@property (nonatomic,assign) BOOL callback; +@property (nonatomic,assign) BOOL onceTime; + ++ (TDSCommand*)constructorCommand:(NSString*)commandJSON; + +- (NSString*)toJSON; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommand.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommand.h.meta new file mode 100644 index 0000000..3e0733b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommand.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 812798dc1c8b44dacb63c31fcd5f96c5 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommandTask.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommandTask.h new file mode 100644 index 0000000..49c7b71 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommandTask.h @@ -0,0 +1,19 @@ +// +// CommandTask.h +// EngineBridge +// +// Created by xe on 2020/9/29. +// Copyright © 2020 xe. All rights reserved. +// +#import +#import +NS_ASSUME_NONNULL_BEGIN + +@interface TDSCommandTask : NSObject + +- (void)execute:(TDSCommand *)command brigeCallback:(void (^)(NSString * resultJSON))result; + +@end + +NS_ASSUME_NONNULL_END + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommandTask.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommandTask.h.meta new file mode 100644 index 0000000..2e9490d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommandTask.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4676c1aed720b430b9f563a1795081b1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonConfirmDialog.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonConfirmDialog.h new file mode 100644 index 0000000..78a1dce --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonConfirmDialog.h @@ -0,0 +1,23 @@ +// +// TDSCommonConfirmDialog.h +// TDSCommon +// +// Created by Bottle K on 2021/3/2. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void (^TDSCommonConfirmDialogHandler) (BOOL confirm); + +@interface TDSCommonConfirmDialog : UIView +- (void)setupWithTitle:(NSString *)title + content:(NSString *)content + cancelText:(NSString *)cancelText + confirmText:(NSString *)confirmText + handler:(TDSCommonConfirmDialogHandler)handler; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonConfirmDialog.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonConfirmDialog.h.meta new file mode 100644 index 0000000..21f137c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonConfirmDialog.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f020fa6df9ab2495bb0681180ff3faed +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonDialogView.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonDialogView.h new file mode 100644 index 0000000..13c1260 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonDialogView.h @@ -0,0 +1,31 @@ +// +// TDSCommonDialogView.h +// TapCommonSDK +// +// Created by Bottle K on 2021/4/29. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol TDSCommonDialogProtocol + +- (void)onReloadData; +- (void)onClose; +@end + +@interface TDSCommonDialogView : UIView +@property (nonatomic, weak) id delegate; + +@property (nonatomic, strong) UIView *dialogView; + +//loading +@property (nonatomic, strong) UIView *loadingView; +//reload +@property (nonatomic, strong) UIView *reloadView; + +- (void)closeDialog; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonDialogView.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonDialogView.h.meta new file mode 100644 index 0000000..a5aefa0 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonDialogView.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 99dc5a5c4845d4b4cb02e004a9718855 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonHeader.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonHeader.h new file mode 100644 index 0000000..1116f2d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonHeader.h @@ -0,0 +1,21 @@ +// +// TDSCommonHeader.h +// TDSCommon +// +// Created by Bottle K on 2020/9/29. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSCommonHeader : NSObject + +- (instancetype)init:(NSString *)sdkName + sdkVersionCode:(NSString *)sdkVersionCode + sdkVersionName:(NSString *)sdkVersionName; + +- (NSString *)getXUAValue; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonHeader.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonHeader.h.meta new file mode 100644 index 0000000..4ac702b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonHeader.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6dc5af641869643068ea51bd2d886675 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonService.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonService.h new file mode 100644 index 0000000..b12310f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonService.h @@ -0,0 +1,30 @@ +// +// TDSCommonService.h +// TDSCommon +// +// Created by TapTap-David on 2020/11/10. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSCommonService : NSObject + ++ (void)initWithConfig:(NSString*)configJSON versionName:(NSString*)versionName; + ++ (void)setXUA:(NSString*)json; + ++ (void)getRegionCode:(void (^)(NSString *result))callback; + ++ (void)isTapTapInstalled:(void (^)(NSString *result))callback; + ++ (void)isTapGlobalInstalled:(void (^)(NSString *result))callback; + ++ (void)preferredLanguage:(NSNumber *)language; + ++ (void)hostToBeReplaced:(NSString*)host replacedHost:(NSString*) replaceHost; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonService.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonService.h.meta new file mode 100644 index 0000000..c9da7a4 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonService.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5d161f4336e7043dd8cc9025930ad6e2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUIHelper.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUIHelper.h new file mode 100644 index 0000000..c797f6c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUIHelper.h @@ -0,0 +1,70 @@ +// +// TDSCommonUIHelper.h +// TDSCommon +// +// Created by Bottle K on 2021/3/2. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSCommonUIHelper : NSObject + +/// 从common bundle获取image ++ (UIImage *)getImageFromCommonWithImageName:(NSString *)name; + +/// 从bundle获取image ++ (UIImage *)getImageFromBundle:(NSString *)bundleName withImage:(NSString *)imageName; + +/// 从bundle获取翻译后的文案 ++ (NSString *)getTranslatedStringFromCommonWithKey:(NSString *)key; + +/// rgb转color ++ (UIColor *)rgbToColorWithRed:(CGFloat)red + green:(CGFloat)green + blue:(CGFloat)blue; + +/// rgba转color ++ (UIColor *)rgbToColorWithRed:(CGFloat)red + green:(CGFloat)green + blue:(CGFloat)blue + aplha:(CGFloat)alpha; + +/// hex转color ++ (UIColor *)hexToColor:(int)hexValue; + +/// hex转color ++ (UIColor *)hexToColor:(int)hexValue alpha:(CGFloat)alpha; + +/// 屏幕宽度,会根据横竖屏的变化而变化 ++ (CGFloat)screenWidth; + +/// 屏幕高度,会根据横竖屏的变化而变化 ++ (CGFloat)screenHeight; + +/// 屏幕宽度,跟横竖屏无关 ++ (CGFloat)deviceWidth; + +/// 屏幕高度,跟横竖屏无关 ++ (CGFloat)deviceHeight; + +/// 用户界面横屏了才会返回YES ++ (BOOL)isUILandscape; + +/// 无论支不支持横屏,只要设备横屏了,就会返回YES ++ (BOOL)isDeviceLandscape; + +/// 是否有刘海 ++ (BOOL)hasNotch; + +/// 安全区域(上左下右) ++ (UIEdgeInsets)safeAreaInsets; + ++ (UIViewController *)findTopViewController; + ++ (UIViewController *)findUIViewController:(UIViewController *)controller; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUIHelper.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUIHelper.h.meta new file mode 100644 index 0000000..dc3c66c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUIHelper.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8e803482b2a4346b5a115e1e38d67bf7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUtils.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUtils.h new file mode 100644 index 0000000..19d7c6f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUtils.h @@ -0,0 +1,39 @@ +// +// TDSCommonUtils.h +// TDSCommon +// +// Created by TapTap-David on 2021/1/18. +// + +#import +#import "TDSTrackerConfig.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSCommonUtils : NSObject ++ (NSData *)lz4Compress:(NSData *)rawData; + ++ (uint32_t)transformTime; + ++ (NSString *)md5HexDigest:(NSData *)data; + ++ (NSString *)getDeviceIdentifier; + ++ (NSString *)getHardParam; + ++ (NSString *)getNetworkType; + ++ (NSString *)getNetWorkStatus:(NSString *)hostName; + ++ (NSString *)getTotalMemorySize:(unsigned long long)fileSize; + ++ (NSString *)getTotalDiskSize; + ++ (NSString *)localeIdentifier; + ++ (NSString *)getCpuInfo; + ++ (NSString *)topic:(TDSTrackerType)type; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUtils.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUtils.h.meta new file mode 100644 index 0000000..0dac802 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUtils.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 405a96461726e4d72b46f862ee3faefb +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDebounce.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDebounce.h new file mode 100644 index 0000000..c976c81 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDebounce.h @@ -0,0 +1,108 @@ +// +// TDSDebounce.h +// TDSCommon +// +// Created by JiangJiahao on 2021/3/22. +// + + +#import + +/** 自定管理执行与释放时,标记调用来源: 对象/类地址_方法名_调用行数 */ +#define TDSDebunceKey [NSString stringWithFormat:@"%p_%s_%d",self,__func__,__LINE__] +#define TDSDebunceKeyAppendCustom(customKey) [NSString stringWithFormat:@"%p_%s_%d%@",self,__func__,__LINE__,customKey] + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^TDSDebounceTaskBlock)(void); +extern double const DEBOUNCE_INTERVAL; // 默认频率间隔,0.5s + +/** + 相邻调用若都在间隔时间内,则合并成一次调用 + */ +@interface TDSDebounce : NSObject +#pragma mark - 自动管理 ++ (TDSDebounce *)debounceWithDebounceKey:(NSString *)debounceKey taskBlock:(TDSDebounceTaskBlock)taskBlock; + ++ (TDSDebounce *)debounceWithInterval:(NSTimeInterval)interval + debounceKey:(NSString *)debounceKey + taskBlock:(TDSDebounceTaskBlock)taskBlock; + +/// 自动执行一个Debounce(防抖)任务。 +/// 注意:适用调用不是异常频繁的任务,如用户按钮频繁点击限制 +/// @param interval 防抖间隔,默认0.5s +/// @param queue 任务执行队列,默认主队列 +/// @param debounceKey 任务来源标识,可使用默认宏 TDSDebunceKey 或 TDSDebunceKeyAppendCustom +/// @param taskBlock 需要执行的任务 ++ (TDSDebounce *)debounceWithInterval:(NSTimeInterval)interval + onQueue:(dispatch_queue_t)queue + debounceKey:(NSString *)debounceKey + taskBlock:(TDSDebounceTaskBlock)taskBlock; +#pragma mark - 手动管理 ++ (TDSDebounce *)manualDebounceWithTaskBlock:(TDSDebounceTaskBlock)taskBlock; + ++ (TDSDebounce *)manualDebounceWithInterval:(NSTimeInterval)interval + taskBlock:(TDSDebounceTaskBlock)taskBlock; + +/// 手动获取一个Debounce(防抖)任务,需要在不再使用时手动调用 dispose 释放 +/// 注意:适合在任务会异常频繁执行时进行限制 +/// @param interval 抖间隔,默认0.5s +/// @param queue 任务执行队列,默认主队列 +/// @param taskBlock 需要执行的任务 ++ (TDSDebounce *)manualDebounceWithInterval:(NSTimeInterval)interval + onQueue:(dispatch_queue_t)queue + taskBlock:(TDSDebounceTaskBlock)taskBlock; +#pragma mark - 执行与释放 +/// 触发任务执行,手动管理时调用 +- (void)invoke; + +/// 销毁任务,手动管理时调用 +- (void)dispose; + +@end + +#pragma mark - private classes +/** + 调用后等待间隔时间超时以后触发,每次触发后重新计时 + */ +@interface TDSDebounceTrailing : TDSDebounce + +@end + +/** + 调用后立即触发,间隔时间未超时无法再次触发,每次触发后重新计时 + */ +@interface TDSDebounceLeading : TDSDebounce + +@end + +/** + 使用方法: + 1.自动管理(自动执行/释放) + // 按钮事件或需要执行的函数,任务使用 Debounce 包裹 + - (void)testDebounce { + [TDSDebounceLeading debounceWithInterval:0.8 debounceKey:TDSDebunceKey taskBlock:^{ + // TODO 想要执行的任务 + }]; + } + + 2.手动管理 (创建时调用 manual 开头函数) + + @property (nonatomic, strong) TDSDebounce *testDebouncer; + + // 按钮事件或需要执行的函数,任务使用 Debounce 包裹 + - (void)testDebounce { + if (!self.testDebouncer) { + self.testDebouncer = [TDSDebounceLeading manualDebounceWithTaskBlock:^{ + // TODO 想要执行的任务 + }]; + } + [self.testDebouncer invoke]; + } + + // 在适当时机,如退出页面时释放 + [self.testDebouncer dispose]; + */ + +NS_ASSUME_NONNULL_END + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDebounce.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDebounce.h.meta new file mode 100644 index 0000000..b77a986 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDebounce.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bbd627e5d5adb444b985d6ae634cec16 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDomainManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDomainManager.h new file mode 100644 index 0000000..a1d329f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDomainManager.h @@ -0,0 +1,61 @@ +// +// TDSDomainManager.h +// TapCommonSDK +// +// Created by Bottle K on 2021/4/19. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol TDSDomainManagerDelegate + +@optional +- (void)checkDomainsDone:(NSDictionary *)resultInfo; + +@end + +FOUNDATION_EXTERN NSString *const DOMAIN_CHECK_HOST_KEY; +FOUNDATION_EXTERN NSString *const DOMAIN_CHECK_CODE_KEY; +FOUNDATION_EXTERN NSString *const DOMAIN_CHECK_DELAY_KEY; +FOUNDATION_EXTERN NSString *const DOMAIN_CHECK_REACHABLE_KEY; + +@interface TDSDomainManager : NSObject +/// 获取一个域名管理实例 +/// @param mainDomains 主域名 +/// @param backupDomains 备用域名 ++ (TDSDomainManager *)managerForDomains:(NSArray *)mainDomains backupDomains:(NSArray *)backupDomains; + +- (void)setupDelegate:(id)delegate; + +/// 指定域名检查接口 +/// @param checkAPI 检查接口 +- (void)setupCheckAPI:(NSString *)checkAPI; + +/// 获取一个当前可用域名 +- (NSString *)getActiveDomain; + +/// 标记一个域名为可用 +/// @param domain 域名 +- (void)activeDomain:(NSString *)domain; ++ (void)activeDomain:(NSString *)domain; + +/// 标记一个域名不可用 +/// @param domain 域名 +- (void)deactiveDomain:(NSString *)domain; ++ (void)deactiveDomain:(NSString *)domain; + +/// 开始检测域名,并定期检测 +- (void)startCheckDomains; + +/// 开始检测域名 +/// @param api 若传入api则会请求该api数据,若传入空则直接检查域名连通 +/// @param repeat 是否定时检测 +- (void)startCheckDomains:(nullable NSString *)api repeat:(BOOL)repeat; + +/// 停止检测域名 +- (void)stopCheckDomains; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDomainManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDomainManager.h.meta new file mode 100644 index 0000000..b4c6fdc --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDomainManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ceafa07d9eb314d5c989b2689107c6f4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSFilePath.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSFilePath.h new file mode 100644 index 0000000..1a6dae5 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSFilePath.h @@ -0,0 +1,24 @@ +// +// FilePath.h +// NativeApp +// +// Created by JiangJiahao on 2018/10/16. +// Copyright © 2018 JiangJiahao. All rights reserved. +// 文件路径类 + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSFilePath : NSObject ++ (NSString *)homePath; ++ (NSString *)documentsPath; ++ (NSString *)cachesPath; ++ (NSString *)tmpPath; ++ (NSString *)pathForFile:(NSString *)name type:(NSString *)type; ++ (NSString *)imagePath; + ++ (NSString *)bundlePath; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSFilePath.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSFilePath.h.meta new file mode 100644 index 0000000..359ab5f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSFilePath.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c7ff35ddc96e041228df293c3e2c9d48 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h new file mode 100644 index 0000000..d87a82e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h @@ -0,0 +1,26 @@ +// +// TDSHandleUrl.h +// TapCommonSDK +// +// Created by 黄驿峰 on 2022/3/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSHandleUrl : NSObject + +/// 在application:openURL:中调用 +/// @param url 传入openURL的url ++ (BOOL)handleOpenURL:(nullable NSURL *)url; + +/// 各模块注册handleUrl的事件 +/// @param event 在block中调用handleUrl的事件 +/// @param tag 唯一标识符,防止重复添加 ++ (void)addHandleEvent:(BOOL (^)(NSURL *url))event withTag:(NSString *)tag; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h.meta new file mode 100644 index 0000000..67740e5 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f1e0275ce42824659b8342605c3e3bc2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHostReplaceUtil.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHostReplaceUtil.h new file mode 100644 index 0000000..15c59e1 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHostReplaceUtil.h @@ -0,0 +1,26 @@ +// +// TDSHostReplaceUtil.h +// TapCommonSDK +// +// Created by Bottle K on 2021/8/3. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSHostReplaceUtil : NSObject ++ (instancetype)shareInstance; + +- (void)addReplacedHostPair:(NSString *)hostToBeReplaced replacedHost:(NSString *)replacedHost; + +- (void)clearReplacedHostPair:(NSString *)hostToBeReplaced; + +- (void)clear; + +- (NSString *)getReplacedHost:(NSString *)originalHost; + +- (BOOL)isTestMode; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHostReplaceUtil.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHostReplaceUtil.h.meta new file mode 100644 index 0000000..dd55427 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHostReplaceUtil.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2ebfdd0b07e144950a6db23fe2fd54db +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadBase.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadBase.h new file mode 100644 index 0000000..121be12 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadBase.h @@ -0,0 +1,30 @@ +// +// HttpDownloadBase.h +// NativeApp +// +// Created by JiangJiahao on 2018/10/16. +// Copyright © 2018 JiangJiahao. All rights reserved. +// 下载基类 + +#import + +typedef void(^downloadCallback)(BOOL success); + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSHttpDownloadBase : NSObject +/// 下载完成以后文件存储路径 ++ (NSString *)saveFilePath; + +/// 文件存储名 +/// @param url 文件url ++ (NSString *)saveFileName:(NSString *)url; + +/// 下载文件 +/// @param url 文件url +/// @param callback 下载结果回调 ++ (void)downloadFile:(NSString *)url callback:(downloadCallback)callback; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadBase.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadBase.h.meta new file mode 100644 index 0000000..eb2b3a2 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadBase.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 94203bdf671d84453ab5d1eae7553a38 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadFile.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadFile.h new file mode 100644 index 0000000..643c0e5 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadFile.h @@ -0,0 +1,22 @@ +// +// TDSHttpDownloadFile.h +// TapCommonSDK +// +// Created by SeraphLi on 2022/12/13. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSHttpDownloadFile : TDSHttpDownloadBase + ++ (void)downloadFile:(NSString *)url callback:(downloadCallback)callback; + ++ (void)getFileFromCacheOrNet:(NSString *)url callback:(downloadCallback)callback; + ++ (NSString *) getFullCachePath:(NSString *)url; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadFile.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadFile.h.meta new file mode 100644 index 0000000..a82d741 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadFile.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 194396e78aefb45ddaeac48db7d4ce32 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadImage.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadImage.h new file mode 100644 index 0000000..8f4571f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadImage.h @@ -0,0 +1,19 @@ +// +// HttpDownloadImage.h +// NativeApp +// +// Created by JiangJiahao on 2018/10/16. +// Copyright © 2018 JiangJiahao. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSHttpDownloadImage : TDSHttpDownloadBase + ++ (void)downloadImage:(NSString *)url callback:(downloadCallback)callback; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadImage.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadImage.h.meta new file mode 100644 index 0000000..ec3859f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadImage.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b763d0d24618846c0aa3c83ab918eacd +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpRequest.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpRequest.h new file mode 100644 index 0000000..3afeca3 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpRequest.h @@ -0,0 +1,22 @@ +// +// HttpRequest.h +// +// Created by JiangJiahao on 2018/3/9. +// Copyright © 2018年 JiangJiahao. All rights reserved. +// Httpq请求封装 + +#import + +@interface TDSHttpRequest : NSObject + +//! GET参数拼接 ++ (NSString *)connectUrl:(NSString *)url params:(NSDictionary *)params; ++ (NSString *)connectUrl:(NSString *)url params:(NSDictionary *)params encode:(BOOL)encode; + +// POST请求参数拼接 ++ (NSString *)postStringWithParams:(NSDictionary *)params; + +// cookie ++ (NSString *)cookieStringForUrl:(NSString *)url; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpRequest.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpRequest.h.meta new file mode 100644 index 0000000..d1b9980 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpRequest.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7b817e684a45c4e968fdfa70fc2acbb9 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpResult.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpResult.h new file mode 100644 index 0000000..338f736 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpResult.h @@ -0,0 +1,23 @@ +// +// HttpResult.h +// +// Created by JiangJiahao on 2018/3/9. +// Copyright © 2018年 JiangJiahao. All rights reserved. +// + +#import + +@interface TDSHttpResult : NSObject + +@property (nonatomic,strong) NSData *data; +@property (nonatomic,strong) NSURLResponse *response; +@property (nonatomic,strong) NSError *error; +@property (nonatomic,strong) NSError *localError; // 本地错误 +@property (nonatomic,copy) NSString *originUrl; + +@property (nonatomic,copy) NSDictionary *resultDic; + +// 多个get同时返回数据时使用 +@property (nonatomic) NSArray *dataArr; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpResult.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpResult.h.meta new file mode 100644 index 0000000..fdc003a --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpResult.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8b2d500498c404ce28df14d4973acbe8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpUtil.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpUtil.h new file mode 100644 index 0000000..a18f43d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpUtil.h @@ -0,0 +1,47 @@ +// +// TTAchievementUtil.h +// TapAchievement +// +// Created by TapTap-David on 2020/9/15. +// Copyright © 2020 taptap. All rights reserved. +// + +#import + + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSHttpUtil : NSObject ++ (NSString *)URLEncodeString:(NSString *)str; + ++ (NSString *)URLDecodeString:(NSString *)str; + ++ (NSString *)urlEncode:(NSString *)str; + ++ (NSString *)SHA256:(NSString *)key; + ++ (NSString *)md5String:(NSString *)str; + ++ (NSString *)getCurrentTime; + ++ (NSString *)randomString:(int)length; + ++ (NSString *)base64HMacSha1WithSecret:(NSString *)secret + signString:(NSString *)signString; + ++ (NSString *)getLcSignWithClientKey:(NSString *)clientKey; + ++ (NSString *)getMacToken:(NSString *)url + method:(NSString *)method + oauthID:(NSString *)oauthID +oauthMacKey:(NSString *)oauthMacKey; + ++ (NSString *)getDeviceId; + ++ (NSString *)createACodeVerifier:(NSUInteger)length; + ++ (NSDictionary *)queryDictionaryFromURL:(NSURL *)url; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpUtil.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpUtil.h.meta new file mode 100644 index 0000000..5317c10 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpUtil.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 639e330b532d24566bc00298f648a5a6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSImageManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSImageManager.h new file mode 100644 index 0000000..2f3262d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSImageManager.h @@ -0,0 +1,45 @@ +// +// ImageManager.h +// NativeApp +// +// Created by JiangJiahao on 2018/10/16. +// Copyright © 2018 JiangJiahao. All rights reserved. +// 图片辅助类,有些方法可以用catogary实现 + +#import +#import + +typedef void(^resultBlockWithName)(UIImage *_Nullable resultImage,NSString * _Nonnull imageName); +typedef void(^resultBlock)(UIImage *_Nullable resultImage); + + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSImageManager : NSObject +/// 图片缩放 +/// @param img 图片 +/// @param size 尺寸 ++ (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size; + +/// 滤镜,高斯模糊 +/// @param image 图片 +/// @param blur 模糊程度 ++ (UIImage *)blurryImage:(UIImage *)image withBlurLevel:(CGFloat)blur; + +/// URL获取图片名称 +/// @param url 图片URL ++ (NSString *)imageNameWithUrl:(NSString *)url; + ++ (void)loadImage:(NSString *)imageName needDecode:(BOOL)needDecode resultBlock:(resultBlockWithName)block; ++ (void)loadImage:(NSString *)imageName resultBlock:(resultBlockWithName)block; ++ (void)loadImage:(NSString *)imageName size:(CGSize)size resultBlock:(resultBlockWithName)block; + +// 只需要传入"xxx.png" ++ (UIImage *)getBundleImage:(NSString *)imageName resultBlock:(resultBlockWithName)block; ++ (UIImage *)getBundleImage:(NSString *)imageName size:(CGSize)size resultBlock:(resultBlockWithName)block; + +//UIColor 转UIImage ++ (UIImage*)createImageWithColor: (UIColor *)color; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSImageManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSImageManager.h.meta new file mode 100644 index 0000000..83471a0 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSImageManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2eb78b2904d3246eaa3b6fbac03ab319 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h new file mode 100644 index 0000000..e5fd85f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h @@ -0,0 +1,28 @@ +// +// TDSLabel.h +// XdComPlatform +// +// Created by JiangJiahao on 2020/5/14. +// Copyright © 2020 X.D. Network Inc. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^CopySuccessCallback)(void); + +typedef NS_ENUM(NSInteger,TDSLabelVerticalAlignment) { + TDSLabelVerticalAlignmentTop = 0, + TDSLabelVerticalAlignmentCenter, + TDSLabelVerticalAlignmentBottom, +}; + +@interface TDSLabel : UILabel +@property (nonatomic) UIEdgeInsets edgeInsets; +@property (nonatomic) BOOL canCopy; +@property (nonatomic) CopySuccessCallback copyCallback; +@property (nonatomic) TDSLabelVerticalAlignment verticalAlignment; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h.meta new file mode 100644 index 0000000..34f2ec6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ea1a5243225694f9fbe6c1ad43e1bc9c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLightWebImageView.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLightWebImageView.h new file mode 100644 index 0000000..a945d59 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLightWebImageView.h @@ -0,0 +1,20 @@ +// +// XDLightWebImageView.h +// NativeApp +// +// Created by JiangJiahao on 2018/12/18. +// Copyright © 2018 JiangJiahao. All rights reserved. +// 轻量,没有点击事件 + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSLightWebImageView : UIView + +- (void)setImageWithUrl:(NSString *)imageUrl; +- (void)setImageWithUrl:(NSString *)imageUrl size:(CGSize)imageSize; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLightWebImageView.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLightWebImageView.h.meta new file mode 100644 index 0000000..64382db --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLightWebImageView.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d4615e5f197504bb3b7116bd163ae8aa +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeManager.h new file mode 100644 index 0000000..c2fd810 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeManager.h @@ -0,0 +1,51 @@ +// +// TDSLocalizeManager.h +// TDSCommon +// +// Created by Bottle K on 2021/3/8. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM (NSInteger, TapLanguageType) { + TapLanguageType_Auto = 0,// 自动 + TapLanguageType_zh_Hans,// 简体中文 + TapLanguageType_en,// 英文 + TapLanguageType_zh_Hant,// 繁体中文 + TapLanguageType_ja,// 日文 + TapLanguageType_ko,// 韩文 + TapLanguageType_th,// 泰文 + TapLanguageType_id,// 印度尼西亚语 +}; + +@interface TDSLocalizeManager : NSObject + +@property (nonatomic, assign) BOOL regionIsIO; + ++ (instancetype)shareInstance; + +/// 设定当前语言类型 +/// @param langType 语言类型 ++ (void)setCurrentLanguage:(TapLanguageType)langType; + +/// 获取当前语言类型 ++ (TapLanguageType)currentLanguage; + +/// 获取当前语言的 String ++ (NSString *)getCurrentLangString; + +/// 注册SDK本地化翻译 +/// @param sdk SDK tag +/// @param filePath 本地化翻译文件位置 ++ (void)addSDKLocalization:(NSString *)sdk localizedFilePath:(NSString *)filePath; + +/// 获取本地化翻译 +/// @param sdk SDK tag +/// @param key 本地化翻译key ++ (NSString *)getLocalizedStringWithSDK:(NSString *)sdk localizedKey:(NSString *)key; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeManager.h.meta new file mode 100644 index 0000000..90623e4 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8f10334a1e4c64181873759d3b9879c5 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeUtil.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeUtil.h new file mode 100644 index 0000000..82dc716 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeUtil.h @@ -0,0 +1,18 @@ +// +// TDSLocalizeUtil.h +// TapCommonSDK +// +// Created by Bottle K on 2021/3/4. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSLocalizeUtil : NSObject ++ (NSString *)getCurrentLangString; ++ (TapLanguageType)getCurrentLangType; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeUtil.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeUtil.h.meta new file mode 100644 index 0000000..b4dadf9 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeUtil.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a492cff01fb9741809aaa4d28cbe0fcb +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLog.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLog.h new file mode 100644 index 0000000..e965e11 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLog.h @@ -0,0 +1,53 @@ +// +// TDSLog.h +// TDSCommon +// +// Created by Insomnia on 2020/10/26. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +#ifndef TDSLogInfo +#define TDSLogInfo(model, format, ...) TDSLogInfoFunc(model, [NSString stringWithFormat:format, ## __VA_ARGS__], __PRETTY_FUNCTION__) +#endif + +#ifndef TDSLogCustom +#define TDSLogCustom(model, tag, format, ...) TDSLogCustomFunc(model, tag, [NSString stringWithFormat:format, ## __VA_ARGS__], __PRETTY_FUNCTION__) +#endif + +#ifndef TDSLogCrash +#define TDSLogCrash(model, format, ...) TDSLogCustomFunc(model, @"Crash", [NSString stringWithFormat:format, ## __VA_ARGS__], __PRETTY_FUNCTION__) +#endif + +@interface TDSLogModel : NSObject +@property (nonatomic, copy, nonnull) NSString *sdkName; +@property (nonatomic, copy, nonnull) NSString *sdkCode; +@property (nonatomic, copy, nonnull) NSString *sdkVersion; +@end + +@protocol TDSLogDelegate +@optional +- (void)reciveLogWithModel:(TDSLogModel * _Nullable)model tag:(NSString * _Nullable)tag content:(id)content; +@end + +@interface TDSLog : NSObject + +@property (nonatomic, weak) id delegate; + ++ (instancetype)sharedInstance; + +- (void)tdsLogWithModel:(TDSLogModel * _Nonnull)model tag:(NSString *)tag content:(NSString *)content; + + + +@end + + +/** 记录Info标签日志 */ +FOUNDATION_EXPORT void TDSLogInfoFunc(TDSLogModel* _Nonnull model, NSString* _Nonnull log, const char * func); +/** 记录自定义标签日志 */ +FOUNDATION_EXPORT void TDSLogCustomFunc(TDSLogModel* _Nonnull model, NSString *_Nonnull tag, NSString* _Nonnull log,const char * func); + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLog.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLog.h.meta new file mode 100644 index 0000000..8c30dd8 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLog.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c7b92deee7c384e87bea390e6789d2b0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLoggerService.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLoggerService.h new file mode 100644 index 0000000..2d38930 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLoggerService.h @@ -0,0 +1,17 @@ +// +// TDSLoggerService.h +// TDSCommon +// +// Created by Insomnia on 2020/10/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSLoggerService : NSObject + ++ (void)log:(NSString *)config tag:(NSString *)tag message:(NSString *)message; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLoggerService.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLoggerService.h.meta new file mode 100644 index 0000000..93ca291 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLoggerService.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 12e93c23f39cf4f5b9da10a52d4cc0c6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMacros.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMacros.h new file mode 100644 index 0000000..83b56d8 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMacros.h @@ -0,0 +1,63 @@ +// +// TDSMacros.h +// TDSCommon +// +// Created by Insomnia on 2020/10/19. +// + +#import +#import + +#ifndef TDS_LOCK +#define TDS_LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER); +#endif + +#ifndef TDS_UNLOCK +#define TDS_UNLOCK(lock) dispatch_semaphore_signal(lock); +#endif + +#define TDSSemaphoreCreate \ +static dispatch_semaphore_t signalSemaphore; \ +static dispatch_once_t onceTokenSemaphore; \ +dispatch_once(&onceTokenSemaphore, ^{ \ + signalSemaphore = dispatch_semaphore_create(1); \ +}); + +#define TDSSemaphoreWait TDS_LOCK(signalSemaphore) +#define TDSSemaphoreSignal TDS_UNLOCK(signalSemaphore) + +#ifndef weakify +#define weakify(...) \ +tds_keywordify \ +metamacro_foreach_cxt(tds_weakify_,, __weak, __VA_ARGS__) +#endif + +#ifndef strongify +#define strongify(...) \ +tds_keywordify \ +_Pragma("clang diagnostic push") \ +_Pragma("clang diagnostic ignored \"-Wshadow\"") \ +metamacro_foreach(tds_strongify_,, __VA_ARGS__) \ +_Pragma("clang diagnostic pop") +#endif + +#define tds_weakify_(INDEX, CONTEXT, VAR) \ +CONTEXT __typeof__(VAR) metamacro_concat(VAR, _weak_) = (VAR); + +#define tds_strongify_(INDEX, VAR) \ +__strong __typeof__(VAR) VAR = metamacro_concat(VAR, _weak_); + +#if DEBUG +#define tds_keywordify autoreleasepool {} +#else +#define tds_keywordify try {} @catch (...) {} +#endif + +#ifndef dispatch_main_async_safe +#define dispatch_main_async_safe(block)\ + if (dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL) == dispatch_queue_get_label(dispatch_get_main_queue())) {\ + block();\ + } else {\ + dispatch_async(dispatch_get_main_queue(), block);\ + } +#endif diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMacros.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMacros.h.meta new file mode 100644 index 0000000..687dac6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMacros.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8d5653103976847699376ded1482a77c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMemoryCache.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMemoryCache.h new file mode 100644 index 0000000..814ac0c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMemoryCache.h @@ -0,0 +1,31 @@ +// +// XDCache.h +// XDCollectionView +// +// Created by JiangJiahao on 2019/5/22. +// Copyright © 2019 tapdb. All rights reserved. +// simple image cache + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSMemoryCache : NSObject ++ (TDSMemoryCache *)shareInstance; + +/// 设置最大缓存数量,默认50 +/// @param countLimit 缓存数量 ++ (void)setCacheCountLimit:(NSUInteger)countLimit; + +/// 设置缓存项目 +/// @param obj 缓存对象 +/// @param key key ++ (void)setObject:(id)obj forKey:(id)key; + +/// 获取缓存 +/// @param key Key ++ (id)objectForKey:(id)key; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMemoryCache.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMemoryCache.h.meta new file mode 100644 index 0000000..383d259 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMemoryCache.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 918017103a3654ac39836402e92b97a1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h new file mode 100644 index 0000000..337ea5d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h @@ -0,0 +1,91 @@ +// +// TDSModelHelper.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import +#import + +#ifndef __TDSConst__ +#define __TDSConst__ +extern NSString *const TDSTypeInt; +extern NSString *const TDSTypeFloat; +extern NSString *const TDSTypeDouble; +extern NSString *const TDSTypeLong; +extern NSString *const TDSTypeLongLong; +extern NSString *const TDSTypeChar; +extern NSString *const TDSTypeBOOL; +extern NSString *const TDSTypePointer; + +extern NSString *const TDSTypeIvar; +extern NSString *const TDSTypeMethod; +extern NSString *const TDSTypeBlock; +extern NSString *const TDSTypeClass; +extern NSString *const TDSTypeSEL; +extern NSString *const TDSTypeId; + +#endif + + + +@interface TDSPropertyType : NSObject +/** 类型标识符 */ +@property (nonatomic, copy) NSString *code; + +/** 是否为id类型 */ +@property (nonatomic, readonly, getter=isIdType) BOOL idType; + +/** 对象类型(如果是基本数据类型,此值为nil) */ +@property (nonatomic, readonly) Class typeClass; + +/** 类型是否来自于Foundation框架,比如NSString、NSArray */ +@property (nonatomic, readonly, getter = isFromFoundation) BOOL fromFoundation; +/** 类型是否不支持KVC */ +@property (nonatomic, readonly, getter = isKVCDisabled) BOOL KVCDisabled; + +/** + * 获得缓存的类型对象 + */ ++ (instancetype)cachedTypeWithCode:(NSString *)code; +@end + +@interface TDSProperty : NSObject +/** 成员属性 */ +@property (nonatomic, assign) objc_property_t property; +/** 成员属性名 */ +@property (nonatomic, readonly) NSString *name; + +/** 成员变量的类型 */ +@property (nonatomic, readonly) TDSPropertyType *type; +/** 成员来源于哪个类(可能是父类) */ +@property (nonatomic, assign) Class srcClass; + +/**** 同一个成员变量 - 父类和子类的行为可能不一致(key、keys、objectClassInArray) ****/ +/** 对应着字典中的key */ +- (void)setKey:(NSString *)key forClass:(Class)c; +- (NSString *)keyFromClass:(Class)c; + +/** 对应着字典中的多级key */ +- (NSArray *)keysFromClass:(Class)c; + +/** 模型数组中的模型类型 */ +- (void)setObjectClassInArray:(Class)objectClass forClass:(Class)c; +- (Class)objectClassInArrayFromClass:(Class)c; +/**** 同一个成员变量 - 父类和子类的行为可能不一致(key、keys、objectClassInArray) ****/ + +/** + * 设置成员变量的值 + */ +- (void)setValue:(id)value forObject:(id)object; +/** + * 得到成员变量的值 + */ +- (id)valueFromObject:(id)object; + +/** + * 初始化 + */ ++ (instancetype)cachedPropertyWithProperty:(objc_property_t)property; +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h.meta new file mode 100644 index 0000000..674b2f7 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5f3d50ae681eb42abb25300ef5e7e04b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClient.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClient.h new file mode 100644 index 0000000..0ece75e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClient.h @@ -0,0 +1,35 @@ +// +// TDSNetClient.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import +#import +#import + +// 待定 +typedef void (^TDSNetProgressBlock) (NSProgress *_Nonnull downloadProgress); +// 返回值待定 +typedef void (^TDSNetSuccessBlock) (NSDictionary *_Nullable resultDic); +// 返回值待定 +typedef void (^TDSNetFailureBlock) (NSError *_Nonnull error); + + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSNetClient : NSObject + +// success / failure 传递data中内容 +- (instancetype)initWithConfig:(TDSNetConfigModel *)config; + +- (void)requestWithModel:(TDSNetRequestModel *)model success:(TDSNetSuccessBlock)success; + +- (void)requestWithModel:(TDSNetRequestModel *)model success:(TDSNetSuccessBlock)success failure:(nullable TDSNetFailureBlock)failure; + +- (void)requestWithModel:(TDSNetRequestModel *)model success:(TDSNetSuccessBlock)success failure:(nullable TDSNetFailureBlock)failure progress:(nullable TDSNetProgressBlock)progress; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClient.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClient.h.meta new file mode 100644 index 0000000..5855302 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClient.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9de1b26e06ad1404ab5c1d50a53cab28 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClientModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClientModel.h new file mode 100644 index 0000000..cc5901e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClientModel.h @@ -0,0 +1,22 @@ +// +// TDSNetClientConfig.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSNetConfigModel : NSObject +/// 可扩展头 +@property (nonatomic, copy, nullable) NSString *baseUrl; +@property (nonatomic, copy, nullable) NSDictionary *extensionHeader; +@property (nonatomic, strong, nullable) TDSCommonHeader *commonHeader; +@property (nonatomic, strong, nullable) TDSAccount *account; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClientModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClientModel.h.meta new file mode 100644 index 0000000..7769585 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClientModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e8be5e6180d7543a18b0f142e1fe9cfe +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetExecutor.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetExecutor.h new file mode 100644 index 0000000..3de213c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetExecutor.h @@ -0,0 +1,51 @@ +// +// TDSNetExecutor.h +// TDSCommon +// +// Created by Insomnia on 2020/10/21. +// + +#import +#import + +typedef NS_ENUM (NSUInteger, TDSNetMethod) { + TDSNetMethodGet = 1, + TDSNetMethodPost +}; + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSNetRequestModel : NSObject + +@property (nonatomic, assign) TDSNetMethod method; + +@property (nonatomic, copy) NSString *url; + +@property (nonatomic, strong) id args; + +@property (nonatomic, strong) NSData *data; //protobuf Data数据 + +@property (nonatomic, assign) BOOL auth; + +@property (nonatomic) Class resCls; + +@property (nonatomic, copy, nullable) NSDictionary *header; + +//是否使用原始网络返回结果 +@property (nonatomic, assign) BOOL useOriginResponse; + +@end + +@interface TDSNetExecutor<__covariant T>: NSObject + ++ (TDSNetExecutor *)create:(void(NS_NOESCAPE ^)(id subscriber))didSubscribe; + +- (void)success:(void(NS_NOESCAPE ^)(id _Nonnull x))success; + +- (void)success:(void(NS_NOESCAPE ^)(id _Nonnull x))success failure:(void (^)(NSError *error))failure; + +- (void)success:(void(NS_NOESCAPE ^)(id _Nonnull x))success failure:(void (^)(NSError *error))failure progress:(void(NS_NOESCAPE ^)(id progress))progress; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetExecutor.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetExecutor.h.meta new file mode 100644 index 0000000..797de2e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetExecutor.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f66ba5c39e4e04d3cb22369f4116fa71 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetInterceptor.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetInterceptor.h new file mode 100644 index 0000000..3691c9f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetInterceptor.h @@ -0,0 +1,36 @@ +// +// TDSNetInterceptor.h +// TDSCommon +// +// Created by Bottle K on 2021/2/25. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol TDSNetInterceptDelegate +@optional +- (void)receiveNetContent:(NSDictionary *)content; +@end + +@interface TDSNetInterceptor : NSObject + ++ (instancetype)new NS_UNAVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; + ++ (instancetype)sharedInstance; + +- (void)registerNetInterceptor:(NSString *)from delegate:(id)delegate; + +- (void)unRegisterNetInterceptor:(NSString *)from; + +- (void)interceptWithContent:(NSDictionary *)content; + ++ (void)checkAuthErrorAccessDenied:(NSDictionary *)params handler:(void (^)(NSDictionary *dataDic))handler; + ++ (void)checkAuthError:(NSDictionary *)params errorList:(NSArray *)errorList handler:(void (^)(NSDictionary *dataDic))handler; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetInterceptor.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetInterceptor.h.meta new file mode 100644 index 0000000..faecfca --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetInterceptor.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e4051b51287024dba9735a4fb9730a08 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetSubscriber.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetSubscriber.h new file mode 100644 index 0000000..b7fb84f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetSubscriber.h @@ -0,0 +1,29 @@ +// +// TDSNetSubscriber.h +// TDSCommon +// +// Created by Insomnia on 2020/10/22. +// + +#import + +@protocol TDSNetSubscriber +@optional + +- (void)sendSuccess:(nullable id)value; + +- (void)sendFailure:(nullable NSError *)error; + +- (void)sendProgress:(nullable id)progress; + +@end + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSNetSubscriber : NSObject + ++ (instancetype)subscriberWithSuccess:(void (^)(id x))success failure:(nullable void (^)(NSError *error))error progress:(nullable void (^)(id progress))progress; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetSubscriber.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetSubscriber.h.meta new file mode 100644 index 0000000..58c3652 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetSubscriber.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fd8aa32c6e0de43b188125aacbeef9b8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetworkTypeUtil.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetworkTypeUtil.h new file mode 100644 index 0000000..751d7f1 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetworkTypeUtil.h @@ -0,0 +1,18 @@ +// +// TDSNetworkTypeUtil.h +// TapCommonSDK +// +// Created by Bottle K on 2021/9/7. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSNetworkTypeUtil : NSObject ++ (instancetype)shareInstance; +- (NSString *)getMobileType; +- (NSInteger)getNetworkType; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetworkTypeUtil.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetworkTypeUtil.h.meta new file mode 100644 index 0000000..7591b68 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetworkTypeUtil.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fe14f8f731acd407cb913046a8a3175f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSProgressHUD.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSProgressHUD.h new file mode 100644 index 0000000..310ed61 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSProgressHUD.h @@ -0,0 +1,391 @@ +// TDSProgressHUD + +#import +#import +#import + +@class TDSBackgroundView; +@protocol TDSProgressHUDDelegate; + + +extern CGFloat const TDSProgressMaxOffset; + +typedef NS_ENUM(NSInteger, TDSProgressHUDMode) { + /// UIActivityIndicatorView. + TDSProgressHUDModeIndeterminate, + /// A round, pie-chart like, progress view. + TDSProgressHUDModeDeterminate, + /// Horizontal progress bar. + TDSProgressHUDModeDeterminateHorizontalBar, + /// Ring-shaped progress view. + TDSProgressHUDModeAnnularDeterminate, + /// Shows a custom view. + TDSProgressHUDModeCustomView, + /// Shows only labels. + TDSProgressHUDModeText +}; + +typedef NS_ENUM(NSInteger, TDSProgressHUDAnimation) { + /// Opacity animation + TDSProgressHUDAnimationFade, + /// Opacity + scale animation (zoom in when appearing zoom out when disappearing) + TDSProgressHUDAnimationZoom, + /// Opacity + scale animation (zoom out style) + TDSProgressHUDAnimationZoomOut, + /// Opacity + scale animation (zoom in style) + TDSProgressHUDAnimationZoomIn +}; + +typedef NS_ENUM(NSInteger, TDSProgressHUDBackgroundStyle) { + /// Solid color background + TDSProgressHUDBackgroundStyleSolidColor, + /// UIVisualEffectView or UIToolbar.layer background view + TDSProgressHUDBackgroundStyleBlur +}; + +typedef void (^TDSProgressHUDCompletionBlock)(void); + + +NS_ASSUME_NONNULL_BEGIN + + +/** + * Displays a simple HUD window containing a progress indicator and two optional labels for short messages. + * + * This is a simple drop-in class for displaying a progress HUD view similar to Apple's private UIProgressHUD class. + * The XDGProgressHUD window spans over the entire space given to it by the initWithFrame: constructor and catches all + * user input on this region, thereby preventing the user operations on components below the view. + * + * @note To still allow touches to pass through the HUD, you can set hud.userInteractionEnabled = NO. + * @attention XDGProgressHUD is a UI class and should therefore only be accessed on the main thread. + */ +@interface TDSProgressHUD : UIView + +/** + * Creates a new HUD, adds it to provided view and shows it. The counterpart to this method is hideHUDForView:animated:. + * + * @note This method sets removeFromSuperViewOnHide. The HUD will automatically be removed from the view hierarchy when hidden. + * + * @param view The view that the HUD will be added to + * @param animated If set to YES the HUD will appear using the current animationType. If set to NO the HUD will not use + * animations while appearing. + * @return A reference to the created HUD. + * + * @see hideHUDForView:animated: + * @see animationType + */ ++ (instancetype)showHUDAddedTo:(UIView *)view animated:(BOOL)animated; + +/// @name Showing and hiding + +/** + * Finds the top-most HUD subview that hasn't finished and hides it. The counterpart to this method is showHUDAddedTo:animated:. + * + * @note This method sets removeFromSuperViewOnHide. The HUD will automatically be removed from the view hierarchy when hidden. + * + * @param view The view that is going to be searched for a HUD subview. + * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use + * animations while disappearing. + * @return YES if a HUD was found and removed, NO otherwise. + * + * @see showHUDAddedTo:animated: + * @see animationType + */ ++ (BOOL)hideHUDForView:(UIView *)view animated:(BOOL)animated; + +/** + * Finds the top-most HUD subview that hasn't finished and returns it. + * + * @param view The view that is going to be searched. + * @return A reference to the last HUD subview discovered. + */ ++ (nullable TDSProgressHUD *)HUDForView:(UIView *)view NS_SWIFT_NAME(forView(_:)); + +/** + * A convenience constructor that initializes the HUD with the view's bounds. Calls the designated constructor with + * view.bounds as the parameter. + * + * @param view The view instance that will provide the bounds for the HUD. Should be the same instance as + * the HUD's superview (i.e., the view that the HUD will be added to). + */ +- (instancetype)initWithView:(UIView *)view; + +/** + * Displays the HUD. + * + * @note You need to make sure that the main thread completes its run loop soon after this method call so that + * the user interface can be updated. Call this method when your task is already set up to be executed in a new thread + * (e.g., when using something like NSOperation or making an asynchronous call like NSURLRequest). + * + * @param animated If set to YES the HUD will appear using the current animationType. If set to NO the HUD will not use + * animations while appearing. + * + * @see animationType + */ +- (void)showAnimated:(BOOL)animated; + +/** + * Hides the HUD. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to + * hide the HUD when your task completes. + * + * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use + * animations while disappearing. + * + * @see animationType + */ +- (void)hideAnimated:(BOOL)animated; + +/** + * Hides the HUD after a delay. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to + * hide the HUD when your task completes. + * + * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use + * animations while disappearing. + * @param delay Delay in seconds until the HUD is hidden. + * + * @see animationType + */ +- (void)hideAnimated:(BOOL)animated afterDelay:(NSTimeInterval)delay; + +/** + * The HUD delegate object. Receives HUD state notifications. + */ +@property (weak, nonatomic) id delegate; + +/** + * Called after the HUD is hidden. + */ +@property (copy, nullable) TDSProgressHUDCompletionBlock completionBlock; + +/** + * Grace period is the time (in seconds) that the invoked method may be run without + * showing the HUD. If the task finishes before the grace time runs out, the HUD will + * not be shown at all. + * This may be used to prevent HUD display for very short tasks. + * Defaults to 0 (no grace time). + * @note The graceTime needs to be set before the hud is shown. You thus can't use `showHUDAddedTo:animated:`, + * but instead need to alloc / init the HUD, configure the grace time and than show it manually. + */ +@property (assign, nonatomic) NSTimeInterval graceTime; + +/** + * The minimum time (in seconds) that the HUD is shown. + * This avoids the problem of the HUD being shown and than instantly hidden. + * Defaults to 0 (no minimum show time). + */ +@property (assign, nonatomic) NSTimeInterval minShowTime; + +/** + * Removes the HUD from its parent view when hidden. + * Defaults to NO. + */ +@property (assign, nonatomic) BOOL removeFromSuperViewOnHide; + +/// @name Appearance + +/** + * XDGProgressHUD operation mode. The default is TDSProgressHUDModeIndeterminate. + */ +@property (assign, nonatomic) TDSProgressHUDMode mode; + +/** + * A color that gets forwarded to all labels and supported indicators. Also sets the tintColor + * for custom views on iOS 7+. Set to nil to manage color individually. + * Defaults to semi-translucent black on iOS 7 and later and white on earlier iOS versions. + */ +@property (strong, nonatomic, nullable) UIColor *contentColor UI_APPEARANCE_SELECTOR; + +/** + * The animation type that should be used when the HUD is shown and hidden. + */ +@property (assign, nonatomic) TDSProgressHUDAnimation animationType UI_APPEARANCE_SELECTOR; + +/** + * The bezel offset relative to the center of the view. You can use TDSProgressMaxOffset + * and -TDSProgressMaxOffset to move the HUD all the way to the screen edge in each direction. + * E.g., CGPointMake(0.f, TDSProgressMaxOffset) would position the HUD centered on the bottom edge. + */ +@property (assign, nonatomic) CGPoint offset UI_APPEARANCE_SELECTOR; + +/** + * The amount of space between the HUD edge and the HUD elements (labels, indicators or custom views). + * This also represents the minimum bezel distance to the edge of the HUD view. + * Defaults to 20.f + */ +@property (assign, nonatomic) CGFloat margin UI_APPEARANCE_SELECTOR; + +/** + Defaults to 13.f +*/ +@property (assign, nonatomic) CGFloat verticalMargin UI_APPEARANCE_SELECTOR; + + +/** + * The minimum size of the HUD bezel. Defaults to CGSizeZero (no minimum size). + */ +@property (assign, nonatomic) CGSize minSize UI_APPEARANCE_SELECTOR; + +/** + * Force the HUD dimensions to be equal if possible. + */ +@property (assign, nonatomic, getter = isSquare) BOOL square UI_APPEARANCE_SELECTOR; + +/** + * When enabled, the bezel center gets slightly affected by the device accelerometer data. + * Defaults to NO. + * + * @note This can cause main thread checker assertions on certain devices. https://github.com/jdg/XDGProgressHUD/issues/552 + */ +@property (assign, nonatomic, getter=areDefaultMotionEffectsEnabled) BOOL defaultMotionEffectsEnabled UI_APPEARANCE_SELECTOR; + +/// @name Progress + +/** + * The progress of the progress indicator, from 0.0 to 1.0. Defaults to 0.0. + */ +@property (assign, nonatomic) float progress; + +/// @name ProgressObject + +/** + * The NSProgress object feeding the progress information to the progress indicator. + */ +@property (strong, nonatomic, nullable) NSProgress *progressObject; + +/// @name Views + +/** + * The view containing the labels and indicator (or customView). + */ +@property (strong, nonatomic, readonly)TDSBackgroundView *bezelView; + +/** + * View covering the entire HUD area, placed behind bezelView. + */ +@property (strong, nonatomic, readonly)TDSBackgroundView *backgroundView; + +/** + * The UIView (e.g., a UIImageView) to be shown when the HUD is in TDSProgressHUDModeCustomView. + * The view should implement intrinsicContentSize for proper sizing. For best results use approximately 37 by 37 pixels. + */ +@property (strong, nonatomic, nullable) UIView *customView; + +/** + * A label that holds an optional short message to be displayed below the activity indicator. The HUD is automatically resized to fit + * the entire text. + */ +@property (strong, nonatomic, readonly) UILabel *label; + +/** + * A label that holds an optional details message displayed below the labelText message. The details text can span multiple lines. + */ +@property (strong, nonatomic, readonly) UILabel *detailsLabel; + +/** + * A button that is placed below the labels. Visible only if a target / action is added and a title is assigned.. + */ +@property (strong, nonatomic, readonly) UIButton *button; + +@end + + +@protocol TDSProgressHUDDelegate + +@optional + +/** + * Called after the HUD was fully hidden from the screen. + */ +- (void)hudWasHidden:(TDSProgressHUD *)hud; + +@end + + +/** + * A progress view for showing definite progress by filling up a circle (pie chart). + */ +@interface XDGRoundProgressView : UIView + +/** + * Progress (0.0 to 1.0) + */ +@property (nonatomic, assign) float progress; + +/** + * Indicator progress color. + * Defaults to white [UIColor whiteColor]. + */ +@property (nonatomic, strong) UIColor *progressTintColor; + +/** + * Indicator background (non-progress) color. + * Only applicable on iOS versions older than iOS 7. + * Defaults to translucent white (alpha 0.1). + */ +@property (nonatomic, strong) UIColor *backgroundTintColor; + +/* + * Display mode - NO = round or YES = annular. Defaults to round. + */ +@property (nonatomic, assign, getter = isAnnular) BOOL annular; + +@end + + +/** + * A flat bar progress view. + */ +@interface XDGBarProgressView : UIView + +/** + * Progress (0.0 to 1.0) + */ +@property (nonatomic, assign) float progress; + +/** + * Bar border line color. + * Defaults to white [UIColor whiteColor]. + */ +@property (nonatomic, strong) UIColor *lineColor; + +/** + * Bar background color. + * Defaults to clear [UIColor clearColor]; + */ +@property (nonatomic, strong) UIColor *progressRemainingColor; + +/** + * Bar progress color. + * Defaults to white [UIColor whiteColor]. + */ +@property (nonatomic, strong) UIColor *progressColor; + +@end + + +@interface TDSBackgroundView : UIView + +/** + * The background style. + * Defaults to TDSProgressHUDBackgroundStyleBlur. + */ +@property (nonatomic) TDSProgressHUDBackgroundStyle style; + +/** + * The blur effect style, when using TDSProgressHUDBackgroundStyleBlur. + * Defaults to UIBlurEffectStyleLight. + */ +@property (nonatomic) UIBlurEffectStyle blurEffectStyle; + +/** + * The background color or the blur tint color. + * + * Defaults to nil on iOS 13 and later and + * `[UIColor colorWithWhite:0.8f alpha:0.6f]` + * on older systems. + */ +@property (nonatomic, strong, nullable) UIColor *color; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSProgressHUD.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSProgressHUD.h.meta new file mode 100644 index 0000000..ab9590f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSProgressHUD.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 62e707214563a4cea8f47c0218c6d23d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h new file mode 100644 index 0000000..4791689 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h @@ -0,0 +1,52 @@ +// +// XDReachability.h +// TDS +// +// Created by JiangJiahao on 2019/7/25. +// Copyright © 2019 X.D. Network Inc. All rights reserved. +// 直接用的YYReachability + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSUInteger, TDSReachabilityStatus) { + TDSReachabilityStatusNone = 0, ///< Not Reachable + TDSReachabilityStatusWWAN = 1, ///< Reachable via WWAN (2G/3G/4G) + TDSReachabilityStatusWiFi = 2, ///< Reachable via WiFi +}; + +typedef NS_ENUM(NSUInteger, TDSReachabilityWWANStatus) { + TDSReachabilityWWANStatusNone = 0, ///< Not Reachable vis WWAN + TDSReachabilityWWANStatus2G = 2, ///< Reachable via 2G (GPRS/EDGE) 10~100Kbps + TDSReachabilityWWANStatus3G = 3, ///< Reachable via 3G (WCDMA/HSDPA/...) 1~10Mbps + TDSReachabilityWWANStatus4G = 4, ///< Reachable via 4G (eHRPD/LTE) 100Mbps + TDSReachabilityWWANStatus5G = 5, ///< Reachable via 5G (sa/nsa) 500Mbps +}; + +@interface TDSReachability : NSObject +@property (nonatomic, readonly) SCNetworkReachabilityFlags flags; ///< Current flags. +@property (nonatomic, readonly) TDSReachabilityStatus status; ///< Current status. +@property (nonatomic, readonly) TDSReachabilityWWANStatus wwanStatus NS_AVAILABLE_IOS(7_0); ///< Current WWAN status. +@property (nonatomic, readonly, getter=isReachable) BOOL reachable; ///< Current reachable status. + +/// Notify block which will be called on main thread when network changed. +@property (nullable, nonatomic, copy) void (^TDSReachabilityNotifyBlock)(TDSReachability *reachability); + +/// Create an object to check the reachability of the default route. ++ (instancetype)reachability; + +/// Create an object to check the reachability of the local WI-FI. ++ (instancetype)reachabilityForLocalWifi DEPRECATED_MSG_ATTRIBUTE("unnecessary and potentially harmful"); + +/// Create an object to check the reachability of a given host name. ++ (nullable instancetype)reachabilityWithHostname:(NSString *)hostname; + +/// Create an object to check the reachability of a given IP address +/// @param hostAddress You may pass `struct sockaddr_in` for IPv4 address or `struct sockaddr_in6` for IPv6 address. ++ (nullable instancetype)reachabilityWithAddress:(const struct sockaddr *)hostAddress; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h.meta new file mode 100644 index 0000000..c241d5c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4b37d410683a54a279d34fb3c401c026 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionApi.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionApi.h new file mode 100644 index 0000000..34c8e53 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionApi.h @@ -0,0 +1,16 @@ +// +// TDSRegionApi.h +// TDSCommon +// +// Created by TapTap-David on 2020/11/18. +// + +#import +#import +NS_ASSUME_NONNULL_BEGIN + +@interface TDSRegionApi : NSObject ++ (TDSNetExecutor *)getDeviceRegion:(NSInteger)carrier bundleId:(NSString *)bundleId; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionApi.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionApi.h.meta new file mode 100644 index 0000000..0727c0b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionApi.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 97c0581ab2d394909a4743f16832a538 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionHelper.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionHelper.h new file mode 100644 index 0000000..5bf6225 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionHelper.h @@ -0,0 +1,18 @@ +// +// TDSRegionHelper.h +// TDSCommon +// +// Created by TapTap-David on 2020/11/18. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSRegionHelper : NSObject + ++ (void)getRegionCode:(void(^)(BOOL isMainland))complete; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionHelper.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionHelper.h.meta new file mode 100644 index 0000000..9df13a6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionHelper.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c53101288729041bda96812cef0aaebd +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionNetClient.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionNetClient.h new file mode 100644 index 0000000..47b1436 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionNetClient.h @@ -0,0 +1,18 @@ +// +// TDSRegionNetClient.h +// TDSCommon +// +// Created by TapTap-David on 2020/11/18. +// + +#import +#import +NS_ASSUME_NONNULL_BEGIN + +@interface TDSRegionNetClient : NSObject ++ (instancetype)sharedInstance; + +- (TDSNetExecutor *)doWithRequest:(TDSNetRequestModel *)request; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionNetClient.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionNetClient.h.meta new file mode 100644 index 0000000..9c5cd5a --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionNetClient.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 64434fcded4974ffd8d1df58809c32dd +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSResult.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSResult.h new file mode 100644 index 0000000..95d1462 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSResult.h @@ -0,0 +1,37 @@ +// +// Result.h +// EngineBridge +// +// Created by xe on 2020/9/28. +// Copyright © 2020 xe. All rights reserved. +// + + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSResult : NSObject + +@property (nonatomic,assign) int code; +@property (nonatomic,copy) NSString* message; +@property (nonatomic,copy) NSString* content; +@property (nonatomic,copy) NSString* callbackId; +@property (nonatomic,assign) BOOL onceTime; + ++ (TDSResult*)code:(int)code + content:(NSString*)content + callbackId:(NSString*)callbackId + message:(NSString*)message; + ++ (TDSResult*)code:(int)code + content:(NSString*)content + callbackId:(NSString*)callbackId + message:(NSString*)message + onceTime:(BOOL) onceTime; + +- (NSString*)toJSON; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSResult.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSResult.h.meta new file mode 100644 index 0000000..fe2059f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSResult.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 02bc754ee38584146b55a380300f8488 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRouter.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRouter.h new file mode 100644 index 0000000..38aa638 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRouter.h @@ -0,0 +1,63 @@ +// +// TDSRouter.h +// TDSCommon +// +// Created by Insomnia on 2020/11/27. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const TDSRouterURL; +extern NSString *const TDSRouterResp; +extern NSString *const TDSRouterParams; + +typedef void (^TDSRouterHandler)(NSDictionary *params); + +typedef void (^TDSRouterResponse)(NSDictionary *response); + + +/// TDS路由 +@interface TDSRouter : NSObject + +/// 注册路由 +/// @param url 路由路径,例如tds://service,并支持带参数路由tds://service/:user/:age +/// @param handler 接收参数,包含了注册的 URL 中对应的变量, 如注册的 URL 为ds://service/:user那么,就会传一个 @{@"user": "tds_name"} 这样的字典过来 ++ (void)registerServiceWithURL:(NSString *)url handler:(TDSRouterHandler)handler; + + +/// 反注册 +/// @param url 路由路径 ++ (void)unregisterServiceWithUrl:(NSString *)url; + +/// 请求路由 +/// @param url 路由路径 ++ (void)requestWithURL:(NSString *)url; + + +/// 请求路由 +/// @param url 路由路径 +/// @param params 请求参数 ++ (void)requestWithURL:(NSString *)url params:(NSDictionary * _Nullable)params; + +/// 请求路由 +/// @param url 路由路径 +/// @param params 请求参数 +/// @param response 返回值字典 ++ (void)requestWithURL:(NSString *)url params:(NSDictionary * _Nullable)params response:(TDSRouterResponse _Nullable)response; + +/// 是否存在服务 +/// @param url 路由路径 ++ (BOOL)hasServiceWithURL:(NSString *)url; + + +/// 自动拼接路由参数 +/// @param url 路由路径,例如tds://service/:user/:age +/// @param params 数组顺序要与路由参数顺序对应 +/// @return 生成URL 字符串 ++ (NSString *)generateWithURL:(NSString *)url params:(NSArray *)params; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRouter.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRouter.h.meta new file mode 100644 index 0000000..e935696 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRouter.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 27002ab4cc03440daac27ee0c874b1b3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSThrottle.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSThrottle.h new file mode 100644 index 0000000..7ccfc06 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSThrottle.h @@ -0,0 +1,107 @@ +// +// TDSThrottle.h +// TDSCommon +// +// Created by JiangJiahao on 2021/3/22. +// + +#import + +/** 自定管理执行与释放时,标记调用来源: 对象/类地址_方法名_调用行数 */ +#define TDSThrottleKey [NSString stringWithFormat:@"%p_%s_%d",self,__func__,__LINE__] +#define TDSThrottleKeyAppendCustom(customKey) [NSString stringWithFormat:@"%p_%s_%d%@",self,__func__,__LINE__,customKey] + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^TDSThrottleTaskBlock)(void); +extern double const THROTTLE_INTERVAL; // 默认频率间隔, 0.5s + +/** + 相邻调用必须间隔超时时间以上才会触发 + */ +@interface TDSThrottle : NSObject +#pragma mark - 自动管理 ++ (TDSThrottle *)throttleWithThrottleKey:(NSString *)throttleKey taskBlock:(TDSThrottleTaskBlock)taskBlock; + ++ (TDSThrottle *)throttleWithInterval:(NSTimeInterval)interval + throttleKey:(NSString *)throttleKey + taskBlock:(TDSThrottleTaskBlock)taskBlock; + +/// 自动执行一个Throttle(节流)任务。 +/// 注意:适用调用不是异常频繁的任务,如用户按钮频繁点击限制 +/// @param interval 防抖间隔,默认0.5s +/// @param queue 任务执行队列,默认主队列 +/// @param throttleKey 任务来源标识,可使用默认宏 TDSThrottleKey 或 TDSThrottleKeyAppendCustom +/// @param taskBlock 需要执行的任务 ++ (TDSThrottle *)throttleWithInterval:(NSTimeInterval)interval + onQueue:(dispatch_queue_t)queue + throttleKey:(NSString *)throttleKey + taskBlock:(TDSThrottleTaskBlock)taskBlock; +#pragma mark - 手动管理 ++ (TDSThrottle *)manualThrottleWithTaskBlock:(TDSThrottleTaskBlock)taskBlock; + ++ (TDSThrottle *)manualThrottleWithInterval:(NSTimeInterval)interval + taskBlock:(TDSThrottleTaskBlock)taskBlock; + +/// 手动获取一个Throttle(节流)任务,需要在不再使用时手动调用 dispose 释放 +/// 注意:适合在任务会异常频繁执行时进行限制,如滑动列表时在频繁系统回调中处理的任务 +/// @param interval 抖间隔,默认0.5s +/// @param queue 任务执行队列,默认主队列 +/// @param taskBlock 需要执行的任务 ++ (TDSThrottle *)manualThrottleWithInterval:(NSTimeInterval)interval + onQueue:(dispatch_queue_t)queue + taskBlock:(TDSThrottleTaskBlock)taskBlock; + +#pragma mark - 执行与销毁 +/// 触发任务执行,手动管理时调用 +- (void)invoke; + +/// 销毁任务,手动管理时调用 +- (void)dispose; + +@end + +#pragma mark - private classes +/** + 调用后立即触发,间隔时间未超时无法再次触发,每次调用不会重新计时 + */ +@interface TDSThrottleLeading : TDSThrottle + +@end + +/** + 调用后等待间隔时间超时以后触发,每次调用不会重新计时 + */ +@interface TDSThrottleTrailing : TDSThrottle + +@end + +/** + 使用方法: + 1.自动管理(自动执行/释放) + // 按钮事件或需要执行的函数,任务使用 Throttle 包裹 + - (void)testThrottle { + [TDSThrottleLeading throttleWithInterval:0.8 throttleKey:TDSThrottleKey taskBlock:^{ + // TODO 想要执行的任务 + }]; + } + + 2.手动管理 (创建时调用 manual 开头函数) + + @property (nonatomic, strong) TDSThrottle *testThrottler; + + // 按钮事件或需要执行的函数,任务使用 Throttle 包裹 + - (void)testThrottle { + if (!self.testThrottler) { + self.testThrottler = [TDSThrottleLeading manualThrottleWithTaskBlock:^{ + // TODO 想要执行的任务 + }]; + } + [self.testThrottler invoke]; + } + + // 在适当时机,如退出页面时释放 + [self.testThrottler dispose]; + */ +NS_ASSUME_NONNULL_END + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSThrottle.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSThrottle.h.meta new file mode 100644 index 0000000..31dddc3 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSThrottle.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4cc1b0ad5ea2a47b1a0d1f01c4836801 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerConfig.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerConfig.h new file mode 100644 index 0000000..e235242 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerConfig.h @@ -0,0 +1,29 @@ +// +// TDSTrackerConfig.h +// TDSCommon +// +// Created by TapTap-David on 2021/1/15. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +typedef enum : NSUInteger { + TDSTrackerForTapsdk = 1, + TDSTrackerForFriends, + TDSTrackerForNetwork, + TDSTrackerForTapSDKNetwork +} TDSTrackerType; + +@interface TDSTrackerConfig : NSObject +@property (nonatomic, copy) NSString *accessKeyId; +@property (nonatomic, copy) NSString *accessKeySecret; +@property (nonatomic, copy) NSString *project; +@property (nonatomic, copy) NSString *endPoint; +@property (nonatomic, copy) NSString *logStore; +@property (nonatomic, copy) NSString *sdkVersionName; +@property (nonatomic, assign) TDSTrackerType trackerType; +@property (nonatomic, assign) NSInteger groupSize; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerConfig.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerConfig.h.meta new file mode 100644 index 0000000..2f9fb0b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerConfig.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 093a043fedb9b47d09e79e3d1103f379 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h new file mode 100644 index 0000000..920d964 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h @@ -0,0 +1,38 @@ +// +// TDSTrackerEvent.h +// TapCommonSDK +// +// Created by Bottle K on 2021/6/21. +// + +#import +#import +#import +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSTrackerEvent : NSObject +//事件类型 +@property (nonatomic, assign) TDSTrackerType trackerType; + +//用户模型 +@property (nonatomic, strong, nullable) UserModel *userModel; + +//页面模型 +@property (nonatomic, strong, nullable) PageModel *pageModel; + +//行为模型 +@property (nonatomic, strong, nullable) ActionModel *actionModel; + +//网络模型 +@property (nonatomic, strong, nullable) NetworkStateModel *networkModel; + +//登录模型 +@property (nonatomic, strong, nullable) LoginModel *loginModel; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h.meta new file mode 100644 index 0000000..e3f7deb --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 15c8511ebd35c42619f4d6a15ec74803 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerManager.h new file mode 100644 index 0000000..6673bbb --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerManager.h @@ -0,0 +1,28 @@ +// +// TDSTrackerManager.h +// TDSCommon +// +// Created by TapTap-David on 2021/1/19. +// + +#import +#import +#import +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSTrackerManager : NSObject + ++ (instancetype)sharedInstance; + ++ (void)registerTracker:(TDSTrackerConfig *)trackerConfig; + +- (void)trackWithEvent:(TDSTrackerEvent *)event; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerManager.h.meta new file mode 100644 index 0000000..837d88a --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3cf9deda851cb4a3ab98a85bab7ce2e1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSUrlSafe.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSUrlSafe.h new file mode 100644 index 0000000..895eb62 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSUrlSafe.h @@ -0,0 +1,22 @@ +// +// TDSUrlSafe.h +// TapCommonSDK +// +// Created by 黄驿峰 on 2022/3/25. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSUrlSafe : NSObject + +// base64 url 编码 ++ (nullable NSString *)base64UrlEncoder:(NSData *)data; + +// base64 url 解码 ++ (nullable NSData *)base64UrlDecoder:(NSString *)str; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSUrlSafe.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSUrlSafe.h.meta new file mode 100644 index 0000000..2cf672e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSUrlSafe.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 07ede35df5c2a4b9a941210f10859b63 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKCookieWebview.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKCookieWebview.h new file mode 100644 index 0000000..0efc47b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKCookieWebview.h @@ -0,0 +1,19 @@ +// +// WKCookieWebview.h +// NativeApp +// +// Created by JiangJiahao on 2019/4/3. +// Copyright © 2019 JiangJiahao. All rights reserved. +// 处理wkwebview的cookie问题 + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSWKCookieWebview : WKWebView +- (id)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration useRedirectCookie:(BOOL)useRedirectCookie; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKCookieWebview.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKCookieWebview.h.meta new file mode 100644 index 0000000..16cbdb9 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKCookieWebview.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fe5cc4199e63244d69f29f9d71cffe3b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKWebViewJavascriptBridge.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKWebViewJavascriptBridge.h new file mode 100755 index 0000000..dd3506f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKWebViewJavascriptBridge.h @@ -0,0 +1,35 @@ +// +// WKWebViewJavascriptBridge.h +// +// Created by @LokiMeyburg on 10/15/14. +// Copyright (c) 2014 @LokiMeyburg. All rights reserved. +// + +#if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_1) +#define supportsWKWebView +#endif + +#if defined supportsWKWebView + +#import +#import +#import + +@interface TDSWKWebViewJavascriptBridge : NSObject + ++ (instancetype)bridgeForWebView:(WKWebView*)webView; ++ (void)enableLogging; + +- (void)registerHandler:(NSString*)handlerName handler:(TDSWVJBHandler)handler; +- (void)removeHandler:(NSString*)handlerName; +- (void)callHandler:(NSString*)handlerName; +- (void)callHandler:(NSString*)handlerName data:(id)data; +- (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(TDSWVJBResponseCallback)responseCallback; +- (void)reset; +- (void)setWebViewDelegate:(id)webViewDelegate; +- (void)disableJavscriptAlertBoxSafetyTimeout; +- (NSArray *)getSupportHandlerNameArray; + +@end + +#endif diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKWebViewJavascriptBridge.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKWebViewJavascriptBridge.h.meta new file mode 100644 index 0000000..15d9597 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKWebViewJavascriptBridge.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: eb1eefba07788489d9e6cd3241fa1ee3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSSecurity.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSSecurity.h new file mode 100644 index 0000000..e81edaa --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSSecurity.h @@ -0,0 +1,82 @@ +////////////////////////////////////////////////////////////////////////////////////////////////// +// +// TDSWSSecurity.h +// +// Created by Austin and Dalton Cherry on on 9/3/15. +// Copyright (c) 2014-2017 Austin Cherry. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +////////////////////////////////////////////////////////////////////////////////////////////////// + +#import +#import + +@interface TDSWSSSLCert : NSObject + +/** + Designated init for certificates + + :param: data is the binary data of the certificate + + :returns: a representation security object to be used with + */ +- (instancetype)initWithData:(NSData *)data; + + +/** + Designated init for public keys + + :param: key is the public key to be used + + :returns: a representation security object to be used with + */ +- (instancetype)initWithKey:(SecKeyRef)key; + +@end + +@interface TDSWSSecurity : NSObject + +/** + Use certs from main app bundle + + :param usePublicKeys: is to specific if the publicKeys or certificates should be used for SSL pinning validation + + :returns: a representation security object to be used with + */ +- (instancetype)initWithCerts:(NSArray*)certs publicKeys:(BOOL)publicKeys; + +/** + Designated init + + :param keys: is the certificates or public keys to use + :param usePublicKeys: is to specific if the publicKeys or certificates should be used for SSL pinning validation + + :returns: a representation security object to be used with + */ +- (instancetype)initUsingPublicKeys:(BOOL)publicKeys; + +/** + Should the domain name be validated? Default is YES. + */ +@property(nonatomic)BOOL validatedDN; + +/** + Validate if the cert is legit or not. + :param: trust is the trust to validate + :param: domain to validate along with the trust (can be nil) + :return: YES or NO if valid. + */ +- (BOOL)isValid:(SecTrustRef)trust domain:(NSString*)domain; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSSecurity.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSSecurity.h.meta new file mode 100644 index 0000000..fd0a0a4 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSSecurity.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dfbd9365688964593a1c091ba53f5b2f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSWebSocket.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSWebSocket.h new file mode 100644 index 0000000..e840aa0 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSWebSocket.h @@ -0,0 +1,189 @@ +////////////////////////////////////////////////////////////////////////////////////////////////// +// +// TDSWSWebSocket.h +// +// Created by Austin and Dalton Cherry on on 5/13/14. +// Copyright (c) 2014-2017 Austin Cherry. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +////////////////////////////////////////////////////////////////////////////////////////////////// + +#import +#import + +@class TDSWSWebSocket; + +/** + It is important to note that all the delegate methods are put back on the main thread. + This means if you want to do some major process of the data, you need to create a background thread. + */ +@protocol TDSWSWebSocketDelegate + +@optional +/** + The websocket connected to its host. + @param socket is the current socket object. + */ +-(void)websocketDidConnect:(nonnull TDSWSWebSocket*)socket; + +/** + The websocket was disconnected from its host. + @param socket is the current socket object. + @param error is return an error occured to trigger the disconnect. + */ +-(void)websocketDidDisconnect:(nonnull TDSWSWebSocket*)socket error:(nullable NSError*)error; + +/** + The websocket got a text based message. + @param socket is the current socket object. + @param string is the text based data that has been returned. + */ +-(void)websocket:(nonnull TDSWSWebSocket*)socket didReceiveMessage:(nonnull NSString*)string; + +/** + The websocket got a binary based message. + @param socket is the current socket object. + @param data is the binary based data that has been returned. + */ +-(void)websocket:(nonnull TDSWSWebSocket*)socket didReceiveData:(nullable NSData*)data; + +/** + The websocket got a pong. + @param socket is the current socket object. + @param data is the binary based data that has been returned. + */ +-(void)websocket:(nonnull TDSWSWebSocket*)socket didReceivePong:(nullable NSData*)data; + +@end + +@interface TDSWSWebSocket : NSObject + +@property(nonatomic,weak, nullable)iddelegate; +@property(nonatomic, readonly, nonnull) NSURL *url; + +/** + constructor to create a new websocket with QOS_CLASS_UTILITY dispatch queue + @param url the host you want to connect to. + @param protocols the websocket protocols you want to use (e.g. chat,superchat). + @return a newly initalized websocket. + */ +- (nonnull instancetype)initWithURL:(nonnull NSURL *)url protocols:(nullable NSArray*)protocols; + +/** + constructor to create a new websocket + @param url the host you want to connect to. + @param protocols the websocket protocols you want to use (e.g. chat,superchat). + @param callbackQueue the dispatch queue for handling callbacks + @return a newly initalized websocket. + */ +- (nonnull instancetype)initWithURL:(nonnull NSURL *)url protocols:(nullable NSArray*)protocols callbackQueue:(nonnull dispatch_queue_t)callbackQueue; + +/** + constructor to create a new websocket + @param url the host you want to connect to. + @param protocols the websocket protocols you want to use (e.g. chat,superchat). + @param callbackQueue the dispatch queue for handling callbacks + @param connectTimeout timeout for blocking connect + @return a newly initalized websocket. + */ +- (nonnull instancetype)initWithURL:(nonnull NSURL *)url protocols:(nullable NSArray*)protocols callbackQueue:(nonnull dispatch_queue_t)callbackQueue connectTimeout:(NSTimeInterval)connectTimeout; + +/** + connect to the host + */ +- (void)connect; + +/** + disconnect to the host. This sends the close Connection opcode to terminate cleanly. + */ +- (void)disconnect; + +/** + write binary based data to the socket. + @param data the binary data to write. + */ +- (void)writeData:(nonnull NSData*)data; + +/** + write text based data to the socket. + @param string the string to write. + */ +- (void)writeString:(nonnull NSString*)string; + +/** + write ping to the socket. + @param data the binary data to write (if desired). + */ +- (void)writePing:(nonnull NSData*)data; + +/** + Add a header to send along on the the HTTP connect. + @param value the string to send + @param key the HTTP key name to send + */ +- (void)addHeader:(nonnull NSString*)value forKey:(nonnull NSString*)key; + +/** + returns if the socket is conneted or not. + */ +@property(nonatomic, assign, readonly)BOOL isConnected; + +/** + Enable VOIP support on the socket, so it can be used in the background for VOIP calls. + Default setting is No. + */ +@property(nonatomic, assign)BOOL voipEnabled; + +/** + Allows connection to self signed or untrusted WebSocket connection. Useful for development. + Default setting is No. + */ +@property(nonatomic, assign)BOOL selfSignedSSL; + +/** + Use for SSL pinning. + */ +@property(nonatomic, strong, nullable)TDSWSSecurity *security; + +/** + Set your own custom queue. + Default setting is dispatch_get_main_queue. + */ +@property(nonatomic, strong, nullable)dispatch_queue_t queue; + +/** + Block property to use on connect. + */ +@property(nonatomic, strong, nullable)void (^onConnect)(void); + +/** + Block property to use on disconnect. + */ +@property(nonatomic, strong, nullable)void (^onDisconnect)(NSError*_Nullable); + +/** + Block property to use on receiving data. + */ +@property(nonatomic, strong, nullable)void (^onData)(NSData*_Nullable); + +/** + Block property to use on receiving text. + */ +@property(nonatomic, strong, nullable)void (^onText)(NSString*_Nullable); + +/** + Block property to use on receiving pong. + */ +@property(nonatomic, strong, nullable)void (^onPong)(NSData*_Nullable); +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSWebSocket.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSWebSocket.h.meta new file mode 100644 index 0000000..dc1f4d4 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSWebSocket.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ea555bb47c9c24212b921e5eff370c1e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebImageView.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebImageView.h new file mode 100644 index 0000000..d0f58ee --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebImageView.h @@ -0,0 +1,21 @@ +// +// XDWebImageView.h +// NativeApp +// +// Created by JiangJiahao on 2018/10/16. +// Copyright © 2018 JiangJiahao. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSWebImageView : UIImageView + +- (void)setImageWithUrl:(NSString *)imageUrl; + +- (void)setImageWithUrl:(nullable NSString *)imageUrl placeholderImage:(nullable UIImage *)placeholder; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebImageView.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebImageView.h.meta new file mode 100644 index 0000000..1dcbeff --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebImageView.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a9961c07e15d9493e8bc5042cd4879dc +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h new file mode 100755 index 0000000..be4c2a4 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h @@ -0,0 +1,46 @@ +// +// TapTapForumWebViewJavascriptBridgeBase.h +// +// Created by @LokiMeyburg on 10/15/14. +// Copyright (c) 2014 @LokiMeyburg. All rights reserved. +// + +#import + +#define kOldProtocolScheme @"wvjbscheme" +#define kNewProtocolScheme @"https" +#define kQueueHasMessage @"__wvjb_queue_message__" +#define kBridgeLoaded @"__bridge_loaded__" + +typedef void (^TDSWVJBResponseCallback)(id responseData); +typedef void (^TDSWVJBHandler)(id data, TDSWVJBResponseCallback responseCallback); +typedef NSDictionary ForumWVJBMessage; + +@protocol TDSWebViewJavascriptBridgeBaseDelegate +- (NSString*) _evaluateJavascript:(NSString*)javascriptCommand; +@end + +@interface TDSWebViewJavascriptBridgeBase : NSObject + + +@property (weak, nonatomic) id delegate; +@property (strong, nonatomic) NSMutableArray* startupMessageQueue; +@property (strong, nonatomic) NSMutableDictionary* responseCallbacks; +@property (strong, nonatomic) NSMutableDictionary* messageHandlers; +@property (strong, nonatomic) TDSWVJBHandler messageHandler; + ++ (void)enableLogging; ++ (void)setLogMaxLength:(int)length; +- (void)reset; +- (void)sendData:(id)data responseCallback:(TDSWVJBResponseCallback)responseCallback handlerName:(NSString*)handlerName; +- (void)flushMessageQueue:(NSString *)messageQueueString; +- (void)injectJavascriptFile; +- (BOOL)isWebViewJavascriptBridgeURL:(NSURL*)url; +- (BOOL)isQueueMessageURL:(NSURL*)urll; +- (BOOL)isBridgeLoadedURL:(NSURL*)urll; +- (void)logUnkownMessage:(NSURL*)url; +- (NSString *)webViewJavascriptCheckCommand; +- (NSString *)webViewJavascriptFetchQueyCommand; +- (void)disableJavscriptAlertBoxSafetyTimeout; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h.meta new file mode 100644 index 0000000..6a5773f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9a70045d444be4034acdf0327a85c6a6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSmetamacro.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSmetamacro.h new file mode 100644 index 0000000..61f651b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSmetamacro.h @@ -0,0 +1,662 @@ +/** + * Macros for metaprogramming + * ExtendedC + * + * Copyright (C) 2012 Justin Spahr-Summers + * Released under the MIT license + */ + +#ifndef EXTC_METAMACROS_H +#define EXTC_METAMACROS_H + + +/** + * Executes one or more expressions (which may have a void type, such as a call + * to a function that returns no value) and always returns true. + */ +#define metamacro_exprify(...) \ + ((__VA_ARGS__), true) + +/** + * Returns a string representation of VALUE after full macro expansion. + */ +#define metamacro_stringify(VALUE) \ + metamacro_stringify_(VALUE) + +/** + * Returns A and B concatenated after full macro expansion. + */ +#define metamacro_concat(A, B) \ + metamacro_concat_(A, B) + +/** + * Returns the Nth variadic argument (starting from zero). At least + * N + 1 variadic arguments must be given. N must be between zero and twenty, + * inclusive. + */ +#define metamacro_at(N, ...) \ + metamacro_concat(metamacro_at, N)(__VA_ARGS__) + +/** + * Returns the number of arguments (up to twenty) provided to the macro. At + * least one argument must be provided. + * + * Inspired by P99: http://p99.gforge.inria.fr + */ +#define metamacro_argcount(...) \ + metamacro_at(20, __VA_ARGS__, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) + +/** + * Identical to #metamacro_foreach_cxt, except that no CONTEXT argument is + * given. Only the index and current argument will thus be passed to MACRO. + */ +#define metamacro_foreach(MACRO, SEP, ...) \ + metamacro_foreach_cxt(metamacro_foreach_iter, SEP, MACRO, __VA_ARGS__) + +/** + * For each consecutive variadic argument (up to twenty), MACRO is passed the + * zero-based index of the current argument, CONTEXT, and then the argument + * itself. The results of adjoining invocations of MACRO are then separated by + * SEP. + * + * Inspired by P99: http://p99.gforge.inria.fr + */ +#define metamacro_foreach_cxt(MACRO, SEP, CONTEXT, ...) \ + metamacro_concat(metamacro_foreach_cxt, metamacro_argcount(__VA_ARGS__))(MACRO, SEP, CONTEXT, __VA_ARGS__) + +/** + * Identical to #metamacro_foreach_cxt. This can be used when the former would + * fail due to recursive macro expansion. + */ +#define metamacro_foreach_cxt_recursive(MACRO, SEP, CONTEXT, ...) \ + metamacro_concat(metamacro_foreach_cxt_recursive, metamacro_argcount(__VA_ARGS__))(MACRO, SEP, CONTEXT, __VA_ARGS__) + +/** + * In consecutive order, appends each variadic argument (up to twenty) onto + * BASE. The resulting concatenations are then separated by SEP. + * + * This is primarily useful to manipulate a list of macro invocations into instead + * invoking a different, possibly related macro. + */ +#define metamacro_foreach_concat(BASE, SEP, ...) \ + metamacro_foreach_cxt(metamacro_foreach_concat_iter, SEP, BASE, __VA_ARGS__) + +/** + * Iterates COUNT times, each time invoking MACRO with the current index + * (starting at zero) and CONTEXT. The results of adjoining invocations of MACRO + * are then separated by SEP. + * + * COUNT must be an integer between zero and twenty, inclusive. + */ +#define metamacro_for_cxt(COUNT, MACRO, SEP, CONTEXT) \ + metamacro_concat(metamacro_for_cxt, COUNT)(MACRO, SEP, CONTEXT) + +/** + * Returns the first argument given. At least one argument must be provided. + * + * This is useful when implementing a variadic macro, where you may have only + * one variadic argument, but no way to retrieve it (for example, because \c ... + * always needs to match at least one argument). + * + * @code +#define varmacro(...) \ + metamacro_head(__VA_ARGS__) + * @endcode + */ +#define metamacro_head(...) \ + metamacro_head_(__VA_ARGS__, 0) + +/** + * Returns every argument except the first. At least two arguments must be + * provided. + */ +#define metamacro_tail(...) \ + metamacro_tail_(__VA_ARGS__) + +/** + * Returns the first N (up to twenty) variadic arguments as a new argument list. + * At least N variadic arguments must be provided. + */ +#define metamacro_take(N, ...) \ + metamacro_concat(metamacro_take, N)(__VA_ARGS__) + +/** + * Removes the first N (up to twenty) variadic arguments from the given argument + * list. At least N variadic arguments must be provided. + */ +#define metamacro_drop(N, ...) \ + metamacro_concat(metamacro_drop, N)(__VA_ARGS__) + +/** + * Decrements VAL, which must be a number between zero and twenty, inclusive. + * + * This is primarily useful when dealing with indexes and counts in + * metaprogramming. + */ +#define metamacro_dec(VAL) \ + metamacro_at(VAL, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19) + +/** + * Increments VAL, which must be a number between zero and twenty, inclusive. + * + * This is primarily useful when dealing with indexes and counts in + * metaprogramming. + */ +#define metamacro_inc(VAL) \ + metamacro_at(VAL, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21) + +/** + * If A is equal to B, the next argument list is expanded; otherwise, the + * argument list after that is expanded. A and B must be numbers between zero + * and twenty, inclusive. Additionally, B must be greater than or equal to A. + * + * @code +// expands to true +metamacro_if_eq(0, 0)(true)(false) +// expands to false +metamacro_if_eq(0, 1)(true)(false) + * @endcode + * + * This is primarily useful when dealing with indexes and counts in + * metaprogramming. + */ +#define metamacro_if_eq(A, B) \ + metamacro_concat(metamacro_if_eq, A)(B) + +/** + * Identical to #metamacro_if_eq. This can be used when the former would fail + * due to recursive macro expansion. + */ +#define metamacro_if_eq_recursive(A, B) \ + metamacro_concat(metamacro_if_eq_recursive, A)(B) + +/** + * Returns 1 if N is an even number, or 0 otherwise. N must be between zero and + * twenty, inclusive. + * + * For the purposes of this test, zero is considered even. + */ +#define metamacro_is_even(N) \ + metamacro_at(N, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1) + +/** + * Returns the logical NOT of B, which must be the number zero or one. + */ +#define metamacro_not(B) \ + metamacro_at(B, 1, 0) + +// IMPLEMENTATION DETAILS FOLLOW! +// Do not write code that depends on anything below this line. +#define metamacro_stringify_(VALUE) # VALUE +#define metamacro_concat_(A, B) A ## B +#define metamacro_foreach_iter(INDEX, MACRO, ARG) MACRO(INDEX, ARG) +#define metamacro_head_(FIRST, ...) FIRST +#define metamacro_tail_(FIRST, ...) __VA_ARGS__ +#define metamacro_consume_(...) +#define metamacro_expand_(...) __VA_ARGS__ + +// implemented from scratch so that metamacro_concat() doesn't end up nesting +#define metamacro_foreach_concat_iter(INDEX, BASE, ARG) metamacro_foreach_concat_iter_(BASE, ARG) +#define metamacro_foreach_concat_iter_(BASE, ARG) BASE ## ARG + +// metamacro_at expansions +#define metamacro_at0(...) metamacro_head(__VA_ARGS__) +#define metamacro_at1(_0, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at2(_0, _1, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at3(_0, _1, _2, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at4(_0, _1, _2, _3, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at5(_0, _1, _2, _3, _4, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at6(_0, _1, _2, _3, _4, _5, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at7(_0, _1, _2, _3, _4, _5, _6, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at8(_0, _1, _2, _3, _4, _5, _6, _7, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at9(_0, _1, _2, _3, _4, _5, _6, _7, _8, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at10(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at11(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at12(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at13(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at14(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at15(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at17(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at18(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at19(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at20(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, ...) metamacro_head(__VA_ARGS__) + +// metamacro_foreach_cxt expansions +#define metamacro_foreach_cxt0(MACRO, SEP, CONTEXT) +#define metamacro_foreach_cxt1(MACRO, SEP, CONTEXT, _0) MACRO(0, CONTEXT, _0) + +#define metamacro_foreach_cxt2(MACRO, SEP, CONTEXT, _0, _1) \ + metamacro_foreach_cxt1(MACRO, SEP, CONTEXT, _0) \ + SEP \ + MACRO(1, CONTEXT, _1) + +#define metamacro_foreach_cxt3(MACRO, SEP, CONTEXT, _0, _1, _2) \ + metamacro_foreach_cxt2(MACRO, SEP, CONTEXT, _0, _1) \ + SEP \ + MACRO(2, CONTEXT, _2) + +#define metamacro_foreach_cxt4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \ + metamacro_foreach_cxt3(MACRO, SEP, CONTEXT, _0, _1, _2) \ + SEP \ + MACRO(3, CONTEXT, _3) + +#define metamacro_foreach_cxt5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \ + metamacro_foreach_cxt4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \ + SEP \ + MACRO(4, CONTEXT, _4) + +#define metamacro_foreach_cxt6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \ + metamacro_foreach_cxt5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \ + SEP \ + MACRO(5, CONTEXT, _5) + +#define metamacro_foreach_cxt7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \ + metamacro_foreach_cxt6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \ + SEP \ + MACRO(6, CONTEXT, _6) + +#define metamacro_foreach_cxt8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \ + metamacro_foreach_cxt7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \ + SEP \ + MACRO(7, CONTEXT, _7) + +#define metamacro_foreach_cxt9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \ + metamacro_foreach_cxt8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \ + SEP \ + MACRO(8, CONTEXT, _8) + +#define metamacro_foreach_cxt10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \ + metamacro_foreach_cxt9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \ + SEP \ + MACRO(9, CONTEXT, _9) + +#define metamacro_foreach_cxt11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \ + metamacro_foreach_cxt10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \ + SEP \ + MACRO(10, CONTEXT, _10) + +#define metamacro_foreach_cxt12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \ + metamacro_foreach_cxt11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \ + SEP \ + MACRO(11, CONTEXT, _11) + +#define metamacro_foreach_cxt13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \ + metamacro_foreach_cxt12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \ + SEP \ + MACRO(12, CONTEXT, _12) + +#define metamacro_foreach_cxt14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \ + metamacro_foreach_cxt13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \ + SEP \ + MACRO(13, CONTEXT, _13) + +#define metamacro_foreach_cxt15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \ + metamacro_foreach_cxt14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \ + SEP \ + MACRO(14, CONTEXT, _14) + +#define metamacro_foreach_cxt16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \ + metamacro_foreach_cxt15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \ + SEP \ + MACRO(15, CONTEXT, _15) + +#define metamacro_foreach_cxt17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \ + metamacro_foreach_cxt16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \ + SEP \ + MACRO(16, CONTEXT, _16) + +#define metamacro_foreach_cxt18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \ + metamacro_foreach_cxt17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \ + SEP \ + MACRO(17, CONTEXT, _17) + +#define metamacro_foreach_cxt19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \ + metamacro_foreach_cxt18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \ + SEP \ + MACRO(18, CONTEXT, _18) + +#define metamacro_foreach_cxt20(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19) \ + metamacro_foreach_cxt19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \ + SEP \ + MACRO(19, CONTEXT, _19) + +// metamacro_foreach_cxt_recursive expansions +#define metamacro_foreach_cxt_recursive0(MACRO, SEP, CONTEXT) +#define metamacro_foreach_cxt_recursive1(MACRO, SEP, CONTEXT, _0) MACRO(0, CONTEXT, _0) + +#define metamacro_foreach_cxt_recursive2(MACRO, SEP, CONTEXT, _0, _1) \ + metamacro_foreach_cxt_recursive1(MACRO, SEP, CONTEXT, _0) \ + SEP \ + MACRO(1, CONTEXT, _1) + +#define metamacro_foreach_cxt_recursive3(MACRO, SEP, CONTEXT, _0, _1, _2) \ + metamacro_foreach_cxt_recursive2(MACRO, SEP, CONTEXT, _0, _1) \ + SEP \ + MACRO(2, CONTEXT, _2) + +#define metamacro_foreach_cxt_recursive4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \ + metamacro_foreach_cxt_recursive3(MACRO, SEP, CONTEXT, _0, _1, _2) \ + SEP \ + MACRO(3, CONTEXT, _3) + +#define metamacro_foreach_cxt_recursive5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \ + metamacro_foreach_cxt_recursive4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \ + SEP \ + MACRO(4, CONTEXT, _4) + +#define metamacro_foreach_cxt_recursive6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \ + metamacro_foreach_cxt_recursive5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \ + SEP \ + MACRO(5, CONTEXT, _5) + +#define metamacro_foreach_cxt_recursive7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \ + metamacro_foreach_cxt_recursive6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \ + SEP \ + MACRO(6, CONTEXT, _6) + +#define metamacro_foreach_cxt_recursive8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \ + metamacro_foreach_cxt_recursive7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \ + SEP \ + MACRO(7, CONTEXT, _7) + +#define metamacro_foreach_cxt_recursive9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \ + metamacro_foreach_cxt_recursive8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \ + SEP \ + MACRO(8, CONTEXT, _8) + +#define metamacro_foreach_cxt_recursive10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \ + metamacro_foreach_cxt_recursive9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \ + SEP \ + MACRO(9, CONTEXT, _9) + +#define metamacro_foreach_cxt_recursive11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \ + metamacro_foreach_cxt_recursive10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \ + SEP \ + MACRO(10, CONTEXT, _10) + +#define metamacro_foreach_cxt_recursive12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \ + metamacro_foreach_cxt_recursive11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \ + SEP \ + MACRO(11, CONTEXT, _11) + +#define metamacro_foreach_cxt_recursive13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \ + metamacro_foreach_cxt_recursive12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \ + SEP \ + MACRO(12, CONTEXT, _12) + +#define metamacro_foreach_cxt_recursive14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \ + metamacro_foreach_cxt_recursive13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \ + SEP \ + MACRO(13, CONTEXT, _13) + +#define metamacro_foreach_cxt_recursive15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \ + metamacro_foreach_cxt_recursive14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \ + SEP \ + MACRO(14, CONTEXT, _14) + +#define metamacro_foreach_cxt_recursive16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \ + metamacro_foreach_cxt_recursive15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \ + SEP \ + MACRO(15, CONTEXT, _15) + +#define metamacro_foreach_cxt_recursive17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \ + metamacro_foreach_cxt_recursive16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \ + SEP \ + MACRO(16, CONTEXT, _16) + +#define metamacro_foreach_cxt_recursive18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \ + metamacro_foreach_cxt_recursive17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \ + SEP \ + MACRO(17, CONTEXT, _17) + +#define metamacro_foreach_cxt_recursive19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \ + metamacro_foreach_cxt_recursive18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \ + SEP \ + MACRO(18, CONTEXT, _18) + +#define metamacro_foreach_cxt_recursive20(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19) \ + metamacro_foreach_cxt_recursive19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \ + SEP \ + MACRO(19, CONTEXT, _19) + +// metamacro_for_cxt expansions +#define metamacro_for_cxt0(MACRO, SEP, CONTEXT) +#define metamacro_for_cxt1(MACRO, SEP, CONTEXT) MACRO(0, CONTEXT) + +#define metamacro_for_cxt2(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt1(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(1, CONTEXT) + +#define metamacro_for_cxt3(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt2(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(2, CONTEXT) + +#define metamacro_for_cxt4(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt3(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(3, CONTEXT) + +#define metamacro_for_cxt5(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt4(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(4, CONTEXT) + +#define metamacro_for_cxt6(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt5(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(5, CONTEXT) + +#define metamacro_for_cxt7(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt6(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(6, CONTEXT) + +#define metamacro_for_cxt8(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt7(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(7, CONTEXT) + +#define metamacro_for_cxt9(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt8(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(8, CONTEXT) + +#define metamacro_for_cxt10(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt9(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(9, CONTEXT) + +#define metamacro_for_cxt11(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt10(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(10, CONTEXT) + +#define metamacro_for_cxt12(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt11(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(11, CONTEXT) + +#define metamacro_for_cxt13(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt12(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(12, CONTEXT) + +#define metamacro_for_cxt14(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt13(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(13, CONTEXT) + +#define metamacro_for_cxt15(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt14(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(14, CONTEXT) + +#define metamacro_for_cxt16(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt15(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(15, CONTEXT) + +#define metamacro_for_cxt17(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt16(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(16, CONTEXT) + +#define metamacro_for_cxt18(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt17(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(17, CONTEXT) + +#define metamacro_for_cxt19(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt18(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(18, CONTEXT) + +#define metamacro_for_cxt20(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt19(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(19, CONTEXT) + +// metamacro_if_eq expansions +#define metamacro_if_eq0(VALUE) \ + metamacro_concat(metamacro_if_eq0_, VALUE) + +#define metamacro_if_eq0_0(...) __VA_ARGS__ metamacro_consume_ +#define metamacro_if_eq0_1(...) metamacro_expand_ +#define metamacro_if_eq0_2(...) metamacro_expand_ +#define metamacro_if_eq0_3(...) metamacro_expand_ +#define metamacro_if_eq0_4(...) metamacro_expand_ +#define metamacro_if_eq0_5(...) metamacro_expand_ +#define metamacro_if_eq0_6(...) metamacro_expand_ +#define metamacro_if_eq0_7(...) metamacro_expand_ +#define metamacro_if_eq0_8(...) metamacro_expand_ +#define metamacro_if_eq0_9(...) metamacro_expand_ +#define metamacro_if_eq0_10(...) metamacro_expand_ +#define metamacro_if_eq0_11(...) metamacro_expand_ +#define metamacro_if_eq0_12(...) metamacro_expand_ +#define metamacro_if_eq0_13(...) metamacro_expand_ +#define metamacro_if_eq0_14(...) metamacro_expand_ +#define metamacro_if_eq0_15(...) metamacro_expand_ +#define metamacro_if_eq0_16(...) metamacro_expand_ +#define metamacro_if_eq0_17(...) metamacro_expand_ +#define metamacro_if_eq0_18(...) metamacro_expand_ +#define metamacro_if_eq0_19(...) metamacro_expand_ +#define metamacro_if_eq0_20(...) metamacro_expand_ + +#define metamacro_if_eq1(VALUE) metamacro_if_eq0(metamacro_dec(VALUE)) +#define metamacro_if_eq2(VALUE) metamacro_if_eq1(metamacro_dec(VALUE)) +#define metamacro_if_eq3(VALUE) metamacro_if_eq2(metamacro_dec(VALUE)) +#define metamacro_if_eq4(VALUE) metamacro_if_eq3(metamacro_dec(VALUE)) +#define metamacro_if_eq5(VALUE) metamacro_if_eq4(metamacro_dec(VALUE)) +#define metamacro_if_eq6(VALUE) metamacro_if_eq5(metamacro_dec(VALUE)) +#define metamacro_if_eq7(VALUE) metamacro_if_eq6(metamacro_dec(VALUE)) +#define metamacro_if_eq8(VALUE) metamacro_if_eq7(metamacro_dec(VALUE)) +#define metamacro_if_eq9(VALUE) metamacro_if_eq8(metamacro_dec(VALUE)) +#define metamacro_if_eq10(VALUE) metamacro_if_eq9(metamacro_dec(VALUE)) +#define metamacro_if_eq11(VALUE) metamacro_if_eq10(metamacro_dec(VALUE)) +#define metamacro_if_eq12(VALUE) metamacro_if_eq11(metamacro_dec(VALUE)) +#define metamacro_if_eq13(VALUE) metamacro_if_eq12(metamacro_dec(VALUE)) +#define metamacro_if_eq14(VALUE) metamacro_if_eq13(metamacro_dec(VALUE)) +#define metamacro_if_eq15(VALUE) metamacro_if_eq14(metamacro_dec(VALUE)) +#define metamacro_if_eq16(VALUE) metamacro_if_eq15(metamacro_dec(VALUE)) +#define metamacro_if_eq17(VALUE) metamacro_if_eq16(metamacro_dec(VALUE)) +#define metamacro_if_eq18(VALUE) metamacro_if_eq17(metamacro_dec(VALUE)) +#define metamacro_if_eq19(VALUE) metamacro_if_eq18(metamacro_dec(VALUE)) +#define metamacro_if_eq20(VALUE) metamacro_if_eq19(metamacro_dec(VALUE)) + +// metamacro_if_eq_recursive expansions +#define metamacro_if_eq_recursive0(VALUE) \ + metamacro_concat(metamacro_if_eq_recursive0_, VALUE) + +#define metamacro_if_eq_recursive0_0(...) __VA_ARGS__ metamacro_consume_ +#define metamacro_if_eq_recursive0_1(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_2(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_3(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_4(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_5(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_6(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_7(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_8(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_9(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_10(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_11(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_12(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_13(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_14(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_15(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_16(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_17(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_18(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_19(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_20(...) metamacro_expand_ + +#define metamacro_if_eq_recursive1(VALUE) metamacro_if_eq_recursive0(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive2(VALUE) metamacro_if_eq_recursive1(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive3(VALUE) metamacro_if_eq_recursive2(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive4(VALUE) metamacro_if_eq_recursive3(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive5(VALUE) metamacro_if_eq_recursive4(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive6(VALUE) metamacro_if_eq_recursive5(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive7(VALUE) metamacro_if_eq_recursive6(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive8(VALUE) metamacro_if_eq_recursive7(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive9(VALUE) metamacro_if_eq_recursive8(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive10(VALUE) metamacro_if_eq_recursive9(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive11(VALUE) metamacro_if_eq_recursive10(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive12(VALUE) metamacro_if_eq_recursive11(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive13(VALUE) metamacro_if_eq_recursive12(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive14(VALUE) metamacro_if_eq_recursive13(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive15(VALUE) metamacro_if_eq_recursive14(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive16(VALUE) metamacro_if_eq_recursive15(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive17(VALUE) metamacro_if_eq_recursive16(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive18(VALUE) metamacro_if_eq_recursive17(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive19(VALUE) metamacro_if_eq_recursive18(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive20(VALUE) metamacro_if_eq_recursive19(metamacro_dec(VALUE)) + +// metamacro_take expansions +#define metamacro_take0(...) +#define metamacro_take1(...) metamacro_head(__VA_ARGS__) +#define metamacro_take2(...) metamacro_head(__VA_ARGS__), metamacro_take1(metamacro_tail(__VA_ARGS__)) +#define metamacro_take3(...) metamacro_head(__VA_ARGS__), metamacro_take2(metamacro_tail(__VA_ARGS__)) +#define metamacro_take4(...) metamacro_head(__VA_ARGS__), metamacro_take3(metamacro_tail(__VA_ARGS__)) +#define metamacro_take5(...) metamacro_head(__VA_ARGS__), metamacro_take4(metamacro_tail(__VA_ARGS__)) +#define metamacro_take6(...) metamacro_head(__VA_ARGS__), metamacro_take5(metamacro_tail(__VA_ARGS__)) +#define metamacro_take7(...) metamacro_head(__VA_ARGS__), metamacro_take6(metamacro_tail(__VA_ARGS__)) +#define metamacro_take8(...) metamacro_head(__VA_ARGS__), metamacro_take7(metamacro_tail(__VA_ARGS__)) +#define metamacro_take9(...) metamacro_head(__VA_ARGS__), metamacro_take8(metamacro_tail(__VA_ARGS__)) +#define metamacro_take10(...) metamacro_head(__VA_ARGS__), metamacro_take9(metamacro_tail(__VA_ARGS__)) +#define metamacro_take11(...) metamacro_head(__VA_ARGS__), metamacro_take10(metamacro_tail(__VA_ARGS__)) +#define metamacro_take12(...) metamacro_head(__VA_ARGS__), metamacro_take11(metamacro_tail(__VA_ARGS__)) +#define metamacro_take13(...) metamacro_head(__VA_ARGS__), metamacro_take12(metamacro_tail(__VA_ARGS__)) +#define metamacro_take14(...) metamacro_head(__VA_ARGS__), metamacro_take13(metamacro_tail(__VA_ARGS__)) +#define metamacro_take15(...) metamacro_head(__VA_ARGS__), metamacro_take14(metamacro_tail(__VA_ARGS__)) +#define metamacro_take16(...) metamacro_head(__VA_ARGS__), metamacro_take15(metamacro_tail(__VA_ARGS__)) +#define metamacro_take17(...) metamacro_head(__VA_ARGS__), metamacro_take16(metamacro_tail(__VA_ARGS__)) +#define metamacro_take18(...) metamacro_head(__VA_ARGS__), metamacro_take17(metamacro_tail(__VA_ARGS__)) +#define metamacro_take19(...) metamacro_head(__VA_ARGS__), metamacro_take18(metamacro_tail(__VA_ARGS__)) +#define metamacro_take20(...) metamacro_head(__VA_ARGS__), metamacro_take19(metamacro_tail(__VA_ARGS__)) + +// metamacro_drop expansions +#define metamacro_drop0(...) __VA_ARGS__ +#define metamacro_drop1(...) metamacro_tail(__VA_ARGS__) +#define metamacro_drop2(...) metamacro_drop1(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop3(...) metamacro_drop2(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop4(...) metamacro_drop3(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop5(...) metamacro_drop4(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop6(...) metamacro_drop5(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop7(...) metamacro_drop6(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop8(...) metamacro_drop7(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop9(...) metamacro_drop8(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop10(...) metamacro_drop9(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop11(...) metamacro_drop10(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop12(...) metamacro_drop11(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop13(...) metamacro_drop12(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop14(...) metamacro_drop13(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop15(...) metamacro_drop14(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop16(...) metamacro_drop15(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop17(...) metamacro_drop16(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop18(...) metamacro_drop17(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop19(...) metamacro_drop18(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop20(...) metamacro_drop19(metamacro_tail(__VA_ARGS__)) + +#endif diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSmetamacro.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSmetamacro.h.meta new file mode 100644 index 0000000..eda9ad6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSmetamacro.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d8c1719ab5e6a4c368f51bf6d738d7f1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthAccessToken.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthAccessToken.h new file mode 100644 index 0000000..28bff7d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthAccessToken.h @@ -0,0 +1,56 @@ +// +// TapAuthAccessToken.h +// TapCommonSDK +// +// Created by 黄驿峰 on 2022/1/26. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/// TapTap authorization token +@interface TapAuthAccessToken : NSObject + +/// A unique identifier +@property (nonatomic, copy, nullable) NSString * kid; + +/// access token +@property (nonatomic, copy, nullable) NSString * accessToken; + +/// token Type +@property (nonatomic, copy, nullable) NSString * tokenType; + +/// mac key +@property (nonatomic, copy, nullable) NSString * macKey; + +/// mac key algorithm +@property (nonatomic, copy, nullable) NSString * macAlgorithm; + +/// Multiple user permissions are separated by commas (,) +@property (nonatomic, copy, nullable) NSString * scope; + + ++ (TapAuthAccessToken *)buildWithKid:(NSString *)kid accessToken:(NSString *)accessToken tokenType:(NSString *)tokenType macKey:(NSString *)macKey macAlgorithm:(NSString *)macAlgorithm; + ++ (nullable TapAuthAccessToken *)buildWithJsonString:(NSString *)jsonString; + ++ (nullable TapAuthAccessToken *)buildWithQueryString:(NSString *)queryString; + ++ (nullable TapAuthAccessToken *)buildWithDic:(NSDictionary *)dic; + +- (NSString *)tokenToQueryString; + +- (NSString *)tokenToJsonString; + + +//+ (void)clearLocalAccessToken; +//- (void)saveToLocal; +//+ (nullable TapAuthAccessToken *)loadLocalAccessToken; + + +- (BOOL)containCompliancePermission; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthAccessToken.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthAccessToken.h.meta new file mode 100644 index 0000000..df0c15b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthAccessToken.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b735f4d3ea50043db8c7f5b953952bcb +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthConfig.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthConfig.h new file mode 100644 index 0000000..2f943e2 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthConfig.h @@ -0,0 +1,39 @@ +// +// TapAuthConfig.h +// TapCommonSDK +// +// Created by 黄驿峰 on 2022/2/7. +// + +#import + +typedef NS_ENUM (NSInteger, TapAuthRegionType) { + TapAuthRegionTypeCN, + TapAuthRegionTypeIO +}; + +NS_ASSUME_NONNULL_BEGIN + +@interface TapAuthConfig : NSObject + +@property (nonatomic, strong, readonly) NSString * source; +@property (nonatomic, strong, readonly) NSString * clientID; +@property (nonatomic, assign, readonly) TapAuthRegionType regionType; +/// Whether it is rounded. The default value is rounded +@property (nonatomic, assign) BOOL roundCorner; + +@property (nonatomic, strong, readonly) NSString * TapTapAppScheme; +@property (nonatomic, strong, readonly) NSString * mainUrl; + + + ++ (instancetype)configWithSource:(NSString *)source + clientID:(NSString *)clientID + regionType:(TapAuthRegionType)regionType; + ++ (instancetype)new NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthConfig.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthConfig.h.meta new file mode 100644 index 0000000..03aed9b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthConfig.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ecf4a9042c83843e489354fee47cccb6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthManager.h new file mode 100644 index 0000000..aa08d54 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthManager.h @@ -0,0 +1,49 @@ +// +// TapAuthManager.h +// TapCommonSDK +// +// Created by 黄驿峰 on 2022/1/27. +// + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void (^TapAuthManagerRequestHandler)(TapAuthResult *result); + +FOUNDATION_EXPORT NSString * const TapTapAuthGameTag; +FOUNDATION_EXPORT NSString * const TapTap_SDK_VERSION; + +@interface TapAuthManager : NSObject + +@property (nonatomic, strong, nullable) TapAuthConfig * config; +@property (nonatomic, strong, nullable) TapAuthAccessToken * currentAccessToken; + + + ++ (instancetype)sharedManager; + +- (void)requestTapTapPermissions:(NSArray *)permissions handler:(TapAuthManagerRequestHandler)handler; + +/// requestTapTapPermissions +/// @param permissions permissions needed +/// @param isInternal is or not in China +/// @param source source +/// @param clientID Your clientID +/// @param handler handler ++ (void)requestTapTapPermissions:(NSArray *)permissions + isInternal:(BOOL)isInternal + source:(NSString *)source + clientID:(NSString *)clientID + handler:(TapAuthManagerRequestHandler)handler; + +- (void)createToken:(NSString *)code verifier:(NSString *)verifier handler:(void (^)(TapAuthAccessToken *, NSError *))handler; + +//- (BOOL)handleURL:(NSURL *)url; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthManager.h.meta new file mode 100644 index 0000000..201a9ec --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 455749d3911974991b19b07262332589 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthResult.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthResult.h new file mode 100644 index 0000000..50f431c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthResult.h @@ -0,0 +1,36 @@ +// +// TapAuthResult.h +// TapCommonSDK +// +// Created by 黄驿峰 on 2022/1/27. +// + +#import +#import + +typedef NS_ENUM(NSInteger, TapAuthResultType) { + TapAuthResultTypeSuccess, + TapAuthResultTypeCancel, + TapAuthResultTypeError, +}; + +NS_ASSUME_NONNULL_BEGIN + +@interface TapAuthResult : NSObject + +@property (nonatomic, assign, readonly) TapAuthResultType type; + +@property (nonatomic, strong, nullable, readonly) TapAuthAccessToken *token; + +@property (nonatomic, strong, nullable, readonly) NSError *error; + ++ (instancetype)successWithToken:(TapAuthAccessToken *)token; ++ (instancetype)failWithError:(NSError *)error; ++ (instancetype)cancel; + ++ (instancetype)new NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthResult.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthResult.h.meta new file mode 100644 index 0000000..ceeaa31 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapAuthResult.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2c5565afee11e4428b4f7cdce1b10577 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapBillboardConfig.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapBillboardConfig.h new file mode 100644 index 0000000..eaa8f34 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapBillboardConfig.h @@ -0,0 +1,22 @@ +// +// TapBillboardConfig.h +// TapCommonSDK +// +// Created by TapTap on 2022/7/18. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +#define TEMPLATE_NAVIGATE @"navigate" +#define TEMPLATE_IMAGE @"image" + +@interface TapBillboardConfig : NSObject +@property (nonatomic, copy) NSSet *diemensionSet; +@property (nonatomic, copy) NSString *templateType __attribute__((deprecated("useless in other interface"))); +@property (nonatomic, copy) NSString *serverUrl; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapBillboardConfig.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapBillboardConfig.h.meta new file mode 100644 index 0000000..637d7fb --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapBillboardConfig.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e507d3c16e6a54e869bab6cc30a6e844 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapCommonSDK.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapCommonSDK.h new file mode 100644 index 0000000..8886075 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapCommonSDK.h @@ -0,0 +1,123 @@ +// +// TapCommonSDK.h +// TapCommonSDK +// +// Created by Bottle K on 2021/3/25. +// + +#import + +//! Project version number for TapCommonSDK. +FOUNDATION_EXPORT double TapCommonSDKVersionNumber; + +//! Project version string for TapCommonSDK. +FOUNDATION_EXPORT const unsigned char TapCommonSDKVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import +#import +#import + +#import +#import +#import + +#import + +#import + +#import + +#import +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#import +#import +#import + +#import +#import +#import diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapCommonSDK.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapCommonSDK.h.meta new file mode 100644 index 0000000..9022845 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapCommonSDK.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c63851286afa1444c9cecd1bc482721e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h new file mode 100644 index 0000000..347eeec --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h @@ -0,0 +1,28 @@ +// +// TapConfig.h +// TapBootstrapSDK +// +// Created by Bottle K on 2021/2/24. +// + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM (NSInteger, TapSDKRegionType) { + TapSDKRegionTypeCN, + TapSDKRegionTypeIO +}; + +@interface TapConfig : NSObject +@property (nonatomic, copy) NSString *clientId; +@property (nonatomic, copy) NSString *clientToken; +@property (nonatomic, copy) NSString *serverURL; +@property (nonatomic, assign) TapSDKRegionType region; +@property (nonatomic, strong) TapDBConfig * dbConfig; +@property (nonatomic, strong) TapBillboardConfig *tapBillboardConfig; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h.meta new file mode 100644 index 0000000..725df6a --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5f6e0b9a09297430a883b44b7b3f0470 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapDBConfig.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapDBConfig.h new file mode 100644 index 0000000..c5a586f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapDBConfig.h @@ -0,0 +1,21 @@ +// +// TapDBConfig.h +// TapCommonSDK +// +// Created by Bottle K on 2021/4/19. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TapDBConfig : NSObject +@property (nonatomic, assign) BOOL enable; +@property (nonatomic, copy) NSString *channel; +@property (nonatomic, copy) NSString *gameVersion; +@property (nonatomic, copy) NSDictionary *deviceLoginProperties; +@property (nonatomic, assign, getter=isAdvertiserIDCollectionEnabled) BOOL advertiserIDCollectionEnabled; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapDBConfig.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapDBConfig.h.meta new file mode 100644 index 0000000..52dcee9 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapDBConfig.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 702bcf658ac2a43baad02c7778553483 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapGameUtil.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapGameUtil.h new file mode 100644 index 0000000..decc4c9 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapGameUtil.h @@ -0,0 +1,20 @@ +// +// TapGameUtil.h +// TDSCommon +// +// Created by Bottle K on 2021/2/2. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TapGameUtil : NSObject + ++ (BOOL)isTapTapInstalled; + ++ (BOOL)isTapGlobalInstalled; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapGameUtil.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapGameUtil.h.meta new file mode 100644 index 0000000..189d29e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapGameUtil.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3c67d5b5f64564a7b98a593370f2228f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapLoginLogManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapLoginLogManager.h new file mode 100644 index 0000000..3e0ce4c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapLoginLogManager.h @@ -0,0 +1,40 @@ +// +// TapLoginLogManager.h +// TapLoginSDK +// +// Created by Bottle K on 2021/6/22. +// + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TapLoginLogManager : NSObject + ++ (instancetype)sharedInstance; + +- (TDSTrackerEvent *)generateNewEvent; + +- (TDSTrackerEvent *)event; + ++ (void)logStart; + ++ (void)logTapOpenWithType:(NSString *)type; + ++ (void)logTapBack; + ++ (void)logTapToken; + ++ (void)logTapProfileWithOpenId:(NSString *_Nullable)openId; + ++ (void)logTapSuccess; + ++ (void)logTapFailWithError:(NSError *)error; + ++ (void)logTapCancel; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapLoginLogManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapLoginLogManager.h.meta new file mode 100644 index 0000000..7e60d5b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapLoginLogManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 86bc4603cb1964eafaafbb6772c4575f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesDelegateProxy.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesDelegateProxy.h new file mode 100644 index 0000000..3cdde81 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesDelegateProxy.h @@ -0,0 +1,22 @@ +// +// TapDBDynamicPropertiesDelegate.h +// TapDB +// +// Created by xe on 2021/4/13. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef const char* _Nullable (*TapPropertiesDelegate)(const char*); + +@interface TapPropertiesDelegateProxy : NSObject + +- (instancetype)initWithDelegate: (TapPropertiesDelegate)delegate key:(NSString*)key; + +- (NSString*) getProperties; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesDelegateProxy.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesDelegateProxy.h.meta new file mode 100644 index 0000000..4470fbf --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesDelegateProxy.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9dc3eadcb65c9404486d9a3a4f8f555c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesHolder.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesHolder.h new file mode 100644 index 0000000..74e7733 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesHolder.h @@ -0,0 +1,23 @@ +// +// TapDBDynamicPropertiesProxy.h +// TapDB +// +// Created by xe on 2021/4/13. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TapPropertiesHolder : NSObject + +@property NSMutableDictionary *dic; + ++ (TapPropertiesHolder*)shareInstance; + +- (NSString*)getProperty:(NSString*)key; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesHolder.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesHolder.h.meta new file mode 100644 index 0000000..a85313c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesHolder.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9196abf3e4c554970b8745ab4e4b9293 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UIButton+TDSThrottle.h b/Plugins/iOS/TapCommonSDK.framework/Headers/UIButton+TDSThrottle.h new file mode 100644 index 0000000..f726464 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UIButton+TDSThrottle.h @@ -0,0 +1,35 @@ +// +// UIButton+TDSThrottle.h +// TDSCommon +// +// Created by JiangJiahao on 2021/3/22. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSUInteger,TDSButtonThrottleType) { + TDSButtonThrottleTypeNone = 0, // 正常调用 + TDSButtonThrottleTypeThrottleLeading, // 节流,指定时间间隔内只能调用一次,首次调用时立即触发 + TDSButtonThrottleTypeThrottleTrailing, // 节流,指定时间间隔内只能调用一次,首次调用超时后触发 + TDSButtonThrottleTypeDebunceLeading, // 防抖,相邻调用间隔若小于指定时间间隔,则合并成一次调用,首次调用时立即触发 + TDSButtonThrottleTypeDebunceTrailing, // 防抖,相邻调用间隔若小于指定时间间隔,则合并成一次调用,首次超时后触发 +}; + +@interface UIButton (TDSThrottle) + +@property (nonatomic,assign) TDSButtonThrottleType throttleType; + +@end + +/** + 使用方法: + #import "UIButton+TDSThrottle.h" + + UIButton *testButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [testButton setThrottleType:TDSButtonThrottleTypeDebunceTrailing]; + + */ + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UIButton+TDSThrottle.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/UIButton+TDSThrottle.h.meta new file mode 100644 index 0000000..1391cdf --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UIButton+TDSThrottle.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3daed0a8272334460bdca57a196f73e8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UIView+Toast.h b/Plugins/iOS/TapCommonSDK.framework/Headers/UIView+Toast.h new file mode 100755 index 0000000..9cf9a59 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UIView+Toast.h @@ -0,0 +1,433 @@ +// +// UIView+Toast.h +// Toast +// +// Copyright (c) 2011-2016 Charles Scalesse. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +extern const NSString * CSToastPositionTop; +extern const NSString * CSToastPositionCenter; +extern const NSString * CSToastPositionBottom; + +@class CSToastStyle; + +/** + Toast is an Objective-C category that adds toast notifications to the UIView + object class. It is intended to be simple, lightweight, and easy to use. Most + toast notifications can be triggered with a single line of code. + + The `makeToast:` methods create a new view and then display it as toast. + + The `showToast:` methods display any view as toast. + + */ +@interface UIView (Toast) + +/** + Creates and presents a new toast view with a message and displays it with the + default duration and position. Styled using the shared style. + + @param message The message to be displayed + */ +- (void)makeToast:(NSString *)message; + +/** + Creates and presents a new toast view with a message. Duration and position + can be set explicitly. Styled using the shared style. + + @param message The message to be displayed + @param duration The toast duration + @param position The toast's center point. Can be one of the predefined CSToastPosition + constants or a `CGPoint` wrapped in an `NSValue` object. + */ +- (void)makeToast:(NSString *)message + duration:(NSTimeInterval)duration + position:(id)position; + + +- (void)makeDebugToast:(NSString *)message duration:(NSTimeInterval)duration position:(id)position; + + +/** + Creates and presents a new toast view with a message. Duration, position, and + style can be set explicitly. + + @param message The message to be displayed + @param duration The toast duration + @param position The toast's center point. Can be one of the predefined CSToastPosition + constants or a `CGPoint` wrapped in an `NSValue` object. + @param style The style. The shared style will be used when nil + */ +- (void)makeToast:(NSString *)message + duration:(NSTimeInterval)duration + position:(id)position + style:(CSToastStyle *)style; + +/** + Creates and presents a new toast view with a message, title, and image. Duration, + position, and style can be set explicitly. The completion block executes when the + toast view completes. `didTap` will be `YES` if the toast view was dismissed from + a tap. + + @param message The message to be displayed + @param duration The toast duration + @param position The toast's center point. Can be one of the predefined CSToastPosition + constants or a `CGPoint` wrapped in an `NSValue` object. + @param title The title + @param image The image + @param style The style. The shared style will be used when nil + @param completion The completion block, executed after the toast view disappears. + didTap will be `YES` if the toast view was dismissed from a tap. + */ +- (void)makeToast:(NSString *)message + duration:(NSTimeInterval)duration + position:(id)position + title:(NSString *)title + image:(UIImage *)image + style:(CSToastStyle *)style + completion:(void(^)(BOOL didTap))completion; + +/** + Creates a new toast view with any combination of message, title, and image. + The look and feel is configured via the style. Unlike the `makeToast:` methods, + this method does not present the toast view automatically. One of the showToast: + methods must be used to present the resulting view. + + @warning if message, title, and image are all nil, this method will return nil. + + @param message The message to be displayed + @param title The title + @param image The image + @param style The style. The shared style will be used when nil + @return The newly created toast view + */ +- (UIView *)toastViewForMessage:(NSString *)message + title:(NSString *)title + image:(UIImage *)image + style:(CSToastStyle *)style; + +/** + Dismisses all active toast views. Any toast that is currently being displayed on the + screen is considered active. + + @warning this does not clear toast views that are currently waiting in the queue. The next queued + toast will appear immediately after `hideToasts` completes the dismissal animation. + + */ +- (void)hideToasts; + +/** + Dismisses an active toast view. + + @param toast The active toast view to dismiss. Any toast that is currently being displayed + on the screen is considered active. + + @warning this does not clear a toast view that is currently waiting in the queue. + + */ +- (void)hideToast:(UIView *)toast; + +/** + Creates and displays a new toast activity indicator view at a specified position. + + @warning Only one toast activity indicator view can be presented per superview. Subsequent + calls to `makeToastActivity:` will be ignored until hideToastActivity is called. + + @warning `makeToastActivity:` works independently of the showToast: methods. Toast activity + views can be presented and dismissed while toast views are being displayed. `makeToastActivity:` + has no effect on the queueing behavior of the showToast: methods. + + @param position The toast's center point. Can be one of the predefined CSToastPosition + constants or a `CGPoint` wrapped in an `NSValue` object. + */ +- (void)makeToastActivity:(id)position; + +/** + Dismisses the active toast activity indicator view. + */ +- (void)hideToastActivity; + +/** + Displays any view as toast using the default duration and position. + + @param toast The view to be displayed as toast + */ +- (void)showToast:(UIView *)toast; + +/** + Displays any view as toast at a provided position and duration. The completion block + executes when the toast view completes. `didTap` will be `YES` if the toast view was + dismissed from a tap. + + @param toast The view to be displayed as toast + @param duration The notification duration + @param position The toast's center point. Can be one of the predefined CSToastPosition + constants or a `CGPoint` wrapped in an `NSValue` object. + @param completion The completion block, executed after the toast view disappears. + didTap will be `YES` if the toast view was dismissed from a tap. + */ +- (void)showToast:(UIView *)toast + duration:(NSTimeInterval)duration + position:(id)position + completion:(void(^)(BOOL didTap))completion; + +- (UIImageView *)addImageToastAnimationWithFrame:(CGRect)frame withImageName:(NSString *)imageName; + +@end + +/** + `CSToastStyle` instances define the look and feel for toast views created via the + `makeToast:` methods as well for toast views created directly with + `toastViewForMessage:title:image:style:`. + + @warning `CSToastStyle` offers relatively simple styling options for the default + toast view. If you require a toast view with more complex UI, it probably makes more + sense to create your own custom UIView subclass and present it with the `showToast:` + methods. + */ +@interface CSToastStyle : NSObject + +/** + The background color. Default is `[UIColor blackColor]` at 80% opacity. + */ +@property (strong, nonatomic) UIColor *backgroundColor; + +/** + The title color. Default is `[UIColor whiteColor]`. + */ +@property (strong, nonatomic) UIColor *titleColor; + +/** + The message color. Default is `[UIColor whiteColor]`. + */ +@property (strong, nonatomic) UIColor *messageColor; + +/** + A percentage value from 0.0 to 1.0, representing the maximum width of the toast + view relative to it's superview. Default is 0.8 (80% of the superview's width). + */ +@property (assign, nonatomic) CGFloat maxWidthPercentage; + +/** + A percentage value from 0.0 to 1.0, representing the maximum height of the toast + view relative to it's superview. Default is 0.8 (80% of the superview's height). + */ +@property (assign, nonatomic) CGFloat maxHeightPercentage; + +/** + The spacing from the horizontal edge of the toast view to the content. When an image + is present, this is also used as the padding between the image and the text. + Default is 10.0. + */ +@property (assign, nonatomic) CGFloat horizontalPadding; + +/** + The spacing from the vertical edge of the toast view to the content. When a title + is present, this is also used as the padding between the title and the message. + Default is 10.0. + */ +@property (assign, nonatomic) CGFloat verticalPadding; + +/** + The corner radius. Default is 10.0. + */ +@property (assign, nonatomic) CGFloat cornerRadius; + +/** + The title font. Default is `[UIFont boldSystemFontOfSize:16.0]`. + */ +@property (strong, nonatomic) UIFont *titleFont; + +/** + The message font. Default is `[UIFont systemFontOfSize:16.0]`. + */ +@property (strong, nonatomic) UIFont *messageFont; + +/** + The title text alignment. Default is `NSTextAlignmentLeft`. + */ +@property (assign, nonatomic) NSTextAlignment titleAlignment; + +/** + The message text alignment. Default is `NSTextAlignmentLeft`. + */ +@property (assign, nonatomic) NSTextAlignment messageAlignment; + +/** + The maximum number of lines for the title. The default is 0 (no limit). + */ +@property (assign, nonatomic) NSInteger titleNumberOfLines; + +/** + The maximum number of lines for the message. The default is 0 (no limit). + */ +@property (assign, nonatomic) NSInteger messageNumberOfLines; + +/** + Enable or disable a shadow on the toast view. Default is `NO`. + */ +@property (assign, nonatomic) BOOL displayShadow; + +/** + The shadow color. Default is `[UIColor blackColor]`. + */ +@property (strong, nonatomic) UIColor *shadowColor; + +/** + A value from 0.0 to 1.0, representing the opacity of the shadow. + Default is 0.8 (80% opacity). + */ +@property (assign, nonatomic) CGFloat shadowOpacity; + +/** + The shadow radius. Default is 6.0. + */ +@property (assign, nonatomic) CGFloat shadowRadius; + +/** + The shadow offset. The default is `CGSizeMake(4.0, 4.0)`. + */ +@property (assign, nonatomic) CGSize shadowOffset; + +/** + The image size. The default is `CGSizeMake(80.0, 80.0)`. + */ +@property (assign, nonatomic) CGSize imageSize; + +/** + The size of the toast activity view when `makeToastActivity:` is called. + Default is `CGSizeMake(100.0, 100.0)`. + */ +@property (assign, nonatomic) CGSize activitySize; + +/** + The fade in/out animation duration. Default is 0.2. + */ +@property (assign, nonatomic) NSTimeInterval fadeDuration; + +/** + Creates a new instance of `CSToastStyle` with all the default values set. + */ +- (instancetype)initWithDefaultStyle NS_DESIGNATED_INITIALIZER; + +/** + @warning Only the designated initializer should be used to create + an instance of `CSToastStyle`. + */ +- (instancetype)init NS_UNAVAILABLE; + +@end + +/** + `CSToastManager` provides general configuration options for all toast + notifications. Backed by a singleton instance. + */ +@interface CSToastManager : NSObject + +/** + Sets the shared style on the singleton. The shared style is used whenever + a `makeToast:` method (or `toastViewForMessage:title:image:style:`) is called + with with a nil style. By default, this is set to `CSToastStyle`'s default + style. + + @param sharedStyle the shared style + */ ++ (void)setSharedStyle:(CSToastStyle *)sharedStyle; + +/** + Gets the shared style from the singlton. By default, this is + `CSToastStyle`'s default style. + + @return the shared style + */ ++ (CSToastStyle *)sharedStyle; + +/** + Enables or disables tap to dismiss on toast views. Default is `YES`. + + @param tapToDismissEnabled YES or NO + */ ++ (void)setTapToDismissEnabled:(BOOL)tapToDismissEnabled; + +/** + Returns `YES` if tap to dismiss is enabled, otherwise `NO`. + Default is `YES`. + + @return BOOL YES or NO + */ ++ (BOOL)isTapToDismissEnabled; + +/** + Enables or disables queueing behavior for toast views. When `YES`, + toast views will appear one after the other. When `NO`, multiple Toast + views will appear at the same time (potentially overlapping depending + on their positions). This has no effect on the toast activity view, + which operates independently of normal toast views. Default is `YES`. + + @param queueEnabled YES or NO + */ ++ (void)setQueueEnabled:(BOOL)queueEnabled; + +/** + Returns `YES` if the queue is enabled, otherwise `NO`. + Default is `YES`. + + @return BOOL + */ ++ (BOOL)isQueueEnabled; + +/** + Sets the default duration. Used for the `makeToast:` and + `showToast:` methods that don't require an explicit duration. + Default is 3.0. + + @param duration The toast duration + */ ++ (void)setDefaultDuration:(NSTimeInterval)duration; + +/** + Returns the default duration. Default is 3.0. + + @return duration The toast duration +*/ ++ (NSTimeInterval)defaultDuration; + +/** + Sets the default position. Used for the `makeToast:` and + `showToast:` methods that don't require an explicit position. + Default is `CSToastPositionBottom`. + + @param position The default center point. Can be one of the predefined + CSToastPosition constants or a `CGPoint` wrapped in an `NSValue` object. + */ ++ (void)setDefaultPosition:(id)position; + +/** + Returns the default toast position. Default is `CSToastPositionBottom`. + + @return position The default center point. Will be one of the predefined + CSToastPosition constants or a `CGPoint` wrapped in an `NSValue` object. + */ ++ (id)defaultPosition; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UIView+Toast.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/UIView+Toast.h.meta new file mode 100644 index 0000000..387d5f0 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UIView+Toast.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f417aad5cbee54a958414bdbab831aaa +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h new file mode 100644 index 0000000..9ef6fa9 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h @@ -0,0 +1,22 @@ +// +// UserModel.h +// TDSCommon +// +// Created by TapTap-David on 2021/1/19. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UserModel : NSObject +//用户id +@property (nonatomic, copy) NSString *user_id; +//用户名 +@property (nonatomic, copy) NSString *user_name; +//taptap 授权的open_id +@property (nonatomic, copy) NSString *taptap_open_id; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h.meta new file mode 100644 index 0000000..32da574 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f726632ef399942d292a91871c085c29 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/WKCookieWebview+CookiesHandle.h b/Plugins/iOS/TapCommonSDK.framework/Headers/WKCookieWebview+CookiesHandle.h new file mode 100644 index 0000000..d6bc294 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/WKCookieWebview+CookiesHandle.h @@ -0,0 +1,21 @@ +// +// WKCookieWebview+CookiesHandle.h +// NativeApp +// +// Created by JiangJiahao on 2019/4/3. +// Copyright © 2019 JiangJiahao. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSWKCookieWebview (CookiesHandle) + +- (void)syncCookies:(NSURLRequest *)request task:(nullable NSURLSessionTask *)task complitionHandle:(void(^)(NSURLRequest *newRequest))complitionHandle; + +- (void)syncCookiesInJS:(nullable NSURLRequest *)request; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/WKCookieWebview+CookiesHandle.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/WKCookieWebview+CookiesHandle.h.meta new file mode 100644 index 0000000..5806348 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/WKCookieWebview+CookiesHandle.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b75cd28768eb24d4498df6115dad2eae +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Info.plist b/Plugins/iOS/TapCommonSDK.framework/Info.plist new file mode 100644 index 0000000..8572c65 Binary files /dev/null and b/Plugins/iOS/TapCommonSDK.framework/Info.plist differ diff --git a/Plugins/iOS/TapCommonSDK.framework/Info.plist.meta b/Plugins/iOS/TapCommonSDK.framework/Info.plist.meta new file mode 100644 index 0000000..dc895b2 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 56dd0ff56021f47e693c22af75e425a3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Modules.meta b/Plugins/iOS/TapCommonSDK.framework/Modules.meta new file mode 100644 index 0000000..de2999f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Modules.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f3f104518267147238964096cb105320 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Modules/module.modulemap b/Plugins/iOS/TapCommonSDK.framework/Modules/module.modulemap new file mode 100644 index 0000000..c250605 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module TapCommonSDK { + umbrella header "TapCommonSDK.h" + + export * + module * { export * } +} diff --git a/Plugins/iOS/TapCommonSDK.framework/Modules/module.modulemap.meta b/Plugins/iOS/TapCommonSDK.framework/Modules/module.modulemap.meta new file mode 100644 index 0000000..1941ef8 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Modules/module.modulemap.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 21d148829b7234b3cb2290517c17e24b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/TapCommonSDK b/Plugins/iOS/TapCommonSDK.framework/TapCommonSDK new file mode 100644 index 0000000..930f536 Binary files /dev/null and b/Plugins/iOS/TapCommonSDK.framework/TapCommonSDK differ diff --git a/Plugins/iOS/TapCommonSDK.framework/TapCommonSDK.meta b/Plugins/iOS/TapCommonSDK.framework/TapCommonSDK.meta new file mode 100644 index 0000000..bb5e8dd --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/TapCommonSDK.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e1230e5b63d63441ca4dd21da1c0d121 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapTap.Common.deps.json b/Plugins/iOS/TapTap.Common.deps.json new file mode 100644 index 0000000..5091e20 --- /dev/null +++ b/Plugins/iOS/TapTap.Common.deps.json @@ -0,0 +1,75 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "TapTap.Common/1.0.0": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "UnityEditor": "0.0.0.0", + "UnityEngine": "0.0.0.0" + }, + "runtime": { + "TapTap.Common.dll": {} + } + }, + "Microsoft.NETCore.Platforms/1.1.0": {}, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "UnityEditor/0.0.0.0": { + "runtime": { + "UnityEditor.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine/0.0.0.0": { + "runtime": { + "UnityEngine.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + } + } + }, + "libraries": { + "TapTap.Common/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "path": "microsoft.netcore.platforms/1.1.0", + "hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "UnityEditor/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Plugins/iOS/TapTap.Common.deps.json.meta b/Plugins/iOS/TapTap.Common.deps.json.meta new file mode 100644 index 0000000..73b4749 --- /dev/null +++ b/Plugins/iOS/TapTap.Common.deps.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: aea2d56a4a4ee4ae4a50936ba813b553 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapTap.Common.dll b/Plugins/iOS/TapTap.Common.dll new file mode 100644 index 0000000..81b0875 Binary files /dev/null and b/Plugins/iOS/TapTap.Common.dll differ diff --git a/Plugins/iOS/TapTap.Common.dll.meta b/Plugins/iOS/TapTap.Common.dll.meta new file mode 100644 index 0000000..b86dfd4 --- /dev/null +++ b/Plugins/iOS/TapTap.Common.dll.meta @@ -0,0 +1,86 @@ +fileFormatVersion: 2 +guid: fda5d2bc4d10048cd9ab996be55fcc04 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapTap.Common.pdb b/Plugins/iOS/TapTap.Common.pdb new file mode 100644 index 0000000..24657c0 Binary files /dev/null and b/Plugins/iOS/TapTap.Common.pdb differ diff --git a/Plugins/iOS/TapTap.Common.pdb.meta b/Plugins/iOS/TapTap.Common.pdb.meta new file mode 100644 index 0000000..dfa5736 --- /dev/null +++ b/Plugins/iOS/TapTap.Common.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7bb35410472d24678a797fca487c5356 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md b/README.md new file mode 100644 index 0000000..eb2dfb0 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +## [TapTap.Common](./Documentation/README.md) \ No newline at end of file diff --git a/README.md.meta b/README.md.meta new file mode 100644 index 0000000..1efb54d --- /dev/null +++ b/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 89f5ee69b81f54617b295e119ceb2f32 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI.meta b/UI.meta new file mode 100644 index 0000000..43484c9 --- /dev/null +++ b/UI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 26890ca09bbde4a6c9cfa1f0ec5c66c5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Editor.meta b/UI/Editor.meta new file mode 100644 index 0000000..ac23679 --- /dev/null +++ b/UI/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d7b757cf9569ee1469081df1e8e79931 +folderAsset: yes +timeCreated: 1533042733 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Editor/ScrollViewEditor.cs b/UI/Editor/ScrollViewEditor.cs new file mode 100644 index 0000000..d45ad9a --- /dev/null +++ b/UI/Editor/ScrollViewEditor.cs @@ -0,0 +1,267 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) AillieoTech. All rights reserved. +// +// ----------------------------------------------------------------------- + +namespace TapTap.UI.AillieoTech +{ + using System; + using System.Linq; + using System.Reflection; + using UnityEditor; + using UnityEditor.UI; + using UnityEngine; + using UnityEngine.UI; + + [CustomEditor(typeof(ScrollView))] + public class ScrollViewEditor : ScrollRectEditor + { + private const string bgPath = "UI/Skin/Background.psd"; + private const string spritePath = "UI/Skin/UISprite.psd"; + private const string maskPath = "UI/Skin/UIMask.psd"; + private static Color panelColor = new Color(1f, 1f, 1f, 0.392f); + private static Color defaultSelectableColor = new Color(1f, 1f, 1f, 1f); + private static Vector2 thinElementSize = new Vector2(160f, 20f); + private static Action PlaceUIElementRoot; + + private SerializedProperty itemTemplate; + private SerializedProperty poolSize; + private SerializedProperty defaultItemSize; + private SerializedProperty layoutType; + + private GUIStyle cachedCaption; + + private GUIStyle caption + { + get + { + if (this.cachedCaption == null) + { + this.cachedCaption = new GUIStyle { richText = true, alignment = TextAnchor.MiddleCenter }; + } + + return this.cachedCaption; + } + } + + public override void OnInspectorGUI() + { + this.serializedObject.Update(); + + EditorGUILayout.BeginVertical("box"); + EditorGUILayout.LabelField("Additional configs", this.caption); + EditorGUILayout.Space(); + this.DrawConfigInfo(); + this.serializedObject.ApplyModifiedProperties(); + EditorGUILayout.EndVertical(); + + EditorGUILayout.BeginVertical("box"); + EditorGUILayout.LabelField("For original ScrollRect", this.caption); + EditorGUILayout.Space(); + base.OnInspectorGUI(); + EditorGUILayout.EndVertical(); + } + + protected static void InternalAddScrollView(MenuCommand menuCommand) + where T : ScrollView + { + GetPrivateMethodByReflection(); + + GameObject root = CreateUIElementRoot(typeof(T).Name, new Vector2(200, 200)); + PlaceUIElementRoot?.Invoke(root, menuCommand); + + GameObject viewport = CreateUIObject("Viewport", root); + GameObject content = CreateUIObject("Content", viewport); + + var parent = menuCommand.context as GameObject; + if (parent != null) + { + root.transform.SetParent(parent.transform, false); + } + + Selection.activeGameObject = root; + + GameObject hScrollbar = CreateScrollbar(); + hScrollbar.name = "Scrollbar Horizontal"; + hScrollbar.transform.SetParent(root.transform, false); + RectTransform hScrollbarRT = hScrollbar.GetComponent(); + hScrollbarRT.anchorMin = Vector2.zero; + hScrollbarRT.anchorMax = Vector2.right; + hScrollbarRT.pivot = Vector2.zero; + hScrollbarRT.sizeDelta = new Vector2(0, hScrollbarRT.sizeDelta.y); + + GameObject vScrollbar = CreateScrollbar(); + vScrollbar.name = "Scrollbar Vertical"; + vScrollbar.transform.SetParent(root.transform, false); + vScrollbar.GetComponent().SetDirection(Scrollbar.Direction.BottomToTop, true); + RectTransform vScrollbarRT = vScrollbar.GetComponent(); + vScrollbarRT.anchorMin = Vector2.right; + vScrollbarRT.anchorMax = Vector2.one; + vScrollbarRT.pivot = Vector2.one; + vScrollbarRT.sizeDelta = new Vector2(vScrollbarRT.sizeDelta.x, 0); + + RectTransform viewportRect = viewport.GetComponent(); + viewportRect.anchorMin = Vector2.zero; + viewportRect.anchorMax = Vector2.one; + viewportRect.sizeDelta = Vector2.zero; + viewportRect.pivot = Vector2.up; + + RectTransform contentRect = content.GetComponent(); + contentRect.anchorMin = Vector2.up; + contentRect.anchorMax = Vector2.one; + contentRect.sizeDelta = new Vector2(0, 300); + contentRect.pivot = Vector2.up; + + ScrollView scrollRect = root.AddComponent(); + scrollRect.content = contentRect; + scrollRect.viewport = viewportRect; + scrollRect.horizontalScrollbar = hScrollbar.GetComponent(); + scrollRect.verticalScrollbar = vScrollbar.GetComponent(); + scrollRect.horizontalScrollbarVisibility = ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport; + scrollRect.verticalScrollbarVisibility = ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport; + scrollRect.horizontalScrollbarSpacing = -3; + scrollRect.verticalScrollbarSpacing = -3; + + Image rootImage = root.AddComponent(); + rootImage.sprite = AssetDatabase.GetBuiltinExtraResource(bgPath); + rootImage.type = Image.Type.Sliced; + rootImage.color = panelColor; + + Mask viewportMask = viewport.AddComponent(); + viewportMask.showMaskGraphic = false; + + Image viewportImage = viewport.AddComponent(); + viewportImage.sprite = AssetDatabase.GetBuiltinExtraResource(maskPath); + viewportImage.type = Image.Type.Sliced; + } + + protected override void OnEnable() + { + base.OnEnable(); + + this.itemTemplate = this.serializedObject.FindProperty("itemTemplate"); + this.poolSize = this.serializedObject.FindProperty("poolSize"); + this.defaultItemSize = this.serializedObject.FindProperty("defaultItemSize"); + this.layoutType = this.serializedObject.FindProperty("layoutType"); + } + + protected virtual void DrawConfigInfo() + { + EditorGUILayout.PropertyField(this.itemTemplate); + EditorGUILayout.PropertyField(this.poolSize); + EditorGUILayout.PropertyField(this.defaultItemSize); + this.layoutType.intValue = (int)(ScrollView.ItemLayoutType)EditorGUILayout.EnumPopup("layoutType", (ScrollView.ItemLayoutType)this.layoutType.intValue); + } + + [MenuItem("GameObject/UI/DynamicScrollView", false, 90)] + private static void AddScrollView(MenuCommand menuCommand) + { + InternalAddScrollView(menuCommand); + } + + private static GameObject CreateScrollbar() + { + // Create GOs Hierarchy + GameObject scrollbarRoot = CreateUIElementRoot("Scrollbar", thinElementSize); + GameObject sliderArea = CreateUIObject("Sliding Area", scrollbarRoot); + GameObject handle = CreateUIObject("Handle", sliderArea); + + Image bgImage = scrollbarRoot.AddComponent(); + bgImage.sprite = AssetDatabase.GetBuiltinExtraResource(bgPath); + bgImage.type = Image.Type.Sliced; + bgImage.color = defaultSelectableColor; + + Image handleImage = handle.AddComponent(); + handleImage.sprite = AssetDatabase.GetBuiltinExtraResource(spritePath); + handleImage.type = Image.Type.Sliced; + handleImage.color = defaultSelectableColor; + + RectTransform sliderAreaRect = sliderArea.GetComponent(); + sliderAreaRect.sizeDelta = new Vector2(-20, -20); + sliderAreaRect.anchorMin = Vector2.zero; + sliderAreaRect.anchorMax = Vector2.one; + + RectTransform handleRect = handle.GetComponent(); + handleRect.sizeDelta = new Vector2(20, 20); + + Scrollbar scrollbar = scrollbarRoot.AddComponent(); + scrollbar.handleRect = handleRect; + scrollbar.targetGraphic = handleImage; + SetDefaultColorTransitionValues(scrollbar); + + return scrollbarRoot; + } + + private static GameObject CreateUIElementRoot(string name, Vector2 size) + { + var child = new GameObject(name); + RectTransform rectTransform = child.AddComponent(); + rectTransform.sizeDelta = size; + return child; + } + + private static GameObject CreateUIObject(string name, GameObject parent) + { + var go = new GameObject(name); + go.AddComponent(); + SetParentAndAlign(go, parent); + return go; + } + + private static void SetParentAndAlign(GameObject child, GameObject parent) + { + if (parent == null) + { + return; + } + + child.transform.SetParent(parent.transform, false); + SetLayerRecursively(child, parent.layer); + } + + private static void SetLayerRecursively(GameObject go, int layer) + { + go.layer = layer; + Transform t = go.transform; + for (var i = 0; i < t.childCount; i++) + { + SetLayerRecursively(t.GetChild(i).gameObject, layer); + } + } + + private static void SetDefaultColorTransitionValues(Selectable slider) + { + ColorBlock colors = slider.colors; + colors.highlightedColor = new Color(0.882f, 0.882f, 0.882f); + colors.pressedColor = new Color(0.698f, 0.698f, 0.698f); + colors.disabledColor = new Color(0.521f, 0.521f, 0.521f); + } + + private static void GetPrivateMethodByReflection() + { + if (PlaceUIElementRoot == null) + { + Assembly uiEditorAssembly = AppDomain.CurrentDomain.GetAssemblies() + .FirstOrDefault(asm => asm.GetName().Name == "UnityEditor.UI"); + if (uiEditorAssembly != null) + { + Type menuOptionType = uiEditorAssembly.GetType("UnityEditor.UI.MenuOptions"); + if (menuOptionType != null) + { + MethodInfo miPlaceUIElementRoot = menuOptionType.GetMethod( + "PlaceUIElementRoot", + BindingFlags.NonPublic | BindingFlags.Static); + if (miPlaceUIElementRoot != null) + { + PlaceUIElementRoot = Delegate.CreateDelegate( + typeof(Action), + miPlaceUIElementRoot) + as Action; + } + } + } + } + } + } +} diff --git a/UI/Editor/ScrollViewEditor.cs.meta b/UI/Editor/ScrollViewEditor.cs.meta new file mode 100644 index 0000000..f1a8a4a --- /dev/null +++ b/UI/Editor/ScrollViewEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8518bb829bc508049a52f0606b4f43a5 +timeCreated: 1533042733 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Editor/ScrollViewExEditor.cs b/UI/Editor/ScrollViewExEditor.cs new file mode 100644 index 0000000..a7c02f8 --- /dev/null +++ b/UI/Editor/ScrollViewExEditor.cs @@ -0,0 +1,34 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) AillieoTech. All rights reserved. +// +// ----------------------------------------------------------------------- + +namespace TapTap.UI.AillieoTech +{ + using UnityEditor; + + [CustomEditor(typeof(ScrollViewEx))] + public class ScrollViewExEditor : ScrollViewEditor + { + private SerializedProperty pageSize; + + protected override void OnEnable() + { + base.OnEnable(); + this.pageSize = this.serializedObject.FindProperty("pageSize"); + } + + protected override void DrawConfigInfo() + { + base.DrawConfigInfo(); + EditorGUILayout.PropertyField(this.pageSize); + } + + [MenuItem("GameObject/UI/DynamicScrollViewEx", false, 90)] + private static void AddScrollViewEx(MenuCommand menuCommand) + { + InternalAddScrollView(menuCommand); + } + } +} diff --git a/UI/Editor/ScrollViewExEditor.cs.meta b/UI/Editor/ScrollViewExEditor.cs.meta new file mode 100644 index 0000000..fb49268 --- /dev/null +++ b/UI/Editor/ScrollViewExEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 12cd1055a4162f842842a60918857100 +timeCreated: 1533042733 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Editor/TapTap.UI.Editor.asmdef b/UI/Editor/TapTap.UI.Editor.asmdef new file mode 100644 index 0000000..ef3f542 --- /dev/null +++ b/UI/Editor/TapTap.UI.Editor.asmdef @@ -0,0 +1,17 @@ +{ + "name": "TapTap.UI.Editor", + "references": [ + "GUID:e40af75f4f5764fee95a90e612fbdab8" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/UI/Editor/TapTap.UI.Editor.asmdef.meta b/UI/Editor/TapTap.UI.Editor.asmdef.meta new file mode 100644 index 0000000..5a4d565 --- /dev/null +++ b/UI/Editor/TapTap.UI.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d577628a069ab4cdc87654cc7ac4b6a4 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources.meta b/UI/Resources.meta new file mode 100644 index 0000000..9d865bd --- /dev/null +++ b/UI/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ce28613a509714fe2bde9bfb79a610bb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources/Fonts.meta b/UI/Resources/Fonts.meta new file mode 100644 index 0000000..e48cca7 --- /dev/null +++ b/UI/Resources/Fonts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 339473477d0894d6593fb5fc9954b0e0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources/Fonts/taptap-sdk-bold.ttf b/UI/Resources/Fonts/taptap-sdk-bold.ttf new file mode 100644 index 0000000..e278157 Binary files /dev/null and b/UI/Resources/Fonts/taptap-sdk-bold.ttf differ diff --git a/UI/Resources/Fonts/taptap-sdk-bold.ttf.meta b/UI/Resources/Fonts/taptap-sdk-bold.ttf.meta new file mode 100644 index 0000000..d54629d --- /dev/null +++ b/UI/Resources/Fonts/taptap-sdk-bold.ttf.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 3b1c92b10dde9426cbbccfbbd9c05cb1 +TrueTypeFontImporter: + externalObjects: {} + serializedVersion: 4 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 0 + characterPadding: 1 + includeFontData: 1 + fontName: icomoon + fontNames: + - taptap-sdk-bold + fallbackFontReferences: + - {fileID: 12800000, guid: 922f25809659d41b4b23147484bd150d, type: 3} + customCharacters: + fontRenderingMode: 0 + ascentCalculationMode: 1 + useLegacyBoundsCalculation: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources/Fonts/taptap-sdk.ttf b/UI/Resources/Fonts/taptap-sdk.ttf new file mode 100644 index 0000000..f54b82f Binary files /dev/null and b/UI/Resources/Fonts/taptap-sdk.ttf differ diff --git a/UI/Resources/Fonts/taptap-sdk.ttf.meta b/UI/Resources/Fonts/taptap-sdk.ttf.meta new file mode 100644 index 0000000..b536082 --- /dev/null +++ b/UI/Resources/Fonts/taptap-sdk.ttf.meta @@ -0,0 +1,21 @@ +fileFormatVersion: 2 +guid: 922f25809659d41b4b23147484bd150d +TrueTypeFontImporter: + externalObjects: {} + serializedVersion: 4 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 0 + characterPadding: 1 + includeFontData: 1 + fontName: icomoon + fontNames: + - taptap-sdk + fallbackFontReferences: [] + customCharacters: + fontRenderingMode: 0 + ascentCalculationMode: 1 + useLegacyBoundsCalculation: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources/Loading.prefab b/UI/Resources/Loading.prefab new file mode 100644 index 0000000..f801eaa --- /dev/null +++ b/UI/Resources/Loading.prefab @@ -0,0 +1,261 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1138495173445114285 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9127102694935652778} + - component: {fileID: 3062185400663604511} + - component: {fileID: 6853361318577022366} + - component: {fileID: 7333425585439521949} + - component: {fileID: 216553251484504045} + m_Layer: 5 + m_Name: Loading + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9127102694935652778 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7053660334341111769} + - {fileID: 6725243170288973124} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &3062185400663604511 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &6853361318577022366 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!225 &7333425585439521949 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &216553251484504045 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dbd5c6109fcfe46a6acf800615f84b0a, type: 3} + m_Name: + m_EditorClassIdentifier: + canvas: {fileID: 0} + canvasGroup: {fileID: 0} + openOrder: 0 + panelConfig: + animationType: 0 + toppedOrder: 10 + rotater: {fileID: 6725243170288973124} + speed: 500 +--- !u!1 &1726325218397980974 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6725243170288973124} + - component: {fileID: 3451134979655710801} + - component: {fileID: 6740354880857316333} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6725243170288973124 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 9127102694935652778} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3451134979655710801 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_CullTransparentMesh: 0 +--- !u!114 &6740354880857316333 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 13124a8b3fc8b47b29ef55a02c3f9b15, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &7843842294332592314 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7053660334341111769} + - component: {fileID: 8764964144715973437} + - component: {fileID: 1611728940112126731} + m_Layer: 5 + m_Name: Bgm + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7053660334341111769 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7843842294332592314} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 9127102694935652778} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8764964144715973437 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7843842294332592314} + m_CullTransparentMesh: 0 +--- !u!114 &1611728940112126731 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7843842294332592314} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.34901962} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 diff --git a/UI/Resources/Loading.prefab.meta b/UI/Resources/Loading.prefab.meta new file mode 100644 index 0000000..38ff4d9 --- /dev/null +++ b/UI/Resources/Loading.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: eb405df7d195944bc9aff978aeb1eadb +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources/TapSDKConstantUIRoot.prefab b/UI/Resources/TapSDKConstantUIRoot.prefab new file mode 100644 index 0000000..e49f57a --- /dev/null +++ b/UI/Resources/TapSDKConstantUIRoot.prefab @@ -0,0 +1,100 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4261950774861981618 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5350339549409990581} + - component: {fileID: 2204181717241611008} + - component: {fileID: 4600610754894736554} + - component: {fileID: 50905930539700672} + m_Layer: 5 + m_Name: TapSDKConstantUIRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5350339549409990581 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &2204181717241611008 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 990 + m_TargetDisplay: 0 +--- !u!114 &4600610754894736554 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &50905930539700672 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 diff --git a/UI/Resources/TapSDKConstantUIRoot.prefab.meta b/UI/Resources/TapSDKConstantUIRoot.prefab.meta new file mode 100644 index 0000000..b462876 --- /dev/null +++ b/UI/Resources/TapSDKConstantUIRoot.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0ae8696978cea41f2a04eee465a77042 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources/TapSDKUIRoot.prefab b/UI/Resources/TapSDKUIRoot.prefab new file mode 100644 index 0000000..85de143 --- /dev/null +++ b/UI/Resources/TapSDKUIRoot.prefab @@ -0,0 +1,100 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4261950774861981618 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5350339549409990581} + - component: {fileID: 2204181717241611008} + - component: {fileID: 4600610754894736554} + - component: {fileID: 739291991273991942} + m_Layer: 5 + m_Name: TapSDKUIRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5350339549409990581 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &2204181717241611008 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 32667 + m_TargetDisplay: 0 +--- !u!114 &4600610754894736554 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &739291991273991942 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2035d02fd32941b68c5a0400a11e41fe, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 diff --git a/UI/Resources/TapSDKUIRoot.prefab.meta b/UI/Resources/TapSDKUIRoot.prefab.meta new file mode 100644 index 0000000..0ff851a --- /dev/null +++ b/UI/Resources/TapSDKUIRoot.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d8c4f80cf8fa64584b3248cf2aed3c87 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources/Toast.prefab b/UI/Resources/Toast.prefab new file mode 100644 index 0000000..74579ab --- /dev/null +++ b/UI/Resources/Toast.prefab @@ -0,0 +1,303 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &784908744357270256 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1362374463538379500} + m_Layer: 5 + m_Name: Root + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1362374463538379500 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 784908744357270256} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 6725243170288973124} + - {fileID: 9114159179718277540} + m_Father: {fileID: 9127102694935652778} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1138495173445114285 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9127102694935652778} + - component: {fileID: 3062185400663604511} + - component: {fileID: 6853361318577022366} + - component: {fileID: 7333425585439521949} + - component: {fileID: 594910176992853236} + m_Layer: 5 + m_Name: Toast + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9127102694935652778 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1362374463538379500} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &3062185400663604511 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &6853361318577022366 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!225 &7333425585439521949 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &594910176992853236 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d976458a47d90410fa1669caf419e0fc, type: 3} + m_Name: + m_EditorClassIdentifier: + canvas: {fileID: 0} + canvasGroup: {fileID: 0} + openOrder: 0 + panelConfig: + animationType: 1 + toppedOrder: 9 + text: {fileID: 0} + background: {fileID: 0} + fixVal: 120 + show: "X\xE1c nh\u1EADn th\xF4ng tin" +--- !u!1 &1726325218397980974 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6725243170288973124} + - component: {fileID: 3451134979655710801} + - component: {fileID: 6740354880857316333} + m_Layer: 5 + m_Name: BGM + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6725243170288973124 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1362374463538379500} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 53.6} + m_SizeDelta: {x: 270, y: 130} + m_Pivot: {x: 0.5, y: 1} +--- !u!222 &3451134979655710801 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_CullTransparentMesh: 0 +--- !u!114 &6740354880857316333 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.8509804} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 9da4db41a3dd74a0aa5505d0c771b4fb, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &2834967756811503227 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9114159179718277540} + - component: {fileID: 3789258745879994999} + - component: {fileID: 7465180183063499933} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9114159179718277540 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2834967756811503227} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1362374463538379500} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3789258745879994999 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2834967756811503227} + m_CullTransparentMesh: 0 +--- !u!114 &7465180183063499933 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2834967756811503227} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 36 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 36 + m_Alignment: 4 + m_AlignByGeometry: 1 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: diff --git a/UI/Resources/Toast.prefab.meta b/UI/Resources/Toast.prefab.meta new file mode 100644 index 0000000..e5fd0c9 --- /dev/null +++ b/UI/Resources/Toast.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2696a66a64e7045d7a2732567a6e440c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources/ToastBackground.png b/UI/Resources/ToastBackground.png new file mode 100644 index 0000000..98d4e22 Binary files /dev/null and b/UI/Resources/ToastBackground.png differ diff --git a/UI/Resources/ToastBackground.png.meta b/UI/Resources/ToastBackground.png.meta new file mode 100644 index 0000000..117506d --- /dev/null +++ b/UI/Resources/ToastBackground.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: 9da4db41a3dd74a0aa5505d0c771b4fb +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 70, y: 78, z: 92, w: 58} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources/success.png b/UI/Resources/success.png new file mode 100644 index 0000000..5b47149 Binary files /dev/null and b/UI/Resources/success.png differ diff --git a/UI/Resources/success.png.meta b/UI/Resources/success.png.meta new file mode 100644 index 0000000..295e382 --- /dev/null +++ b/UI/Resources/success.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: d25c3c8620cc04100b98842d8a94920c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources/taptap-bg.png b/UI/Resources/taptap-bg.png new file mode 100644 index 0000000..057f714 Binary files /dev/null and b/UI/Resources/taptap-bg.png differ diff --git a/UI/Resources/taptap-bg.png.meta b/UI/Resources/taptap-bg.png.meta new file mode 100644 index 0000000..67cc7df --- /dev/null +++ b/UI/Resources/taptap-bg.png.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: 86b9e58454341479496cd09b34eb515a +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 300 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources/taptap-close.png b/UI/Resources/taptap-close.png new file mode 100644 index 0000000..ec8c659 Binary files /dev/null and b/UI/Resources/taptap-close.png differ diff --git a/UI/Resources/taptap-close.png.meta b/UI/Resources/taptap-close.png.meta new file mode 100644 index 0000000..2d1978f --- /dev/null +++ b/UI/Resources/taptap-close.png.meta @@ -0,0 +1,146 @@ +fileFormatVersion: 2 +guid: 362d3f2c5cb32453383f03bdcaf75f76 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 300 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources/taptap-router.png b/UI/Resources/taptap-router.png new file mode 100644 index 0000000..10d960a Binary files /dev/null and b/UI/Resources/taptap-router.png differ diff --git a/UI/Resources/taptap-router.png.meta b/UI/Resources/taptap-router.png.meta new file mode 100644 index 0000000..45dacc6 --- /dev/null +++ b/UI/Resources/taptap-router.png.meta @@ -0,0 +1,146 @@ +fileFormatVersion: 2 +guid: c40d5e66443dd4ee892103750b8d2d5f +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 300 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Resources/taptap-sdk-refresh 1.png b/UI/Resources/taptap-sdk-refresh 1.png new file mode 100644 index 0000000..36ae8b1 Binary files /dev/null and b/UI/Resources/taptap-sdk-refresh 1.png differ diff --git a/UI/Resources/taptap-sdk-refresh 1.png.meta b/UI/Resources/taptap-sdk-refresh 1.png.meta new file mode 100644 index 0000000..7ca08fb --- /dev/null +++ b/UI/Resources/taptap-sdk-refresh 1.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: 13124a8b3fc8b47b29ef55a02c3f9b15 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts.meta b/UI/Scripts.meta new file mode 100644 index 0000000..af839df --- /dev/null +++ b/UI/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 988b5f5008c474ade9dce1e6d54db7fb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/Base.meta b/UI/Scripts/Base.meta new file mode 100644 index 0000000..2e7eedf --- /dev/null +++ b/UI/Scripts/Base.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b55505382b99946cdac17f40c9c6ee0f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/Base/Const.cs b/UI/Scripts/Base/Const.cs new file mode 100644 index 0000000..1f33414 --- /dev/null +++ b/UI/Scripts/Base/Const.cs @@ -0,0 +1,24 @@ +using System; +namespace TapTap.UI +{ + public enum EOpenMode + { + Sync, + + Async, + } + + [Flags] + public enum EAnimationMode + { + None = 0, + + Alpha = 1 << 0, + + Scale = 1 << 1, + + RightSlideIn = 1 << 2, + + AlphaAndScale = Alpha | Scale, + } +} \ No newline at end of file diff --git a/UI/Scripts/Base/Const.cs.meta b/UI/Scripts/Base/Const.cs.meta new file mode 100644 index 0000000..b85e9d8 --- /dev/null +++ b/UI/Scripts/Base/Const.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4c258ce272494fea981dcbc0dcb3d48 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/Base/GraphicRaycasterBugFixed.cs b/UI/Scripts/Base/GraphicRaycasterBugFixed.cs new file mode 100644 index 0000000..e44c9cd --- /dev/null +++ b/UI/Scripts/Base/GraphicRaycasterBugFixed.cs @@ -0,0 +1,240 @@ +using System; +using System.Collections.Generic; +using System.Text; +using UnityEngine; +using UnityEngine.EventSystems; +using UnityEngine.Serialization; +using UnityEngine.UI; + +namespace TapTap.UI +{ + /// + /// 修复UnityUGui中Canvas画布在Windows平台宽高比过长(横屏拉很长)导致UI的最右边一部分无法被点击的Bug,现发现与2021.3.x版本 + /// + public class GraphicRaycasterBugFixed : GraphicRaycaster + { + [NonSerialized] private List m_RaycastResults = new List(); + private Canvas _Canvas; + private Canvas canvasBugFixed + { + get + { + if (_Canvas != null) + return _Canvas; + + _Canvas = GetComponent(); + return _Canvas; + } + } + /// + /// Perform the raycast against the list of graphics associated with the Canvas. + /// + /// Current event data + /// List of hit objects to append new results to. + public override void Raycast(PointerEventData eventData, List resultAppendList) + { + if (canvasBugFixed == null) + return; + + var canvasGraphics = GraphicRegistry.GetGraphicsForCanvas(canvasBugFixed); + if (canvasGraphics == null || canvasGraphics.Count == 0) + return; + + int displayIndex; + var currentEventCamera = eventCamera; // Property can call Camera.main, so cache the reference + + if (canvasBugFixed.renderMode == RenderMode.ScreenSpaceOverlay || currentEventCamera == null) + displayIndex = canvasBugFixed.targetDisplay; + else + displayIndex = currentEventCamera.targetDisplay; + + //!! 不同之处 + var eventPosition = Display.RelativeMouseAt(eventData.position); + //MultipleDisplayUtilities.RelativeMouseAtScaled(eventData.position); + if (eventPosition != Vector3.zero) + { + // We support multiple display and display identification based on event position. + + int eventDisplayIndex = (int)eventPosition.z; + + // Discard events that are not part of this display so the user does not interact with multiple displays at once. + if (eventDisplayIndex != displayIndex) + return; + } + else + { + // The multiple display system is not supported on all platforms, when it is not supported the returned position + // will be all zeros so when the returned index is 0 we will default to the event data to be safe. + eventPosition = eventData.position; + + // We dont really know in which display the event occured. We will process the event assuming it occured in our display. + } + + // Convert to view space + Vector2 pos; + if (currentEventCamera == null) + { + // Multiple display support only when not the main display. For display 0 the reported + // resolution is always the desktops resolution since its part of the display API, + // so we use the standard none multiple display method. (case 741751) + float w = Screen.width; + float h = Screen.height; + if (displayIndex > 0 && displayIndex < Display.displays.Length) + { + w = Display.displays[displayIndex].systemWidth; + h = Display.displays[displayIndex].systemHeight; + } + pos = new Vector2(eventPosition.x / w, eventPosition.y / h); + } + else + pos = currentEventCamera.ScreenToViewportPoint(eventPosition); + + // If it's outside the camera's viewport, do nothing + if (pos.x < 0f || pos.x > 1f || pos.y < 0f || pos.y > 1f) + return; + + float hitDistance = float.MaxValue; + + Ray ray = new Ray(); + + if (currentEventCamera != null) + ray = currentEventCamera.ScreenPointToRay(eventPosition); + + if (canvasBugFixed.renderMode != RenderMode.ScreenSpaceOverlay && blockingObjects != BlockingObjects.None) + { + float distanceToClipPlane = 100.0f; + + if (currentEventCamera != null) + { + float projectionDirection = ray.direction.z; + distanceToClipPlane = Mathf.Approximately(0.0f, projectionDirection) + ? Mathf.Infinity + : Mathf.Abs((currentEventCamera.farClipPlane - currentEventCamera.nearClipPlane) / projectionDirection); + } + #if PACKAGE_PHYSICS + if (blockingObjects == BlockingObjects.ThreeD || blockingObjects == BlockingObjects.All) + { + if (ReflectionMethodsCache.Singleton.raycast3D != null) + { + var hits = ReflectionMethodsCache.Singleton.raycast3DAll(ray, distanceToClipPlane, (int)m_BlockingMask); + if (hits.Length > 0) + hitDistance = hits[0].distance; + } + } + #endif + #if PACKAGE_PHYSICS2D + if (blockingObjects == BlockingObjects.TwoD || blockingObjects == BlockingObjects.All) + { + if (ReflectionMethodsCache.Singleton.raycast2D != null) + { + var hits = ReflectionMethodsCache.Singleton.getRayIntersectionAll(ray, distanceToClipPlane, (int)m_BlockingMask); + if (hits.Length > 0) + hitDistance = hits[0].distance; + } + } + #endif + } + + m_RaycastResults.Clear(); + + Raycast(canvasBugFixed, currentEventCamera, eventPosition, canvasGraphics, m_RaycastResults); + + int totalCount = m_RaycastResults.Count; + for (var index = 0; index < totalCount; index++) + { + var go = m_RaycastResults[index].gameObject; + bool appendGraphic = true; + + if (ignoreReversedGraphics) + { + if (currentEventCamera == null) + { + // If we dont have a camera we know that we should always be facing forward + var dir = go.transform.rotation * Vector3.forward; + appendGraphic = Vector3.Dot(Vector3.forward, dir) > 0; + } + else + { + // If we have a camera compare the direction against the cameras forward. + var cameraForward = currentEventCamera.transform.rotation * Vector3.forward * currentEventCamera.nearClipPlane; + // !!不同之处 + appendGraphic = Vector3.Dot(go.transform.position - currentEventCamera.transform.position - cameraForward, go.transform.forward) >= 0; + } + } + + if (appendGraphic) + { + float distance = 0; + Transform trans = go.transform; + Vector3 transForward = trans.forward; + + if (currentEventCamera == null || canvasBugFixed.renderMode == RenderMode.ScreenSpaceOverlay) + distance = 0; + else + { + // http://geomalgorithms.com/a06-_intersect-2.html + distance = (Vector3.Dot(transForward, trans.position - ray.origin) / Vector3.Dot(transForward, ray.direction)); + + // Check to see if the go is behind the camera. + if (distance < 0) + continue; + } + + if (distance >= hitDistance) + continue; + + var castResult = new RaycastResult + { + gameObject = go, + module = this, + distance = distance, + screenPosition = eventPosition, + displayIndex = displayIndex, + index = resultAppendList.Count, + depth = m_RaycastResults[index].depth, + sortingLayer = canvasBugFixed.sortingLayerID, + sortingOrder = canvasBugFixed.sortingOrder, + worldPosition = ray.origin + ray.direction * distance, + worldNormal = -transForward + }; + resultAppendList.Add(castResult); + } + } + } + /// + /// Perform a raycast into the screen and collect all graphics underneath it. + /// + [NonSerialized] static readonly List s_SortedGraphics = new List(); + private static void Raycast(Canvas canvas, Camera eventCamera, Vector2 pointerPosition, IList foundGraphics, List results) + { + // Necessary for the event system + int totalCount = foundGraphics.Count; + for (int i = 0; i < totalCount; ++i) + { + Graphic graphic = foundGraphics[i]; + + // -1 means it hasn't been processed by the canvas, which means it isn't actually drawn + if (!graphic.raycastTarget || graphic.canvasRenderer.cull || graphic.depth == -1) + continue; + + if (!RectTransformUtility.RectangleContainsScreenPoint(graphic.rectTransform, pointerPosition, eventCamera)) + continue; + + if (eventCamera != null && eventCamera.WorldToScreenPoint(graphic.rectTransform.position).z > eventCamera.farClipPlane) + continue; + + if (graphic.Raycast(pointerPosition, eventCamera)) + { + s_SortedGraphics.Add(graphic); + } + } + + s_SortedGraphics.Sort((g1, g2) => g2.depth.CompareTo(g1.depth)); + totalCount = s_SortedGraphics.Count; + for (int i = 0; i < totalCount; ++i) + results.Add(s_SortedGraphics[i]); + + s_SortedGraphics.Clear(); + } + } +} diff --git a/UI/Scripts/Base/GraphicRaycasterBugFixed.cs.meta b/UI/Scripts/Base/GraphicRaycasterBugFixed.cs.meta new file mode 100644 index 0000000..562217b --- /dev/null +++ b/UI/Scripts/Base/GraphicRaycasterBugFixed.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2035d02fd32941b68c5a0400a11e41fe +timeCreated: 1678941027 \ No newline at end of file diff --git a/UI/Scripts/Base/LoadingPanelController.cs b/UI/Scripts/Base/LoadingPanelController.cs new file mode 100644 index 0000000..ee4b2b1 --- /dev/null +++ b/UI/Scripts/Base/LoadingPanelController.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace TapTap.UI +{ + public class LoadingPanelController : BasePanelController + { + public Transform rotater; + + public float speed = 10; + /// + /// bind ugui components for every panel + /// + protected override void BindComponents() + { + rotater = transform.Find("Image");; + } + + private void Update() + { + if (rotater != null) + { + var localEuler = rotater.localEulerAngles; + var z = rotater.localEulerAngles.z; + z += Time.deltaTime * speed; + rotater.localEulerAngles = new Vector3(localEuler.x, localEuler.y, z); + } + } + } +} diff --git a/UI/Scripts/Base/LoadingPanelController.cs.meta b/UI/Scripts/Base/LoadingPanelController.cs.meta new file mode 100644 index 0000000..ca740bd --- /dev/null +++ b/UI/Scripts/Base/LoadingPanelController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dbd5c6109fcfe46a6acf800615f84b0a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/Base/MonoSingleton.cs b/UI/Scripts/Base/MonoSingleton.cs new file mode 100644 index 0000000..6302461 --- /dev/null +++ b/UI/Scripts/Base/MonoSingleton.cs @@ -0,0 +1,102 @@ +using System; +using UnityEngine; + +namespace TapTap.UI +{ + public class MonoSingleton : MonoBehaviour where T : Component + { + private static T _instance; + + public static T Instance + { + get + { + if (_instance == null && Application.isPlaying) + { + CreateInstance(); + } + + return _instance; + } + } + + private static void CreateInstance() + { + Type theType = typeof(T); + + _instance = (T)FindObjectOfType(theType); + + if (_instance == null) + { + var go = new GameObject(typeof(T).Name); + _instance = go.AddComponent(); + + GameObject rootObj = GameObject.Find("TapSDKSingletons"); + if (rootObj == null) + { + rootObj = new GameObject("TapSDKSingletons"); + DontDestroyOnLoad(rootObj); + } + + go.transform.SetParent(rootObj.transform); + } + } + + public static void DestroyInstance() + { + if (_instance != null) + { + Destroy(_instance.gameObject); + } + } + + public static bool HasInstance() + { + return _instance != null; + } + + protected virtual void Awake() + { + if (_instance != null && _instance.gameObject != gameObject) + { + if (Application.isPlaying) + { + Destroy(gameObject); + } + else + { + DestroyImmediate(gameObject); // UNITY_EDITOR + } + + return; + } + else if (_instance == null) + { + _instance = GetComponent(); + } + + DontDestroyOnLoad(gameObject); + + Init(); + } + + protected virtual void OnDestroy() + { + Uninit(); + + if (_instance != null && _instance.gameObject == gameObject) + { + _instance = null; + } + } + + protected virtual void Init() + { + } + + public virtual void Uninit() + { + } + + } +} \ No newline at end of file diff --git a/UI/Scripts/Base/MonoSingleton.cs.meta b/UI/Scripts/Base/MonoSingleton.cs.meta new file mode 100644 index 0000000..370dd83 --- /dev/null +++ b/UI/Scripts/Base/MonoSingleton.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6f59854d639084b21b7d8f5fc3cb8994 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/Base/Singleton.cs b/UI/Scripts/Base/Singleton.cs new file mode 100644 index 0000000..c86879d --- /dev/null +++ b/UI/Scripts/Base/Singleton.cs @@ -0,0 +1,29 @@ +using System; + +namespace TapTap.UI +{ + public class Singleton where T : class + { + private static T _instance; + private static readonly object _lock = new object(); + + public static T Instance + { + get + { + if (_instance == null) + { + lock (_lock) + { + if (_instance == null) + { + _instance = (T)Activator.CreateInstance(typeof(T), true); + } + } + } + + return _instance; + } + } + } +} \ No newline at end of file diff --git a/UI/Scripts/Base/Singleton.cs.meta b/UI/Scripts/Base/Singleton.cs.meta new file mode 100644 index 0000000..b74ceb3 --- /dev/null +++ b/UI/Scripts/Base/Singleton.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 72a44edb1518346a190668972f2f58f0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/Base/ToastPanelController.cs b/UI/Scripts/Base/ToastPanelController.cs new file mode 100644 index 0000000..2d772a0 --- /dev/null +++ b/UI/Scripts/Base/ToastPanelController.cs @@ -0,0 +1,59 @@ +using System; +using UnityEngine; +using UnityEngine.UI; + +namespace TapTap.UI +{ + public class ToastPanelOpenParam : AbstractOpenPanelParameter + { + public float popupTime; + + public string text; + + public ToastPanelOpenParam(string text, float popupTime) + { + this.text = text; + this.popupTime = popupTime; + } + } + public class ToastPanelController : BasePanelController + { + public Text text; + + public RectTransform background; + + public float fixVal; + + public string show; + + protected override void BindComponents() + { + base.BindComponents(); + text = transform.Find("Root/Text").GetComponent(); + background = transform.Find("Root/BGM") as RectTransform; + } + + protected override void OnLoadSuccess() + { + base.OnLoadSuccess(); + ToastPanelOpenParam param = this.openParam as ToastPanelOpenParam; + if (param != null) + { + text.text = param.text; + var totalLength = CalculateLengthOfText(); + var x = totalLength; + var y = background.sizeDelta.y; + background.sizeDelta = new Vector2(x, y); + this.Invoke("Close", param.popupTime); + } + } + + private float CalculateLengthOfText() + { + var width = text.preferredWidth + fixVal; + width = Mathf.Max(200, width); + width = Mathf.Min(Screen.width, width); + return width; + } + } +} diff --git a/UI/Scripts/Base/ToastPanelController.cs.meta b/UI/Scripts/Base/ToastPanelController.cs.meta new file mode 100644 index 0000000..7a408c4 --- /dev/null +++ b/UI/Scripts/Base/ToastPanelController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d976458a47d90410fa1669caf419e0fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/Base/UIManager.cs b/UI/Scripts/Base/UIManager.cs new file mode 100644 index 0000000..a0e816a --- /dev/null +++ b/UI/Scripts/Base/UIManager.cs @@ -0,0 +1,559 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using UnityEngine; + +namespace TapTap.UI +{ + public class UIManager : MonoSingleton + { + public const int TOPPEST_SORTING_ORDER = 32767; + + private const int LOADING_PANEL_SORTING_ORDER = TOPPEST_SORTING_ORDER; + + private const int TOAST_PANEL_SORTING_ORDER = TOPPEST_SORTING_ORDER - 10; + + private readonly Dictionary _registerPanels = new Dictionary(); + + // uicamera + private Camera _uiCamera; + + private GameObject _uiRoot; + private GameObject _uiConstantRoot; + private Canvas _uiRootCanvas; + + public Camera UiCamera => _uiCamera; + + protected override void Init() + { + if (_uiRoot == null && Application.isPlaying) + { + CreateUIRoot(); + } + } + + private void CreateUIRoot() + { + _uiRoot = Instantiate(Resources.Load("TapSDKUIRoot")); + DontDestroyOnLoad(_uiRoot); + var canvas = _uiRoot.GetComponent(); + _uiCamera = canvas.renderMode == RenderMode.ScreenSpaceOverlay ? Camera.main : canvas.worldCamera; + _uiRoot.transform.SetParent(UIManager.Instance.transform); + _uiRootCanvas = _uiRoot.transform.GetComponent(); + + _uiConstantRoot = Instantiate(Resources.Load("TapSDKConstantUIRoot")); + DontDestroyOnLoad(_uiConstantRoot); + canvas = _uiConstantRoot.GetComponent(); + _uiCamera = canvas.renderMode == RenderMode.ScreenSpaceOverlay ? Camera.main : canvas.worldCamera; + _uiConstantRoot.transform.SetParent(UIManager.Instance.transform); + _uiRootCanvas = _uiConstantRoot.transform.GetComponent(); + } + + public override void Uninit() + { + _uiCamera = null; + _uiRoot = null; + _uiConstantRoot = null; + _uiRootCanvas = null; + base.Uninit(); + } + + /// + /// Get Or Create UI asynchronously + /// + /// the prefab path + /// opening param + /// if u want to get ui do something,here is for u, which is invoked after BasePanelController.OnLoadSuccess + /// + /// get panel instance if sync mode load + public async Task OpenUIAsync(string path, AbstractOpenPanelParameter param = null, Action onAsyncGet = null) where TPanelController : BasePanelController + { + var basePanelController = GetUI(); + + // 如果已有界面(之前缓存过的),则不执行任何操作 + if (basePanelController != null) + { + if (!basePanelController.canvas.enabled) + { + basePanelController.canvas.enabled = true; + } + + onAsyncGet?.Invoke(basePanelController); + + return basePanelController; + } + + ResourceRequest request = Resources.LoadAsync(path); + while (request.isDone == false) + { + await Task.Yield(); + } + + GameObject go = request.asset as GameObject; + var basePanel = Instantiate(go).GetComponent(); + if (basePanel != null) + { + var prefabRectTransform = basePanel.transform as RectTransform; + var anchorMin = prefabRectTransform.anchorMin; + var anchorMax = prefabRectTransform.anchorMax; + var anchoredPosition = prefabRectTransform.anchoredPosition; + var sizeDelta = prefabRectTransform.sizeDelta; + + InternalOnPanelLoaded(typeof(TPanelController), basePanel, param); + if (IsNeedCorrectRectTransform(basePanel)) + { + var panelRectTransform = basePanel.transform as RectTransform; + panelRectTransform.anchorMin = anchorMin; + panelRectTransform.anchorMax = anchorMax; + panelRectTransform.anchoredPosition = anchoredPosition; + panelRectTransform.sizeDelta = sizeDelta; + } + onAsyncGet?.Invoke(basePanel); + + EnsureSpecialPanel(); + return basePanel; + } + else + { + return null; + } + } + + /// + /// Get Or Create UI asynchronously + /// + /// the panel Type + /// the prefab path + /// opening param + /// if u want to get ui do something,here is for u, which is invoked after BasePanelController.OnLoadSuccess + /// get panel instance if sync mode load + public async Task OpenUIAsync(Type panelType, string path, AbstractOpenPanelParameter param = null, Action onAsyncGet = null) + { + if (!typeof(BasePanelController).IsAssignableFrom(panelType)) + { + return null; + } + var basePanelController = GetUI(panelType); + + // 如果已有界面(之前缓存过的),则不执行任何操作 + if (basePanelController != null) + { + if (!basePanelController.canvas.enabled) + { + basePanelController.canvas.enabled = true; + } + + onAsyncGet?.Invoke(basePanelController); + + return basePanelController; + } + + ResourceRequest request = Resources.LoadAsync(path); + while (request.isDone == false) + { + await Task.Yield(); + } + + GameObject go = request.asset as GameObject; + var basePanel = Instantiate(go).GetComponent(); + if (basePanel != null) + { + var prefabRectTransform = basePanel.transform as RectTransform; + var anchorMin = prefabRectTransform.anchorMin; + var anchorMax = prefabRectTransform.anchorMax; + var anchoredPosition = prefabRectTransform.anchoredPosition; + var sizeDelta = prefabRectTransform.sizeDelta; + + InternalOnPanelLoaded(panelType, basePanel, param); + if (IsNeedCorrectRectTransform(basePanel)) + { + var panelRectTransform = basePanel.transform as RectTransform; + panelRectTransform.anchorMin = anchorMin; + panelRectTransform.anchorMax = anchorMax; + panelRectTransform.anchoredPosition = anchoredPosition; + panelRectTransform.sizeDelta = sizeDelta; + } + onAsyncGet?.Invoke(basePanel); + + EnsureSpecialPanel(); + return basePanel; + } + else + { + return null; + } + } + + /// + /// Get Or Create UI + /// + /// the prefab path + /// opening param + /// + /// get panel instance if sync mode load + public TPanelController OpenUI(string path, AbstractOpenPanelParameter param = null) where TPanelController : BasePanelController + { + TPanelController basePanelController = GetUI(); + + // 如果已有界面(之前缓存过的),则不执行任何操作 + if (basePanelController != null) + { + if (!basePanelController.canvas.enabled) + { + basePanelController.canvas.enabled = true; + } + + return basePanelController; + } + + var go = Resources.Load(path) as GameObject; + if (go != null) + { + var prefabRectTransform = go.transform as RectTransform; + var anchorMin = prefabRectTransform.anchorMin; + var anchorMax = prefabRectTransform.anchorMax; + var anchoredPosition = prefabRectTransform.anchoredPosition; + var sizeDelta = prefabRectTransform.sizeDelta; + + GameObject panelGo = GameObject.Instantiate(go); + + var basePanel = panelGo.GetComponent(); + if (basePanel == null) { + basePanel = panelGo.AddComponent(); + } + _registerPanels.Add(typeof(TPanelController), basePanel); + basePanel.OnLoaded(param); + basePanel.transform.SetAsLastSibling(); + if (IsNeedCorrectRectTransform(basePanel)) + { + var panelRectTransform = basePanel.transform as RectTransform; + panelRectTransform.anchorMin = anchorMin; + panelRectTransform.anchorMax = anchorMax; + panelRectTransform.anchoredPosition = anchoredPosition; + panelRectTransform.sizeDelta = sizeDelta; + } + + EnsureSpecialPanel(); + return basePanel; + } + return null; + } + + /// + /// Get Or Create UI + /// + /// panel type MUST based on BasePanelController + /// the prefab path + /// opening param + /// get panel instance if sync mode load + public BasePanelController OpenUI(Type panelType, string path, AbstractOpenPanelParameter param = null) + { + if (!typeof(BasePanelController).IsAssignableFrom(panelType)) + { + return null; + } + var basePanelController = GetUI(panelType); + + // 如果已有界面(之前缓存过的),则不执行任何操作 + if (basePanelController != null) + { + if (basePanelController != null && !basePanelController.canvas.enabled) + { + basePanelController.canvas.enabled = true; + } + + return basePanelController; + } + + var panelGo = Resources.Load(path) as GameObject; + if (panelGo != null) + { + var prefabRectTransform = panelGo.transform as RectTransform; + var anchorMin = prefabRectTransform.anchorMin; + var anchorMax = prefabRectTransform.anchorMax; + var anchoredPosition = prefabRectTransform.anchoredPosition; + var sizeDelta = prefabRectTransform.sizeDelta; + + var basePanel = GameObject.Instantiate(panelGo).GetComponent(); + + _registerPanels.Add(panelType, basePanel); + + basePanel.OnLoaded(param); + + // basePanel.SetOpenOrder(uiOpenOrder); + basePanel.transform.SetAsLastSibling(); + + if (IsNeedCorrectRectTransform(basePanel)) + { + var panelRectTransform = basePanel.transform as RectTransform; + panelRectTransform.anchorMin = anchorMin; + panelRectTransform.anchorMax = anchorMax; + panelRectTransform.anchoredPosition = anchoredPosition; + panelRectTransform.sizeDelta = sizeDelta; + } + + EnsureSpecialPanel(); + return basePanel; + } + return null; + } + + public BasePanelController GetUI(Type panelType) + { + if (!typeof(BasePanelController).IsAssignableFrom(panelType)) + { + return null; + } + + if (_registerPanels.TryGetValue(panelType, out BasePanelController basePanelController)) + { + return basePanelController; + } + + return null; + } + + public TPanelController GetUI() where TPanelController : BasePanelController + { + Type panelType = typeof(TPanelController); + + if (_registerPanels.TryGetValue(panelType, out BasePanelController panel)) + { + return (TPanelController)panel; + } + + return null; + } + + public bool CloseUI(Type panelType) + { + if (!typeof(BasePanelController).IsAssignableFrom(panelType)) + { + return false; + } + BasePanelController baseController = GetUI(panelType); + if (baseController != null) + { + if (panelType == typeof(BasePanelController)) // 标尺界面是测试界面 不用关闭 + return false; + else + baseController.Close(); + return true; + } + return false; + } + + public bool CloseUI() where TPanelController : BasePanelController + { + TPanelController panel = GetUI(); + if (panel != null) + { + panel.Close(); + return true; + } + return false; + } + + /// + /// add ui would invoked after create ui automatically, don't need mannually call it in most case + /// + public void AddUI(BasePanelController panel) + { + if (panel == null) + { + return; + } + var rt = panel.transform as RectTransform; + Vector2 cacheAP = Vector2.zero; + Vector2 cacheOffsetMax = Vector2.zero; + Vector2 cacheOffsetMin = Vector2.zero; + Vector2 cacheSizeDelta = Vector2.zero; + if (rt != null) + { + cacheAP = rt.anchoredPosition; + cacheOffsetMax = rt.offsetMax; + cacheOffsetMin = rt.offsetMin; + cacheSizeDelta = rt.sizeDelta; + } + panel.transform.SetParent(panel.AttachedParent); + if (rt != null) + { + rt.anchoredPosition = cacheAP; + rt.offsetMax = cacheOffsetMax; + rt.offsetMin = cacheOffsetMin; + rt.sizeDelta = cacheSizeDelta; + } + panel.transform.localScale = Vector3.one; + panel.transform.localRotation = Quaternion.identity; + panel.gameObject.name = panel.gameObject.name.Replace("(Clone)", ""); + } + + /// + /// remove ui would invoked automatically, don't need mannually call it in most case + /// + public void RemoveUI(BasePanelController panel) + { + if (panel == null) + { + return; + } + Type panelType = panel.GetType(); + if (_registerPanels.ContainsKey(panelType)) + { + _registerPanels.Remove(panelType); + } + panel.Dispose(); + } + + /// + /// take some ui to the most top layer + /// + /// + public void ToppedUI(Type panelType) + { + if (!typeof(BasePanelController).IsAssignableFrom(panelType)) + { + return; + } + ToppedUI(GetUI(panelType)); + } + + /// + /// take some ui to the most top layer + /// + /// + /// 特殊 UI(Loading,Toast之类) 是否需要重新制定 + public void ToppedUI(BasePanelController panel, bool toppedSepcialUI = true) + { + if (panel == null) + { + return; + } + + // panel.SetOpenOrder(uiOpenOrder); + panel.transform.SetAsLastSibling(); + if (toppedSepcialUI) EnsureSpecialPanel(); + } + + /// + /// open toast panel for tip info + /// + public void OpenToast(string text, float popupTime = 2.0f) + { + if (!string.IsNullOrEmpty(text) && popupTime > 0) + { + var toast = OpenUI("Toast", new ToastPanelOpenParam(text, popupTime)); + if (toast != null) + { + // toast.SetOpenOrder(TOAST_PANEL_SORTING_ORDER); + toast.transform.SetAsLastSibling(); + } + } + } + + /// + /// open toast panel for tip info + /// + public async Task OpenToastAsync(string text, float popupTime = 2.0f) + { + if (!string.IsNullOrEmpty(text) && popupTime > 0) + { + var toast = await OpenUIAsync("Toast", new ToastPanelOpenParam(text, popupTime)); + if (toast != null) + { + // toast.SetOpenOrder(TOAST_PANEL_SORTING_ORDER); + toast.transform.SetAsLastSibling(); + } + } + } + + /// + /// open loading panel that would at the toppest layer and block interaction + /// + public void OpenLoading() + { + var loadingPanel = OpenUI("Loading"); + if (loadingPanel != null) + { + // https://www.reddit.com/r/Unity3D/comments/2b1g1l/order_in_layer_maximum_value/ + // loadingPanel.SetOpenOrder(LOADING_PANEL_SORTING_ORDER); + loadingPanel.transform.SetAsLastSibling(); + } + } + + /// + /// open loading panel that would at the toppest layer and block interaction + /// + public async Task OpenLoadingAsync() + { + var loadingPanel = await OpenUIAsync("Loading"); + if (loadingPanel != null) + { + // https://www.reddit.com/r/Unity3D/comments/2b1g1l/order_in_layer_maximum_value/ + // loadingPanel.SetOpenOrder(LOADING_PANEL_SORTING_ORDER); + loadingPanel.transform.SetAsLastSibling(); + } + } + + public void CloseLoading() + { + var loadingPanel = GetUI(); + if (loadingPanel != null) + { + loadingPanel.Close(); + } + } + + private bool IsNeedCorrectRectTransform(BasePanelController controller) + { + if (controller == null) return false; + return (controller.panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.None; + } + + private void InternalOnPanelLoaded(Type tPanelController, BasePanelController basePanel, AbstractOpenPanelParameter param = null) + { + _registerPanels.Add(tPanelController, basePanel); + + basePanel.OnLoaded(param); + + // basePanel.SetOpenOrder(uiOpenOrder); + + basePanel.transform.SetAsLastSibling(); + } + + private void EnsureSpecialPanel() + { + var temp = _registerPanels.Where(panel => + panel.Value != null && panel.Value.gameObject.activeInHierarchy && panel.Value.toppedOrder != 0); + var toppedPanels = new List>(temp); + if (toppedPanels.Count == 0) return; + toppedPanels.Sort((x,y)=>x.Value.toppedOrder.CompareTo(y.Value.toppedOrder)); + foreach (var toppedPanel in toppedPanels) + { + toppedPanel.Value.transform.SetAsLastSibling(); + } + } + + internal Transform GetUIRootTransform(BasePanelController panel) + { + if (panel?.openParam != null && panel.openParam.NeedConstantResolution) + return _uiConstantRoot.transform; + else + return _uiRoot.transform; + } + + + #region external api + public void SetSortOrder(int order) + { + _uiRootCanvas.sortingOrder = order; + } + + public Camera GetUICamera() + { + return _uiCamera; + } + #endregion + } +} \ No newline at end of file diff --git a/UI/Scripts/Base/UIManager.cs.meta b/UI/Scripts/Base/UIManager.cs.meta new file mode 100644 index 0000000..217590e --- /dev/null +++ b/UI/Scripts/Base/UIManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5605d28bde3d14bbeb7903ccb50ae6cf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/BasePanel.meta b/UI/Scripts/BasePanel.meta new file mode 100644 index 0000000..151c603 --- /dev/null +++ b/UI/Scripts/BasePanel.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f72fc0aa3c0e04243afa27ea15d1693f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/BasePanel/BasePanelController.cs b/UI/Scripts/BasePanel/BasePanelController.cs new file mode 100644 index 0000000..fe90505 --- /dev/null +++ b/UI/Scripts/BasePanel/BasePanelController.cs @@ -0,0 +1,330 @@ +using System; +using System.Collections; +using UnityEngine; +using UnityEngine.UI; + +namespace TapTap.UI +{ + /// + /// base panel of TapSDK UI module + /// + [RequireComponent(typeof(Canvas))] + [RequireComponent(typeof(CanvasGroup))] + public abstract class BasePanelController : MonoBehaviour + { + /// + /// the canvas related to this panel + /// + [HideInInspector] + public Canvas canvas; + + /// + /// the canvas group related to this panel + /// + [HideInInspector] + public CanvasGroup canvasGroup; + + /// + /// fade in/out time + /// + private const float FADE_TIME = 0.15f; + + /// + /// animation elapse time + /// + private float _animationElapse; + + private Vector2 _screenSize; + private Vector2 _cachedAnchorPos; + + private RectTransform _rectTransform; + + private Coroutine _animationCoroutine; + + /// + /// open parameter + /// + protected internal AbstractOpenPanelParameter openParam; + + /// + /// settings about this panel + /// + public BasePanelConfig panelConfig; + + /// + /// 特殊面板需要一直保持置顶的,需要填写 toppedOrder, toppedOrder 越大越置顶 + /// + public int toppedOrder; + + /// + /// the transform parent when created it would be attached to + /// + /// + public virtual Transform AttachedParent => UIManager.Instance.GetUIRootTransform(this); + + #region Load + protected virtual void Awake() + { + canvas = GetComponent(); + canvasGroup = GetComponent(); + _rectTransform = transform as RectTransform; + + _screenSize = new Vector2(Screen.width, Screen.height); + + #if UNITY_EDITOR + if (canvas == null) + { + Debug.LogErrorFormat("[TapSDK UI] BasePanel Must Be Related To Canvas Component!"); + } + #endif + } + + /// + /// bind ugui components for every panel + /// + protected virtual void BindComponents() {} + + /// + /// create the prefab instance + /// + /// + public void OnLoaded(AbstractOpenPanelParameter param = null) + { + openParam = param; + // 寻找组件 + BindComponents(); + + // 添加到控制层 + UIManager.Instance.AddUI(this); + + // 更新层级信息 + InitCanvasSetting(); + // 开始动画效果 + OnShowEffectStart(); + + // 调用加载成功方法 + OnLoadSuccess(); + } + + private void InitCanvasSetting() + { + if (canvas.renderMode != RenderMode.ScreenSpaceOverlay) + { + var camera = UIManager.Instance.GetUICamera(); + if (camera != null) + { + canvas.worldCamera = camera; + } + } + + canvas.pixelPerfect = true; + // canvas.overrideSorting = true; + } + + /// + /// init panel logic here + /// + protected virtual void OnLoadSuccess() + { + + } + + #endregion + + #region Animation + + protected virtual void OnShowEffectStart() + { + if (panelConfig.animationType == EAnimationMode.None) + { + return; + } + + if ((panelConfig.animationType & EAnimationMode.Alpha) == EAnimationMode.Alpha) + { + canvasGroup.alpha = 0; + } + + if ((panelConfig.animationType & EAnimationMode.Scale) == EAnimationMode.Scale) + { + transform.localScale = Vector3.zero; + } + if ((panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.RightSlideIn) + { + _cachedAnchorPos = _rectTransform.anchoredPosition; + _rectTransform.anchoredPosition += new Vector2(_screenSize.x, 0); + } + OnEffectStart(); + _animationCoroutine = StartCoroutine(FadeInCoroutine(FADE_TIME)); + } + + protected virtual void OnShowEffectEnd() + { + OnEffectEnd(); + } + + protected virtual void OnCloseEffectStart() + { + OnEffectStart(); + + if ((panelConfig.animationType & EAnimationMode.Alpha) == EAnimationMode.Alpha) + { + canvasGroup.alpha = 1; + } + if ((panelConfig.animationType & EAnimationMode.Scale) == EAnimationMode.Scale) + { + transform.localScale = Vector3.one; + } + if ((panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.RightSlideIn) + { + _rectTransform.anchoredPosition = _cachedAnchorPos; + } + _animationCoroutine = StartCoroutine(FadeOutCoroutine(FADE_TIME)); + } + + protected virtual void OnCloseEffectEnd() + { + OnEffectEnd(); + GameObject.Destroy(gameObject); + } + + private void OnEffectStart() + { + _animationElapse = 0; + if (_animationCoroutine != null) + { + StopCoroutine(_animationCoroutine); + _animationCoroutine = null; + } + canvasGroup.interactable = false; + } + + private void OnEffectEnd() + { + canvasGroup.interactable = true; + _animationElapse = 0; + _animationCoroutine = null; + } + + private IEnumerator FadeInCoroutine(float time) + { + while (_animationElapse < time) + { + yield return null; + _animationElapse += Time.deltaTime; + float value = Mathf.Clamp01(_animationElapse / time); + + if ((panelConfig.animationType & EAnimationMode.Alpha) == EAnimationMode.Alpha) + { + canvasGroup.alpha = value; + } + if ((panelConfig.animationType & EAnimationMode.Scale) == EAnimationMode.Scale) + { + transform.localScale = new Vector3(value, value, value); + } + if ((panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.RightSlideIn) + { + var temp = (1 - value) * _screenSize.x; + _rectTransform.anchoredPosition = new Vector2(_cachedAnchorPos.x + temp, _cachedAnchorPos.y); + } + } + + if ((panelConfig.animationType & EAnimationMode.Alpha) == EAnimationMode.Alpha) + { + canvasGroup.alpha = 1; + } + if ((panelConfig.animationType & EAnimationMode.Scale) == EAnimationMode.Scale) + { + transform.localScale = Vector3.one; + } + if ((panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.RightSlideIn) + { + _rectTransform.anchoredPosition = _cachedAnchorPos; + } + + OnShowEffectEnd(); + } + + private IEnumerator FadeOutCoroutine(float time) + { + while (_animationElapse < time) + { + yield return null; + _animationElapse += Time.deltaTime; + float value = 1 - Mathf.Clamp01(_animationElapse / time); + + if ((panelConfig.animationType & EAnimationMode.Alpha) == EAnimationMode.Alpha) + { + canvasGroup.alpha = value; + } + if ((panelConfig.animationType & EAnimationMode.Scale) == EAnimationMode.Scale) + { + transform.localScale = new Vector3(value, value, value); + } + if ((panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.RightSlideIn) + { + var temp = (1 - value) * _screenSize.x; + _rectTransform.anchoredPosition = new Vector2(_cachedAnchorPos.x + temp, _cachedAnchorPos.y); + } + } + + if ((panelConfig.animationType & EAnimationMode.Alpha) == EAnimationMode.Alpha) + { + canvasGroup.alpha = 0; + } + if ((panelConfig.animationType & EAnimationMode.Scale) == EAnimationMode.Scale) + { + transform.localScale = Vector3.zero; + } + if ((panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.RightSlideIn) + { + _rectTransform.anchoredPosition = new Vector2(_cachedAnchorPos.x + _screenSize.x, _cachedAnchorPos.y); + } + + OnCloseEffectEnd(); + } + + #endregion + + + /// + /// on receive resolution change event + /// + /// + protected virtual void UIAdapt(Vector2Int res) {} + + /// + /// common close api + /// + public virtual void Close() + { + UIManager.Instance.RemoveUI(this); + } + + /// + /// set canvas sorting order + /// + /// + public void SetOpenOrder(int openOrder) + { + if (canvas != null) + { + canvas.sortingOrder = openOrder; + } + } + + /// + /// also would destroy panel gameObject + /// + public virtual void Dispose() + { + if (panelConfig.animationType == EAnimationMode.None) + { + GameObject.Destroy(gameObject); + return; + } + + OnCloseEffectStart(); + } + } +} diff --git a/UI/Scripts/BasePanel/BasePanelController.cs.meta b/UI/Scripts/BasePanel/BasePanelController.cs.meta new file mode 100644 index 0000000..9d387c1 --- /dev/null +++ b/UI/Scripts/BasePanel/BasePanelController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46b452bcf000a41f98212ccee88899e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/Params.meta b/UI/Scripts/Params.meta new file mode 100644 index 0000000..092c2d9 --- /dev/null +++ b/UI/Scripts/Params.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 39f7fade888d64e9193a7bed1148b13d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/Params/BasePanelConfig.cs b/UI/Scripts/Params/BasePanelConfig.cs new file mode 100644 index 0000000..7497444 --- /dev/null +++ b/UI/Scripts/Params/BasePanelConfig.cs @@ -0,0 +1,18 @@ +using UnityEngine; + +namespace TapTap.UI +{ + [System.Serializable] + public struct BasePanelConfig + { + /// + /// animation effect related to opening and closing + /// + public EAnimationMode animationType; + + public BasePanelConfig(EAnimationMode animationMode = EAnimationMode.None) + { + animationType = animationMode; + } + } +} \ No newline at end of file diff --git a/UI/Scripts/Params/BasePanelConfig.cs.meta b/UI/Scripts/Params/BasePanelConfig.cs.meta new file mode 100644 index 0000000..fce1083 --- /dev/null +++ b/UI/Scripts/Params/BasePanelConfig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e2be27146852e4ff1a93a250036bed2c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/Params/IOpenPanelParameter.cs b/UI/Scripts/Params/IOpenPanelParameter.cs new file mode 100644 index 0000000..b4fe37e --- /dev/null +++ b/UI/Scripts/Params/IOpenPanelParameter.cs @@ -0,0 +1,7 @@ +namespace TapTap.UI +{ + public abstract class AbstractOpenPanelParameter + { + public virtual bool NeedConstantResolution => false; + } +} \ No newline at end of file diff --git a/UI/Scripts/Params/IOpenPanelParameter.cs.meta b/UI/Scripts/Params/IOpenPanelParameter.cs.meta new file mode 100644 index 0000000..e1754ef --- /dev/null +++ b/UI/Scripts/Params/IOpenPanelParameter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0e76508aefd8446ba91ba241d655950f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/ScrollViewEx.meta b/UI/Scripts/ScrollViewEx.meta new file mode 100644 index 0000000..4ceecab --- /dev/null +++ b/UI/Scripts/ScrollViewEx.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 96e3a90892d5f4d469f093c70e24c4d0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/ScrollViewEx/ObjPool.meta b/UI/Scripts/ScrollViewEx/ObjPool.meta new file mode 100644 index 0000000..25da6f5 --- /dev/null +++ b/UI/Scripts/ScrollViewEx/ObjPool.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f0676fa1c0082e2408572d35067b7caa +folderAsset: yes +timeCreated: 1533284978 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/ScrollViewEx/ObjPool/SimpleObjPool.cs b/UI/Scripts/ScrollViewEx/ObjPool/SimpleObjPool.cs new file mode 100644 index 0000000..75aff92 --- /dev/null +++ b/UI/Scripts/ScrollViewEx/ObjPool/SimpleObjPool.cs @@ -0,0 +1,76 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) AillieoTech. All rights reserved. +// +// ----------------------------------------------------------------------- + +namespace TapTap.UI.AillieoTech +{ + using System; + using System.Collections.Generic; + + public class SimpleObjPool + { + private readonly Stack stack; + private readonly Func ctor; + private readonly Action onRecycle; + private int size; + private int usedCount; + + public SimpleObjPool(int max = 7, Action onRecycle = null, Func ctor = null) + { + this.stack = new Stack(max); + this.size = max; + this.onRecycle = onRecycle; + this.ctor = ctor; + } + + public T Get() + { + T item; + if (this.stack.Count == 0) + { + if (this.ctor != null) + { + item = this.ctor(); + } + else + { + item = Activator.CreateInstance(); + } + } + else + { + item = this.stack.Pop(); + } + + this.usedCount++; + return item; + } + + public void Recycle(T item) + { + if (this.onRecycle != null) + { + this.onRecycle.Invoke(item); + } + + if (this.stack.Count < this.size) + { + this.stack.Push(item); + } + + this.usedCount--; + } + + public void Purge() + { + // TODO + } + + public override string ToString() + { + return $"SimpleObjPool: item=[{typeof(T)}], inUse=[{this.usedCount}], restInPool=[{this.stack.Count}/{this.size}] "; + } + } +} diff --git a/UI/Scripts/ScrollViewEx/ObjPool/SimpleObjPool.cs.meta b/UI/Scripts/ScrollViewEx/ObjPool/SimpleObjPool.cs.meta new file mode 100644 index 0000000..49a5e26 --- /dev/null +++ b/UI/Scripts/ScrollViewEx/ObjPool/SimpleObjPool.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 779a3e961157c3f468ebe1db83df1e8d +timeCreated: 1533284979 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/ScrollViewEx/ScrollView.meta b/UI/Scripts/ScrollViewEx/ScrollView.meta new file mode 100644 index 0000000..ec6d62c --- /dev/null +++ b/UI/Scripts/ScrollViewEx/ScrollView.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 94da82d2b551d1e4da1543a8beb76371 +folderAsset: yes +timeCreated: 1533284978 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/ScrollViewEx/ScrollView/ScrollView.cs b/UI/Scripts/ScrollViewEx/ScrollView/ScrollView.cs new file mode 100644 index 0000000..5434f3a --- /dev/null +++ b/UI/Scripts/ScrollViewEx/ScrollView/ScrollView.cs @@ -0,0 +1,828 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) AillieoTech. All rights reserved. +// +// ----------------------------------------------------------------------- + +namespace TapTap.UI.AillieoTech +{ + using System; + using System.Collections; + using System.Collections.Generic; + using UnityEngine; + using UnityEngine.Serialization; + using UnityEngine.UI; + + [RequireComponent(typeof(RectTransform))] + [DisallowMultipleComponent] + public class ScrollView : ScrollRect + { + [Tooltip("默认item尺寸")] + public Vector2 defaultItemSize; + + [Tooltip("item的模板")] + public RectTransform itemTemplate; + + // 0001 + protected const int flagScrollDirection = 1; + + [SerializeField] + [FormerlySerializedAs("m_layoutType")] + protected ItemLayoutType layoutType = ItemLayoutType.Vertical; + + // 只保存4个临界index + protected int[] criticalItemIndex = new int[4]; + + // callbacks for items + protected Action updateFunc; + protected Func itemSizeFunc; + protected Func itemCountFunc; + protected Func itemGetFunc; + protected Action itemRecycleFunc; + + private readonly List managedItems = new List(); + + private Rect refRect; + + // resource management + private SimpleObjPool itemPool = null; + + private int dataCount = 0; + + [Tooltip("初始化时池内item数量")] + [SerializeField] + private int poolSize; + + // status + private bool initialized = false; + private int willUpdateData = 0; + + private Vector3[] viewWorldConers = new Vector3[4]; + private Vector3[] rectCorners = new Vector3[2]; + + // for hide and show + public enum ItemLayoutType + { + // 最后一位表示滚动方向 + Vertical = 0b0001, // 0001 + Horizontal = 0b0010, // 0010 + VerticalThenHorizontal = 0b0100, // 0100 + HorizontalThenVertical = 0b0101, // 0101 + } + + public virtual void SetUpdateFunc(Action func) + { + this.updateFunc = func; + } + + public virtual void SetItemSizeFunc(Func func) + { + this.itemSizeFunc = func; + } + + public virtual void SetItemCountFunc(Func func) + { + this.itemCountFunc = func; + } + + public void SetItemGetAndRecycleFunc(Func getFunc, Action recycleFunc) + { + if (getFunc != null && recycleFunc != null) + { + this.itemGetFunc = getFunc; + this.itemRecycleFunc = recycleFunc; + } + else + { + this.itemGetFunc = null; + this.itemRecycleFunc = null; + } + } + + public void ResetAllDelegates() + { + this.SetUpdateFunc(null); + this.SetItemSizeFunc(null); + this.SetItemCountFunc(null); + this.SetItemGetAndRecycleFunc(null, null); + } + + public void UpdateData(bool immediately = true) + { + if (immediately) + { + this.willUpdateData |= 3; // 0011 + this.InternalUpdateData(); + } + else + { + if (this.willUpdateData == 0 && this.IsActive()) + { + this.StartCoroutine(this.DelayUpdateData()); + } + + this.willUpdateData |= 3; + } + } + + public void UpdateDataIncrementally(bool immediately = true) + { + if (immediately) + { + this.willUpdateData |= 1; // 0001 + this.InternalUpdateData(); + } + else + { + if (this.willUpdateData == 0) + { + this.StartCoroutine(this.DelayUpdateData()); + } + + this.willUpdateData |= 1; + } + } + + public void ScrollTo(int index) + { + this.InternalScrollTo(index); + } + + protected override void OnEnable() + { + base.OnEnable(); + if (this.willUpdateData != 0) + { + this.StartCoroutine(this.DelayUpdateData()); + } + } + + protected override void OnDisable() + { + this.initialized = false; + base.OnDisable(); + } + + protected virtual void InternalScrollTo(int index) + { + index = Mathf.Clamp(index, 0, this.dataCount - 1); + this.EnsureItemRect(index); + Rect r = this.managedItems[index].rect; + + var dir = (int)this.layoutType & flagScrollDirection; + if (dir == 1) + { + // vertical + var value = 1 - (-r.yMax / (this.content.sizeDelta.y - this.refRect.height)); + this.SetNormalizedPosition(value, 1); + } + else + { + // horizontal + var value = r.xMin / (this.content.sizeDelta.x - this.refRect.width); + this.SetNormalizedPosition(value, 0); + } + } + + protected override void SetContentAnchoredPosition(Vector2 position) + { + base.SetContentAnchoredPosition(position); + this.UpdateCriticalItems(); + } + + protected override void SetNormalizedPosition(float value, int axis) + { + base.SetNormalizedPosition(value, axis); + this.ResetCriticalItems(); + } + + protected void EnsureItemRect(int index) + { + if (!this.managedItems[index].rectDirty) + { + // 已经是干净的了 + return; + } + + ScrollItemWithRect firstItem = this.managedItems[0]; + if (firstItem.rectDirty) + { + Vector2 firstSize = this.GetItemSize(0); + firstItem.rect = CreateWithLeftTopAndSize(Vector2.zero, firstSize); + firstItem.rectDirty = false; + } + + // 当前item之前的最近的已更新的rect + var nearestClean = 0; + for (var i = index; i >= 0; --i) + { + if (!this.managedItems[i].rectDirty) + { + nearestClean = i; + break; + } + } + + // 需要更新 从 nearestClean 到 index 的尺寸 + Rect nearestCleanRect = this.managedItems[nearestClean].rect; + Vector2 curPos = GetLeftTop(nearestCleanRect); + Vector2 size = nearestCleanRect.size; + this.MovePos(ref curPos, size); + + for (var i = nearestClean + 1; i <= index; i++) + { + size = this.GetItemSize(i); + this.managedItems[i].rect = CreateWithLeftTopAndSize(curPos, size); + this.managedItems[i].rectDirty = false; + this.MovePos(ref curPos, size); + } + + var range = new Vector2(Mathf.Abs(curPos.x), Mathf.Abs(curPos.y)); + switch (this.layoutType) + { + case ItemLayoutType.VerticalThenHorizontal: + range.x += size.x; + range.y = this.refRect.height; + break; + case ItemLayoutType.HorizontalThenVertical: + range.x = this.refRect.width; + if (curPos.x != 0) + { + range.y += size.y; + } + + break; + default: + break; + } + + this.content.sizeDelta = range; + } + + protected override void OnDestroy() + { + if (this.itemPool != null) + { + this.itemPool.Purge(); + } + } + + protected Rect GetItemLocalRect(int index) + { + if (index >= 0 && index < this.dataCount) + { + this.EnsureItemRect(index); + return this.managedItems[index].rect; + } + + return (Rect)default; + } + +#if UNITY_EDITOR + protected override void OnValidate() + { + var dir = (int)this.layoutType & flagScrollDirection; + if (dir == 1) + { + // vertical + if (this.horizontalScrollbar != null) + { + this.horizontalScrollbar.gameObject.SetActive(false); + this.horizontalScrollbar = null; + } + } + else + { + // horizontal + if (this.verticalScrollbar != null) + { + this.verticalScrollbar.gameObject.SetActive(false); + this.verticalScrollbar = null; + } + } + + base.OnValidate(); + } +#endif + + private static Vector2 GetLeftTop(Rect rect) + { + Vector2 ret = rect.position; + ret.y += rect.size.y; + return ret; + } + + private static Rect CreateWithLeftTopAndSize(Vector2 leftTop, Vector2 size) + { + Vector2 leftBottom = leftTop - new Vector2(0, size.y); + return new Rect(leftBottom, size); + } + + private IEnumerator DelayUpdateData() + { + yield return new WaitForEndOfFrame(); + this.InternalUpdateData(); + } + + private void InternalUpdateData() + { + if (!this.IsActive()) + { + this.willUpdateData |= 3; + return; + } + + if (!this.initialized) + { + this.InitScrollView(); + } + + var newDataCount = 0; + var keepOldItems = (this.willUpdateData & 2) == 0; + + if (this.itemCountFunc != null) + { + newDataCount = this.itemCountFunc(); + } + + if (newDataCount != this.managedItems.Count) + { + if (this.managedItems.Count < newDataCount) + { + // 增加 + if (!keepOldItems) + { + foreach (var itemWithRect in this.managedItems) + { + // 重置所有rect + itemWithRect.rectDirty = true; + } + } + + while (this.managedItems.Count < newDataCount) + { + this.managedItems.Add(new ScrollItemWithRect()); + } + } + else + { + // 减少 保留空位 避免GC + for (int i = 0, count = this.managedItems.Count; i < count; ++i) + { + if (i < newDataCount) + { + // 重置所有rect + if (!keepOldItems) + { + this.managedItems[i].rectDirty = true; + } + + if (i == newDataCount - 1) + { + this.managedItems[i].rectDirty = true; + } + } + + // 超出部分 清理回收item + if (i >= newDataCount) + { + this.managedItems[i].rectDirty = true; + if (this.managedItems[i].item != null) + { + this.RecycleOldItem(this.managedItems[i].item); + this.managedItems[i].item = null; + } + } + } + } + } + else + { + if (!keepOldItems) + { + for (int i = 0, count = this.managedItems.Count; i < count; ++i) + { + // 重置所有rect + this.managedItems[i].rectDirty = true; + } + } + } + + this.dataCount = newDataCount; + + this.ResetCriticalItems(); + + this.willUpdateData = 0; + } + + private void ResetCriticalItems() + { + bool hasItem, shouldShow; + int firstIndex = -1, lastIndex = -1; + + for (var i = 0; i < this.dataCount; i++) + { + hasItem = this.managedItems[i].item != null; + shouldShow = this.ShouldItemSeenAtIndex(i); + + if (shouldShow) + { + if (firstIndex == -1) + { + firstIndex = i; + } + + lastIndex = i; + } + + if (hasItem && shouldShow) + { + // 应显示且已显示 + this.SetDataForItemAtIndex(this.managedItems[i].item, i); + continue; + } + + if (hasItem == shouldShow) + { + // 不应显示且未显示 + // if (firstIndex != -1) + // { + // // 已经遍历完所有要显示的了 后边的先跳过 + // break; + // } + continue; + } + + if (hasItem && !shouldShow) + { + // 不该显示 但是有 + this.RecycleOldItem(this.managedItems[i].item); + this.managedItems[i].item = null; + continue; + } + + if (shouldShow && !hasItem) + { + // 需要显示 但是没有 + RectTransform item = this.GetNewItem(i); + this.OnGetItemForDataIndex(item, i); + this.managedItems[i].item = item; + continue; + } + } + + // content.localPosition = Vector2.zero; + this.criticalItemIndex[CriticalItemType.UpToHide] = firstIndex; + this.criticalItemIndex[CriticalItemType.DownToHide] = lastIndex; + this.criticalItemIndex[CriticalItemType.UpToShow] = Mathf.Max(firstIndex - 1, 0); + this.criticalItemIndex[CriticalItemType.DownToShow] = Mathf.Min(lastIndex + 1, this.dataCount - 1); + } + + private RectTransform GetCriticalItem(int type) + { + var index = this.criticalItemIndex[type]; + if (index >= 0 && index < this.dataCount) + { + return this.managedItems[index].item; + } + + return null; + } + + private void UpdateCriticalItems() + { + var dirty = true; + + while (dirty) + { + dirty = false; + + for (int i = CriticalItemType.UpToHide; i <= CriticalItemType.DownToShow; i++) + { + if (i <= CriticalItemType.DownToHide) + { + // 隐藏离开可见区域的item + dirty = dirty || this.CheckAndHideItem(i); + } + else + { + // 显示进入可见区域的item + dirty = dirty || this.CheckAndShowItem(i); + } + } + } + } + + private bool CheckAndHideItem(int criticalItemType) + { + RectTransform item = this.GetCriticalItem(criticalItemType); + var criticalIndex = this.criticalItemIndex[criticalItemType]; + if (item != null && !this.ShouldItemSeenAtIndex(criticalIndex)) + { + this.RecycleOldItem(item); + this.managedItems[criticalIndex].item = null; + + if (criticalItemType == CriticalItemType.UpToHide) + { + // 最上隐藏了一个 + this.criticalItemIndex[criticalItemType + 2] = Mathf.Max(criticalIndex, this.criticalItemIndex[criticalItemType + 2]); + this.criticalItemIndex[criticalItemType]++; + } + else + { + // 最下隐藏了一个 + this.criticalItemIndex[criticalItemType + 2] = Mathf.Min(criticalIndex, this.criticalItemIndex[criticalItemType + 2]); + this.criticalItemIndex[criticalItemType]--; + } + + this.criticalItemIndex[criticalItemType] = Mathf.Clamp(this.criticalItemIndex[criticalItemType], 0, this.dataCount - 1); + + if (this.criticalItemIndex[CriticalItemType.UpToHide] > this.criticalItemIndex[CriticalItemType.DownToHide]) + { + // 偶然的情况 拖拽超出一屏 + this.ResetCriticalItems(); + return false; + } + + return true; + } + + return false; + } + + private bool CheckAndShowItem(int criticalItemType) + { + RectTransform item = this.GetCriticalItem(criticalItemType); + var criticalIndex = this.criticalItemIndex[criticalItemType]; + + if (item == null && this.ShouldItemSeenAtIndex(criticalIndex)) + { + RectTransform newItem = this.GetNewItem(criticalIndex); + this.OnGetItemForDataIndex(newItem, criticalIndex); + this.managedItems[criticalIndex].item = newItem; + + if (criticalItemType == CriticalItemType.UpToShow) + { + // 最上显示了一个 + this.criticalItemIndex[criticalItemType - 2] = Mathf.Min(criticalIndex, this.criticalItemIndex[criticalItemType - 2]); + this.criticalItemIndex[criticalItemType]--; + } + else + { + // 最下显示了一个 + this.criticalItemIndex[criticalItemType - 2] = Mathf.Max(criticalIndex, this.criticalItemIndex[criticalItemType - 2]); + this.criticalItemIndex[criticalItemType]++; + } + + this.criticalItemIndex[criticalItemType] = Mathf.Clamp(this.criticalItemIndex[criticalItemType], 0, this.dataCount - 1); + + if (this.criticalItemIndex[CriticalItemType.UpToShow] >= this.criticalItemIndex[CriticalItemType.DownToShow]) + { + // 偶然的情况 拖拽超出一屏 + this.ResetCriticalItems(); + return false; + } + + return true; + } + + return false; + } + + private bool ShouldItemSeenAtIndex(int index) + { + if (index < 0 || index >= this.dataCount) + { + return false; + } + + this.EnsureItemRect(index); + return new Rect(this.refRect.position - this.content.anchoredPosition, this.refRect.size).Overlaps(this.managedItems[index].rect); + } + + private bool ShouldItemFullySeenAtIndex(int index) + { + if (index < 0 || index >= this.dataCount) + { + return false; + } + + this.EnsureItemRect(index); + return this.IsRectContains(new Rect(this.refRect.position - this.content.anchoredPosition, this.refRect.size), this.managedItems[index].rect); + } + + private bool IsRectContains(Rect outRect, Rect inRect, bool bothDimensions = false) + { + if (bothDimensions) + { + var xContains = (outRect.xMax >= inRect.xMax) && (outRect.xMin <= inRect.xMin); + var yContains = (outRect.yMax >= inRect.yMax) && (outRect.yMin <= inRect.yMin); + return xContains && yContains; + } + else + { + var dir = (int)this.layoutType & flagScrollDirection; + if (dir == 1) + { + // 垂直滚动 只计算y向 + return (outRect.yMax >= inRect.yMax) && (outRect.yMin <= inRect.yMin); + } + else + { + // = 0 + // 水平滚动 只计算x向 + return (outRect.xMax >= inRect.xMax) && (outRect.xMin <= inRect.xMin); + } + } + } + + private void InitPool() + { + var poolNode = new GameObject("POOL"); + poolNode.SetActive(false); + poolNode.transform.SetParent(this.transform, false); + this.itemPool = new SimpleObjPool( + this.poolSize, + (RectTransform item) => + { + item.transform.SetParent(poolNode.transform, false); + }, + () => + { + GameObject itemObj = Instantiate(this.itemTemplate.gameObject); + RectTransform item = itemObj.GetComponent(); + itemObj.transform.SetParent(poolNode.transform, false); + + item.anchorMin = Vector2.up; + item.anchorMax = Vector2.up; + item.pivot = Vector2.zero; + + itemObj.SetActive(true); + return item; + }); + } + + private void OnGetItemForDataIndex(RectTransform item, int index) + { + this.SetDataForItemAtIndex(item, index); + item.transform.SetParent(this.content, false); + } + + private void SetDataForItemAtIndex(RectTransform item, int index) + { + if (this.updateFunc != null) + { + this.updateFunc(index, item); + } + + this.SetPosForItemAtIndex(item, index); + } + + private void SetPosForItemAtIndex(RectTransform item, int index) + { + this.EnsureItemRect(index); + Rect r = this.managedItems[index].rect; + item.localPosition = r.position; + item.sizeDelta = r.size; + } + + private Vector2 GetItemSize(int index) + { + if (index >= 0 && index <= this.dataCount) + { + if (this.itemSizeFunc != null) + { + return this.itemSizeFunc(index); + } + } + + return this.defaultItemSize; + } + + private RectTransform GetNewItem(int index) + { + RectTransform item; + if (this.itemGetFunc != null) + { + item = this.itemGetFunc(index); + } + else + { + item = this.itemPool.Get(); + } + + return item; + } + + private void RecycleOldItem(RectTransform item) + { + if (this.itemRecycleFunc != null) + { + this.itemRecycleFunc(item); + } + else + { + this.itemPool.Recycle(item); + } + } + + private void InitScrollView() + { + this.initialized = true; + + // 根据设置来控制原ScrollRect的滚动方向 + var dir = (int)this.layoutType & flagScrollDirection; + this.vertical = dir == 1; + this.horizontal = dir == 0; + + this.content.pivot = Vector2.up; + this.content.anchorMin = Vector2.up; + this.content.anchorMax = Vector2.up; + this.content.anchoredPosition = Vector2.zero; + + this.InitPool(); + this.UpdateRefRect(); + } + + // refRect是在Content节点下的 viewport的 rect + private void UpdateRefRect() + { + /* + * WorldCorners + * + * 1 ------- 2 + * | | + * | | + * 0 ------- 3 + * + */ + + if (!CanvasUpdateRegistry.IsRebuildingLayout()) + { + Canvas.ForceUpdateCanvases(); + } + + this.viewRect.GetWorldCorners(this.viewWorldConers); + this.rectCorners[0] = this.content.transform.InverseTransformPoint(this.viewWorldConers[0]); + this.rectCorners[1] = this.content.transform.InverseTransformPoint(this.viewWorldConers[2]); + this.refRect = new Rect((Vector2)this.rectCorners[0] - this.content.anchoredPosition, this.rectCorners[1] - this.rectCorners[0]); + } + + private void MovePos(ref Vector2 pos, Vector2 size) + { + // 注意 所有的rect都是左下角为基准 + switch (this.layoutType) + { + case ItemLayoutType.Vertical: + // 垂直方向 向下移动 + pos.y -= size.y; + break; + case ItemLayoutType.Horizontal: + // 水平方向 向右移动 + pos.x += size.x; + break; + case ItemLayoutType.VerticalThenHorizontal: + pos.y -= size.y; + if (pos.y <= -this.refRect.height) + { + pos.y = 0; + pos.x += size.x; + } + + break; + case ItemLayoutType.HorizontalThenVertical: + pos.x += size.x; + if (pos.x >= this.refRect.width) + { + pos.x = 0; + pos.y -= size.y; + } + + break; + default: + break; + } + } + + // const int 代替 enum 减少 (int)和(CriticalItemType)转换 + protected static class CriticalItemType + { + public static byte UpToHide = 0; + public static byte DownToHide = 1; + public static byte UpToShow = 2; + public static byte DownToShow = 3; + } + + private class ScrollItemWithRect + { + // scroll item 身上的 RectTransform组件 + public RectTransform item; + + // scroll item 在scrollview中的位置 + public Rect rect; + + // rect 是否需要更新 + public bool rectDirty = true; + } + } +} diff --git a/UI/Scripts/ScrollViewEx/ScrollView/ScrollView.cs.meta b/UI/Scripts/ScrollViewEx/ScrollView/ScrollView.cs.meta new file mode 100644 index 0000000..eaad719 --- /dev/null +++ b/UI/Scripts/ScrollViewEx/ScrollView/ScrollView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2d355eec575560046ba27246695b84ad +timeCreated: 1533042733 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/Scripts/ScrollViewEx/ScrollView/ScrollViewEx.cs b/UI/Scripts/ScrollViewEx/ScrollView/ScrollViewEx.cs new file mode 100644 index 0000000..df2d59b --- /dev/null +++ b/UI/Scripts/ScrollViewEx/ScrollView/ScrollViewEx.cs @@ -0,0 +1,245 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) AillieoTech. All rights reserved. +// +// ----------------------------------------------------------------------- + +namespace TapTap.UI.AillieoTech +{ + using System; + using UnityEngine; + using UnityEngine.EventSystems; + using UnityEngine.Serialization; + + [RequireComponent(typeof(RectTransform))] + [DisallowMultipleComponent] + public class ScrollViewEx : ScrollView + { + [SerializeField] + [FormerlySerializedAs("m_pageSize")] + private int pageSize = 50; + + private int startOffset = 0; + + private Func realItemCountFunc; + + private Vector2 lastPosition; + + private bool reloadFlag = false; + + public override void SetUpdateFunc(Action func) + { + if (func != null) + { + var f = func; + func = (index, rect) => + { + f(index + this.startOffset, rect); + }; + } + + base.SetUpdateFunc(func); + } + + public override void SetItemSizeFunc(Func func) + { + if (func != null) + { + var f = func; + func = (index) => + { + return f(index + this.startOffset); + }; + } + + base.SetItemSizeFunc(func); + } + + public override void SetItemCountFunc(Func func) + { + this.realItemCountFunc = func; + if (func != null) + { + var f = func; + func = () => Mathf.Min(f(), this.pageSize); + } + + base.SetItemCountFunc(func); + } + + public override void OnDrag(PointerEventData eventData) + { + if (this.reloadFlag) + { + this.reloadFlag = false; + this.OnEndDrag(eventData); + this.OnBeginDrag(eventData); + + return; + } + + base.OnDrag(eventData); + } + + protected override void Awake() + { + base.Awake(); + + this.lastPosition = Vector2.up; + this.onValueChanged.AddListener(this.OnValueChanged); + } + + protected override void InternalScrollTo(int index) + { + var count = 0; + if (this.realItemCountFunc != null) + { + count = this.realItemCountFunc(); + } + + index = Mathf.Clamp(index, 0, count - 1); + this.startOffset = Mathf.Clamp(index - (this.pageSize / 2), 0, count - this.itemCountFunc()); + this.UpdateData(true); + base.InternalScrollTo(index - this.startOffset); + } + + private void OnValueChanged(Vector2 position) + { + int toShow; + int critical; + bool downward; + int pin; + + Vector2 delta = position - this.lastPosition; + this.lastPosition = position; + + this.reloadFlag = false; + + if (((int)this.layoutType & flagScrollDirection) == 1) + { + // 垂直滚动 只计算y向 + if (delta.y < 0) + { + // 向上 + toShow = this.criticalItemIndex[CriticalItemType.DownToShow]; + critical = this.pageSize - 1; + if (toShow < critical) + { + return; + } + + pin = critical - 1; + downward = false; + } + else if (delta.y > 0) + { + // 向下 + toShow = this.criticalItemIndex[CriticalItemType.UpToShow]; + critical = 0; + if (toShow > critical) + { + return; + } + + pin = critical + 1; + downward = true; + } + else + { + return; + } + } + else + { + // = 0 + // 水平滚动 只计算x向 + if (delta.x > 0) + { + // 向右 + toShow = this.criticalItemIndex[CriticalItemType.UpToShow]; + critical = 0; + if (toShow > critical) + { + return; + } + + pin = critical + 1; + downward = true; + } + else if (delta.x < 0) + { + // 向左 + toShow = this.criticalItemIndex[CriticalItemType.DownToShow]; + critical = this.pageSize - 1; + if (toShow < critical) + { + return; + } + + pin = critical - 1; + downward = false; + } + else + { + return; + } + } + + // 该翻页了 翻半页吧 + var old = this.startOffset; + if (downward) + { + this.startOffset -= this.pageSize / 2; + } + else + { + this.startOffset += this.pageSize / 2; + } + + var realDataCount = 0; + if (this.realItemCountFunc != null) + { + realDataCount = this.realItemCountFunc(); + } + + this.startOffset = Mathf.Clamp(this.startOffset, 0, Mathf.Max(realDataCount - this.pageSize, 0)); + + if (old != this.startOffset) + { + this.reloadFlag = true; + + // 记录 原先的速度 + Vector2 oldVelocity = this.velocity; + + // 计算 pin元素的世界坐标 + Rect rect = this.GetItemLocalRect(pin); + + Vector2 oldWorld = this.content.TransformPoint(rect.position); + var dataCount = 0; + if (this.itemCountFunc != null) + { + dataCount = this.itemCountFunc(); + } + + if (dataCount > 0) + { + this.EnsureItemRect(0); + if (dataCount > 1) + { + this.EnsureItemRect(dataCount - 1); + } + } + + // 根据 pin元素的世界坐标 计算出content的position + var pin2 = pin + old - this.startOffset; + Rect rect2 = this.GetItemLocalRect(pin2); + Vector2 newWorld = this.content.TransformPoint(rect2.position); + Vector2 deltaWorld = newWorld - oldWorld; + Vector2 deltaLocal = this.content.InverseTransformVector(deltaWorld); + this.SetContentAnchoredPosition(this.content.anchoredPosition - deltaLocal); + this.UpdateData(true); + this.velocity = oldVelocity; + } + } + } +} diff --git a/UI/Scripts/ScrollViewEx/ScrollView/ScrollViewEx.cs.meta b/UI/Scripts/ScrollViewEx/ScrollView/ScrollViewEx.cs.meta new file mode 100644 index 0000000..036ab2a --- /dev/null +++ b/UI/Scripts/ScrollViewEx/ScrollView/ScrollViewEx.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d8f3e076f25860743a2d5212b2c285ac +timeCreated: 1533042733 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UI/TapTap.UI.asmdef b/UI/TapTap.UI.asmdef new file mode 100644 index 0000000..2b030a0 --- /dev/null +++ b/UI/TapTap.UI.asmdef @@ -0,0 +1,3 @@ +{ + "name": "TapTap.UI" +} diff --git a/UI/TapTap.UI.asmdef.meta b/UI/TapTap.UI.asmdef.meta new file mode 100644 index 0000000..80881be --- /dev/null +++ b/UI/TapTap.UI.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e40af75f4f5764fee95a90e612fbdab8 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/VERSIONNOTE.md b/VERSIONNOTE.md new file mode 100644 index 0000000..e69de29 diff --git a/VERSIONNOTE.md.meta b/VERSIONNOTE.md.meta new file mode 100644 index 0000000..c0e111d --- /dev/null +++ b/VERSIONNOTE.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8f641ea9398ec4290be0e2a577551514 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json new file mode 100644 index 0000000..eb2c288 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "com.taptap.tds.common", + "displayName": "TapTap Common", + "description": "TapTap Develop Service", + "version": "3.18.7", + "unity": "2018.3", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.leancloud.storage": "https://github.com/leancloud/csharp-sdk-upm.git#storage-0.10.14" + }, + "license": "MIT" +} diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 0000000..6a84ce1 --- /dev/null +++ b/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 863b7a574870c4ea29a8c63b01b1b63b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: