|
@@ -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)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|