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

Added setLockOrientation for activities #1839

Merged
merged 14 commits into from
Sep 29, 2020
Merged

Added setLockOrientation for activities #1839

merged 14 commits into from
Sep 29, 2020

Conversation

laurentiu-git
Copy link
Contributor

Hello, I have tried to implement the feature requested #1834 .

Copy link
Contributor

@samtstern samtstern left a comment

Choose a reason for hiding this comment

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

Thank you for this! Mostly it looks great, just a few comments.

@@ -101,6 +103,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
mHandler = ViewModelProviders.of(this).get(SocialProviderResponseHandler.class);
mHandler.init(params);

if (params.lockOrientation) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be moved into AppCompatBase so that we don't have to repeat it in each subclass?

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think adding a boolean resource to FirebaseUI for this is a step too far. The developer should add this in their own app and then tell us to lock the orientation accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understood the feature wrong, sorry for the inconvenience.
I hope it's alright now, thanks for the guidance.

@samtstern samtstern added this to the 6.4.0 milestone Sep 29, 2020
Copy link
Contributor

@samtstern samtstern left a comment

Choose a reason for hiding this comment

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

Looks great, thank you! Just two small comments and then I will merge.

Oh and please add a line to CHANGELOG.md describing your change.

@@ -53,4 +59,9 @@ protected void switchFragment(@NonNull Fragment fragment,
protected void switchFragment(@NonNull Fragment fragment, int fragmentId, @NonNull String tag) {
switchFragment(fragment, fragmentId, tag, false, false);
}

@SuppressLint("all")
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we actually need this @SuppressLint anymore? If so can we be more specific than all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without @SuppressLint when running gradlew check it gives the following error and I don't know how suppress it.

Error: You should not lock orientation of your activities, so that you can support a good user experience for any device or orientation [SourceLockedOrientationActivity]
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

Copy link
Contributor

Choose a reason for hiding this comment

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

So then could it be @SuppressLint("SourceLockedOrientationActivity")?

@@ -14,8 +14,10 @@

package com.firebase.ui.auth.ui.idp;

import android.annotation.SuppressLint;
Copy link
Contributor

Choose a reason for hiding this comment

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

There are no changes in this file anymore besides these two imports and some whitespace, so maybe we can revert the whole file?

@samtstern
Copy link
Contributor

@laurentiu-git LGTM! If tests pass I am going to merge.

@samtstern samtstern merged commit c3badea into firebase:version-6.4.0-dev Sep 29, 2020
@laurentiu-git laurentiu-git deleted the lockOrientation branch September 29, 2020 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants