-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Created CellularDialogController * Started making tests for controller * Removed import * Fixed test cases and renamed to hideDialog * Fixed comments * Added use cellular data value and added test cases * Started adding test cases * Setup initial testing environment for state fragment * Add more test cases * Changed cellular data controller methods to always and never use cellular data
- Loading branch information
Showing
11 changed files
with
608 additions
and
42 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
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
17 changes: 17 additions & 0 deletions
17
app/src/main/java/org/oppia/app/player/state/testing/StateFragmentTestActivity.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,17 @@ | ||
package org.oppia.app.player.state.testing | ||
|
||
import android.os.Bundle | ||
import org.oppia.app.activity.InjectableAppCompatActivity | ||
import javax.inject.Inject | ||
|
||
/** Test Activity used for testing StateFragment */ | ||
class StateFragmentTestActivity : InjectableAppCompatActivity() { | ||
|
||
@Inject lateinit var stateFragmentTestActivityController: StateFragmentTestActivityPresenter | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
activityComponent.inject(this) | ||
stateFragmentTestActivityController.handleOnCreate() | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
app/src/main/java/org/oppia/app/player/state/testing/StateFragmentTestActivityPresenter.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,27 @@ | ||
package org.oppia.app.player.state.testing | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import org.oppia.app.R | ||
import org.oppia.app.activity.ActivityScope | ||
import org.oppia.app.player.state.StateFragment | ||
import javax.inject.Inject | ||
|
||
/** The presenter for [StateFragmentTestActivity] */ | ||
@ActivityScope | ||
class StateFragmentTestActivityPresenter @Inject constructor( | ||
private val activity: AppCompatActivity | ||
) { | ||
fun handleOnCreate() { | ||
activity.setContentView(R.layout.state_fragment_test_activity) | ||
if (getStateFragment() == null) { | ||
activity.supportFragmentManager.beginTransaction().add( | ||
R.id.state_fragment_placeholder, | ||
StateFragment() | ||
).commitNow() | ||
} | ||
} | ||
|
||
private fun getStateFragment(): StateFragment? { | ||
return activity.supportFragmentManager.findFragmentById(R.id.state_fragment_placeholder) as StateFragment? | ||
} | ||
} |
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,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/state_fragment_placeholder" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".player.state.testing.StateFragmentTestActivity" /> |
Oops, something went wrong.