Explorar el Código

feat:调整tab结构

kailen hace 2 meses
padre
commit
5cfb0875b6

+ 23 - 0
TSLiveWallpaper/Assets.xcassets/Common/top_diy.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "top_diy@1x.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "top_diy@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "top_diy@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
TSLiveWallpaper/Assets.xcassets/Common/top_diy.imageset/top_diy@1x.png


BIN
TSLiveWallpaper/Assets.xcassets/Common/top_diy.imageset/top_diy@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/Common/top_diy.imageset/top_diy@3x.png


+ 23 - 0
TSLiveWallpaper/Assets.xcassets/Common/top_shuffle.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "top_shuffle@1x.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "top_shuffle@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "top_shuffle@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
TSLiveWallpaper/Assets.xcassets/Common/top_shuffle.imageset/top_shuffle@1x.png


BIN
TSLiveWallpaper/Assets.xcassets/Common/top_shuffle.imageset/top_shuffle@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/Common/top_shuffle.imageset/top_shuffle@3x.png


+ 26 - 0
TSLiveWallpaper/Assets.xcassets/Music/WallpaperBg.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "filename" : "WallpaperBg@1x.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "WallpaperBg@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "WallpaperBg@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  },
+  "properties" : {
+    "template-rendering-intent" : "original"
+  }
+}

BIN
TSLiveWallpaper/Assets.xcassets/Music/WallpaperBg.imageset/WallpaperBg@1x.png


BIN
TSLiveWallpaper/Assets.xcassets/Music/WallpaperBg.imageset/WallpaperBg@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/Music/WallpaperBg.imageset/WallpaperBg@3x.png


+ 37 - 6
TSLiveWallpaper/Business/TSHomeVC/TSHomeVC.swift

@@ -24,13 +24,33 @@ class TSHomeVC: TSBaseVC {
         return navBarView
     }()
 
+    lazy var hStack: UIStackView = {
+        let stack = UIStackView()
+        stack.axis = .horizontal
+        stack.distribution = .fillEqually
+        stack.spacing = 16
+        return stack
+    }()
+
     lazy var diyButton: SpacedButton = {
         let btn = SpacedButton()
-        btn.setTitle("DIY Live Wallpaper", for: .normal)
-        btn.setTitleColor(.black, for: .normal)
-        btn.setImage(UIImage(named: "ic_diy_wallpaper"), for: .normal)
-        btn.setBackgroundImage(UIImage(named: "ic_gen_button"), for: .normal)
+        btn.setTitle("DIY Live Photo", for: .normal)
+        btn.setTitleColor(.white, for: .normal)
+        btn.setImage(UIImage(named: "top_diy"), for: .normal)
+        btn.setBackgroundImage(UIImage(named: "WallpaperBg"), for: .normal)
         btn.addTarget(self, action: #selector(showDiyPaperController), for: .touchUpInside)
+        btn.titleLabel?.font = .systemFont14
+        return btn
+    }()
+
+    lazy var shuffleButton: SpacedButton = {
+        let btn = SpacedButton()
+        btn.setTitle("Shuffle Packs", for: .normal)
+        btn.setTitleColor(.white, for: .normal)
+        btn.setImage(UIImage(named: "top_shuffle"), for: .normal)
+        btn.setBackgroundImage(UIImage(named: "WallpaperBg"), for: .normal)
+        btn.addTarget(self, action: #selector(showRandomWallpaperVC), for: .touchUpInside)
+        btn.titleLabel?.font = .systemFont14
         return btn
     }()
 
@@ -63,8 +83,10 @@ class TSHomeVC: TSBaseVC {
             make.edges.equalToSuperview()
         }
 
-        contentView.addSubview(diyButton)
-        diyButton.snp.makeConstraints { make in
+        hStack.addArrangedSubview(diyButton)
+        hStack.addArrangedSubview(shuffleButton)
+        contentView.addSubview(hStack)
+        hStack.snp.makeConstraints { make in
             make.horizontalEdges.equalToSuperview().inset(16)
             make.top.equalToSuperview().offset(16)
             make.height.equalTo(60)
@@ -90,4 +112,13 @@ class TSHomeVC: TSBaseVC {
         vc.modalPresentationStyle = .overFullScreen
         present(vc, animated: true)
     }
+    
+    @objc func showRandomWallpaperVC() {
+        let vc = TSRandomWallpaperVC()
+        let nav = TSBaseNavigationC(rootViewController: vc)
+        nav.modalPresentationStyle = .overFullScreen
+        present(nav, animated: true)
+    }
+    
+    
 }

+ 27 - 12
TSLiveWallpaper/Business/TSRandomWallpaperVC/TSRandomWallpaperVC.swift

@@ -10,18 +10,27 @@ class TSRandomWallpaperVC: TSBaseVC {
     @UserDefault(key: "isShowGuide", defaultValue: true)
     var isShowGuide: Bool
     
-    lazy var navBarView: TSBaseNavContentBarView = {
-        let navBarView = TSBaseNavContentBarView()
-        let titleImageView = UIImageView.createImageView(imageName: "nav_title_random",contentMode: .scaleToFill)
-        
-        navBarView.barView.addSubview(titleImageView)
-        titleImageView.snp.makeConstraints { make in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(16)
-//            make.width.equalTo(185)
-//            make.height.equalTo(24)
-        }
-
+//    lazy var navBarView: TSBaseNavContentBarView = {
+//        let navBarView = TSBaseNavContentBarView()
+//        let titleImageView = UIImageView.createImageView(imageName: "nav_title_random",contentMode: .scaleToFill)
+//        
+//        navBarView.barView.addSubview(titleImageView)
+//        titleImageView.snp.makeConstraints { make in
+//            make.centerY.equalToSuperview()
+//            make.left.equalTo(16)
+////            make.width.equalTo(185)
+////            make.height.equalTo(24)
+//        }
+//
+//        return navBarView
+//    }()
+//    
+    
+    lazy var navBarView: LWSubNavigationBar = {
+        let navBarView = LWSubNavigationBar()
+        navBarView.backButton.addTarget(self, action: #selector(pop), for: .touchUpInside)
+        navBarView.backButton.setImage(.icClose, for: .normal)
+        navBarView.titleLabel.text = "DIY Live Wallpaper"
         return navBarView
     }()
     
@@ -65,9 +74,15 @@ class TSRandomWallpaperVC: TSBaseVC {
         setViewBgImageNamed(named: "view_main_bg")
         
         navBarContentView.addSubview(navBarView)
+        navBarContentView.snp.remakeConstraints { make in
+            make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
+            make.leading.trailing.equalToSuperview()
+            make.height.equalTo(44.0)
+        }
         navBarView.snp.makeConstraints { make in
             make.edges.equalToSuperview()
         }
+
         
         contentView.addSubview(collectionComponent.collectionView)
         collectionComponent.collectionView.snp.makeConstraints { make in