-
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.
Merge branch 'develop' into introduce-exploration-progress-controller
- Loading branch information
Showing
30 changed files
with
725 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,16 @@ | ||
package org.oppia.app.topic | ||
|
||
import android.os.Bundle | ||
import org.oppia.app.activity.InjectableAppCompatActivity | ||
import javax.inject.Inject | ||
|
||
/** The activity for tabs in Topic. */ | ||
class TopicActivity : InjectableAppCompatActivity() { | ||
@Inject lateinit var topicActivityPresenter: TopicActivityPresenter | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
activityComponent.inject(this) | ||
topicActivityPresenter.handleOnCreate() | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/org/oppia/app/topic/TopicActivityPresenter.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,24 @@ | ||
package org.oppia.app.topic | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import org.oppia.app.R | ||
import org.oppia.app.activity.ActivityScope | ||
import javax.inject.Inject | ||
|
||
/** The presenter for [TopicActivity]. */ | ||
@ActivityScope | ||
class TopicActivityPresenter @Inject constructor(private val activity: AppCompatActivity) { | ||
fun handleOnCreate() { | ||
activity.setContentView(R.layout.topic_activity) | ||
if (getTopicFragment() == null) { | ||
activity.supportFragmentManager.beginTransaction().add( | ||
R.id.topic_fragment_placeholder, | ||
TopicFragment() | ||
).commitNow() | ||
} | ||
} | ||
|
||
private fun getTopicFragment(): TopicFragment? { | ||
return activity.supportFragmentManager.findFragmentById(R.id.topic_fragment_placeholder) as TopicFragment? | ||
} | ||
} |
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,23 @@ | ||
package org.oppia.app.topic | ||
|
||
import android.content.Context | ||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import org.oppia.app.fragment.InjectableFragment | ||
import javax.inject.Inject | ||
|
||
/** Fragment that contains tabs for Topic. */ | ||
class TopicFragment : InjectableFragment() { | ||
@Inject lateinit var topicFragmentPresenter: TopicFragmentPresenter | ||
|
||
override fun onAttach(context: Context?) { | ||
super.onAttach(context) | ||
fragmentComponent.inject(this) | ||
} | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
return topicFragmentPresenter.handleCreateView(inflater, container) | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/org/oppia/app/topic/TopicFragmentPresenter.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,23 @@ | ||
package org.oppia.app.topic | ||
|
||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import org.oppia.app.databinding.TopicFragmentBinding | ||
import org.oppia.app.fragment.FragmentScope | ||
import javax.inject.Inject | ||
|
||
/** The controller for [TopicFragment]. */ | ||
@FragmentScope | ||
class TopicFragmentPresenter @Inject constructor( | ||
private val fragment: Fragment | ||
) { | ||
fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View? { | ||
val binding = TopicFragmentBinding.inflate(inflater, container, /* attachToRoot= */ false) | ||
binding.let { | ||
it.lifecycleOwner = fragment | ||
} | ||
return binding.root | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/org/oppia/app/topic/overview/TopicOverviewFragment.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,24 @@ | ||
package org.oppia.app.topic.overview | ||
|
||
import android.content.Context | ||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import org.oppia.app.fragment.InjectableFragment | ||
import javax.inject.Inject | ||
|
||
/** Fragment that contains overview of Topic. */ | ||
class TopicOverviewFragment : InjectableFragment() { | ||
@Inject | ||
lateinit var topicOverviewFragmentPresenter: TopicOverviewFragmentPresenter | ||
|
||
override fun onAttach(context: Context?) { | ||
super.onAttach(context) | ||
fragmentComponent.inject(this) | ||
} | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
return topicOverviewFragmentPresenter.handleCreateView(inflater, container) | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/org/oppia/app/topic/overview/TopicOverviewFragmentPresenter.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,23 @@ | ||
package org.oppia.app.topic.overview | ||
|
||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import org.oppia.app.databinding.TopicOverviewFragmentBinding | ||
import org.oppia.app.fragment.FragmentScope | ||
import javax.inject.Inject | ||
|
||
/** The presenter for [TopicOverviewFragment]. */ | ||
@FragmentScope | ||
class TopicOverviewFragmentPresenter @Inject constructor( | ||
private val fragment: Fragment | ||
) { | ||
fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View? { | ||
val binding = TopicOverviewFragmentBinding.inflate(inflater, container, /* attachToRoot= */ false) | ||
binding.let { | ||
it.lifecycleOwner = fragment | ||
} | ||
return binding.root | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/org/oppia/app/topic/play/TopicPlayFragment.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,24 @@ | ||
package org.oppia.app.topic.play | ||
|
||
import android.content.Context | ||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import org.oppia.app.fragment.InjectableFragment | ||
import javax.inject.Inject | ||
|
||
/** Fragment that contains subtopic list for play mode. */ | ||
class TopicPlayFragment : InjectableFragment() { | ||
@Inject | ||
lateinit var topicPlayFragmentPresenter: TopicPlayFragmentPresenter | ||
|
||
override fun onAttach(context: Context?) { | ||
super.onAttach(context) | ||
fragmentComponent.inject(this) | ||
} | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
return topicPlayFragmentPresenter.handleCreateView(inflater, container) | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/org/oppia/app/topic/play/TopicPlayFragmentPresenter.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,23 @@ | ||
package org.oppia.app.topic.play | ||
|
||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import org.oppia.app.databinding.TopicPlayFragmentBinding | ||
import org.oppia.app.fragment.FragmentScope | ||
import javax.inject.Inject | ||
|
||
/** The presenter for [TopicPlayFragment]. */ | ||
@FragmentScope | ||
class TopicPlayFragmentPresenter @Inject constructor( | ||
private val fragment: Fragment | ||
) { | ||
fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View? { | ||
val binding = TopicPlayFragmentBinding.inflate(inflater, container, /* attachToRoot= */ false) | ||
binding.let { | ||
it.lifecycleOwner = fragment | ||
} | ||
return binding.root | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/org/oppia/app/topic/review/TopicReviewFragment.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,24 @@ | ||
package org.oppia.app.topic.review | ||
|
||
import android.content.Context | ||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import org.oppia.app.fragment.InjectableFragment | ||
import javax.inject.Inject | ||
|
||
/** Fragment that card for topic review. */ | ||
class TopicReviewFragment : InjectableFragment() { | ||
@Inject | ||
lateinit var topicReviewFragmentPresenter: TopicReviewFragmentPresenter | ||
|
||
override fun onAttach(context: Context?) { | ||
super.onAttach(context) | ||
fragmentComponent.inject(this) | ||
} | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
return topicReviewFragmentPresenter.handleCreateView(inflater, container) | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/org/oppia/app/topic/review/TopicReviewFragmentPresenter.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,23 @@ | ||
package org.oppia.app.topic.review | ||
|
||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import org.oppia.app.databinding.TopicReviewFragmentBinding | ||
import org.oppia.app.fragment.FragmentScope | ||
import javax.inject.Inject | ||
|
||
/** The presenter for [TopicReviewFragment]. */ | ||
@FragmentScope | ||
class TopicReviewFragmentPresenter @Inject constructor( | ||
private val fragment: Fragment | ||
) { | ||
fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View? { | ||
val binding = TopicReviewFragmentBinding.inflate(inflater, container, /* attachToRoot= */ false) | ||
binding.let { | ||
it.lifecycleOwner = fragment | ||
} | ||
return binding.root | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/org/oppia/app/topic/train/TopicTrainFragment.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,24 @@ | ||
package org.oppia.app.topic.train | ||
|
||
import android.content.Context | ||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import org.oppia.app.fragment.InjectableFragment | ||
import javax.inject.Inject | ||
|
||
/** Fragment that contains skills for topic train mode. */ | ||
class TopicTrainFragment : InjectableFragment() { | ||
@Inject | ||
lateinit var topicTrainFragmentPresenter: TopicTrainFragmentPresenter | ||
|
||
override fun onAttach(context: Context?) { | ||
super.onAttach(context) | ||
fragmentComponent.inject(this) | ||
} | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
return topicTrainFragmentPresenter.handleCreateView(inflater, container) | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/org/oppia/app/topic/train/TopicTrainFragmentPresenter.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,23 @@ | ||
package org.oppia.app.topic.train | ||
|
||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import org.oppia.app.databinding.TopicTrainFragmentBinding | ||
import org.oppia.app.fragment.FragmentScope | ||
import javax.inject.Inject | ||
|
||
/** The presenter for [TopicTrainFragment]. */ | ||
@FragmentScope | ||
class TopicTrainFragmentPresenter @Inject constructor( | ||
private val fragment: Fragment | ||
) { | ||
fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View? { | ||
val binding = TopicTrainFragmentBinding.inflate(inflater, container, /* attachToRoot= */ false) | ||
binding.let { | ||
it.lifecycleOwner = fragment | ||
} | ||
return binding.root | ||
} | ||
} |
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/topic_fragment_placeholder" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".topic.TopicActivity" /> |
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,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
<TextView | ||
android:id="@+id/dummy_text_view" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="This is dummy TextView for testing" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent"/> | ||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</layout> |
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,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
<TextView | ||
android:id="@+id/dummy_text_view" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="This is dummy TextView for testing" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent"/> | ||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</layout> |
Oops, something went wrong.