Fix EditContactFragment view and allow '+' in number dialer

This commit is contained in:
Benoit Martins 2025-09-26 15:57:07 +02:00
parent 3b2ce2ed4b
commit a33a8666ae
2 changed files with 22 additions and 28 deletions

View file

@ -29,6 +29,7 @@ struct EditContactFragment: View {
@State private var orientation = UIDevice.current.orientation
@StateObject private var editContactViewModel: EditContactViewModel
@StateObject private var keyboard = KeyboardResponder()
@Binding var isShowEditContactFragment: Bool
@Binding var isShowDismissPopup: Bool
@ -356,10 +357,8 @@ struct EditContactFragment: View {
.padding(.all, 10)
}
.disabled(editContactViewModel.sipAddresses[index].isEmpty && index == editContactViewModel.sipAddresses.count - 1)
.frame(maxHeight: .infinity)
}
}
}
.padding(.bottom)
@ -373,20 +372,12 @@ struct EditContactFragment: View {
TextField("phone_number", text: $editContactViewModel.phoneNumbers[index])
.default_text_style(styleSize: 15)
.textContentType(.oneTimeCode)
.keyboardType(.numberPad)
.keyboardType(.phonePad)
.frame(height: 25)
.padding(.horizontal, 20)
.padding(.vertical, 15)
.background(.white)
.cornerRadius(60)
.toolbar {
ToolbarItemGroup(placement: .keyboard) {
Spacer()
Button("Done") {
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
}
}
}
.overlay(
RoundedRectangle(cornerRadius: 60)
.inset(by: 0.5)
@ -417,12 +408,10 @@ struct EditContactFragment: View {
.padding(.all, 10)
}
.disabled(editContactViewModel.phoneNumbers[index].isEmpty && index == editContactViewModel.phoneNumbers.count - 1)
.frame(maxHeight: .infinity)
}
.zIndex(isPhoneNumberFocused == index ? 1 : 0)
.transition(.move(edge: .top))
}
}
.padding(.bottom)

View file

@ -1062,17 +1062,22 @@ struct ContentView: View {
}
if isShowEditContactFragment {
VStack {
EditContactFragment(
isShowEditContactFragment: $isShowEditContactFragment,
isShowDismissPopup: $isShowDismissPopup,
isShowEditContactFragmentAddress: isShowEditContactFragmentAddress
)
.zIndex(3)
.transition(.opacity.combined(with: .move(edge: .bottom)))
.frame(height: geometry.size.height)
.onAppear {
sharedMainViewModel.displayedFriend = nil
isShowEditContactFragmentAddress = ""
}
Spacer()
}
.zIndex(3)
.transition(.opacity.combined(with: .move(edge: .bottom)))
}
if isShowStartCallFragment {