mirror of
https://github.com/nerdycat/Cupcake.git
synced 2024-09-11 13:07:13 +03:00
update Demo
This commit is contained in:
parent
c8ba36bbfc
commit
d755015b6a
Binary file not shown.
@ -44,19 +44,19 @@ class SignupViewController: BaseViewController {
|
||||
let card = View.bg("white").radius(4).embedIn(self.view, iphone5 ? 40 : 60, 30)
|
||||
|
||||
let inputStyle = Styles.pin(40, .lowHugging).font(14)
|
||||
Styles("ruler").bg("#C7C7CD").pin(1)
|
||||
Styles("separator").bg("#C7C7CD").pin(1)
|
||||
|
||||
let name = Label.str("FULL NAME").font(17)
|
||||
let nameField = TextField.hint("Enter your full name").maxLength(15).styles(inputStyle)
|
||||
let line1 = View.styles("ruler")
|
||||
let line1 = View.styles("separator")
|
||||
|
||||
let email = Label.str("E-MAIL").font(17)
|
||||
let emailField = TextField.hint("Your E-mail goes here").keyboard(.emailAddress).styles(inputStyle)
|
||||
let line2 = View.styles("ruler")
|
||||
let line2 = View.styles("separator")
|
||||
|
||||
let pw = Label.str("Password").font(17)
|
||||
let pwField = TextField.hint("Enter your password").maxLength(10).secure().styles(inputStyle)
|
||||
let line3 = View.styles("ruler")
|
||||
let line3 = View.styles("separator")
|
||||
|
||||
let statement = Label.str("☑️ I agree all statements in").color("lightGray").font(12)
|
||||
let term = Button.str( AttStr("Terms of service").color("#8DD6E5").font("12").underline() ).margin(0, -22)
|
||||
|
@ -28,15 +28,13 @@ class StaticViewController: BaseViewController {
|
||||
|
||||
Section(
|
||||
Row.img("general").str("General").arrow().custom({ row in
|
||||
let badge = Button.pin(22, 22, .maxX(-5), .centerY(0)).radius(-1).str("1").font(14).bg("red")
|
||||
let badge = Button.pin(22, 22, .maxX(-5), .centerY(0)).radius(-1).str(1).font(14).bg("red")
|
||||
badge.isUserInteractionEnabled = false
|
||||
row.cell.contentView.addSubview(badge)
|
||||
}).onClick({ _ in
|
||||
weakSelf?.push(GeneralViewController())
|
||||
}),
|
||||
Row.img("display").str("Display & Brightness").arrow().onClick({ _ in
|
||||
|
||||
}).onClick({ _ in
|
||||
weakSelf?.push(DisplayViewController())
|
||||
})
|
||||
)
|
||||
@ -51,21 +49,21 @@ class WLANViewController: BaseViewController {
|
||||
let footer = "Known networks will be joined automatically. If no known networks are available, you will have to manually select a network."
|
||||
|
||||
GroupTable(
|
||||
Section(
|
||||
Row.str("WLAN").switchOn().onChange({ row in
|
||||
print(row.switchView.isOn)
|
||||
})
|
||||
),
|
||||
}),
|
||||
|
||||
Section(
|
||||
Row.str("Wireless 1").detail("\u{0001F512} \u{268C}").accessory(.detailButton).onButton({ _ in
|
||||
Alert.title("Wireless 1").message("detail button tapped").action("OK").show()
|
||||
Alert.title("Wireless 1").message("detail button tapped").action("OK", {
|
||||
print("OK")
|
||||
}).cancel("Cancel").show()
|
||||
}).onClick({ _ in
|
||||
print("Wireless 1")
|
||||
}),
|
||||
|
||||
Row.str("Wireless 2").detail("\u{0001F513} \u{2630}").accessory(.detailButton).onButton({ _ in
|
||||
Alert.title("Wireless 2").message("detail button tapped").action("OK", {
|
||||
ActionSheet.title("Wireless 2").message("detail button tapped").action("OK", {
|
||||
print("OK")
|
||||
}).cancel("Cancel").show()
|
||||
}).onClick({ _ in
|
||||
@ -137,34 +135,6 @@ class GeneralViewController: BaseViewController {
|
||||
}
|
||||
|
||||
|
||||
class DisplayViewController: BaseViewController {
|
||||
var autoLockRow: StaticRow!
|
||||
|
||||
override func setupUI() {
|
||||
autoLockRow = Row.str("Auto-Lock").detail("").arrow().onClick({ [unowned self] _ in
|
||||
self.push(AutoLockViewController())
|
||||
})
|
||||
|
||||
GroupTable(
|
||||
Section(
|
||||
Row.custom({ row in
|
||||
let slider = UISlider().embedIn(row.cell.contentView, 0, 15)
|
||||
slider.minimumValueImage = Img("$candle").resize(0.5)
|
||||
slider.maximumValueImage = Img("$candle").resize(0.7)
|
||||
})
|
||||
).header("BRIGHTNESS"),
|
||||
|
||||
Section(autoLockRow)
|
||||
).embedIn(self.view)
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
autoLockRow.detail(AutoLockViewController.selectedOption())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class NameViewController: BaseViewController {
|
||||
static var name = "My-iPhone"
|
||||
var textField: UITextField!
|
||||
@ -193,7 +163,6 @@ class UpdateViewController: BaseViewController {
|
||||
override func setupUI() {
|
||||
let desc = "iOS 10.3.1 introduces new features including the ability to locate AirPods using Find my iPhone and more ways to use Siri with payment, ride booking and automaker apps.\n\nFor information on the security content of Apple software update, please visit this website: https://support.apple.com/kb/HT201222"
|
||||
|
||||
let attDesc = AttStr(desc).font(15).select(.url).link()
|
||||
|
||||
GroupTable(
|
||||
Section(
|
||||
@ -203,15 +172,13 @@ class UpdateViewController: BaseViewController {
|
||||
let cops = Label.str("Apple Inc.").font(13)
|
||||
let status = Label.str("Downloaded").font(13)
|
||||
|
||||
let attDesc = AttStr(desc).font(15).select(.url).link()
|
||||
let desc = Label.str(attDesc).lines().onLink({ text in
|
||||
print(text)
|
||||
})
|
||||
|
||||
VStack(
|
||||
HStack( icon, VStack(title, cops, status).gap(2) ).gap(10),
|
||||
12,
|
||||
desc
|
||||
).embedIn(row.cell.contentView, 10, 15)
|
||||
let head = HStack( icon, VStack(title, cops, status).gap(2) ).gap(10)
|
||||
VStack(head, 12, desc).embedIn(row.cell.contentView, 10, 15)
|
||||
}).height(-1),
|
||||
|
||||
Row.str("Learn More").arrow().onClick({ _ in
|
||||
@ -229,6 +196,34 @@ class UpdateViewController: BaseViewController {
|
||||
}
|
||||
|
||||
|
||||
class DisplayViewController: BaseViewController {
|
||||
var autoLockRow: StaticRow!
|
||||
|
||||
override func setupUI() {
|
||||
autoLockRow = Row.str("Auto-Lock").detail("").arrow().onClick({ [unowned self] _ in
|
||||
self.push(AutoLockViewController())
|
||||
})
|
||||
|
||||
GroupTable(
|
||||
Section(
|
||||
Row.custom({ row in
|
||||
let slider = UISlider().embedIn(row.cell.contentView, 0, 15)
|
||||
slider.minimumValueImage = Img("$candle").resize(0.5)
|
||||
slider.maximumValueImage = Img("$candle").resize(0.7)
|
||||
})
|
||||
).header("BRIGHTNESS"),
|
||||
|
||||
Section(autoLockRow)
|
||||
).embedIn(self.view)
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
autoLockRow.detail(AutoLockViewController.selectedOption())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class AutoLockViewController: BaseViewController {
|
||||
static let options = ["30 Seconds", "1 Minute", "2 Minutes", "3 Minutes", "4 Minutes", "Never"]
|
||||
static var optionIndex = 1
|
||||
|
Loading…
Reference in New Issue
Block a user