Commit 939708d2 authored by CZ1004's avatar CZ1004

Merge branch 'develop_0409' into homeUpdate

* develop_0409:
  首页 按钮换位置
  首页动画
  设置 项目修改
  小组件 适配
parents 1d2ad718 56ec55dd
{"nm":"Render Me","h":1000,"w":1000,"meta":{"g":"LottieFiles AE 1.0.0","tc":"#ffffff"},"layers":[{"ty":4,"nm":"Blue","sr":1,"st":0,"op":100,"ip":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[500,500,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":7},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100],"t":9},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100],"t":35},{"s":[0],"t":37}]}},"ef":[],"shapes":[{"ty":"gr","nm":"Ellipse 2","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-55.228],[-55.228,0],[0,55.228],[55.228,0]],"o":[[0,55.228],[55.228,0],[0,-55.228],[-55.228,0]],"v":[[-100,0],[0,100],[100,0],[0,-100]]}}},{"ty":"st","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":60},"c":{"a":0,"k":[1,1,1]}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Ellipse 1","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-55.228],[55.228,0],[0,55.228],[-55.228,0]],"o":[[0,55.228],[-55.228,0],[0,-55.228],[55.228,0]],"v":[[100,0],[0,100],[-100,0],[0,-100]]}}},{"ty":"st","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":60},"c":{"a":0,"k":[1,1,1]}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[-100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"tm","nm":"Trim Paths 1","e":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.667,"y":1},"s":[85],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[70],"t":30},{"s":[85],"t":60}]},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[360],"t":60}]},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.667,"y":1},"s":[90],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[100],"t":30},{"s":[90],"t":60}]},"m":2}],"ind":1},{"ty":4,"nm":"Red","sr":1,"st":0,"op":100,"ip":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[500,500,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"ef":[],"shapes":[{"ty":"gr","nm":"Ellipse 2","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-55.228],[-55.228,0],[0,55.228],[55.228,0]],"o":[[0,55.228],[55.228,0],[0,-55.228],[-55.228,0]],"v":[[-100,0],[0,100],[100,0],[0,-100]]}}},{"ty":"st","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":60},"c":{"a":0,"k":[1,1,1]}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Ellipse 1","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-55.228],[55.228,0],[0,55.228],[-55.228,0]],"o":[[0,55.228],[-55.228,0],[0,-55.228],[55.228,0]],"v":[[100,0],[0,100],[-100,0],[0,-100]]}}},{"ty":"st","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":60},"c":{"a":0,"k":[1,1,1]}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[-100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"tm","nm":"Trim Paths 1","e":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.667,"y":1},"s":[85],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[70],"t":30},{"s":[85],"t":60}]},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[360],"t":60}]},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.667,"y":1},"s":[90],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[100],"t":30},{"s":[90],"t":60}]},"m":2}],"ind":2},{"ty":4,"nm":"Circles","sr":1,"st":0,"op":100,"ip":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[500,500,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"ef":[],"shapes":[{"ty":"gr","nm":"Ellipse 2","it":[{"ty":"el","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[76,76]}},{"ty":"fl","nm":"Fill 1","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,100],"t":34},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[140,140],"t":39},{"s":[100,100],"t":47}]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[-100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Ellipse 1","it":[{"ty":"el","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[76,76]}},{"ty":"fl","nm":"Fill 1","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,100],"t":6},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[140,140],"t":11},{"s":[100,100],"t":19}]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Group 1","it":[{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[-100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Group 2","it":[{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]}],"ind":3}],"v":"4.8.0","fr":29.97,"op":60,"ip":0,"assets":[]}
\ No newline at end of file
......@@ -9,7 +9,7 @@ import UIKit
class HomeNavView:UIView {
private var titleLabel:UILabel!
// private var titleLabel:UILabel!
private var settingBtn:UIButton!
private var proBtn:UIButton!
private var tipLabel:UILabel!
......@@ -29,19 +29,19 @@ class HomeNavView:UIView {
backgroundColor = .white
titleLabel = UILabel()
titleLabel.text = "Cleanup"
titleLabel.font = UIFont.systemFont(ofSize: 20, weight: .bold)
titleLabel.textColor = UIColor.colorWithHex(hexStr: black3Color)
titleLabel.sizeToFit()
self.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.centerY.equalTo(navCenterY)
make.left.equalTo(marginLR)
}
// titleLabel = UILabel()
// titleLabel.text = "Cleanup"
// titleLabel.font = UIFont.systemFont(ofSize: 20, weight: .bold)
// titleLabel.textColor = UIColor.colorWithHex(hexStr: black3Color)
// titleLabel.sizeToFit()
//
// self.addSubview(titleLabel)
//
// titleLabel.snp.makeConstraints { make in
//
// make.centerY.equalTo(navCenterY)
// make.left.equalTo(marginLR)
// }
settingBtn = UIButton()
settingBtn.setImage(UIImage(named: "home_setting_icon"), for: .normal)
......@@ -49,9 +49,10 @@ class HomeNavView:UIView {
self.addSubview(settingBtn)
settingBtn.snp.makeConstraints { make in
// make.centerY.equalTo(navCenterY)
// make.right.equalToSuperview().offset(-marginLR)
make.centerY.equalTo(navCenterY)
make.right.equalToSuperview().offset(-marginLR)
make.left.equalTo(marginLR)
make.width.height.equalTo(iconWH)
}
......@@ -62,8 +63,10 @@ class HomeNavView:UIView {
proBtn.snp.makeConstraints { make in
// make.centerY.equalTo(navCenterY)
// make.right.equalTo(settingBtn.snp.left).offset(-8)
make.centerY.equalTo(navCenterY)
make.right.equalTo(settingBtn.snp.left).offset(-8)
make.right.equalToSuperview().offset(-marginLR)
make.width.equalTo(70)
make.height.equalTo(iconWH)
}
......
......@@ -2,6 +2,7 @@
<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" initialViewController="Y6W-OH-hqX">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
......@@ -16,18 +17,16 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="In6-Ib-vMq">
<rect key="frame" x="0.0" y="0.33333333333331439" width="393" height="851.33333333333348"/>
<constraints>
<constraint firstAttribute="width" secondItem="In6-Ib-vMq" secondAttribute="height" multiplier="0.4618" id="pro-at-5R5"/>
</constraints>
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" red="0.0" green="0.50980392156862742" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="In6-Ib-vMq" firstAttribute="centerX" secondItem="5EZ-qb-Rvc" secondAttribute="centerX" id="Chj-38-1sF"/>
<constraint firstItem="In6-Ib-vMq" firstAttribute="width" secondItem="5EZ-qb-Rvc" secondAttribute="width" id="YGg-mA-X9M"/>
<constraint firstItem="In6-Ib-vMq" firstAttribute="centerY" secondItem="5EZ-qb-Rvc" secondAttribute="centerY" id="ZB8-n3-NkT"/>
<constraint firstAttribute="bottom" secondItem="In6-Ib-vMq" secondAttribute="bottom" id="Fxc-W0-tn1"/>
<constraint firstItem="In6-Ib-vMq" firstAttribute="top" secondItem="5EZ-qb-Rvc" secondAttribute="top" id="SWH-Pc-co8"/>
<constraint firstItem="In6-Ib-vMq" firstAttribute="trailing" secondItem="vDu-zF-Fre" secondAttribute="trailing" id="Ujk-gr-J7O"/>
<constraint firstItem="In6-Ib-vMq" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" id="X8d-PF-cLI"/>
</constraints>
</view>
<connections>
......
......@@ -12,10 +12,15 @@ class LauchVC:UIViewController {
@IBOutlet weak var backView: UIView!
lazy var LaunchingView:LottieAnimationView = {
let animationView = LottieAnimationView(name: "applicationLauncher")
private lazy var LaunchingView:LottieAnimationView = {
let animationView = LottieAnimationView(name: "AppLauncher")
animationView.loopMode = .playOnce
animationView.play()
return animationView
}()
private lazy var LaunchingLoop: LottieAnimationView = {
let animationView = LottieAnimationView(name: "Loading_white")
animationView.loopMode = .loop
animationView.play()
return animationView
......@@ -24,46 +29,37 @@ class LauchVC:UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
LaunchingView.frame = backView.bounds
backView.addSubview(LaunchingView)
DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: {
backView.addSubview(LaunchingLoop)
LaunchingView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview().offset(-80)
make.width.equalToSuperview().offset(-20)
make.height.equalTo(LaunchingView.snp.width).multipliedBy(276/504.0)
}
LaunchingLoop.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.centerY.equalToSuperview().offset(80)
}
DispatchQueue.main.asyncAfter(deadline: .now() + 3, execute: {
var vc:UIViewController?
if (UserDef.shard.isShowLanding) {
vc = HomeViewController()
}else {
let Ssoryboard = UIStoryboard(name: "PermissionVC", bundle: nil)
if let current = Ssoryboard.instantiateViewController(identifier: "PermissionVCID") as? PermissionVC {
vc = current
}
}
guard let vc else {return}
let nav = BaseNavViewController(rootViewController: vc)
cWindow?.rootViewController = nav
let transition = CATransition()
transition.duration = 0.5
// transition.type = CATransitionType.push // 推入动画
transition.subtype = CATransitionSubtype.fromRight // 从左侧推入
transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
// 添加动画到 window 的 layer
cWindow?.layer.add(transition, forKey: kCATransition)
// 显示 window
cWindow?.makeKeyAndVisible()
})
......
......@@ -403,11 +403,11 @@ extension HomeNoAdsViewController : UIScrollViewDelegate {
}
ppBtn.snp.makeConstraints { make in
make.top.equalTo(buybut.snp.bottom).offset(10)
make.left.equalToSuperview().offset(15)
make.left.equalTo(buybut)
}
restoreBtn.snp.makeConstraints { make in
make.centerY.equalTo(ppBtn)
make.right.equalTo(stack.snp.right).offset(-10)
make.right.equalTo(buybut.snp.right)
}
self.type = 0
self.view.layoutIfNeeded()
......
......@@ -107,28 +107,34 @@ class SecretViewController: BaseViewController {
}
private func deleteData() -> Void {
var delName:[String] = []
for idx in selectArray.allObjects {
guard let row:Int = idx as? Int else { return }
let name = dataSource[row]
delName.append(name)
}
"".delPhotoVideo(delName)
if selectArray.count > 0 {
selectArray.removeAllObjects()
var DelCallBlock = { [weak self] in
guard let self = self else { return }
var delName:[String] = []
for idx in self.selectArray.allObjects {
guard let row:Int = idx as? Int else { return }
let name = self.dataSource[row]
delName.append(name)
}
"".delPhotoVideo(delName)
if self.selectArray.count > 0 {
self.selectArray.removeAllObjects()
}
Print("删除成功")
self.dataSource = self.loadData()
self.bottomm.state = .add
}
Print("删除成功")
dataSource = loadData()
bottomm.state = .add
PMAlert("These photos or videos will be deleted from your private space" , ["Cancel","Delete"] , { alert, selectidx in
if selectidx == 1 {
DelCallBlock()
}
alert.dismiss(animated: true)
})
}
@objc private func lockTouch(_ sender:UIButton) -> Void {
if pass.count > 2 {
let set = SecretSetViewController()
set.secretType = .del
set.Callback = { bt in
}
self.navigationController?.pushViewController(set, animated: true)
}else{
let set = SecretSetViewController()
......
......@@ -60,10 +60,10 @@ func getSettingViewInfo() -> [SettingModel] {
[RowInfoModel(imageName: "ic_more_setting",title: "More Apps From Us")]),
SettingModel(sectionTitle: "UTILITIES",rowInfo:
[RowInfoModel(imageName: "ic_widgets_setting",title: "Widgets")]),
SettingModel(sectionTitle: "SECRET SPACE",rowInfo: [
RowInfoModel(imageName: "ic_pin_setting",title: "Use PIN")]),
// SettingModel(sectionTitle: "SECRET SPACE",rowInfo: [
// RowInfoModel(imageName: "ic_pin_setting",title: "Use PIN")]),
SettingModel(sectionTitle: "STAY IN TOUCH",rowInfo:
[RowInfoModel(imageName: "ic_rate_setting",title: "Rate App"),
RowInfoModel(imageName: "ic_share_setting",title: "Share App"),
RowInfoModel(imageName: "ic_ins_setting",title: "Follow on Instagram")])]
/*RowInfoModel(imageName: "ic_ins_setting",title: "Follow on Instagram")*/])]
}
......@@ -62,7 +62,7 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
let model : SettingModel = modelData![indexPath.section]
let detailModel : RowInfoModel = model.rowInfo[indexPath.row]
if indexPath.section == 3 {
if indexPath.section == 13 {
let cell : SettingSwitchCell = tableView.dequeueReusableCell(withIdentifier: "SettingSwitchCell",for: indexPath) as! SettingSwitchCell
cell.fLabel.text = detailModel.title
cell.logoView.image = UIImage(named: detailModel.imageName)
......@@ -155,8 +155,6 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
self.navigationController?.pushViewController(widget, animated: true)
break
case 3:
break
case 4:
if indexPath.row == 0 { // 评分
self.review()
}else if indexPath.row == 1 { // 分享
......
......@@ -39,7 +39,7 @@ class WidgetViewController: BaseViewController {
var widgetIdx = 0
widgetIdx = (widgets == .battery ? 0 : 1) * 10 + widgetMode
widgetAppgourp.share.PushWidgetData(widgetIdx, battery: Int(battery), storage: Int(storage))
alert("Set Widget Successfully")
PMAlert("Set Widget Successfully")
}
func setUI() -> Void {
......
......@@ -808,7 +808,7 @@ class SecretPhotoManager: NSObject, PhotoPickerControllerDelegate , CameraContro
func cameraController(_ cameraController: HXPhotoPicker.CameraController, didFinishWithResult result: HXPhotoPicker.CameraController.Result, phAsset: PHAsset?, location: CLLocation?) {
switch result {
case .image(let image):
image.compressImage(0.7) {[weak self] image in
image.compressImage(0.3) {[weak self] image in
let data = image.pngData()
guard self?.callback != nil else { return }
self?.callback!(0,data)
......
......@@ -55,15 +55,27 @@ func weekFormatter() -> String {
}
func alert(_ msg:String) -> Void {
func PMAlert(_ msg:String , _ action:[String] = [] , _ complate:@escaping(( UIAlertController ,Int)->Void) = { v , idx in} ) -> Void {
let alertview = UIAlertController(title: nil, message: msg, preferredStyle: .alert)
guard let root = cWindow?.rootViewController else { return }
root.present(alertview, animated: true)
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
alertview.dismiss(animated: true)
if action.count > 0 {
for (i,title) in action.enumerated() {
let action = UIAlertAction(title: title, style: .default) { action in
complate(alertview,i)
}
alertview.addAction(action)
}
}else{
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
alertview.dismiss(animated: true)
}
}
}
public func Print(_ items: Any...) {
#if DEBUG
......
......@@ -108,7 +108,7 @@ extension String {
pv(-1,UIImage.Clear())
return
}
icon.resizeAndCompressImage().compressImage(0.3) { image in
icon.compressImage(0.2) { image in
SecretImageCache.share.saveImageCache(self, image)
pv(-1,image)
}
......@@ -121,7 +121,7 @@ extension String {
do {
let cgImage = try imageGenerator.copyCGImage(at: CMTime(value: 0, timescale: 1), actualTime: nil)
let icon = UIImage(cgImage: cgImage);
icon.resizeAndCompressImage(0.3).compressImage(0.3) { image in
icon.compressImage(0.2) { image in
SecretImageCache.share.saveImageCache(self, image,CMTimeGetSeconds(duration))
pv(CMTimeGetSeconds(duration) ,image)
}
......
......@@ -64,24 +64,49 @@ struct SimpleEntry: TimelineEntry {
struct BatteryWidgetEntryView : View {
var entry: Provider.Entry
var body: some View {
ZStack {
Color(getwidgetStyle().backgound).ignoresSafeArea()
VStack {
HStack(alignment: .center) {
Text(getwidgetStyle().lText).frame(maxWidth: .infinity,maxHeight: .infinity,alignment: .topLeading).font(.system(size: 14)).foregroundColor(Color(getwidgetStyle().textColor))
VStack(alignment: .center, spacing: 2) {
Text(String(getwidgetStyle().Angle) + "%" ).frame(maxWidth: .infinity,maxHeight: .infinity,alignment: .topTrailing).font(.system(size: 14)).foregroundColor(Color(getwidgetStyle().textColor))
if entry.widgets / 10 == 1 {
Text("Used").frame(maxWidth: .infinity,alignment: .topTrailing).font(.system(size: 10)).foregroundColor(Color(getwidgetStyle().textColor)).padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 5))
if #available(iOSApplicationExtension 17.0, *) {
ZStack {
Color(getwidgetStyle().backgound).ignoresSafeArea()
VStack {
HStack(alignment: .center) {
Text(getwidgetStyle().lText).frame(maxWidth: .infinity,maxHeight: .infinity,alignment: .topLeading).font(.system(size: 14)).foregroundColor(Color(getwidgetStyle().textColor))
VStack(alignment: .center, spacing: 2) {
Text(String(getwidgetStyle().Angle) + "%" ).frame(maxWidth: .infinity,maxHeight: .infinity,alignment: .topTrailing).font(.system(size: 14)).foregroundColor(Color(getwidgetStyle().textColor))
if entry.widgets / 10 == 1 {
Text("Used").frame(maxWidth: .infinity,alignment: .topTrailing).font(.system(size: 10)).foregroundColor(Color(getwidgetStyle().textColor)).padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 5))
}
}
}
}
ZStack {
Image(getwidgetStyle().icon)
ArcShape(startAngle: .degrees(-90), endAngle: .degrees(getwidgetStyle().Angle/100.0 * 360.0 - 90.0), clockwise: false)
.stroke(Color(getwidgetStyle().LineColor), style: StrokeStyle(lineWidth: 5, lineCap: .round) )
}
}.padding(EdgeInsets(top: 16, leading: 10, bottom: 30, trailing: 10))
ZStack {
Image(getwidgetStyle().icon)
ArcShape(startAngle: .degrees(-90), endAngle: .degrees(getwidgetStyle().Angle/100.0 * 360.0 - 90.0), clockwise: false)
.stroke(Color(getwidgetStyle().LineColor), style: StrokeStyle(lineWidth: 5, lineCap: .round) )
}
}.padding(EdgeInsets(top: 16, leading: 10, bottom: 30, trailing: 10))
}
.containerBackground(for: .widget) {
Color(getwidgetStyle().backgound)
}
} else {
ZStack {
Color(getwidgetStyle().backgound).ignoresSafeArea()
VStack {
HStack(alignment: .center) {
Text(getwidgetStyle().lText).frame(maxWidth: .infinity,maxHeight: .infinity,alignment: .topLeading).font(.system(size: 14)).foregroundColor(Color(getwidgetStyle().textColor))
VStack(alignment: .center, spacing: 2) {
Text(String(getwidgetStyle().Angle) + "%" ).frame(maxWidth: .infinity,maxHeight: .infinity,alignment: .topTrailing).font(.system(size: 14)).foregroundColor(Color(getwidgetStyle().textColor))
if entry.widgets / 10 == 1 {
Text("Used").frame(maxWidth: .infinity,alignment: .topTrailing).font(.system(size: 10)).foregroundColor(Color(getwidgetStyle().textColor)).padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 5))
}
}
}
ZStack {
Image(getwidgetStyle().icon)
ArcShape(startAngle: .degrees(-90), endAngle: .degrees(getwidgetStyle().Angle/100.0 * 360.0 - 90.0), clockwise: false)
.stroke(Color(getwidgetStyle().LineColor), style: StrokeStyle(lineWidth: 5, lineCap: .round) )
}
}.padding(EdgeInsets(top: 16, leading: 10, bottom: 30, trailing: 10))
}
}
}
......@@ -150,5 +175,6 @@ struct BatteryWidget: Widget {
BatteryWidgetEntryView(entry: entry)
}.configurationDisplayName("").description("")
.supportedFamilies([.systemSmall , .systemMedium])
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment