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

#58 Add a pause between each paragraph #89

Merged
merged 3 commits into from
Sep 15, 2021

Conversation

gscdev
Copy link
Member

@gscdev gscdev commented Sep 8, 2021

No description provided.

@gscdev gscdev requested review from jo-elimu and nya-elimu September 8, 2021 22:18
@gscdev gscdev requested a review from a team as a code owner September 8, 2021 22:18
nya-elimu
nya-elimu previously approved these changes Sep 9, 2021
private StoryBookChapterGson storyBookChapter;

protected String chapterText = "";
protected String[] chapterText = {};
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps rename to chapterParagraphs?

@@ -200,7 +199,7 @@ public void onClick(View view) {
});
}

public void playAudio(final String chapterText, final AudioListener audioListener) {
public void playAudio(final String[] chapterText, final AudioListener audioListener) {
List<StoryBookParagraphGson> storyBookParagraphs = storyBookChapter.getStoryBookParagraphs();
StoryBookParagraphGson storyBookParagraphGson = storyBookParagraphs.get(0);
Copy link
Member

Choose a reason for hiding this comment

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

It looks like we have hardcoded a selection of only the first paragraph, which is probably the audio is not being played correctly for chapters containing more than 1 paragraph.

I created a separate issue for this here: #90

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll take that issue

Copy link
Member

Choose a reason for hiding this comment

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

I'll take that issue

@gscdev Great, thank you! 🙂

@@ -189,7 +188,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
super.onViewCreated(view, savedInstanceState);

// Add button for initializing Text-to-Speech (TTS)
final String finalChapterText = chapterText;
final String[] finalChapterText = chapterText;
Copy link
Member

Choose a reason for hiding this comment

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

finalChapterText might be mistaken for meaning "the final text of this chapter", so perhaps we should rename this variable?

nya-elimu
nya-elimu previously approved these changes Sep 10, 2021
@@ -61,7 +61,7 @@

private StoryBookChapterGson storyBookChapter;

protected String[] chapterText = {};
protected String[] chapterParagraph = {};
Copy link
Member

Choose a reason for hiding this comment

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

And perhaps make the name plural, since it's an array?

Suggested change
protected String[] chapterParagraph = {};
protected String[] chapterParagraphs = {};

@@ -54,19 +54,19 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
int[] titleFontSize = getResources().getIntArray(R.array.cover_title_font_size);
int[] descriptionFontSize = getResources().getIntArray(R.array.chapter_text_font_size);

for (int i=0; i<chapterText.length; i++) {
chapterText[i] = setWordSpacing(chapterText[i]);
for (int i=0; i<chapterParagraph.length; i++) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
for (int i=0; i<chapterParagraph.length; i++) {
for (int i = 0; i < chapterParagraph.length; i++) {

jo-elimu
jo-elimu previously approved these changes Sep 10, 2021
@gscdev gscdev dismissed stale reviews from jo-elimu and nya-elimu via 103f3ed September 14, 2021 21:59
Copy link
Member

@nya-elimu nya-elimu left a comment

Choose a reason for hiding this comment

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

Ready to be merged 👍

@gscdev gscdev merged commit 7f17445 into master Sep 15, 2021
@gscdev gscdev deleted the 58-Play-chapters-audio-recordings-when-FAB-is-pressed branch September 15, 2021 21:20
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.

3 participants