浏览代码

update show room

/zgh-add_chatroom
guanghuispark 3 年前
当前提交
961ad0d2
共有 7 个文件被更改,包括 982 次插入81 次删除
  1. 885
      AwesomeUIWidgets/Assets/Scenes/ShowRoom.unity
  2. 6
      AwesomeUIWidgets/Assets/Scripts/DateAndTimePicker.cs
  3. 20
      AwesomeUIWidgets/Assets/Scripts/Widgets/input.cs
  4. 6
      AwesomeUIWidgets/Assets/Scripts/Widgets/send_button.cs
  5. 20
      AwesomeUIWidgets/Assets/Scripts/chat_theme.cs
  6. 91
      AwesomeUIWidgets/Assets/ChatPanelManager.cs
  7. 35
      AwesomeUIWidgets/Assets/Scripts/ChatPanelDemo.cs

885
AwesomeUIWidgets/Assets/Scenes/ShowRoom.unity
文件差异内容过多而无法显示
查看文件

6
AwesomeUIWidgets/Assets/Scripts/DateAndTimePicker.cs


textTheme: new CupertinoTextThemeData(
dateTimePickerTextStyle: new TextStyle(
fontSize: 16,
color: Colors.white
color: Color.fromARGB(255, 226, 255, 255)
backgroundColor: Colors.black,
backgroundColor: Color.fromARGB(180, 0, 123, 255),
mode: CupertinoDatePickerMode.dateAndTime,
initialDateTime: this.dateTime,
onDateTimeChanged: (DateTime newDateTime) => {

public override Widget build(BuildContext context)
{
return new Container(
color : Colors.black,
color : Color.fromARGB(180, 0, 123, 255),
child : this._buildDateAndTimePicker(context)
);
}

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


{
var _query = MediaQuery.of(context);
var results = new List<Widget>();
if (widget.onAttachmentPressed != null)
results.Add(_leftWidget());
//if (widget.onAttachmentPressed != null)
// results.Add(_leftWidget());
results.Add( new SizedBox(
height: 14,
width: 24
));
var hintStyle = InheritedChatTheme.of(context)?
.theme
.inputTextStyle

color: InheritedChatTheme.of(context).theme.inputBackgroundColor,
child: new Container(
/*padding: EdgeInsets.fromLTRB(
left:24 + _query.padding.left,
top:0,
right:24 + _query.padding.right,
padding: EdgeInsets.fromLTRB(
left:_query.padding.left,
top:10,
right:_query.padding.right,
),*/
),
children: results
)
)

6
AwesomeUIWidgets/Assets/Scripts/Widgets/send_button.cs


);
var tooltip = InheritedL10n.of(context).l10n?.sendButtonAccessibilityLabel;
return new Container(
height: 14,
//margin: EdgeInsets.only(16),
width: 24,
height: 20,
margin: EdgeInsets.only(right:16),
width: 30,
child: new IconButton(
icon: icon,
onPressed: () => { onPressed(); },

20
AwesomeUIWidgets/Assets/Scripts/chat_theme.cs


inputBorderRadius == null ? BorderRadius.vertical(Radius.circular(20f)) : inputBorderRadius,
inputTextColor: inputTextColor ?? ChatThemeUtils.NEUTRAL_7,
inputTextStyle: inputTextStyle == null
? new TextStyle(fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 16, fontWeight: FontWeight.w500, height: 1.5f)
? new TextStyle(fontFamily: "Avenir", fontSize:ChatThemeUtils.ratio * 30, fontWeight: FontWeight.w500, height: 1.5f)
fontSize:ChatThemeUtils.ratio * 16, fontWeight: FontWeight.w500, height: 1.5f)
fontSize:ChatThemeUtils.ratio * 30, fontWeight: FontWeight.w500, height: 1.5f)
fontSize:ChatThemeUtils.ratio * 12, fontWeight: FontWeight.w500, height: 1.333f)
fontSize:ChatThemeUtils.ratio * 30, fontWeight: FontWeight.w500, height: 1.333f)
: receivedMessageCaptionTextStyle,
receivedMessageDocumentIconColor: receivedMessageDocumentIconColor ?? ChatThemeUtils.PRIMARY,
receivedMessageLinkDescriptionTextStyle:

: receivedMessageLinkDescriptionTextStyle,
receivedMessageLinkTitleTextStyle: receivedMessageLinkTitleTextStyle == null
? new TextStyle(color:ChatThemeUtils.NEUTRAL_0, fontFamily: "Avenir",
fontSize:ChatThemeUtils.ratio * 16, fontWeight: FontWeight.w800, height: 1.375f)
fontSize:ChatThemeUtils.ratio * 30, fontWeight: FontWeight.w800, height: 1.375f)
: receivedMessageLinkTitleTextStyle,
secondaryColor: secondaryColor ?? ChatThemeUtils.SECONDARY,
seenIcon: seenIcon,

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

91
AwesomeUIWidgets/Assets/ChatPanelManager.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ChatPanelManager : MonoBehaviour
{
public RectTransform transformPosition;
public RectTransform transformedPosition;
public RectTransform canvasPosition;
public RectTransform imagePosition;
public Vector2 standerdImageSize;
public GameObject panel;
public GameObject dateAndTimePicker;
private bool isLerp = false;
private bool isOpenPanel = false;
public float speed = 5.0f;
private bool isFirstTime = true;
private bool wait = false;
void Update()
{
if(Input.GetKeyDown(KeyCode.Space))
{
isLerp = true;
isOpenPanel = !isOpenPanel;
isFirstTime = true;
}
if (isLerp)
{
if (isOpenPanel)
{
canvasPosition.anchoredPosition3D = Vector3.Lerp(canvasPosition.anchoredPosition3D,
transformedPosition.anchoredPosition3D, speed * Time.deltaTime);
canvasPosition.localRotation = Quaternion.Lerp(canvasPosition.localRotation,
transformedPosition.localRotation, speed * Time.deltaTime);
canvasPosition.localScale = Vector3.Lerp(canvasPosition.localScale, transformedPosition.localScale,
speed * Time.deltaTime);
if(canvasPosition.anchoredPosition3D == transformedPosition.anchoredPosition3D)
{
isLerp = false;
canvasPosition.GetComponent<Canvas>().renderMode = RenderMode.ScreenSpaceOverlay;
imagePosition.sizeDelta = standerdImageSize;
panel.SetActive(false);
dateAndTimePicker.SetActive(false);
}
}
else
{
if (isFirstTime)
{
canvasPosition.GetComponent<Canvas>().renderMode = RenderMode.WorldSpace;
canvasPosition.anchoredPosition3D = transformedPosition.anchoredPosition3D;
canvasPosition.localRotation = transformedPosition.localRotation;
canvasPosition.localScale = transformedPosition.localScale;
panel.SetActive(true);
dateAndTimePicker.SetActive(true);
isFirstTime = false;
wait = true;
StartCoroutine(SkipForAFrame());
}
if (!wait)
{
canvasPosition.anchoredPosition3D = Vector3.Lerp(canvasPosition.anchoredPosition3D,
transformPosition.anchoredPosition3D, speed * Time.deltaTime);
canvasPosition.localRotation = Quaternion.Lerp(canvasPosition.localRotation,
transformPosition.localRotation, speed * Time.deltaTime);
canvasPosition.localScale = Vector3.Lerp(canvasPosition.localScale, transformPosition.localScale,
speed * Time.deltaTime);
if(canvasPosition.anchoredPosition3D == transformedPosition.anchoredPosition3D)
{
isLerp = false;
}
}
}
}
}
IEnumerator SkipForAFrame()
{
yield return 0;
wait = false;
}
}

35
AwesomeUIWidgets/Assets/Scripts/ChatPanelDemo.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using Text = Unity.UIWidgets.widgets.Text;
using ui_ = Unity.UIWidgets.widgets.ui_;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace UIWidgetsSample
{
public class ChatPanelDemo : UIWidgetsPanel
{
protected void OnEnable()
{
base.OnEnable();
}
protected override void main()
{
ui_.runApp(new ChatRoomApp());
}
class ChatRoomApp : StatelessWidget
{
public override Widget build(BuildContext context)
{
return new CupertinoApp(
home: new ChatPage()
);
}
}
}
}
正在加载...
取消
保存