Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: #94,#97,#99 #95

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Fix: #94,#97,#99 #95

wants to merge 9 commits into from

Conversation

gzlboy
Copy link
Contributor

@gzlboy gzlboy commented Sep 16, 2024

Fix: When the recording duration is too long (for example, 2 minutes), the waveform view exceeds the screen width.
Fix:Only one audio should be played at the same time.
New feature: add copy button to message action menu
New feature: supports audio play progress dragging.
New feature: support localizable.

…, the waveform view exceeds the screen width.
@gzlboy gzlboy changed the title Fix: #94 Fix: #94,#97 Sep 17, 2024
@@ -12,6 +12,9 @@ struct RecordWaveformWithButtons: View {
@Environment(\.chatTheme) private var theme

@StateObject var recordPlayer = RecordingPlayer()
//160 is screen left-padding/right-padding and playButton's width.
//To ensure that the view does not exceed the screen, need to subtract
static let viewPadding:CGFloat = 160
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can you guarantee that this will always be 160? you should pass this value using frame getters from wherever it is set in

@@ -53,20 +56,29 @@ struct RecordWaveformWithButtons: View {
}

struct RecordWaveformPlaying: View {

Copy link
Collaborator

@f3dm76 f3dm76 Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please preserve the selected code style, namely:

  • do not add extra spaces (Xcode > Preferences > Text Editing > While editing > Automatically trim trailing whitespaces+Including whitespace-only lines)
  • do not add extra \n like here:
var body: some View {

        GeometryReader { g in
  • after // there should be a space
  • after // there is a small letter
    // ensure that the view does not exceed the screen
  • viewPadding:CGFloat - there should be a space here: "viewPadding: CGFloat"
  • there should be a \n between these lines:
@StateObject var recordPlayer = RecordingPlayer()
//160 is screen left-padding/right-padding and playButton's width.

@f3dm76
Copy link
Collaborator

f3dm76 commented Sep 17, 2024

Hey @gzlboy, thank you so much, this looks great, just please fix some formatting issues and a constant. Have a great day!

@gzlboy gzlboy changed the title Fix: #94,#97 Fix: #94,#97,#99 Sep 18, 2024
@gzlboy
Copy link
Contributor Author

gzlboy commented Sep 19, 2024

New feature: support localizable.

@gzlboy
Copy link
Contributor Author

gzlboy commented Sep 19, 2024

hi @f3dm76 alisa, please help me check the code. I am going to use the latest code in the project. Thank you very much!
Have a nice day!

@f3dm76
Copy link
Collaborator

f3dm76 commented Sep 19, 2024

Sorry, I don't have time for this, I am busy on a project. In any case 160 has to be removed before I can merge this.

@gzlboy
Copy link
Contributor Author

gzlboy commented Sep 19, 2024

Sorry, I don't have time for this, I am busy on a project. In any case 160 has to be removed before I can merge this.

Understood, I try again:(
Have a nice day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants