Răsfoiți Sursa

feat: 礼物面板顶部头像区增加右边的渐变遮罩

陈文艺 20 ore în urmă
părinte
comite
224f3128f8

+ 9 - 2
Lanu.xcodeproj/project.pbxproj

@@ -70,6 +70,7 @@
 				"Common/Theme/UIFont+Theme.swift",
 				"Common/Theme/UIImage+Theme.swift",
 				"Common/Theme/UIImageView+Theme.swift",
+				"Common/Theme/UIView+Theme.swift",
 				Common/Views/Base/LNFakeNaviBar.swift,
 				Common/Views/Base/LNNavigationController.swift,
 				Common/Views/Base/LNViewController.swift,
@@ -443,8 +444,6 @@
 		};
 		FBB67E232EC48B440070E686 /* ThirdParty */ = {
 			isa = PBXFileSystemSynchronizedRootGroup;
-			exceptions = (
-			);
 			path = ThirdParty;
 			sourceTree = "<group>";
 		};
@@ -597,10 +596,14 @@
 			inputFileListPaths = (
 				"${PODS_ROOT}/Target Support Files/Pods-Gami/Pods-Gami-resources-${CONFIGURATION}-input-files.xcfilelist",
 			);
+			inputPaths = (
+			);
 			name = "[CP] Copy Pods Resources";
 			outputFileListPaths = (
 				"${PODS_ROOT}/Target Support Files/Pods-Gami/Pods-Gami-resources-${CONFIGURATION}-output-files.xcfilelist",
 			);
+			outputPaths = (
+			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
 			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Gami/Pods-Gami-resources.sh\"\n";
@@ -636,10 +639,14 @@
 			inputFileListPaths = (
 				"${PODS_ROOT}/Target Support Files/Pods-Gami/Pods-Gami-frameworks-${CONFIGURATION}-input-files.xcfilelist",
 			);
+			inputPaths = (
+			);
 			name = "[CP] Embed Pods Frameworks";
 			outputFileListPaths = (
 				"${PODS_ROOT}/Target Support Files/Pods-Gami/Pods-Gami-frameworks-${CONFIGURATION}-output-files.xcfilelist",
 			);
+			outputPaths = (
+			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
 			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Gami/Pods-Gami-frameworks.sh\"\n";

+ 54 - 0
Lanu/Common/Theme/UIView+Theme.swift

@@ -0,0 +1,54 @@
+//
+//  UIView+Theme.swift
+//  Gami
+//
+//  Created by OneeChan on 2026/4/1.
+//
+
+import Foundation
+import UIKit
+import Combine
+
+
+enum LNViewGradientDirection {
+    case horizontalLTR
+    case horizontalRTL
+    case verticalUTD
+    case verticalDTU
+    case custom(start: CGPoint, endPoint: CGPoint)
+}
+
+extension UIView {
+    static func gradientView(_ colors: [UIColor], _ direction: LNViewGradientDirection) -> UIView {
+        let view = UIView()
+        view.isUserInteractionEnabled = false
+        
+        let gradientLayer = CAGradientLayer()
+        gradientLayer.colors = colors.map({ $0.cgColor })
+        switch direction {
+        case .horizontalLTR:
+            gradientLayer.startPoint = .zero
+            gradientLayer.endPoint = .init(x: 1, y: 0)
+        case .horizontalRTL:
+            gradientLayer.startPoint = .init(x: 1, y: 0)
+            gradientLayer.endPoint = .zero
+        case .verticalUTD:
+            gradientLayer.startPoint = .zero
+            gradientLayer.endPoint = .init(x: 0, y: 1)
+        case .verticalDTU:
+            gradientLayer.startPoint = .init(x: 0, y: 1)
+            gradientLayer.endPoint = .zero
+        case .custom(let start, let endPoint):
+            gradientLayer.startPoint = start
+            gradientLayer.endPoint = endPoint
+        }
+        view.layer.addSublayer(gradientLayer)
+        view.publisher(for: \.bounds).removeDuplicates().sink
+        { [weak gradientLayer] newValue in
+            guard let gradientLayer else { return }
+            gradientLayer.frame = newValue
+        }.store(in: &view.cancellables)
+        
+        return view
+    }
+}

+ 1 - 1
Lanu/Localizable.xcstrings

@@ -588,7 +588,7 @@
         "id" : {
           "stringUnit" : {
             "state" : "translated",
-            "value" : "Berhenti Mengikuti"
+            "value" : "Berhenti ikuti"
           }
         },
         "zh-Hans" : {

+ 19 - 3
Lanu/Views/Room/Gift/LNRoomGiftHeaderView.swift

@@ -11,7 +11,7 @@ import SnapKit
 
 
 class LNRoomGiftHeaderView: UIView {
-    private let roomSeatsView = UIScrollView()
+    private let roomSeatsView = UIView()
     private let stackView = UIStackView()
     
     private let specifiedUserView = LNRoomGiftSpecifiedUserView()
@@ -117,15 +117,31 @@ private extension LNRoomGiftHeaderView {
     }
     
     private func buildRoomSeatsView() -> UIView {
-        roomSeatsView.showsHorizontalScrollIndicator = false
+        let scrollView = UIScrollView()
+        scrollView.showsHorizontalScrollIndicator = false
+        scrollView.contentInset = .init(top: 0, left: 0, bottom: 0, right: 32)
+        roomSeatsView.addSubview(scrollView)
+        scrollView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
         
         stackView.axis = .horizontal
-        roomSeatsView.addSubview(stackView)
+        scrollView.addSubview(stackView)
         stackView.snp.makeConstraints { make in
             make.edges.equalToSuperview()
             make.height.equalToSuperview()
         }
         
+        let gradientView = UIView.gradientView([
+            .fill_7.withAlphaComponent(0), .fill_7
+        ], .horizontalLTR)
+        roomSeatsView.addSubview(gradientView)
+        gradientView.snp.makeConstraints { make in
+            make.verticalEdges.equalToSuperview()
+            make.trailing.equalToSuperview()
+            make.width.equalTo(32)
+        }
+        
         return roomSeatsView
     }
     

+ 3 - 16
Lanu/Views/Room/Gift/List/LNRoomGiftListView.swift

@@ -100,27 +100,14 @@ private extension LNRoomGiftListView {
             make.edges.equalToSuperview()
         }
         
-        let bottomGradientView = UIView()
-        bottomGradientView.isUserInteractionEnabled = false
+        let bottomGradientView = UIView.gradientView([
+            .init(hex: "#24213800"), .init(hex: "#242138")
+        ], .verticalUTD)
         addSubview(bottomGradientView)
         bottomGradientView.snp.makeConstraints { make in
             make.horizontalEdges.equalToSuperview()
             make.bottom.equalToSuperview()
             make.height.equalTo(44)
         }
-        
-        let gradientLayer = CAGradientLayer()
-        gradientLayer.colors = [
-            UIColor(hex: "#24213800").cgColor,
-            UIColor(hex: "#242138").cgColor
-        ]
-        gradientLayer.startPoint = .zero
-        gradientLayer.endPoint = .init(x: 0, y: 1)
-        bottomGradientView.layer.addSublayer(gradientLayer)
-        bottomGradientView.publisher(for: \.bounds).removeDuplicates().sink
-        { [weak gradientLayer] newValue in
-            guard let gradientLayer else { return }
-            gradientLayer.frame = newValue
-        }.store(in: &cancellables)
     }
 }

+ 3 - 16
Lanu/Views/Room/Message/LNRoomMessageView.swift

@@ -91,28 +91,15 @@ extension LNRoomMessageView {
             make.edges.equalToSuperview()
         }
         
-        let bottomGradientView = UIView()
-        bottomGradientView.isUserInteractionEnabled = false
+        let bottomGradientView = UIView.gradientView([
+            .init(hex: "#010B2300"), .init(hex: "#010B23")
+        ], .verticalUTD)
         addSubview(bottomGradientView)
         bottomGradientView.snp.makeConstraints { make in
             make.horizontalEdges.equalToSuperview()
             make.bottom.equalToSuperview()
             make.height.equalTo(44)
         }
-        
-        let gradientLayer = CAGradientLayer()
-        gradientLayer.colors = [
-            UIColor(hex: "#010B2300").cgColor,
-            UIColor(hex: "#010B23").cgColor
-        ]
-        gradientLayer.startPoint = .zero
-        gradientLayer.endPoint = .init(x: 0, y: 1)
-        bottomGradientView.layer.addSublayer(gradientLayer)
-        bottomGradientView.publisher(for: \.bounds).removeDuplicates().sink
-        { [weak gradientLayer] newValue in
-            guard let gradientLayer else { return }
-            gradientLayer.frame = newValue
-        }.store(in: &cancellables)
     }
 }
 

+ 0 - 2
Lanu/Views/Room/Profile/LNRoomProfileBottomMenu.swift

@@ -21,11 +21,9 @@ class LNRoomProfileBottomMenu: UIView {
             if isFollow {
                 follow.setTitle(.init(key: "A00026"), for: .normal)
                 follow.setTitleColor(.text_1.withAlphaComponent(0.2), for: .normal)
-                follow.titleLabel?.font = .body_l
             } else {
                 follow.setTitle(.init(key: "A00225"), for: .normal)
                 follow.setTitleColor(.text_1, for: .normal)
-                follow.titleLabel?.font = .body_l
             }
         }
     }