Closed throwingdarts closed 5 years ago
Hey @throwingdarts , you should be able to use nativescript-orientation plugin to lock your editor in landscape and then when it returns the result to change it again.
Thank you, I will try that. This doesn't seem to be an issue in iOS btw.
Not sure what do you mean under issue?
I just mean in my case my app is in landscape orientation. I have disabled portrait option. However for whatever reason on my android tablet when the photo editor launches it opens in portrait orientation and when closed my app is still in landscape. This is not the case on my iPad. (I have not yet implemented the nativescript-orientation plugin you suggested.)
Aha, it is probably because of this: https://github.com/PeterStaev/nativescript-photo-editor/blob/5a3faf98da20180d7cc78f6d597f35dc06b051ab/android/photoeditor/src/main/AndroidManifest.xml#L10-L16
Even if i remove the hardcoded orientation I'm not sure that it will work as then it will rotate based on device orientation. So I think you should add the above lines in your app's AndroidManifest.xml
and set the orientation to be landscape. Then I think it should work.
Thanks @PeterStaev but unfortunately when I add this to my AndroidManifest.xml within the application node the app will no longer build on android platform.
<application android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/AppTheme">
<activity
android:name="com.tns.NativeScriptActivity"
android:label="@string/title_activity_kimera"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/LaunchScreenTheme"
android:screenOrientation="landscape">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.tangrainc.photoeditor.PhotoEditorActivity"
android:screenOrientation="landscape" />
<activity
android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
android:screenOrientation="landscape"
android:theme="@style/Base.Theme.AppCompat" />
<activity android:name="com.tns.ErrorReportActivity"/>
</application>
And what is the error? 😕
@throwingdarts , version 1.0.3 has been just pushed to npm and this remove the hardcoded screen orientation in the plugin itself. See if that will make any difference in your case.
Version 1.0.3 works perfectly! Thank you so much.
Thank you for the great plugin! Is there a setting (or can there be) for the editor to open in a landscape orientation?