-
Notifications
You must be signed in to change notification settings - Fork 527
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce load exploration part 1 (#213)
* Introduce first pass interface for ExplorationProgressController. * Fill in the stubbed logic for ExplorationProgressController. Still no tests to verify correctness. Also, added a method to facilitate notifying of DataProvider changes on the UI thread. * Fix lateinit issue in ExplorationProgressController due to wrongly ordered initialization. * Fix a variaty of issues in the exp progress controller, properly hook it up to the data controller, and start adding tests. * Created a separate ExplorationRetriever, hooked up AnswerClassificationController, and attempted to make ExplorationProgressController thread-safe. The thread-safety led to significant interface changes in the progress controller, and led to discovering some issues with the mediator live data approach to interop coroutines and LiveData. This locking mechanism will need to change since the optimal solution requires resolving #90. * Change the locking mechanism for ExplorationProgressController to work with the current MediatorLiveData implementation (see #90 for more context). Fix existing progress controller tests and add a few more. All current progress controller tests are passing. * Finish tests for ExplorationProgressController and add test classification support for the second test exploration (about_oppia). * ObservableViewModel * Load exploration and open ExplorationActivity * Test case for load exploration * Connection with StateFragment * Nit changes self review * Refactor home * Resolve merge conflicts * Test case updated
- Loading branch information
Showing
9 changed files
with
148 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
app/src/main/java/org/oppia/app/home/RouteToExplorationListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.oppia.app.home | ||
|
||
/** Listener for when an activity should route to a exploration. */ | ||
interface RouteToExplorationListener { | ||
fun routeToExploration(explorationId: String) | ||
} |
16 changes: 15 additions & 1 deletion
16
app/src/main/java/org/oppia/app/player/exploration/ExplorationActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
package org.oppia.app.player.exploration | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import org.oppia.app.activity.InjectableAppCompatActivity | ||
import javax.inject.Inject | ||
|
||
const val EXPLORATION_ACTIVITY_TOPIC_ID_ARGUMENT_KEY = "ExplorationActivity.exploration_id" | ||
|
||
/** The starting point for exploration. */ | ||
class ExplorationActivity : InjectableAppCompatActivity() { | ||
@Inject lateinit var explorationActivityPresenter: ExplorationActivityPresenter | ||
@Inject | ||
lateinit var explorationActivityPresenter: ExplorationActivityPresenter | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
activityComponent.inject(this) | ||
explorationActivityPresenter.handleOnCreate() | ||
} | ||
|
||
companion object { | ||
/** Returns a new [Intent] to route to [ExplorationActivity] for a specified topic ID. */ | ||
fun createExplorationActivityIntent(context: Context, explorationId: String): Intent { | ||
val intent = Intent(context, ExplorationActivity::class.java) | ||
intent.putExtra(EXPLORATION_ACTIVITY_TOPIC_ID_ARGUMENT_KEY, explorationId) | ||
return intent | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<FrameLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/home_fragment_placeholder" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".home.HomeActivity" /> | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/home_fragment_placeholder" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".home.HomeActivity" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters