Skip to content

Commit 19d2fea

Browse files
author
qinhui
committed
bug fix : delete make up in video process scene
1 parent 1099962 commit 19d2fea

4 files changed

Lines changed: 3 additions & 288 deletions

File tree

iOS/APIExample/APIExample/Examples/Advanced/VideoProcess/Base.lproj/VideoProcess.storyboard

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina4_7" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
77
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
88
<capability name="System colors in document resources" minToolsVersion="11.0"/>
99
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -415,19 +415,6 @@
415415
<action selector="onChangeVirtualBgSegment:" destination="jKA-9Y-IUF" eventType="valueChanged" id="xbN-1c-01P"/>
416416
</connections>
417417
</segmentedControl>
418-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FVk-N0-Zza">
419-
<rect key="frame" x="280" y="588" width="74" height="35"/>
420-
<constraints>
421-
<constraint firstAttribute="height" constant="35" id="mrf-oJ-kYs"/>
422-
</constraints>
423-
<state key="normal" title="Button"/>
424-
<buttonConfiguration key="configuration" style="plain" title="Make Up">
425-
<fontDescription key="titleFontDescription" type="system" pointSize="12"/>
426-
</buttonConfiguration>
427-
<connections>
428-
<action selector="onShowMakeUpAction" destination="jKA-9Y-IUF" eventType="touchUpInside" id="h9p-tE-ngt"/>
429-
</connections>
430-
</button>
431418
</subviews>
432419
<viewLayoutGuide key="safeArea" id="Nld-X4-Zcy"/>
433420
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
@@ -438,7 +425,6 @@
438425
<constraint firstItem="oeC-rg-Fjj" firstAttribute="leading" secondItem="0Op-5A-oxl" secondAttribute="leading" id="92B-kw-FIj"/>
439426
<constraint firstItem="W0Y-Vm-X3Y" firstAttribute="centerY" secondItem="0Op-5A-oxl" secondAttribute="centerY" constant="1" id="94w-YK-0Ml"/>
440427
<constraint firstItem="ocB-CG-vnH" firstAttribute="top" secondItem="0Op-5A-oxl" secondAttribute="bottom" constant="11" id="ETG-lq-9km"/>
441-
<constraint firstItem="Nld-X4-Zcy" firstAttribute="trailing" secondItem="FVk-N0-Zza" secondAttribute="trailing" constant="21" id="IYO-ZL-Rl6"/>
442428
<constraint firstItem="IQr-5t-5Li" firstAttribute="top" secondItem="Nld-X4-Zcy" secondAttribute="top" id="KkA-eb-4nn"/>
443429
<constraint firstItem="0Op-5A-oxl" firstAttribute="leading" secondItem="Nld-X4-Zcy" secondAttribute="leading" constant="18" id="M9Y-LC-nJs"/>
444430
<constraint firstItem="IQr-5t-5Li" firstAttribute="trailing" secondItem="Nld-X4-Zcy" secondAttribute="trailing" id="PCc-6r-ctV"/>
@@ -451,8 +437,6 @@
451437
<constraint firstItem="B1h-vc-Ktj" firstAttribute="trailing" secondItem="oeC-rg-Fjj" secondAttribute="trailing" id="dFl-wQ-POd"/>
452438
<constraint firstItem="B1h-vc-Ktj" firstAttribute="leading" secondItem="oeC-rg-Fjj" secondAttribute="leading" id="gcq-OI-AA2"/>
453439
<constraint firstItem="DZl-zb-qBA" firstAttribute="leading" secondItem="Kbb-Wz-bo8" secondAttribute="leading" id="iAD-Nq-hS4"/>
454-
<constraint firstItem="FVk-N0-Zza" firstAttribute="centerY" secondItem="Qhf-Ob-NYA" secondAttribute="centerY" id="j7n-Ye-3Fb"/>
455-
<constraint firstItem="FVk-N0-Zza" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Qhf-Ob-NYA" secondAttribute="trailing" constant="8" symbolic="YES" id="kE8-Nt-mF0"/>
456440
<constraint firstItem="RiO-Eg-x0D" firstAttribute="top" secondItem="dbp-ZR-iav" secondAttribute="bottom" constant="8.5" id="kg8-Cr-fVb"/>
457441
<constraint firstItem="IQr-5t-5Li" firstAttribute="leading" secondItem="Nld-X4-Zcy" secondAttribute="leading" id="kr1-Ml-DNh"/>
458442
<constraint firstItem="Kbb-Wz-bo8" firstAttribute="leading" secondItem="Cdl-89-b0G" secondAttribute="leading" id="mzx-Mq-0wN"/>
@@ -493,7 +477,7 @@
493477
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
494478
</systemColor>
495479
<systemColor name="systemGrayColor">
496-
<color red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
480+
<color red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
497481
</systemColor>
498482
</resources>
499483
</document>

iOS/APIExample/APIExample/Examples/Advanced/VideoProcess/VideoProcess.swift

Lines changed: 0 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -495,145 +495,6 @@ private let makeupList = [
495495

496496
// MARK: make up setting
497497
extension VideoProcessMain {
498-
@IBAction func onShowMakeUpAction() {
499-
let customAlertVC = UIViewController()
500-
customAlertVC.modalPresentationStyle = .overFullScreen
501-
customAlertVC.view.backgroundColor = .clear
502-
503-
let alertView = UIView()
504-
alertView.translatesAutoresizingMaskIntoConstraints = false
505-
alertView.backgroundColor = UIColor.white
506-
alertView.layer.shadowColor = UIColor.black.cgColor
507-
alertView.layer.shadowOpacity = 0.2
508-
alertView.layer.shadowOffset = CGSize(width: 0, height: 2)
509-
alertView.layer.shadowRadius = 4
510-
511-
customAlertVC.view.addSubview(alertView)
512-
513-
NSLayoutConstraint.activate([
514-
alertView.centerXAnchor.constraint(equalTo: customAlertVC.view.centerXAnchor),
515-
alertView.centerYAnchor.constraint(equalTo: customAlertVC.view.centerYAnchor),
516-
alertView.widthAnchor.constraint(equalTo: customAlertVC.view.widthAnchor, constant: -20),
517-
alertView.heightAnchor.constraint(equalToConstant: 300)
518-
])
519-
520-
let scrollView = UIScrollView()
521-
scrollView.translatesAutoresizingMaskIntoConstraints = false
522-
alertView.addSubview(scrollView)
523-
524-
NSLayoutConstraint.activate([
525-
scrollView.topAnchor.constraint(equalTo: alertView.topAnchor),
526-
scrollView.leadingAnchor.constraint(equalTo: alertView.leadingAnchor),
527-
scrollView.trailingAnchor.constraint(equalTo: alertView.trailingAnchor),
528-
scrollView.bottomAnchor.constraint(equalTo: alertView.bottomAnchor, constant: -50)
529-
])
530-
531-
let contentView = UIView()
532-
contentView.translatesAutoresizingMaskIntoConstraints = false
533-
scrollView.addSubview(contentView)
534-
535-
NSLayoutConstraint.activate([
536-
contentView.topAnchor.constraint(equalTo: scrollView.topAnchor),
537-
contentView.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor),
538-
contentView.trailingAnchor.constraint(equalTo: scrollView.trailingAnchor),
539-
contentView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor),
540-
contentView.widthAnchor.constraint(equalTo: scrollView.widthAnchor)
541-
])
542-
543-
var lastLabel: UILabel?
544-
for i in 0..<makeupList.count {
545-
let label = UILabel()
546-
label.translatesAutoresizingMaskIntoConstraints = false
547-
label.text = makeupList[i]["name"] as? String ?? "none"
548-
label.font = UIFont.systemFont(ofSize: 12)
549-
label.textColor = .black
550-
label.tag = i + 2000
551-
contentView.addSubview(label)
552-
553-
var valueView: UIView?
554-
let key = makeupList[i]["key"] as? String ?? ""
555-
let type = makeupList[i]["type"] as? String ?? ""
556-
if type == "slider" {
557-
let value = makeupList[i]["value"] as? [Float] ?? []
558-
let sliderView = UISlider()
559-
label.text = String(format: "%@[%.f]", label.text ?? "none", sliderView.value)
560-
sliderView.minimumValue = value.first ?? 0
561-
sliderView.maximumValue = value.last ?? 1
562-
sliderView.value = makeupParams[key] as? Float ?? 0
563-
sliderView.addTarget(self, action: #selector(makeupSliderAction(_:)), for: .valueChanged)
564-
valueView = sliderView
565-
} else if type == "switch" {
566-
let switchView = UISwitch()
567-
switchView.isOn = makeupParams[key] as? Bool ?? false
568-
switchView.addTarget(self, action: #selector(makeupSwitchAction(_:)), for: .valueChanged)
569-
valueView = switchView
570-
} else if type == "segment" {
571-
let value = makeupList[i]["value"] as? [String] ?? []
572-
let segmentView = UISegmentedControl(items: value)
573-
segmentView.selectedSegmentIndex = makeupParams[key] as? Int ?? 0
574-
segmentView.addTarget(self, action: #selector(makeupSegmentAction(_:)), for: .valueChanged)
575-
valueView = segmentView
576-
}
577-
guard let valueView = valueView else {return}
578-
valueView.translatesAutoresizingMaskIntoConstraints = false
579-
contentView.addSubview(valueView)
580-
valueView.tag = i + 1000
581-
NSLayoutConstraint.activate([
582-
label.topAnchor.constraint(equalTo: lastLabel?.bottomAnchor ?? contentView.topAnchor, constant: lastLabel == nil ? 10 : 10),
583-
label.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 15),
584-
label.trailingAnchor.constraint(equalTo: valueView.leadingAnchor, constant: -10),
585-
label.heightAnchor.constraint(equalToConstant: 40),
586-
valueView.centerYAnchor.constraint(equalTo: label.centerYAnchor),
587-
valueView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -10)
588-
])
589-
lastLabel = label
590-
}
591-
592-
let confirmButton = UIButton(type: .system)
593-
confirmButton.setTitle("Sure".localized, for: .normal)
594-
confirmButton.translatesAutoresizingMaskIntoConstraints = false
595-
confirmButton.addTarget(self, action: #selector(confirmAction), for: .touchUpInside)
596-
597-
alertView.addSubview(confirmButton)
598-
599-
NSLayoutConstraint.activate([
600-
confirmButton.topAnchor.constraint(equalTo: alertView.bottomAnchor, constant: -40),
601-
confirmButton.centerXAnchor.constraint(equalTo: alertView.centerXAnchor)
602-
])
603-
604-
let lastView = lastLabel ?? contentView
605-
NSLayoutConstraint.activate([
606-
contentView.bottomAnchor.constraint(equalTo: lastView.bottomAnchor, constant: 10)
607-
])
608-
609-
self.present(customAlertVC, animated: true, completion: nil)
610-
}
611-
612-
@objc func makeupSliderAction(_ view: UISlider) {
613-
let index = view.tag - 1000
614-
let key = makeupList[index]["key"] as? String ?? ""
615-
makeupParams[key] = view.value
616-
617-
if let label = view.superview?.viewWithTag(index + 2000) as? UILabel {
618-
label.text = String(format: "%@[%.f]", makeupList[index]["name"] as? String ?? "none", view.value)
619-
}
620-
updateMakeup()
621-
}
622-
623-
@objc func makeupSwitchAction(_ view: UISwitch) {
624-
let index = view.tag - 1000
625-
let key = makeupList[index]["key"] as? String ?? ""
626-
makeupParams[key] = view.isOn
627-
updateMakeup()
628-
}
629-
630-
@objc func makeupSegmentAction(_ view: UISegmentedControl) {
631-
let index = view.tag - 1000
632-
let key = makeupList[index]["key"] as? String ?? ""
633-
makeupParams[key] = view.selectedSegmentIndex
634-
updateMakeup()
635-
}
636-
637498
@objc func confirmAction() {
638499
self.dismiss(animated: true, completion: nil)
639500
}

macOS/APIExample/Examples/Advanced/VideoProcess/Base.lproj/VideoProcess.storyboard

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -238,17 +238,6 @@
238238
<action selector="onWhinteningSliderChange:" target="YjT-yy-DnJ" id="GtV-9D-XdJ"/>
239239
</connections>
240240
</slider>
241-
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xvM-Pt-uFi" userLabel="Make up">
242-
<rect key="frame" x="19" y="0.0" width="88" height="32"/>
243-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
244-
<buttonCell key="cell" type="push" title="Make Up" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="8aS-7m-YP7">
245-
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
246-
<font key="font" metaFont="system"/>
247-
</buttonCell>
248-
<connections>
249-
<action selector="onShowMakeUpAction:" target="YjT-yy-DnJ" id="8hZ-Wo-umn"/>
250-
</connections>
251-
</button>
252241
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xSp-Ye-Fs9" userLabel="Face Shape">
253242
<rect key="frame" x="104" y="0.0" width="105" height="32"/>
254243
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>

0 commit comments

Comments
 (0)