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

Implementation change of fragment new instance #1267

Closed
6 tasks
nikitamarysolomanpvt opened this issue Jun 8, 2020 · 0 comments · Fixed by #1280
Closed
6 tasks

Implementation change of fragment new instance #1267

nikitamarysolomanpvt opened this issue Jun 8, 2020 · 0 comments · Fixed by #1280
Assignees
Labels
good first issue This item is good for new contributors to make their pull request. Priority: Important This work item is really important to complete for its milestone, but it can be scoped out. Z-ibt Temporary label for Ben to keep track of issues he's triaged.

Comments

@nikitamarysolomanpvt
Copy link
Contributor

nikitamarysolomanpvt commented Jun 8, 2020

Implementation change of fragment new instance
Suggestion is:
in ExplorationActivityPresenter

   if (getExplorationManagerFragment() == null) {
      activity.supportFragmentManager.beginTransaction().add(
        R.id.exploration_fragment_placeholder,
        ExplorationManagerFragment.newInstance(internalProfileId),
        ExplorationManagerFragment.TAG
      ).commitNow()
    }

In ExplorationManagerFragment

  companion object {
    internal const val EXPLORATION_MANAGER_FRAGMENT_INTERNAL_PROFILE_ID_ARGUMENT_KEY = "ExplorationManagerFragment.internal_profile_id"

const val TAG = "ExplorationManagerFragment.TAG"

    fun newInstance(internalProfileId: Int): ExplorationManagerFragment {
      val explorationManagerFragment = ExplorationManagerFragment()
      val args = Bundle()
      args.putInt(EXPLORATION_MANAGER_FRAGMENT_INTERNAL_PROFILE_ID_ARGUMENT_KEY, internalProfileId)
      explorationManagerFragment.arguments = args
      return explorationManagerFragment
    }
  }

NAMING CONVENTIONS :
INTERNAL_PROFILE_ID_EXTRA_KEY
INTERNAL_PROFILE_ID_ARGUMENT_KEY
INTERNAL_PROFILE_ID_SAVED_KEY (saved instance state)

Checklist

@rt4914 rt4914 added good first issue This item is good for new contributors to make their pull request. Priority: Important This work item is really important to complete for its milestone, but it can be scoped out. Type: Improvement labels Jun 8, 2020
vinitamurthi pushed a commit that referenced this issue Jun 11, 2020
…1280)

* added new instance function in TopicInfoFragment

* updated use of TopicInfoFragment in 1 file

Co-authored-by: Sajal Asati <sajalasati@google.com>
rt4914 pushed a commit that referenced this issue Jun 12, 2020
* updated remaining fragment implementations

* nit changes done

Co-authored-by: Sajal Asati <sajalasati@google.com>
@BenHenning BenHenning added the Z-ibt Temporary label for Ben to keep track of issues he's triaged. label Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue This item is good for new contributors to make their pull request. Priority: Important This work item is really important to complete for its milestone, but it can be scoped out. Z-ibt Temporary label for Ben to keep track of issues he's triaged.
Development

Successfully merging a pull request may close this issue.

3 participants