mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
## Summary - standardize mobile sheets with shared spacing, close controls, action tiles, haptics, and motion - add uniform native concentric corners on iOS 26+ while preserving the Android sheet shape - refresh profile actions/status and normalize membership and huddle timeline spacing ## Validation - `just mobile-check` - `just mobile-test` (1,165 tests) - signed iPhone Release build and device install - Android debug build and Pixel 10 install ## Snapshots ### Channel actions  ### Profile card  --------- Signed-off-by: kenny lopez <klopez4212@gmail.com>
55 lines
1.6 KiB
Swift
55 lines
1.6 KiB
Swift
import Flutter
|
|
import UIKit
|
|
|
|
final class ConcentricSheetSurfaceFactory: NSObject, FlutterPlatformViewFactory {
|
|
func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol {
|
|
FlutterStandardMessageCodec.sharedInstance()
|
|
}
|
|
|
|
func create(
|
|
withFrame frame: CGRect,
|
|
viewIdentifier viewId: Int64,
|
|
arguments args: Any?
|
|
) -> FlutterPlatformView {
|
|
ConcentricSheetSurfacePlatformView(frame: frame, arguments: args)
|
|
}
|
|
}
|
|
|
|
final class ConcentricSheetSurfacePlatformView: NSObject, FlutterPlatformView {
|
|
private let surfaceView: UIView
|
|
|
|
init(frame: CGRect, arguments args: Any?) {
|
|
let arguments = args as? [String: Any]
|
|
let colorValue = (arguments?["color"] as? NSNumber)?.uint32Value ?? 0xFFFFFFFF
|
|
let minimumRadius = (arguments?["minimumRadius"] as? NSNumber)?.doubleValue ?? 24
|
|
|
|
surfaceView = UIView(frame: frame)
|
|
surfaceView.isOpaque = true
|
|
surfaceView.backgroundColor = Self.color(from: colorValue)
|
|
surfaceView.clipsToBounds = true
|
|
surfaceView.layer.cornerCurve = .continuous
|
|
|
|
if #available(iOS 26.0, *) {
|
|
surfaceView.cornerConfiguration = .uniformCorners(
|
|
radius: .containerConcentric(minimum: minimumRadius)
|
|
)
|
|
} else {
|
|
surfaceView.layer.cornerRadius = minimumRadius
|
|
}
|
|
|
|
super.init()
|
|
}
|
|
|
|
func view() -> UIView {
|
|
surfaceView
|
|
}
|
|
|
|
private static func color(from value: UInt32) -> UIColor {
|
|
let alpha = CGFloat((value >> 24) & 0xFF) / 255
|
|
let red = CGFloat((value >> 16) & 0xFF) / 255
|
|
let green = CGFloat((value >> 8) & 0xFF) / 255
|
|
let blue = CGFloat(value & 0xFF) / 255
|
|
return UIColor(red: red, green: green, blue: blue, alpha: alpha)
|
|
}
|
|
}
|