Skip to content

Commit

Permalink
[no-jira] hotfix for 3.26.0 release - crashes in discovery fragment w…
Browse files Browse the repository at this point in the history
…hen context is null (#2154)
  • Loading branch information
leighdouglas authored Oct 21, 2024
1 parent 497016f commit a9187fb
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/external_version_code.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2014150918
2014150919
2 changes: 1 addition & 1 deletion app/external_version_name.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.25.2
3.26.0
2 changes: 1 addition & 1 deletion app/internal_version_code.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2014150918
2014150919
2 changes: 1 addition & 1 deletion app/internal_version_name.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.25.2
3.26.0
51 changes: 34 additions & 17 deletions app/src/main/java/com/kickstarter/ui/fragments/DiscoveryFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -262,17 +262,28 @@ class DiscoveryFragment : Fragment() {
}

private fun startActivityFeedActivity() {
startActivity(Intent(activity, ActivityFeedActivity::class.java))
context?.let {
startActivity(Intent(context, ActivityFeedActivity::class.java))
}
}

private fun startSetPasswordActivity(email: String) {
val intent = Intent().getSetPasswordActivity(requireContext(), email)
startActivityForResult(intent, ActivityRequestCodes.LOGIN_FLOW)
TransitionUtils.transition(requireContext(), TransitionUtils.fadeIn())
context?.let {
val intent = Intent().getSetPasswordActivity(requireContext(), email)
startActivityForResult(intent, ActivityRequestCodes.LOGIN_FLOW)
TransitionUtils.transition(requireContext(), TransitionUtils.fadeIn())
}
}

private fun showStarToast() {
ViewUtils.showToastFromTop(requireContext(), getString(this.projectStarConfirmationString), 0, resources.getDimensionPixelSize(R.dimen.grid_8))
context?.let {
ViewUtils.showToastFromTop(
requireContext(),
getString(this.projectStarConfirmationString),
0,
resources.getDimensionPixelSize(R.dimen.grid_8)
)
}
}

private fun startEditorialActivity(editorial: Editorial) {
Expand All @@ -288,21 +299,27 @@ class DiscoveryFragment : Fragment() {
}

private fun startLoginToutActivity() {
val intent = Intent(activity, LoginToutActivity::class.java)
.putExtra(IntentKey.LOGIN_REASON, LoginReason.DEFAULT)
startActivityForResult(intent, ActivityRequestCodes.LOGIN_FLOW)
context?.let {
val intent = Intent(context, LoginToutActivity::class.java)
.putExtra(IntentKey.LOGIN_REASON, LoginReason.DEFAULT)
startActivityForResult(intent, ActivityRequestCodes.LOGIN_FLOW)
TransitionUtils.transition(it, TransitionUtils.fadeIn())
}
}

private fun startPreLaunchProjectActivity(project: Project, refTag: RefTag) {
val intent = Intent().getPreLaunchProjectActivity(requireContext(), project.slug())
.putExtra(IntentKey.REF_TAG, refTag)
.putExtra(IntentKey.PREVIOUS_SCREEN, ThirdPartyEventValues.ScreenName.DISCOVERY.value)
startActivity(intent)
TransitionUtils.transition(requireContext(), TransitionUtils.slideInFromRight())
context?.let {
val intent = Intent().getPreLaunchProjectActivity(requireContext(), project.slug())
.putExtra(IntentKey.REF_TAG, refTag)
.putExtra(
IntentKey.PREVIOUS_SCREEN,
ThirdPartyEventValues.ScreenName.DISCOVERY.value
)
startActivity(intent)
TransitionUtils.transition(requireContext(), TransitionUtils.slideInFromRight())
}
}

private fun startProjectActivity(project: Project, refTag: RefTag) {
context?.let {
val intent = Intent().getProjectIntent(it)
Expand All @@ -315,11 +332,11 @@ class DiscoveryFragment : Fragment() {
}

private fun startUpdateActivity(activity: Activity) {
val intent = Intent(getActivity(), UpdateActivity::class.java)
.putExtra(IntentKey.PROJECT, activity.project())
.putExtra(IntentKey.UPDATE, activity.update())
startActivity(intent)
context?.let {
val intent = Intent(context, UpdateActivity::class.java)
.putExtra(IntentKey.PROJECT, activity.project())
.putExtra(IntentKey.UPDATE, activity.update())
startActivity(intent)
TransitionUtils.transition(it, TransitionUtils.slideInFromRight())
}
}
Expand Down

0 comments on commit a9187fb

Please sign in to comment.