浏览代码

update button control event & add a safeArea

/add_hero_sample
guanghuispark 3 年前
当前提交
b3c4eac7
共有 5 个文件被更改,包括 368 次插入283 次删除
  1. 529
      AwesomeUIWidgets/Assets/Scenes/ItemPickerRoom.unity
  2. 64
      AwesomeUIWidgets/Assets/Scripts/ChatPage.cs
  3. 25
      AwesomeUIWidgets/Assets/Scripts/ChatPanelManager.cs
  4. 7
      AwesomeUIWidgets/Assets/Scripts/Widgets/input.cs
  5. 26
      AwesomeUIWidgets/Assets/Scripts/chat_theme.cs

529
AwesomeUIWidgets/Assets/Scenes/ItemPickerRoom.unity


m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 378261382}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!28 &389582037
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_TextureFormat: 0
m_MipCount: 1
m_IsReadable: 1
m_IgnoreMasterTextureLimit: 0
m_IsPreProcessed: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 0
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_StreamData:
offset: 0
size: 0
path:
m_OriginalWidth: 0
m_OriginalHeight: 0
m_OriginalAssetGuid: 00000000000000000000000000000000
--- !u!1 &410074745
GameObject:
m_ObjectHideFlags: 0

type: 3}
m_PrefabInstance: {fileID: 1244095385}
m_PrefabAsset: {fileID: 0}
--- !u!28 &593799069
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 2
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_TextureFormat: 0
m_MipCount: 1
m_IsReadable: 1
m_IgnoreMasterTextureLimit: 0
m_IsPreProcessed: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 0
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_StreamData:
offset: 0
size: 0
path:
--- !u!1 &594228147
GameObject:
m_ObjectHideFlags: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 636527051}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!28 &650906333
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 2
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_TextureFormat: 0
m_MipCount: 1
m_IsReadable: 1
m_IgnoreMasterTextureLimit: 0
m_IsPreProcessed: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 0
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_StreamData:
offset: 0
size: 0
path:
--- !u!1 &661128880
GameObject:
m_ObjectHideFlags: 0

m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!28 &837982234
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_TextureFormat: 0
m_MipCount: 1
m_IsReadable: 1
m_IgnoreMasterTextureLimit: 0
m_IsPreProcessed: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 0
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_StreamData:
offset: 0
size: 0
path:
m_OriginalWidth: 0
m_OriginalHeight: 0
m_OriginalAssetGuid: 00000000000000000000000000000000
--- !u!1001 &854782982
PrefabInstance:
m_ObjectHideFlags: 0

m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!28 &1238628557
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_TextureFormat: 0
m_MipCount: 1
m_IsReadable: 1
m_IgnoreMasterTextureLimit: 0
m_IsPreProcessed: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 0
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_StreamData:
offset: 0
size: 0
path:
m_OriginalWidth: 0
m_OriginalHeight: 0
m_OriginalAssetGuid: 00000000000000000000000000000000
--- !u!1001 &1244095385
PrefabInstance:
m_ObjectHideFlags: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1475640688}
m_LocalRotation: {x: -0, y: 0.0030212402, z: -0, w: 0.99999547}
m_LocalPosition: {x: 130.00003, y: 240.00003, z: 7.000017}
m_LocalScale: {x: 419.8, y: 7.8, z: 6.6185}
m_LocalPosition: {x: 130.00003, y: 317, z: 7.000017}
m_LocalScale: {x: 398.35242, y: 7.8, z: 6.6185}
m_Children: []
m_Father: {fileID: 8481369894466841862}
m_RootOrder: 3

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 650906333}
m_Texture: {fileID: 1238628557}
m_UVRect:
serializedVersion: 2
x: 0

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 20b83b6c7039f5d47beac9ffafe09d6e, type: 3}
--- !u!28 &1616619010
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 2
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_TextureFormat: 0
m_MipCount: 1
m_IsReadable: 1
m_IgnoreMasterTextureLimit: 0
m_IsPreProcessed: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 0
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_StreamData:
offset: 0
size: 0
path:
--- !u!1 &1617165399
GameObject:
m_ObjectHideFlags: 0

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 2032261749}
m_Texture: {fileID: 1819346927}
m_UVRect:
serializedVersion: 2
x: 0

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 1616619010}
m_Texture: {fileID: 389582037}
m_UVRect:
serializedVersion: 2
x: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1798061346}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!28 &1819346927
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_TextureFormat: 0
m_MipCount: 1
m_IsReadable: 1
m_IgnoreMasterTextureLimit: 0
m_IsPreProcessed: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 0
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_StreamData:
offset: 0
size: 0
path:
m_OriginalWidth: 0
m_OriginalHeight: 0
m_OriginalAssetGuid: 00000000000000000000000000000000
--- !u!1 &1823135198
GameObject:
m_ObjectHideFlags: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1887772892}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 136, y: 28, z: 8}
m_LocalScale: {x: 419.8, y: 12.072596, z: 6.6185}
m_LocalPosition: {x: 131, y: -85, z: 8}
m_LocalScale: {x: 393.12592, y: 12.072596, z: 6.6185}
m_Children: []
m_Father: {fileID: 8481369894466841862}
m_RootOrder: 4

m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!28 &1967628707
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 2
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_TextureFormat: 0
m_MipCount: 1
m_IsReadable: 1
m_IgnoreMasterTextureLimit: 0
m_IsPreProcessed: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 0
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_StreamData:
offset: 0
size: 0
path:
--- !u!1 &2016732637
GameObject:
m_ObjectHideFlags: 0

m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!28 &2032261749
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 2
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_TextureFormat: 0
m_MipCount: 1
m_IsReadable: 1
m_IgnoreMasterTextureLimit: 0
m_IsPreProcessed: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 0
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_StreamData:
offset: 0
size: 0
path:
--- !u!1 &2072133055
GameObject:
m_ObjectHideFlags: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2100562919}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!28 &2111596222
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_TextureFormat: 0
m_MipCount: 1
m_IsReadable: 1
m_IgnoreMasterTextureLimit: 0
m_IsPreProcessed: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 0
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_StreamData:
offset: 0
size: 0
path:
m_OriginalWidth: 0
m_OriginalHeight: 0
m_OriginalAssetGuid: 00000000000000000000000000000000
--- !u!1 &2129737819
GameObject:
m_ObjectHideFlags: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2137220276}
m_LocalRotation: {x: 0.006262094, y: -0.0000002682209, z: -0.0026238584, w: 0.999977}
m_LocalPosition: {x: 335.00006, y: 134.00014, z: 0.99999905}
m_LocalScale: {x: 11.811192, y: 215.21, z: 6.6185}
m_LocalPosition: {x: 317.9, y: 117.9, z: 0.88}
m_LocalScale: {x: 11.811192, y: 390.9233, z: 6.6185}
m_Children: []
m_Father: {fileID: 8481369894466841862}
m_RootOrder: 2

- {fileID: 1355646877}
- {fileID: 8481369894466841863}
mainCamera: {fileID: 1078121413}
button: {fileID: 6963289594951728341}
speed: 5
--- !u!4 &6963289594243017382
Transform:

- component: {fileID: 6963289594951728343}
- component: {fileID: 6963289594951728337}
- component: {fileID: 6963289594951728342}
- component: {fileID: 6963289594951728341}
m_Layer: 0
m_Name: RawImage
m_TagString: Untagged

m_IsActive: 1
--- !u!114 &6963289594951728341
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6963289594951728340}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 6963289594951728342}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 6963289594243017377}
m_MethodName: SwitchB
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &6963289594951728342
MonoBehaviour:
m_ObjectHideFlags: 0

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 593799069}
m_Texture: {fileID: 837982234}
m_UVRect:
serializedVersion: 2
x: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8481369895454136274}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -76, y: 128, z: 9}
m_LocalScale: {x: 11.811192, y: 215.21, z: 6.6185}
m_LocalPosition: {x: -61, y: 121.1, z: 9}
m_LocalScale: {x: 11.811192, y: 399.42813, z: 6.6185}
m_Children: []
m_Father: {fileID: 8481369894466841862}
m_RootOrder: 1

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 1967628707}
m_Texture: {fileID: 2111596222}
m_UVRect:
serializedVersion: 2
x: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8481369895487139654}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: -0.000015088}
m_LocalScale: {x: 0.5, y: 0.5, z: 1}
m_Children: []
m_Father: {fileID: 8481369896194050402}

m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -3.7825928, y: 4.8399353}
m_SizeDelta: {x: 800, y: 400}
m_AnchoredPosition: {x: 0.000041485, y: -6.4022}
m_SizeDelta: {x: 734.26843, y: 809.6885}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &8481369895487139654
GameObject:

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8481369896194050403}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -1}
m_LocalPosition: {x: 0, y: 0, z: 4.6}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 8481369895487139653}

m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 133, y: 129.54239}
m_SizeDelta: {x: 367.13422, y: 417.5619}
m_AnchoredPosition: {x: 133, y: 116.8}
m_SizeDelta: {x: 367.13422, y: 392.03992}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &8481369896194050403
GameObject:

64
AwesomeUIWidgets/Assets/Scripts/ChatPage.cs


// user: _user
// )
// );
return new MaterialApp(
home: new Scaffold(
backgroundColor:Color.fromARGB(0,0,0,0),
appBar: new AppBar(
backgroundColor: Color.white,
centerTitle: false,
title: new IconButton(
icon: new Icon(Icons.arrow_back, color: Color.black),
onPressed: () => { ChatPanelManager.Switch(); },
padding: EdgeInsets.zero
)
),
body: new Container(
child: new Chat(
messages: _messages,
onAttachmentPressed: _handleAtachmentPressed,
onMessageTap: _handleMessageTap,
onPreviewDataFetched: (
previewData,
message) =>
{
_handlePreviewDataFetched(message, previewData);
},
onTextChanged: (_str) => { },
onSendPressed: _handleSendPressed,
onEndReached: _handleEndReached,
//onEndReachedThreshold: 0.65f,
user: _user
return new SafeArea(
child: new MaterialApp(
home: new Scaffold(
backgroundColor:Color.fromARGB(0,0,0,0),
appBar: new AppBar(
backgroundColor: Color.white,
centerTitle: false,
title: new IconButton(
icon: new Icon(Icons.arrow_back, color: Color.black),
onPressed: () =>
{
ChatPanelManager.Switch();
},
padding: EdgeInsets.zero
)
),
body: new Container(
child: new Chat(
messages: _messages,
onAttachmentPressed: _handleAtachmentPressed,
onMessageTap: _handleMessageTap,
onPreviewDataFetched: (
previewData,
message) =>
{
_handlePreviewDataFetched(message, previewData);
},
onTextChanged: (_str) => { },
onSendPressed: _handleSendPressed,
onEndReached: _handleEndReached,
//onEndReachedThreshold: 0.65f,
user: _user
)
)
)
);
}
}

25
AwesomeUIWidgets/Assets/Scripts/ChatPanelManager.cs


using System.Collections;
using System;
using System.Collections;
using UnityEngine.UI;
public class ChatPanelManager : MonoBehaviour
{

public Vector2 standerdImageSize;
public List<GameObject> OtherPanels;
public Camera mainCamera;
public Button button;
private void Start()
{
button.enabled = true;
}
void Update()
{
if(Input.GetKeyDown(KeyCode.Tab))

panel.SetActive(false);
}
}
button.enabled = false;
}
else
{

}
isFirstTime = false;
wait = true;
StartCoroutine(SkipForAFrame());
button.enabled = true;
StartCoroutine(SkipForAWhile());
}
if (!wait)

}
}
IEnumerator SkipForAFrame()
IEnumerator SkipForAWhile()
{
yield return new WaitForSeconds(0.15f);
wait = false;

isOpenPanel = !isOpenPanel;
isFirstTime = true;
}
public void SwitchB()
{
isLerp = true;
isOpenPanel = !isOpenPanel;
isFirstTime = true;
}
}

7
AwesomeUIWidgets/Assets/Scripts/Widgets/input.cs


};
var test = _query;
return new GestureDetector(
onTapDown: (v) =>
{
if (!ChatPanelManager.isOpenPanel)
{
ChatPanelManager.Switch();
}
},
onTap: () =>
{
_inputFocusNode.requestFocus();

26
AwesomeUIWidgets/Assets/Scripts/chat_theme.cs


attachmentButtonIcon,
backgroundColor ?? ChatThemeUtils.NEUTRAL_7,
dateDividerTextStyle == null
? new TextStyle(color:ChatThemeUtils.NEUTRAL_2, fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 50,
? new TextStyle(color:ChatThemeUtils.NEUTRAL_2, fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 35,
fontWeight: FontWeight.w800, height: 1.333f)
: dateDividerTextStyle,
deliveredIcon,

fontSize:ChatThemeUtils.ratio * 50, fontWeight: FontWeight.w500, height: 1.5f)
fontSize:ChatThemeUtils.ratio * 35, fontWeight: FontWeight.w500, height: 1.5f)
: emptyChatPlaceholderTextStyle,
errorColor ?? ChatThemeUtils.ERROR,
errorIcon,

inputTextStyle: inputTextStyle == null
? new TextStyle(fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 50, fontWeight: FontWeight.w500, height: 1.5f)
? new TextStyle(fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 35, fontWeight: FontWeight.w500, height: 1.5f)
fontSize:ChatThemeUtils.ratio * 50, fontWeight: FontWeight.w500, height: 1.5f)
fontSize:ChatThemeUtils.ratio * 35, fontWeight: FontWeight.w500, height: 1.5f)
fontSize:ChatThemeUtils.ratio * 50, fontWeight: FontWeight.w500, height: 1.333f)
fontSize:ChatThemeUtils.ratio * 35, fontWeight: FontWeight.w500, height: 1.333f)
fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 50, fontWeight: FontWeight.w400, height: 1.428f)
fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 35, fontWeight: FontWeight.w400, height: 1.428f)
fontSize:ChatThemeUtils.ratio * 50, fontWeight: FontWeight.w800, height: 1.375f)
fontSize:ChatThemeUtils.ratio * 35, fontWeight: FontWeight.w800, height: 1.375f)
: receivedMessageLinkTitleTextStyle,
secondaryColor: secondaryColor ?? ChatThemeUtils.SECONDARY,
seenIcon: seenIcon,

fontSize:ChatThemeUtils.ratio * 50, fontWeight: FontWeight.w500, height: 1.5f)
fontSize:ChatThemeUtils.ratio * 35, fontWeight: FontWeight.w500, height: 1.5f)
fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 50, fontWeight: FontWeight.w500, height: 1.333f)
fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 35, fontWeight: FontWeight.w500, height: 1.333f)
fontSize:ChatThemeUtils.ratio * 50, fontWeight: FontWeight.w400, height: 1.428f)
fontSize:ChatThemeUtils.ratio * 35, fontWeight: FontWeight.w400, height: 1.428f)
fontSize:ChatThemeUtils.ratio * 50, fontWeight: FontWeight.w800, height: 1.375f)
fontSize:ChatThemeUtils.ratio * 35, fontWeight: FontWeight.w800, height: 1.375f)
? new TextStyle(color:ChatThemeUtils.NEUTRAL_7, fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 50,
? new TextStyle(color:ChatThemeUtils.NEUTRAL_7, fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 35,
? new TextStyle(fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 50, fontWeight: FontWeight.w800, height: 1.333f)
? new TextStyle(fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 35, fontWeight: FontWeight.w800, height: 1.333f)
: userNameTextStyle
)
{

正在加载...
取消
保存