Skip to content

Commit

Permalink
feat: Enable navigating to help screen from within the editor
Browse files Browse the repository at this point in the history
In the context of displaying the send feedback form in the editor,
merely navigating backwards meant the editor would be displayed, not the
expected help screen.
  • Loading branch information
dcalhoun committed Jan 15, 2025
1 parent d3b9ab7 commit 4e105e1
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.ui.platform.ViewCompositionStrategy
import dagger.hilt.android.AndroidEntryPoint
import androidx.appcompat.app.AppCompatActivity
import org.wordpress.android.ui.RequestCodes
import org.wordpress.android.ui.accounts.HelpActivity

@AndroidEntryPoint
class FeedbackFormActivity : AppCompatActivity() {
Expand Down Expand Up @@ -45,15 +46,21 @@ class FeedbackFormActivity : AppCompatActivity() {
viewModel.onRemoveMediaClick(it)
},
onSupportClick = {
// This will return to the Help screen, where the user can see the contact support link
finish()
navigateToHelpScreen()
},
)
}
}
)
}

private fun navigateToHelpScreen() {
val intent = Intent(this, HelpActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(intent)
finish()
}

@Deprecated("Deprecated in Java")
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
Expand Down

0 comments on commit 4e105e1

Please sign in to comment.