davidshumway / pg-plugin-screen-orientation Goto Github PK
View Code? Open in Web Editor NEWPhoneGap Plugin for Android that can lock/unlock the screen orientation.
License: Other
PhoneGap Plugin for Android that can lock/unlock the screen orientation.
License: Other
Using navigator.screenOrientation.set('landscape'); and navigator.screenOrientation.set('portrait'); work as expected, but trying to set navigator.screenOrientation.set('fullSensor'); navigator.screenOrientation.set('sensor'); or navigator.screenOrientation.set('unspecified'); to revert to default behaviour does not work (where it was previously working in Android <= 4.3) and leaves screen locked to either portrait or landscape, whichever was last locked to.
I got this error
Uncaught TypeError: Object # has no method 'exec' at file:///android_asset/www/JS/pg-plugin-screen-orientation.js:4
Hello,
I am using your plugin with phonegap and Cordova.
I followed your instructions and am getting an error with the .js file at line 4, PhoneGap.exec is not defined.
Could you please advise what the problem could be? Has this feature been depreciated in Cordova?
Thanks
Hi there,
I'm getting an error in ScreenOrientation.java, line 30: Cannot cast from LegacyContext to Activity
The line of code is: Activity activity = (Activity)this.ctx;
Any ideas what I'm doing wrong here? I'm using Cordova 2.0.0, Eclipse 4.2.0 - all the latest versions as far as I know.
Thanks,
David
Hey,
Going to be using this plugin to be able to lock and unlock orientation. Followed the directions and receiving these errors for the last 5 possible settings in ScreenOrientation.java includeing full sensor
SCREEN_ORIENTATION_FULL_SENSOR cannot be resolved or is not a field
The top 5 have no error.
Thinking maybe sensor_landscape, reverse_portrait, full_sensor ect were not implemented in 2.2?
If this is so, is there a way around it or is something wrong with my code maybe?
Any help would be appreciated. Thanks!
Josh
Hi Guys,
Im using PhoneGap 2.8.1 and I added the necessary files for the plugin, I made some changes as:
Change: PhoneGap.exec (success, fail, "ScreenOrientation", "set", [str]);
To: cordova.exec (null, null, "ScreenOrientation", "set", [str]);
and add a few lines in the file ScreenOrientation.java, and is without error.
But when I make a call using the code below:
$ ('# rotate'). click (function (event) {
navigator.screenOrientation.set ('landscape');
window.weHaveChangedOrientation = true;
});
My console in Eclipse shows the following notification:
Tag: PlugInManager
Text: exec () call to unknown plugin: ScreenOrientation
And does not the screen rotation.
Could anyone help me please.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.