[AltStore] Adds redesigned MyAppsViewController to refresh/update installed apps

This commit is contained in:
Riley Testut
2019-07-19 16:42:40 -07:00
parent 7f85d73857
commit 711dd69b74
21 changed files with 1069 additions and 844 deletions

View File

@@ -17,6 +17,8 @@ class AppIconImageView: UIImageView
self.contentMode = .scaleAspectFill
self.clipsToBounds = true
self.backgroundColor = .white
self.layer.borderWidth = 0.5
self.layer.borderColor = UIColor.lightGray.cgColor

View File

@@ -1,5 +1,5 @@
//
// ProgressButton.swift
// PillButton.swift
// AltStore
//
// Created by Riley Testut on 7/15/19.
@@ -8,12 +8,16 @@
import UIKit
class ProgressButton: UIButton
class PillButton: UIButton
{
var progress: Progress? {
didSet {
didSet {
self.progressView.progress = Float(self.progress?.fractionCompleted ?? 0)
self.progressView.observedProgress = self.progress
let isUserInteractionEnabled = self.isUserInteractionEnabled
self.isIndicatingActivity = (self.progress != nil)
self.isUserInteractionEnabled = isUserInteractionEnabled
}
}
@@ -26,12 +30,18 @@ class ProgressButton: UIButton
}
}
var isInverted: Bool = false {
didSet {
self.update()
}
}
private let progressView = UIProgressView(progressViewStyle: .default)
override var intrinsicContentSize: CGSize {
var size = super.intrinsicContentSize
size.width += 32
size.height += 4
size.width += 26
size.height += 3
return size
}
@@ -41,10 +51,15 @@ class ProgressButton: UIButton
self.layer.masksToBounds = true
self.activityIndicatorView.style = .white
self.activityIndicatorView.isUserInteractionEnabled = false
self.progressView.progress = 0
self.progressView.trackImage = UIImage()
self.progressView.isUserInteractionEnabled = false
self.addSubview(self.progressView)
self.update()
}
override func layoutSubviews()
@@ -60,4 +75,30 @@ class ProgressButton: UIButton
self.layer.cornerRadius = self.bounds.midY
}
override func tintColorDidChange()
{
super.tintColorDidChange()
self.update()
}
}
private extension PillButton
{
func update()
{
if self.isInverted
{
self.setTitleColor(.white, for: .normal)
self.backgroundColor = self.tintColor
self.progressView.progressTintColor = self.tintColor.withAlphaComponent(0.15)
}
else
{
self.setTitleColor(self.tintColor, for: .normal)
self.backgroundColor = self.tintColor.withAlphaComponent(0.15)
self.progressView.progressTintColor = self.tintColor
}
}
}

View File

@@ -0,0 +1,19 @@
//
// ToastView.swift
// AltStore
//
// Created by Riley Testut on 7/19/19.
// Copyright © 2019 Riley Testut. All rights reserved.
//
import Roxas
class ToastView: RSTToastView
{
override func layoutSubviews()
{
super.layoutSubviews()
self.layer.cornerRadius = self.bounds.midY
}
}