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

Resolve android privacy contract issues #270

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/react-native-orientation-locker.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,28 +233,33 @@ Whenever you want to use it within React Native code now you can:
import Orientation from 'react-native-orientation-locker';


_onOrientationDidChange = (orientation) => {
_onOrientationDidChange = (orientation) => {
if (orientation == 'LANDSCAPE-LEFT') {
//do something with landscape left layout
//do something with landscape left layout
} else {
//do something with portrait layout
//do something with portrait layout
}
};
};

componentWillMount() {
componentWillMount()
{
//The getOrientation method is async. It happens sometimes that
//you need the orientation at the moment the js starts running on device.
//getInitialOrientation returns directly because its a constant set at the
//beginning of the js code.
var initial = Orientation.getInitialOrientation();
if (initial === 'PORTRAIT') {
//do stuff
//do stuff
} else {
//do other stuff
//do other stuff
}
},
}
,

componentDidMount() {
componentDidMount()
{
// init sdk Only need android other platforms can ignore
Orientation.init();

Orientation.getAutoRotateState((rotationLock) => this.setState({rotationLock}));
//this allows to check if the system autolock is enabled or not.
Expand All @@ -276,11 +281,14 @@ import Orientation from 'react-native-orientation-locker';
*/

Orientation.addOrientationListener(this._onOrientationDidChange);
},
}
,

componentWillUnmount: function() {
componentWillUnmount: function () {
Orientation.removeOrientationListener(this._onOrientationDidChange);
}
// init sdk Only need android other platforms can ignore
Orientation.removeInit();
}
```

### Reactive component `<OrientationLocker>`
Expand Down
Loading