ios: fix media input sizing and playback progress
All checks were successful
TestFlight / testflight (push) Successful in 1m24s
All checks were successful
TestFlight / testflight (push) Successful in 1m24s
This commit is contained in:
@@ -50,8 +50,9 @@ struct RequestBuilder
|
||||
}
|
||||
|
||||
public func build() -> URLRequest {
|
||||
var request = URLRequest(url: self.url)
|
||||
var request = URLRequest(url: self.url, cachePolicy: .reloadIgnoringLocalCacheData)
|
||||
request.httpMethod = self.httpMethod.rawValue
|
||||
request.setValue("no-cache", forHTTPHeaderField: "Cache-Control")
|
||||
if let body {
|
||||
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
|
||||
request.httpBody = body
|
||||
|
||||
@@ -20,12 +20,14 @@ struct AddMediaView: View
|
||||
AutofocusingTextField(String(localized: "ADD_ANY_URL"), text: $model.fieldContents)
|
||||
.autocapitalization(.none)
|
||||
.autocorrectionDisabled()
|
||||
.frame(minWidth: 0.0, maxWidth: .infinity)
|
||||
|
||||
PasteButton(payloadType: String.self) { payload in
|
||||
guard let contents = payload.first else { return }
|
||||
model.fieldContents = contents
|
||||
}
|
||||
.labelStyle(.iconOnly)
|
||||
.fixedSize()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,6 +100,7 @@ struct SearchMediaView: View
|
||||
|
||||
AutofocusingTextField(String(localized: "SEARCH_FOR_MEDIA"), text: $searchText, onSubmit: performSearch)
|
||||
.focused($searchFieldFocused)
|
||||
.frame(minWidth: 0.0, maxWidth: .infinity)
|
||||
|
||||
if !searchText.isEmpty {
|
||||
Button {
|
||||
|
||||
@@ -29,6 +29,8 @@ struct AutofocusingTextField: UIViewRepresentable
|
||||
tf.delegate = context.coordinator
|
||||
tf.returnKeyType = .done
|
||||
tf.setContentHuggingPriority(.defaultHigh, for: .vertical)
|
||||
tf.setContentHuggingPriority(.defaultLow, for: .horizontal)
|
||||
tf.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
||||
tf.autocorrectionType = .no
|
||||
tf.autocapitalizationType = .none
|
||||
return tf
|
||||
@@ -64,6 +66,12 @@ struct AutofocusingTextField: UIViewRepresentable
|
||||
}
|
||||
|
||||
final class FirstResponderTextField: UITextField {
|
||||
override var intrinsicContentSize: CGSize {
|
||||
var size = super.intrinsicContentSize
|
||||
size.width = UIView.noIntrinsicMetric
|
||||
return size
|
||||
}
|
||||
|
||||
override func didMoveToSuperview() {
|
||||
super.didMoveToSuperview()
|
||||
becomeFirstResponder()
|
||||
|
||||
@@ -20,6 +20,7 @@ struct NowPlayingMiniView: View {
|
||||
|
||||
var body: some View {
|
||||
let playPauseImageName = model.isPlaying ? "pause.fill" : "play.fill"
|
||||
let containerShape = RoundedRectangle(cornerRadius: 12.0, style: .continuous)
|
||||
let tapGesture = DragGesture(minimumDistance: 0)
|
||||
.updating($tapGestureState) { _, state, _ in
|
||||
state = true
|
||||
@@ -67,10 +68,11 @@ struct NowPlayingMiniView: View {
|
||||
}
|
||||
}
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 12)
|
||||
containerShape
|
||||
.fill(tapGestureState ? .ultraThinMaterial : .bar)
|
||||
.stroke(.ultraThinMaterial, lineWidth: 1.0)
|
||||
)
|
||||
.clipShape(containerShape)
|
||||
.shadow(color: .black.opacity(0.15), radius: 14.0, y: 2.0)
|
||||
.gesture(tapGesture)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user