瀏覽代碼

相册优化

zhaoyang 2 年之前
父節點
當前提交
17735a958f

+ 1 - 1
FGUIProject/assets/poem/PoemPhotoShareUI.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920">
   <displayList>
-    <loader id="n0_v482" name="loaBg" xy="540,960" pivot="0.5,0.5" anchor="true" size="1080,1920" fill="scaleMatchWidth">
+    <loader id="n0_v482" name="loaBg" xy="540,960" pivot="0.5,0.5" anchor="true" size="1080,1920" align="center" vAlign="middle" fill="scaleMatchWidth">
       <relation target="" sidePair="center-center,middle-middle"/>
     </loader>
     <component id="n1_v482" name="btnback" src="9xlo8" fileName="components/ButtonBack1.xml" pkg="eg2y0ldp" xy="34,60">

+ 3 - 1
FGUIProject/assets/poem/components/ComIcon.xml

@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="465,655" mask="n13_uyux">
   <displayList>
-    <loader id="n4_v482" name="loaIcon" xy="0,-50" pivot="0.5,0.5" size="465,826" aspect="true" url="ui://iyz778gkuyux102" fill="scaleMatchWidth"/>
+    <loader id="n4_v482" name="loaIcon" xy="0,-30" size="465,826" aspect="true" url="ui://iyz778gkuyux102" align="center" vAlign="middle" fill="scaleMatchWidth">
+      <relation target="" sidePair="center-center,middle-middle"/>
+    </loader>
     <image id="n13_uyux" name="n13" src="uyux107" fileName="photImages/xc_xzxd.png" xy="0,0"/>
   </displayList>
 </component>

+ 3 - 1
FGUIProject/assets/poem/components/ComPhoto.xml

@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="994,1600" overflow="hidden" mask="n7_uyux" reversedMask="true">
   <displayList>
-    <loader id="n5_v482" name="loaPhoto" xy="497,800" pivot="0.5,0.5" anchor="true" size="1000,1777" aspect="true" url="ui://iyz778gkuyux102" fill="scaleMatchWidth"/>
+    <loader id="n5_v482" name="loaPhoto" xy="-3,-88" size="1000,1777" aspect="true" url="ui://iyz778gkuyux102" align="center" vAlign="middle" fill="scaleMatchWidth">
+      <relation target="" sidePair="width-width,height-height,center-center,middle-middle"/>
+    </loader>
     <image id="n7_uyux" name="n7" src="uyux100" fileName="photImages/xc_dakuang.png" xy="-3,-2" size="1000,1607">
       <relation target="" sidePair="width-width,height-height"/>
     </image>

+ 1 - 1
FGUIProject/assets/poem/components/ListPhotoPreviewItem.xml

@@ -5,7 +5,7 @@
       <relation target="" sidePair="width-width,height-height"/>
     </component>
     <image id="n9_mdd9" name="imgBorder" src="uyux100" fileName="photImages/xc_dakuang.png" xy="0,0" size="1000,1605">
-      <relation target="" sidePair="width-width,height-height,center-center,middle-middle"/>
+      <relation target="" sidePair="width-width,height-height"/>
     </image>
   </displayList>
 </component>

+ 7 - 9
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoPreView.cs

@@ -77,7 +77,7 @@ namespace GFGGame
             ViewManager.GoBackFrom(typeof(PoemPhotoPreView).FullName);
 
         }
-        private void UpdateView()
+        private void UpdateView(bool ani = false)
         {
             _ui.m_btnLeft.enabled = _curIndex > 0;
             _ui.m_btnRight.enabled = _curIndex < _ui.m_list.numItems - 1;
@@ -85,7 +85,7 @@ namespace GFGGame
             _ui.m_btnLock.m_c1.selectedIndex = _photoInfos[_curIndex].LockingStatus ? 1 : 0;
             _ui.m_btnUp.m_c1.selectedIndex = _photoInfos[_curIndex].ToppingStatus ? 1 : 0;
 
-            if (_photoInfos.Count > 0) _ui.m_list.ScrollToView(_curIndex);
+            if (_photoInfos.Count > 0) _ui.m_list.ScrollToView(_curIndex, ani);
 
             if (_ui.m_btnLock.target.data == null)
             {
@@ -103,12 +103,10 @@ namespace GFGGame
         private void RenderListItem(int index, GObject obj)
         {
             UI_ListPhotoPreviewItem item = UI_ListPhotoPreviewItem.Proxy(obj);
-            GLoader loaIcon = item.m_comPhoto.m_loaPhoto;
-            item.m_comPhoto.m_loaPhoto.texture = _photoInfos[index].Ntexture;// PoemPhotoDataManager.Instance.BytesToTexture2D(_photoInfos[index].Bytes);
+
+            item.m_comPhoto.m_loaPhoto.texture = _photoInfos[index].Ntexture;
             item.target.SetSize(item.target.width, item.target.initHeight * _ui.target.height / _ui.target.initHeight);
-            loaIcon.SetSize(loaIcon.width, loaIcon.texture.height * loaIcon.width / loaIcon.texture.width);
-            loaIcon.y = item.target.height / 2;
-            item.m_imgBorder.SetSize(item.target.width, item.target.height);
+
             UI_ListPhotoPreviewItem.ProxyEnd();
         }
 
@@ -117,7 +115,7 @@ namespace GFGGame
             _curIndex--;
             _curIndex = Mathf.Max(0, _curIndex);
 
-            UpdateView();
+            UpdateView(true);
         }
 
         private void OnBtnRightClick()
@@ -125,7 +123,7 @@ namespace GFGGame
             _curIndex++;
             _curIndex = Mathf.Min(_ui.m_list.numItems - 1, _curIndex);
 
-            UpdateView();
+            UpdateView(true);
         }
         private void OnListScrollEnd()
         {

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoShareView.cs

@@ -50,7 +50,7 @@ namespace GFGGame
 
             _curPhotoData = this.viewData as PoemPhotoData;
 
-            _ui.m_loaBg.texture = _curPhotoData.Ntexture;// PoemPhotoDataManager.Instance.BytesToTexture2D(_curPhotoData.Bytes);
+            _ui.m_loaBg.texture = _curPhotoData.Ntexture;
             _ui.m_loaBg.SetSize(_ui.m_loaBg.width, _ui.m_loaBg.texture.height * _ui.m_loaBg.width / _ui.m_loaBg.texture.width);
 
         }

+ 0 - 1
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoView.cs

@@ -129,7 +129,6 @@ namespace GFGGame
                 _photoInfos[index].Ntexture = PoemPhotoDataManager.Instance.BytesToTexture2D(_photoInfos[index].Bytes);
             }
             loaIcon.texture = _photoInfos[index].Ntexture;
-            loaIcon.SetSize(loaIcon.width, loaIcon.texture.height * loaIcon.width / loaIcon.texture.width);
 
             item.m_txtTime.text = TimeUtil.FormattingTime1(_photoInfos[index].CreationTime);
             item.m_btnLock.m_c1.selectedIndex = _photoInfos[index].LockingStatus ? 1 : 0;

二進制
GameClient/Assets/ResIn/UI/Poem/Poem_fui.bytes