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

ReactActivity extends FragmentActivity #22662

Conversation

dulmandakh
Copy link
Contributor

@dulmandakh dulmandakh commented Dec 15, 2018

In #20602, I tried to make ReactActivity to extend AppCompatActivity per Google recommendation. But import failed, now ReactActivity extends FragmentActivity which is a parent class of AppCompatActivity and step forward to extend AppCompatActivity.

Test Plan:

Everything should run as usual.

Changelog:

[Android] [Changed] - ReactActivity extends FragmentActivity. Therefore, we're deprecating ReactFragmentActivity and it'll will be removed in next release.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 15, 2018
@dulmandakh
Copy link
Contributor Author

@LinusU @hramos I think that it might be a way forward while we're waiting for Android Support Library issue is resolved.

@LinusU
Copy link
Contributor

LinusU commented Dec 17, 2018

This looks great! 👏

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@dulmandakh
Copy link
Contributor Author

@hramos anything I can help with?

@hramos
Copy link
Contributor

hramos commented Dec 20, 2018

@dulmandakh the internal diff is passing all tests. I'm waiting for someone to take another look internally before I land it.

@dulmandakh
Copy link
Contributor Author

@hramos cool. Once merged, I'll do some cleanup in other parts.

Copy link
Contributor

@hramos hramos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request. @mdvacca reviewed it internally and he agrees it's a good idea to use FragmentActivity instead of plain Activity.

We're requesting two changes to your pull request:

  • Please consider marking ReactActivityDelegate as deprecated before removing it. Once the deprecation notice makes it to a release, we can then remove ReactActivityDelegate for the next release.

  • Can you edit the original PR description's changelog to make note of the deprecation?

@dulmandakh dulmandakh added the Platform: Android Android applications. label Jan 12, 2019
@dulmandakh
Copy link
Contributor Author

@hramos done

@dulmandakh
Copy link
Contributor Author

leaving only public ReactActivityDelegate(ReactActivity activity, @nullable String mainComponentName), because it'll work for both ReactActivity and ReactFragmentActivity, which extends ReactActivity.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@hramos hramos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the ReactActivityDelegate that takes an Activity argument is still removed. Ideally, it would still be there, but marked as deprecated.

@dulmandakh
Copy link
Contributor Author

@hramos ReactActivityDelegate now have 2 constructors for both Activity and ReactActivity, and constructor for Activity is marked as deprecated.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@dulmandakh
Copy link
Contributor Author

@hramos any news?

@hramos
Copy link
Contributor

hramos commented Feb 1, 2019

Thanks for the reminder! It looks like the internal diff got approved. I just kicked off the land process, if everything goes well, you should see a message from the bot posted here later today.

@react-native-bot
Copy link
Collaborator

@dulmandakh merged commit dda2b82 into facebook:master.

@facebook facebook locked as resolved and limited conversation to collaborators Feb 1, 2019
@react-native-bot react-native-bot added the Merged This PR has been merged. label Feb 1, 2019
matt-oakes pushed a commit to matt-oakes/react-native that referenced this pull request Feb 7, 2019
Summary:
In facebook#20602, I tried to make ReactActivity to extend AppCompatActivity per Google recommendation. But import failed, now ReactActivity extends FragmentActivity which is a parent class of AppCompatActivity and step forward to extend AppCompatActivity.
Pull Request resolved: facebook#22662

Reviewed By: mdvacca

Differential Revision: D13505140

Pulled By: hramos

fbshipit-source-id: d4edc8dc5c606c45811c1deddf5727a47ad484d8
@dulmandakh dulmandakh deleted the reactactivity-extends-fragmentactivity branch February 22, 2019 14:23
rozele pushed a commit to microsoft/react-native-windows that referenced this pull request Jul 18, 2019
Summary:
In facebook/react-native#20602, I tried to make ReactActivity to extend AppCompatActivity per Google recommendation. But import failed, now ReactActivity extends FragmentActivity which is a parent class of AppCompatActivity and step forward to extend AppCompatActivity.
Pull Request resolved: facebook/react-native#22662

Reviewed By: mdvacca

Differential Revision: D13505140

Pulled By: hramos

fbshipit-source-id: d4edc8dc5c606c45811c1deddf5727a47ad484d8
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: Android Android applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants