-
Notifications
You must be signed in to change notification settings - Fork 535
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 part of #130: Cellular data alert in audio player #146
Conversation
@BenHenning @jamesxu0 PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM @rt4914--can you also add tests to verify that the dialogs at least appear? I know we can't fully flesh out the behavioral aspects of when they should show up, but ideally if they are always showing then these tests will fail once the real domain implementations are added, and then we'll need to update them accordingly.
app/src/main/java/org/oppia/app/player/audio/CellularDataDialogFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/app/player/audio/CellularDataDialogFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/app/player/audio/CellularDataInterface.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/app/player/audio/CellularDataDialogFragment.kt
Outdated
Show resolved
Hide resolved
Test case done. This test case checks the entire flow of the audio component from showing |
@BenHenning PTAL
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just did a really quick glance, but didn't deep-dive yet. Got a bit tired all of a sudden, so I'll take a closer look at this later.
@jamesxu0 could you please give this PR a pass tomorrow?
app/src/main/java/org/oppia/app/player/audio/CellularDataDialogFragment.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rt4914! Did a more thorough pass on this. PTAL at comments.
app/src/main/java/org/oppia/app/player/audio/CellularDataDialogFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/app/player/audio/CellularDataDialogFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/app/player/audio/CellularDataInterface.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/app/player/audio/LanguageDialogFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/app/player/audio/LanguageDialogFragment.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/app/player/audio/CellularDataDialogFragmentTest.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/app/player/audio/CellularDataDialogFragmentTest.kt
Show resolved
Hide resolved
languageList.add("hi-en") | ||
} | ||
var selectedIndex = arguments!!.getInt(KEY_SELECTED_INDEX, 0) | ||
val languageArrayList: ArrayList<String> = arguments?.getStringArrayList(KEY_LANGUAGE_LIST) as ArrayList<String> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this cast needed? It seems superfluous since getStringArrayList() returns ArrayList.
Also, the ?.
operator needed here? I think you can avoid it by saving arguments locally:
val args = checkNotNull(arguments) { "Expected arguments to be pass to LanguageDialogFragment" }
// args can now be used without the nullability considerations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding extra cast:
val languageArrayList: ArrayList<String> = args.getStringArrayList(KEY_LANGUAGE_LIST) as ArrayList<String>
If we do not add this extra cast then there is type mismatch warning
Added this line:
val args = checkNotNull(arguments) { "Expected arguments to be pass to LanguageDialogFragment" }
app/src/main/java/org/oppia/app/player/audio/CellularDataDialogFragment.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rt4914! Generally LGTM, but I think there are still some earlier unresolved comments. Can you please take a look at those & address them? I'm specifically interested in the request for additional tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the remaining changes are trivial, feel free to submit once they're resolved (changing the fragment manager & adding the remaining 2 test cases).
Thanks @BenHenning for regular and prompt reviews. I have replaced Also, working on test-cases now. |
Final task of adding test-cases has been done, therefore, merging this PR now. |
Explanation
This PR contains the code for cellular data alert. Currently the code does not save user preference to storage.
Output (low-fi)
Checklist