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