Skip to content

Commit

Permalink
topic fragment argument moved to proto
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishwajith-Shettigar committed Nov 28, 2023
1 parent 454ce5d commit c3e6e80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.oppia.android.app.topic

import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import org.oppia.android.R
import org.oppia.android.app.activity.ActivityScope
Expand Down Expand Up @@ -36,7 +35,6 @@ class TopicActivityPresenter @Inject constructor(private val activity: AppCompat
// }
// topicFragment.arguments = args


val topicFragment = TopicFragment()
val argsBuilder = TopicFragmentArgsOuterClass.TopicFragmentArgs.newBuilder()
.setProfileId(internalProfileId)
Expand All @@ -54,7 +52,6 @@ class TopicActivityPresenter @Inject constructor(private val activity: AppCompat

topicFragment.arguments = bundle


activity.supportFragmentManager.beginTransaction().add(
R.id.topic_fragment_placeholder,
topicFragment, TOPIC_FRAGMENT_TAG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import android.view.ViewGroup
import org.oppia.android.app.fragment.FragmentComponentImpl
import org.oppia.android.app.fragment.InjectableFragment
import org.oppia.android.domain.topic.TEST_TOPIC_ID_0
import org.oppia.android.util.extensions.getStringFromBundle
import javax.inject.Inject

/** Fragment that contains tabs for Topic. */
Expand All @@ -28,12 +27,11 @@ class TopicFragment : InjectableFragment() {
): View? {
val argsByteArray = arguments?.getByteArray("args")

val args = TopicFragmentArgsOuterClass.TopicFragmentArgs.parseFrom(argsByteArray)

val args = TopicFragmentArgsOuterClass.TopicFragmentArgs.parseFrom(argsByteArray)

val internalProfileId = args?.profileId ?: -1
val topicId = args?.topicId ?: TEST_TOPIC_ID_0
val storyId =args?.storyId ?: ""
val storyId = args?.storyId ?: ""

return topicFragmentPresenter.handleCreateView(
inflater,
Expand Down

0 comments on commit c3e6e80

Please sign in to comment.