mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-19 03:33:36 +01:00
Improved app detail view
This commit is contained in:
@@ -30,3 +30,9 @@ struct AppIconView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension AppIconView: Equatable {
|
||||||
|
/// Prevent re-rendering of the view if the parameters didn't change
|
||||||
|
static func == (lhs: AppIconView, rhs: AppIconView) -> Bool {
|
||||||
|
lhs.iconUrl == rhs.iconUrl && lhs.cornerRadius == rhs.cornerRadius
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ struct AppDetailView: View {
|
|||||||
let headerViewHeight: CGFloat = 140
|
let headerViewHeight: CGFloat = 140
|
||||||
let permissionColumns = 4
|
let permissionColumns = 4
|
||||||
|
|
||||||
|
var headerBlurRadius: CGFloat {
|
||||||
|
min(20, max(0, 20 - (scrollOffset / -150) * 20))
|
||||||
|
}
|
||||||
var isHeaderViewVisible: Bool {
|
var isHeaderViewVisible: Bool {
|
||||||
scrollOffset < headerViewHeight + 12
|
scrollOffset < headerViewHeight + 12
|
||||||
}
|
}
|
||||||
@@ -78,8 +81,10 @@ struct AppDetailView: View {
|
|||||||
ZStack(alignment: .center) {
|
ZStack(alignment: .center) {
|
||||||
GeometryReader { proxy in
|
GeometryReader { proxy in
|
||||||
AppIconView(iconUrl: storeApp.iconURL, size: proxy.frame(in: .global).width)
|
AppIconView(iconUrl: storeApp.iconURL, size: proxy.frame(in: .global).width)
|
||||||
.blur(radius: 20)
|
.blur(radius: headerBlurRadius)
|
||||||
|
.offset(y: min(0, scrollOffset))
|
||||||
}
|
}
|
||||||
|
.padding()
|
||||||
|
|
||||||
AppRowView(app: storeApp)
|
AppRowView(app: storeApp)
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ struct AppPermissionGridItemView: View {
|
|||||||
Image(uiImage: (permission.type.icon?.withRenderingMode(.alwaysTemplate) ?? UIImage(systemName: "questionmark"))!) // TODO: Replace with system icon
|
Image(uiImage: (permission.type.icon?.withRenderingMode(.alwaysTemplate) ?? UIImage(systemName: "questionmark"))!) // TODO: Replace with system icon
|
||||||
.padding()
|
.padding()
|
||||||
.background(Circle().foregroundColor(Color(.secondarySystemBackground)))
|
.background(Circle().foregroundColor(Color(.secondarySystemBackground)))
|
||||||
Text(permission.type.localizedShortName ?? "")
|
Text(permission.type.localizedShortName ?? permission.type.localizedName ?? "")
|
||||||
}
|
}
|
||||||
.foregroundColor(.primary)
|
.foregroundColor(.primary)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user