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 #259 and part of #163: Finish state fragment UI structure #270

Merged
merged 275 commits into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
275 commits
Select commit Hold shift + click to select a range
6b3daed
nit changes
nikitamarysolomanpvt Oct 10, 2019
b0fa8b4
nit changes
nikitamarysolomanpvt Oct 10, 2019
ce34219
nit changes
nikitamarysolomanpvt Oct 10, 2019
6755d5c
numericInputTypeView test case is in progress
nikitamarysolomanpvt Oct 11, 2019
acff28d
numericInputTypeView test case is in progress
nikitamarysolomanpvt Oct 11, 2019
7fb5ea4
nit changes as per #223
nikitamarysolomanpvt Oct 11, 2019
ba3be9b
nit changes as per #223
nikitamarysolomanpvt Oct 11, 2019
fe5ab82
working on fetching customization_args
veena14cs Oct 11, 2019
b474a73
On configuration changes save and restore the text of numericInputType
nikitamarysolomanpvt Oct 11, 2019
e45fb0a
Update StateFragmentPresenter.kt
veena14cs Oct 11, 2019
86dc073
resolved conflicts
veena14cs Oct 11, 2019
c6bbfdb
Separated this in its own PR
veena14cs Oct 11, 2019
0edaca1
Delete UrlImageParser.kt
veena14cs Oct 11, 2019
9f02fba
Update StateFragmentPresenter.kt
veena14cs Oct 11, 2019
af8610b
Update build.gradle
veena14cs Oct 11, 2019
5039d84
Create HtmlParser.kt
veena14cs Oct 11, 2019
aed513e
Update HtmlParser.kt
veena14cs Oct 11, 2019
ee29f6c
Update HtmlParser.kt
veena14cs Oct 11, 2019
fc60566
Test Cases for NumericInputInteractionView,
nikitamarysolomanpvt Oct 11, 2019
9e5dc2e
Test Cases for NumericInputInteractionView,
nikitamarysolomanpvt Oct 14, 2019
a7ef482
PR suggestions updated
nikitamarysolomanpvt Oct 14, 2019
69b0b8c
PR suggestions updated
nikitamarysolomanpvt Oct 14, 2019
3578a0c
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
nikitamarysolomanpvt Oct 14, 2019
e7a6411
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
nikitamarysolomanpvt Oct 14, 2019
5d1c769
nit changes as per PR review
nikitamarysolomanpvt Oct 14, 2019
ed31dd5
nit changes as per PR review
nikitamarysolomanpvt Oct 14, 2019
65c41ca
nit changes as per PR review
nikitamarysolomanpvt Oct 15, 2019
5d4db81
nit changes as per PR review
nikitamarysolomanpvt Oct 15, 2019
a56e298
Update HtmlParser.kt
veena14cs Oct 15, 2019
fed8c7f
Number input test Activity test cases
nikitamarysolomanpvt Oct 15, 2019
ac13a74
nit changes
nikitamarysolomanpvt Oct 15, 2019
cce10c1
nit changes
nikitamarysolomanpvt Oct 15, 2019
41650b4
nit changes
nikitamarysolomanpvt Oct 15, 2019
0664bc6
nit changes
nikitamarysolomanpvt Oct 15, 2019
f55b8a8
nit changes
nikitamarysolomanpvt Oct 15, 2019
e652e42
nit changes
nikitamarysolomanpvt Oct 15, 2019
30f7ce0
nit changes
nikitamarysolomanpvt Oct 15, 2019
1737a33
nit changes
nikitamarysolomanpvt Oct 15, 2019
9920380
nit changes
nikitamarysolomanpvt Oct 15, 2019
7b86a0c
nit changes
nikitamarysolomanpvt Oct 15, 2019
46d37e6
nit changes
nikitamarysolomanpvt Oct 15, 2019
107e154
setReal type in getPendingAnswer
nikitamarysolomanpvt Oct 16, 2019
b7a406f
updated test cases, disabled long click to prevent pasting value
nikitamarysolomanpvt Oct 16, 2019
3b6c56d
nit changes
nikitamarysolomanpvt Oct 16, 2019
3b7a01f
Merge branches 'develop' and 'text-input-lowfi-numeric-input-interact…
nikitamarysolomanpvt Oct 16, 2019
326d3a9
nit changes
nikitamarysolomanpvt Oct 16, 2019
3aa6724
nit changes
nikitamarysolomanpvt Oct 16, 2019
7f51265
nit changes
nikitamarysolomanpvt Oct 16, 2019
a3cbe65
nit changes
nikitamarysolomanpvt Oct 16, 2019
6c18922
nit changes
nikitamarysolomanpvt Oct 16, 2019
eda21ad
nit changes
nikitamarysolomanpvt Oct 16, 2019
b72961c
nit changes
nikitamarysolomanpvt Oct 16, 2019
ade8a73
nit changes
nikitamarysolomanpvt Oct 16, 2019
0f033d9
NumericInputInteractionViewTestActivity renamed to InputInteractionVi…
nikitamarysolomanpvt Oct 16, 2019
b4fc329
nit changes
nikitamarysolomanpvt Oct 16, 2019
f4f037b
working on testcases
veena14cs Oct 16, 2019
966f84d
nit changes
nikitamarysolomanpvt Oct 16, 2019
0b82bbf
nit changes
nikitamarysolomanpvt Oct 17, 2019
d35ceda
Update HtmlParserTestActivty.kt
veena14cs Oct 17, 2019
03b4e1a
Update HtmlParserTestActivty.kt
veena14cs Oct 17, 2019
3e46d44
added testcases.
veena14cs Oct 17, 2019
1e76982
Update AndroidManifest.xml
veena14cs Oct 17, 2019
2cbf7a0
Update InteractionAdapter.kt
veena14cs Oct 17, 2019
4cfd636
Update InteractionAdapter.kt
veena14cs Oct 17, 2019
eac6442
Update HtmlParser.kt
veena14cs Oct 17, 2019
bd070c7
corrected variable names.
veena14cs Oct 17, 2019
c051b56
updated variables.
veena14cs Oct 17, 2019
83c09a1
Update HtmlParser.kt
veena14cs Oct 17, 2019
8e5328e
Update HtmlParser.kt
veena14cs Oct 17, 2019
8cded3a
Merge branch 'develop' into introduce-image-parser-replica
veena14cs Oct 17, 2019
cff9dd8
Update HtmlParserTestActivty.kt
veena14cs Oct 17, 2019
76c136a
Update HtmlParser.kt
veena14cs Oct 17, 2019
7a3085f
Merge branch 'develop' into introduce-html-parser
veena14cs Oct 17, 2019
84aa993
Delete InteractionAdapter.kt
veena14cs Oct 17, 2019
80ecb88
deteted unused xml files
veena14cs Oct 17, 2019
c7af4d6
Merge branch 'introduce-html-parser' into introduce-image-parser-replica
veena14cs Oct 17, 2019
a69585e
merged html code.
veena14cs Oct 17, 2019
84efb79
Update HtmlParser.kt
veena14cs Oct 17, 2019
0ed8224
Merge branch 'introduce-html-parser' into introduce-image-parser-replica
veena14cs Oct 17, 2019
6cd8df8
Delete UrlImageParserTest.kt
veena14cs Oct 17, 2019
b195069
used dagger injection for UrlImageParser.
veena14cs Oct 17, 2019
44fcd0c
Update HtmlParserTestActivty.kt
veena14cs Oct 17, 2019
f4eb529
Merge branch 'introduce-html-parser' into introduce-image-parser-replica
veena14cs Oct 17, 2019
483ca5d
Update HtmlParserTestActivty.kt
veena14cs Oct 17, 2019
f38ae47
Update HtmlParser.kt
veena14cs Oct 17, 2019
7babef9
Update HtmlParserTestActivty.kt
veena14cs Oct 17, 2019
2c25558
updated tests
veena14cs Oct 17, 2019
074f1c4
updated test
veena14cs Oct 18, 2019
160ab10
moved to testing package
veena14cs Oct 18, 2019
df6c78f
Merge branch 'introduce-html-parser' into introduce-image-parser-replica
veena14cs Oct 18, 2019
8cec9ad
Update HtmlParserTestActivty.kt
veena14cs Oct 18, 2019
ee6c427
Update HtmlParserTestActivty.kt
veena14cs Oct 18, 2019
8b3649f
fix issues
veena14cs Oct 18, 2019
0f96296
fix issues.
veena14cs Oct 18, 2019
b68e7bd
fixed issues
veena14cs Oct 18, 2019
b29d4ec
fixed issues.
veena14cs Oct 18, 2019
dff9130
Update activity_test_html_parser.xml
veena14cs Oct 18, 2019
e4c936d
fixes
veena14cs Oct 18, 2019
1ce598b
fixes
veena14cs Oct 18, 2019
ad66f23
Update HtmlParserTest.kt
veena14cs Oct 18, 2019
717b3f9
Update HtmlParserTest.kt
veena14cs Oct 18, 2019
0582d60
fixed issues.
veena14cs Oct 18, 2019
719a4db
nit
nikitamarysolomanpvt Oct 18, 2019
a910156
fixing issues.
veena14cs Oct 18, 2019
371a2b9
made use of factory
veena14cs Oct 18, 2019
b77419c
Update HtmlParserTest.kt
veena14cs Oct 18, 2019
09f5178
Update UrlImageParser.kt
veena14cs Oct 18, 2019
5a874c2
Update AndroidManifest.xml
veena14cs Oct 18, 2019
494714d
Update HtmlParserTestActivity.kt
veena14cs Oct 18, 2019
7fc2ff3
nit
veena14cs Oct 18, 2019
1fdce58
Update AudioFragmentTest.kt
veena14cs Oct 18, 2019
76e4271
updated
veena14cs Oct 18, 2019
52bec40
Merge branch 'introduce-image-parser-replica' of https://github.com/o…
veena14cs Oct 18, 2019
cbad1f1
fixes
veena14cs Oct 18, 2019
b8d8881
Update UrlImageParser.kt
veena14cs Oct 18, 2019
eff05b6
Not used in this.
veena14cs Oct 18, 2019
8464de6
fixes
veena14cs Oct 18, 2019
134fe98
Merge branch 'introduce-image-parser-replica' of https://github.com/o…
veena14cs Oct 18, 2019
c47ae67
Merge branch 'introduce-html-parser' into introduce-image-parser-replica
veena14cs Oct 18, 2019
ed04ac7
Not used.
veena14cs Oct 18, 2019
944f25e
Update CellularDataDialogFragmentTest.kt
veena14cs Oct 18, 2019
64cd6a1
Merge branch 'develop' into introduce-image-parser-replica
veena14cs Oct 18, 2019
c02df0b
reverted
veena14cs Oct 18, 2019
6dc9cb8
Update CellularDataDialogFragmentTest.kt
veena14cs Oct 18, 2019
88175d2
fixes
veena14cs Oct 18, 2019
7897368
Update ImageLoader.kt
veena14cs Oct 18, 2019
dd9163b
NumericInputInteractionView attributes are moved to xml,testcases upd…
nikitamarysolomanpvt Oct 18, 2019
2dc617b
Update HtmlParser.kt
veena14cs Oct 18, 2019
910ec00
NumericInputInteractionView attributes are moved to xml,testcases upd…
nikitamarysolomanpvt Oct 18, 2019
d64f763
Update HtmlParser.kt
veena14cs Oct 18, 2019
199094a
Update build.gradle
veena14cs Oct 18, 2019
b8eed4c
fixed issues.
veena14cs Oct 18, 2019
e914116
Update UrlImageParser.kt
veena14cs Oct 18, 2019
c315a28
Update UrlImageParser.kt
veena14cs Oct 18, 2019
4b95f16
Update UrlImageParser.kt
veena14cs Oct 18, 2019
ed1cc3f
Update ImageParsingAnnotations.kt
veena14cs Oct 18, 2019
d20c12e
TextInputInteractionView
nikitamarysolomanpvt Oct 18, 2019
5e67f9c
working on image loader
veena14cs Oct 18, 2019
0008248
Injected ImageLoader
veena14cs Oct 18, 2019
62d4a70
updated image loader.
veena14cs Oct 18, 2019
4070307
Update ActivityComponent.kt
veena14cs Oct 18, 2019
cfd1816
Update HtmlParserTestActivity.kt
veena14cs Oct 18, 2019
2bc3292
TextInputInteractionView
nikitamarysolomanpvt Oct 19, 2019
1c70849
test cases
nikitamarysolomanpvt Oct 20, 2019
d2c070a
nit
nikitamarysolomanpvt Oct 20, 2019
ce6a48d
nit
nikitamarysolomanpvt Oct 21, 2019
066b389
nit
nikitamarysolomanpvt Oct 21, 2019
d3fa576
nit
nikitamarysolomanpvt Oct 21, 2019
8784d76
nit
nikitamarysolomanpvt Oct 21, 2019
8c267e2
Merge branches 'develop' and 'lowfi-input-interaction-views' of https…
nikitamarysolomanpvt Oct 21, 2019
7701e09
Merge branches 'develop' and 'lowfi-input-interaction-views' of https…
nikitamarysolomanpvt Oct 21, 2019
66b1df9
nit
nikitamarysolomanpvt Oct 21, 2019
f0ebeec
nit
nikitamarysolomanpvt Oct 21, 2019
ba90a82
nit
nikitamarysolomanpvt Oct 21, 2019
97c7eab
nit
nikitamarysolomanpvt Oct 21, 2019
737c356
Merge branches 'develop' and 'lowfi-input-interaction-views' of https…
nikitamarysolomanpvt Oct 21, 2019
bce041c
Merge branches 'develop' and 'text-input-lowfi-numeric-input-interact…
nikitamarysolomanpvt Oct 21, 2019
653070b
nit
nikitamarysolomanpvt Oct 21, 2019
b5576e2
NumberWithUnitsInputInteractionView
nikitamarysolomanpvt Oct 22, 2019
5600459
Merge branch 'develop' into introduce-image-parser-replica
veena14cs Oct 22, 2019
3b8e4e6
Update GlideImageLoader.kt
veena14cs Oct 22, 2019
afffd70
removed annotation
veena14cs Oct 22, 2019
712f115
Update HtmlParser.kt
veena14cs Oct 22, 2019
d7af86f
line break
veena14cs Oct 22, 2019
e3cc8fd
fix
veena14cs Oct 23, 2019
933f1f1
fix comments
veena14cs Oct 23, 2019
0f5f4ad
Update UrlImageParser.kt
veena14cs Oct 23, 2019
1359ae4
Update UrlImageParser.kt
veena14cs Oct 23, 2019
c630461
injected context
veena14cs Oct 23, 2019
ddf7d86
working on testcase.
veena14cs Oct 23, 2019
9bff2b0
testcase added
veena14cs Oct 23, 2019
115cac1
NumberWithUnitsInputInteractionView
nikitamarysolomanpvt Oct 23, 2019
8766fb2
added test case
veena14cs Oct 23, 2019
cf561c9
testcases
veena14cs Oct 23, 2019
017eb29
Update build.gradle
veena14cs Oct 23, 2019
385b1d1
Update AndroidManifest.xml
veena14cs Oct 23, 2019
f1ac620
fixes
veena14cs Oct 23, 2019
ad2ca74
Test cases Number With Units
nikitamarysolomanpvt Oct 24, 2019
0774124
nit
nikitamarysolomanpvt Oct 24, 2019
b024b1a
nit
nikitamarysolomanpvt Oct 24, 2019
9d3c846
nit
nikitamarysolomanpvt Oct 24, 2019
da99dfb
nit
nikitamarysolomanpvt Oct 24, 2019
d49dd08
nit
nikitamarysolomanpvt Oct 24, 2019
486bcb3
nit
nikitamarysolomanpvt Oct 24, 2019
a8d6b8d
nit
nikitamarysolomanpvt Oct 24, 2019
8066afe
nit
nikitamarysolomanpvt Oct 25, 2019
2799a20
nit
nikitamarysolomanpvt Oct 25, 2019
412593c
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
nikitamarysolomanpvt Oct 25, 2019
b64bafc
Update UrlImageParserTest.kt
veena14cs Oct 25, 2019
cfa3b9e
nit
nikitamarysolomanpvt Oct 25, 2019
b459158
nit
nikitamarysolomanpvt Oct 25, 2019
0314815
changed to CutomTarget
veena14cs Oct 25, 2019
5539e7c
nit
nikitamarysolomanpvt Oct 25, 2019
db420aa
Merge branch 'introduce-image-parser-replica' into temp-integration-b…
BenHenning Oct 25, 2019
294ef2c
Merge branch 'lowfi-number-with-units-input-interaction-view' into te…
BenHenning Oct 25, 2019
6035481
Attempt to rebase content-card onto develop.
BenHenning Oct 26, 2019
47bf004
Merge branch 'introduce-image-parser-replica' into content-card-from-…
BenHenning Oct 26, 2019
93c562c
Merge branch 'develop' into introduce-image-parser-replica-up-to-date
BenHenning Oct 26, 2019
7b6a69a
Merge branch 'introduce-image-parser-replica-up-to-date' into content…
BenHenning Oct 26, 2019
8cf0eee
Manually apply rejections and remove rej files.
BenHenning Oct 26, 2019
ab0e35a
Add missing pieces implied in merge-fix that are needed for this branch.
BenHenning Oct 26, 2019
72c5c1f
Merge branch 'content-card-from-develop' into temp-integration-branch…
BenHenning Oct 26, 2019
4c78e06
Maunally apply multiple-single-input-interaction changes to develop
BenHenning Oct 26, 2019
b7cd6ec
Merge branch 'content-card-from-develop' into multiple-single-input-i…
BenHenning Oct 26, 2019
2da17aa
Manually apply rejected diffs.
BenHenning Oct 26, 2019
88cd912
Fix broken build after merges.
BenHenning Oct 26, 2019
0aaace5
Add missing changes from merge-fix that are needed to enable state
BenHenning Oct 26, 2019
f86eb60
Merge branch 'content-card-from-develop' into multiple-single-input-i…
BenHenning Oct 26, 2019
940e3ec
Resolve unresolved conflicts.
BenHenning Oct 26, 2019
3eef2c1
Merge branch 'content-card-from-develop' into temp-integration-branch…
BenHenning Oct 26, 2019
6dd1e7b
Merge branch 'multiple-single-input-interaction-from-develop' into te…
BenHenning Oct 26, 2019
43a6788
Make an exploration with all prototype interactions work end-to-end.
BenHenning Oct 26, 2019
a426658
Add support for displaying feedback items.
BenHenning Oct 26, 2019
aaf83e9
Add support for reshowing submitted answers.
BenHenning Oct 29, 2019
d2cc927
Make 'Continue' button a separate interaction (but keep the existing
BenHenning Oct 29, 2019
c548fe8
Move audio functionality to a custom toolbar, remove the dummy audio
BenHenning Oct 29, 2019
c8b7158
Simplify the presenter by updating ExplorationProgressController to feed
BenHenning Oct 29, 2019
1b4ec9e
First batch of work corresponding to moving the entirety of state
BenHenning Oct 31, 2019
adc7854
Finish updating item selection recycler view to use data binding. This
BenHenning Oct 31, 2019
0acf15c
Some minor fixes to polish up the experience a bit and reduce jank.
BenHenning Oct 31, 2019
622f04d
Fix broken voiceover audio button.
BenHenning Oct 31, 2019
a23646b
Address one TODO to generalize adding interactions by leveraging a Da…
BenHenning Oct 31, 2019
2372d78
Merge branch 'develop' into finish-state-fragment-ui-structure
BenHenning Nov 4, 2019
dc2dff1
Fix broken test.
BenHenning Nov 4, 2019
dc3f67a
Fix broken domain tests by allowing feedback to be either a string or an
BenHenning Nov 4, 2019
95af595
Fix broken app test builds (tests still fail, but at least run now).
BenHenning Nov 4, 2019
7c22286
Add TODO to fix feedback parsing hack.
BenHenning Nov 5, 2019
c17e394
Remove TODOs in StringToFractionParser.
BenHenning Nov 5, 2019
d0b16bc
Resolve open TODOs for the state portion of the player, or associate
BenHenning Nov 5, 2019
e71116b
Associate 2 more TODOs with issues.
BenHenning Nov 5, 2019
d8c6fa6
Add tests for new next state behavior in ExplorationProgressController,
BenHenning Nov 5, 2019
70b6e38
Remove number with units support.
BenHenning Nov 5, 2019
0b0144e
Merge branch 'develop' into finish-state-fragment-ui-structure
BenHenning Nov 5, 2019
449391f
Post-merge fixes and clean-ups.
BenHenning Nov 5, 2019
1a8600b
Merge branch 'develop' into finish-state-fragment-ui-structure
BenHenning Nov 5, 2019
43b7a38
Post-merge fix.
BenHenning Nov 5, 2019
610b941
Merge branch 'develop' into finish-state-fragment-ui-structure
BenHenning Nov 7, 2019
ac4f905
Remove number with units tests.
BenHenning Nov 7, 2019
eb31a3c
First round of addressing reviewer comments.
BenHenning Nov 7, 2019
99783d5
Remove view scope & component.
BenHenning Nov 7, 2019
d8770de
Second round of addressing reviewer comments. Includes a project-wide
BenHenning Nov 7, 2019
008d21f
Round 3 of addressing reviewer changes: removed UrlImageParserTest since
BenHenning Nov 7, 2019
9fd655d
Round 4 of addressing reviewer comments: reformat all layout XML files.
BenHenning Nov 7, 2019
2fcbc43
Round 5 of addressing reviewer comments.
BenHenning Nov 7, 2019
45ea71a
Revert "Remove view scope & component."
BenHenning Nov 7, 2019
a94fe4c
Post-clean up fixes and other minor adjustments.
BenHenning Nov 7, 2019
b847e0d
Ensure ExplorationActivityTest passes even though it doesn't have
BenHenning Nov 7, 2019
83c5e42
Temporary workaround to make the prototype exploration accessible with
BenHenning Nov 7, 2019
56630b4
Round 6 of addressing review comments.
BenHenning Nov 7, 2019
ea8f219
Update prototype exploration to provide feedback after the multi-item
BenHenning Nov 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ dependencies {
'androidx.appcompat:appcompat:1.0.2',
'androidx.constraintlayout:constraintlayout:1.1.3',
'androidx.core:core-ktx:1.0.2',
"androidx.fragment:fragment:$fragment_version",
'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0-alpha03',
'androidx.multidex:multidex:2.0.1',
'androidx.recyclerview:recyclerview:1.0.0',
Expand All @@ -72,6 +73,7 @@ dependencies {
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version",
'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1',
'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.1',
'org.mockito:mockito-core:2.7.22',
)
testImplementation(
'androidx.test:core:1.2.0',
Expand All @@ -82,6 +84,7 @@ dependencies {
'com.google.truth:truth:0.43',
'org.robolectric:robolectric:4.3',
'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.2.2',
'org.mockito:mockito-core:2.7.22',
)
androidTestImplementation(
'androidx.test:core:1.2.0',
Expand All @@ -91,7 +94,8 @@ dependencies {
'androidx.test.ext:junit:1.1.1',
'androidx.test:runner:1.2.0',
'com.google.truth:truth:0.43',
'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.2.2'
'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.2.2',
'org.mockito:mockito-android:2.7.22',
)
androidTestUtil(
'androidx.test:orchestrator:1.2.0',
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
<activity android:name=".testing.ContinuePlayingFragmentTestActivity" />
<activity android:name=".home.HomeActivity" />
<activity android:name=".player.audio.testing.AudioFragmentTestActivity" />
<activity android:name=".player.exploration.ExplorationActivity" />
<activity
android:name=".player.exploration.ExplorationActivity"
android:theme="@style/OppiaThemeWithoutActionBar" />
<activity android:name=".player.state.testing.StateFragmentTestActivity" />
<activity android:name=".profile.ProfileActivity" />
<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import androidx.appcompat.app.AppCompatActivity
import dagger.BindsInstance
import dagger.Subcomponent
import org.oppia.app.fragment.FragmentComponent
import org.oppia.app.home.continueplaying.ContinuePlayingActivity
import org.oppia.app.home.HomeActivity
import org.oppia.app.home.continueplaying.ContinuePlayingActivity
import org.oppia.app.player.audio.testing.AudioFragmentTestActivity
import org.oppia.app.player.exploration.ExplorationActivity
import org.oppia.app.player.state.testing.StateFragmentTestActivity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import javax.inject.Singleton
@Component(modules = [
ApplicationModule::class, DispatcherModule::class, NetworkModule::class, LoggerModule::class,
ContinueModule::class, FractionInputModule::class, ItemSelectionInputModule::class, MultipleChoiceInputModule::class,
NumberWithUnitsRuleModule::class, NumericInputRuleModule::class, TextInputRuleModule::class, InteractionsModule::class,
GcsResourceModule::class, ImageParsingModule::class, GlideImageLoaderModule::class,
NumberWithUnitsRuleModule::class, NumericInputRuleModule::class, TextInputRuleModule::class,
InteractionsModule::class, GcsResourceModule::class, GlideImageLoaderModule::class, ImageParsingModule::class,
HtmlParserEntityTypeModule::class
])
interface ApplicationComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package org.oppia.app.customview.interaction
import android.content.Context
import android.util.AttributeSet
import android.widget.EditText
import org.oppia.app.model.InteractionObject
import org.oppia.app.parser.StringToFractionParser

// TODO(#249): These are the attributes which should be defined in XML, that are required for this interaction view to work correctly
// digits="0123456789/-"
Expand All @@ -18,13 +16,4 @@ class FractionInputInteractionView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyle: Int = android.R.attr.editTextStyle
) : EditText(context, attrs, defStyle), InteractionAnswerRetriever {

override fun getPendingAnswer(): InteractionObject {
val interactionObjectBuilder = InteractionObject.newBuilder()
if (!text.isNullOrEmpty()) {
interactionObjectBuilder.fraction = StringToFractionParser().getFractionFromString(text = text.toString())
}
return interactionObjectBuilder.build()
}
}
) : EditText(context, attrs, defStyle)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.oppia.app.customview.interaction
import android.content.Context
import android.util.AttributeSet
import android.widget.EditText
import org.oppia.app.model.InteractionObject

// TODO(#249): These are the attributes which should be defined in XML, that are required for this interaction view to work correctly
// digits="0123456789."
Expand All @@ -17,13 +16,4 @@ class NumericInputInteractionView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyle: Int = android.R.attr.editTextStyle
) : EditText(context, attrs, defStyle), InteractionAnswerRetriever {

override fun getPendingAnswer(): InteractionObject {
val interactionObjectBuilder = InteractionObject.newBuilder()
if (!text.isNullOrEmpty()) {
interactionObjectBuilder.real = text.toString().toDouble()
}
return interactionObjectBuilder.build()
}
}
) : EditText(context, attrs, defStyle)
BenHenning marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.oppia.app.customview.interaction
import android.content.Context
import android.util.AttributeSet
import android.widget.EditText
import org.oppia.app.model.InteractionObject

// TODO(#249): These are the attributes which should be defined in XML, that are required for this interaction view to work correctly
// hint="Write here."
Expand All @@ -16,13 +15,4 @@ class TextInputInteractionView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyle: Int = android.R.attr.editTextStyle
) : EditText(context, attrs, defStyle), InteractionAnswerRetriever {

override fun getPendingAnswer(): InteractionObject {
val interactionObjectBuilder = InteractionObject.newBuilder()
if (!text.isNullOrEmpty()) {
interactionObjectBuilder.normalizedString = text.toString()
}
return interactionObjectBuilder.build()
}
}
) : EditText(context, attrs, defStyle)
BenHenning marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package org.oppia.app.databinding
import android.widget.ImageView
import androidx.annotation.DrawableRes
import androidx.databinding.BindingAdapter
import com.bumptech.glide.request.RequestOptions
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import org.oppia.app.R
import org.oppia.app.model.LessonThumbnailGraphic

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package org.oppia.app.fragment
import androidx.fragment.app.Fragment
import dagger.BindsInstance
import dagger.Subcomponent
import org.oppia.app.home.continueplaying.ContinuePlayingFragment
import org.oppia.app.home.HomeFragment
import org.oppia.app.home.continueplaying.ContinuePlayingFragment
import org.oppia.app.player.audio.AudioFragment
import org.oppia.app.player.exploration.ExplorationFragment
import org.oppia.app.player.state.StateFragment
import org.oppia.app.player.state.itemviewmodel.InteractionViewModelModule
import org.oppia.app.profile.AddProfileFragment
import org.oppia.app.profile.AdminAuthFragment
import org.oppia.app.profile.ProfileChooserFragment
Expand All @@ -20,9 +21,11 @@ import org.oppia.app.topic.play.TopicPlayFragment
import org.oppia.app.topic.questionplayer.QuestionPlayerFragment
import org.oppia.app.topic.review.TopicReviewFragment
import org.oppia.app.topic.train.TopicTrainFragment
import org.oppia.app.view.ViewComponent
import javax.inject.Provider

/** Root subcomponent for all fragments. */
@Subcomponent
@Subcomponent(modules = [FragmentModule::class, InteractionViewModelModule::class])
@FragmentScope
interface FragmentComponent {
@Subcomponent.Builder
Expand All @@ -33,6 +36,8 @@ interface FragmentComponent {
fun build(): FragmentComponent
}

fun getViewComponentBuilderProvider(): Provider<ViewComponent.Builder>

fun inject(addProfileFragment: AddProfileFragment)
fun inject(adminAuthFragment: AdminAuthFragment)
fun inject(audioFragment: AudioFragment)
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/org/oppia/app/fragment/FragmentModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.oppia.app.fragment

import dagger.Module
import org.oppia.app.view.ViewComponent

/** Root fragment module. */
@Module(subcomponents = [ViewComponent::class]) class FragmentModule
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ abstract class InjectableDialogFragment: DialogFragment() {
*/
lateinit var fragmentComponent: FragmentComponent

override fun onAttach(context: Context?) {
override fun onAttach(context: Context) {
super.onAttach(context)
fragmentComponent = (requireActivity() as InjectableAppCompatActivity).createFragmentComponent(this)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package org.oppia.app.fragment

import android.content.Context
import android.view.View
import androidx.fragment.app.Fragment
import org.oppia.app.activity.InjectableAppCompatActivity
import org.oppia.app.view.ViewComponent

/**
* A fragment that facilitates field injection to children. This fragment can only be used with
Expand All @@ -16,8 +18,12 @@ abstract class InjectableFragment: Fragment() {
*/
lateinit var fragmentComponent: FragmentComponent

override fun onAttach(context: Context?) {
override fun onAttach(context: Context) {
super.onAttach(context)
fragmentComponent = (requireActivity() as InjectableAppCompatActivity).createFragmentComponent(this)
}

fun createViewComponent(view: View): ViewComponent {
BenHenning marked this conversation as resolved.
Show resolved Hide resolved
return fragmentComponent.getViewComponentBuilderProvider().get().setView(view).build()
}
}
2 changes: 1 addition & 1 deletion app/src/main/java/org/oppia/app/home/HomeFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import javax.inject.Inject
class HomeFragment : InjectableFragment(), TopicSummaryClickListener {
@Inject lateinit var homeFragmentPresenter: HomeFragmentPresenter

override fun onAttach(context: Context?) {
override fun onAttach(context: Context) {
super.onAttach(context)
fragmentComponent.inject(this)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import org.oppia.app.model.TopicSummary
import org.oppia.app.model.UserAppHistory
import org.oppia.domain.UserAppHistoryController
import org.oppia.domain.exploration.ExplorationDataController
import org.oppia.domain.exploration.TEST_EXPLORATION_ID_5
import org.oppia.domain.exploration.TEST_EXPLORATION_ID_30
import org.oppia.domain.topic.TEST_TOPIC_ID_0
import org.oppia.domain.topic.TopicListController
import org.oppia.util.data.AsyncResult
import org.oppia.util.logging.Logger
import javax.inject.Inject

private const val EXPLORATION_ID = TEST_EXPLORATION_ID_5
private const val EXPLORATION_ID = TEST_EXPLORATION_ID_30
private const val TAG_HOME_FRAGMENT = "HomeFragment"

/** The presenter for [HomeFragment]. */
Expand Down Expand Up @@ -82,6 +82,7 @@ class HomeFragmentPresenter @Inject constructor(
}

fun playExplorationButton(v: View) {
explorationDataController.stopPlayingExploration()
explorationDataController.startPlayingExploration(
EXPLORATION_ID
).observe(fragment, Observer<AsyncResult<Any?>> { result ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import javax.inject.Inject
class ContinuePlayingFragment : InjectableFragment(), OngoingStoryClickListener {
@Inject lateinit var continuePlayingFragmentPresenter: ContinuePlayingFragmentPresenter

override fun onAttach(context: Context?) {
override fun onAttach(context: Context) {
super.onAttach(context)
fragmentComponent.inject(this)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.ObservableField
import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel
import org.oppia.app.home.continueplaying.ContinuePlayingActivity
import org.oppia.app.home.HomeItemViewModel
import org.oppia.app.home.RouteToContinuePlayingListener
import org.oppia.app.home.RouteToTopicPlayStoryListener
import org.oppia.app.home.continueplaying.ContinuePlayingActivity
import org.oppia.app.model.PromotedStory
import org.oppia.app.topic.TopicActivity

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.oppia.app.home.topiclist
import android.graphics.Color
import android.view.View
import androidx.annotation.ColorInt
import androidx.lifecycle.ViewModel
import org.oppia.app.home.HomeItemViewModel
import org.oppia.app.model.TopicSummary

Expand Down
72 changes: 47 additions & 25 deletions app/src/main/java/org/oppia/app/parser/StringToFractionParser.kt
Original file line number Diff line number Diff line change
@@ -1,34 +1,56 @@
package org.oppia.app.parser

import org.oppia.app.model.Fraction
import org.oppia.domain.util.normalizeWhitespace

/** This class contains method that helps to parse string to fraction. */
class StringToFractionParser {
private val wholeNumberOnlyRegex = """^-? ?(\d+)$""".toRegex()
private val fractionOnlyRegex = """^-? ?(\d+) ?/ ?(\d)+$""".toRegex()
private val mixedNumberRegex = """^-? ?(\d)+ ?(\d+) ?/ ?(\d)+$""".toRegex()

fun getFractionFromString(text: String): Fraction {
var inputText: String = text
var isNegative = false
var numerator = "0"
var denominator = "0"
var wholeNumber = "0"
val fractionObjectBuilder = Fraction.newBuilder()
if (inputText.startsWith("-"))
isNegative = true
inputText = inputText.replace("-", "").trim()
wholeNumber = if (inputText.contains("/") && inputText.contains(" ")) {
inputText.substringBefore(" ")
} else if (inputText.contains("/")) {
wholeNumber
} else {
inputText
}
inputText =
if (inputText.contains(" ")) inputText.substringAfter(" ").replace(" ", "") else inputText.replace(" ", "")
if (inputText.contains("/")) {
numerator = inputText.substringBefore("/")
denominator = inputText.substringAfter("/")
}
fractionObjectBuilder.setIsNegative(isNegative).setNumerator(numerator.toInt())
.setDenominator(denominator.toInt()).wholeNumber = wholeNumber.toInt()
return fractionObjectBuilder.build()
// Normalize whitespace to ensure that answer follows a simpler subset of possible patterns.
val inputText: String = text.normalizeWhitespace()
return parseMixedNumber(inputText)
?: parseFraction(inputText)
?: parseWholeNumber(inputText)
?: throw IllegalArgumentException("Incorrectly formatted fraction: $text")
}

private fun parseMixedNumber(inputText: String): Fraction? {
val mixedNumberMatch = mixedNumberRegex.matchEntire(inputText) ?: return null
val (_, wholeNumberText, numeratorText, denominatorText) = mixedNumberMatch.groupValues
return Fraction.newBuilder()
.setIsNegative(isInputNegative(inputText))
.setWholeNumber(wholeNumberText.toInt())
.setNumerator(numeratorText.toInt())
.setDenominator(denominatorText.toInt())
.build()
}

private fun parseFraction(inputText: String): Fraction? {
val fractionOnlyMatch = fractionOnlyRegex.matchEntire(inputText) ?: return null
val (_, numeratorText, denominatorText) = fractionOnlyMatch.groupValues
// Fraction-only numbers imply no whole number.
return Fraction.newBuilder()
.setIsNegative(isInputNegative(inputText))
.setNumerator(numeratorText.toInt())
.setDenominator(denominatorText.toInt())
.build()
}

private fun parseWholeNumber(inputText: String): Fraction? {
val wholeNumberMatch = wholeNumberOnlyRegex.matchEntire(inputText) ?: return null
val (_, wholeNumberText) = wholeNumberMatch.groupValues
// Whole number fractions imply '0/1' fractional parts.
return Fraction.newBuilder()
.setIsNegative(isInputNegative(inputText))
.setWholeNumber(wholeNumberText.toInt())
.setNumerator(0)
.setDenominator(1)
.build()
}

private fun isInputNegative(inputText: String): Boolean = inputText.startsWith("-")
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AudioFragment : InjectableFragment(), LanguageInterface {
@Inject
lateinit var audioFragmentPresenter: AudioFragmentPresenter

override fun onAttach(context: Context?) {
override fun onAttach(context: Context) {
super.onAttach(context)
fragmentComponent.inject(this)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import org.oppia.domain.exploration.ExplorationDataController
import org.oppia.util.data.AsyncResult
import org.oppia.util.logging.Logger
import javax.inject.Inject
import kotlin.collections.ArrayList

private const val TAG_LANGUAGE_DIALOG = "LANGUAGE_DIALOG"
private const val KEY_SELECTED_LANGUAGE = "SELECTED_LANGUAGE"
Expand Down
Loading