I have a RubyMotion application that is completely portrait (no landscape), but loads BW::Media.play_modal for an external MP4 video URL that I'd like to play in landscape mode.
It's loaded like this using RMQ, PM, and BW:
def on_load
rmq(#object).on(:tap) do
BW::Media.play_modal(#object.video_url)
end
end
I know how to enable autoRotate for an entire screen/controller, but is there a way to force landscape mode only when the modal is played?
Thanks in advance for any help!
Here's how I ended up solving the problem-
I enabled landscape_left and landscape_right throughout the RM app.
I set the should_autorotate method to false throughout the app.
I added a condition using PM's modal? method that set should_autorotate to true when a modal was active.
I used RMQ's rmq.orientation.landscape? method to set the view back to portrait as soon as the modal was exited.
I hope this helps if anyone else has the same problem!
Related
I can track/record event from container app by Amplitude. I use the code bellow
Amplitude.instance().logEvent("Launch")
but when I write the bellow line
Amplitude.instance().logEvent("Share Catmoji Keyboard Extension")
in keyboard extension
The event does not record in amplitude dashboard.
Can anyone faced this issue? please help me.
Yes you can log events from App Extensions. I know this works in share extensions in production. You have to initialize Amplitude in the viewDidLoad of the principal view controller. According to the Amplitude docs this should work for all App Extensions except WatchOS, so I would imagine if you intialize Amplitude in your UIInputViewController subclass's viewDidLoad method it would work:
Amplitude.instance().initializeApiKey("{YOUR_API_KEY}")
So I have a MFC application which flick when we do some action.
So I figured I would set SetRedraw(false) and set it to true at the end of the function.
The application doesn't refresh anymore but if I click on it while SetRedraw(false), my cursor is not catched by my application, it goes throught it and set focus on the application below.
Anyone has some kind of idea how I could fix that.
I ended up using CWnd::LockWindowUpdate instead after some research.
It freezes the update but doesn't act if the window was transparent.
I have tried putting android:icon and android:logo under Application and the launcher activity in the Android Manifest. I have also tried programatically setting the logo and setting the icon. And finally I have also tried including icon="my_icon" and logo="my_logo" in the AppCompat styles.xml. None of this has worked and I am still left icon less. Any help please?
Google decided to disable the action bar icon beginning in Lollipop without documentating the change. There is another thread with more information.
In my project I have made a tabWidget the centralWidget for my program. When the program is first opened by the user, the tabWidget is disabled. The user can enable everything when they open a file. So everything in my program starts disabled.
In one of the tabs, I have a webView widget that plays a youtube video set to autoplay. Everything works fine, except the webView can't be clicked (the video can't be stopped) until the tabWidget is enabled.
Is there any way I can allow ONE object to be enabled while everything else is still disabled?
It's hard for me to explain, but here is a picture:
As you can see, everything is disabled including the video. Can I single out that video to be enabled?
Thanks for your time :)
There is no free lunch. You have two options:
Disable the other tabs and all other widgets on the Settings tab.
Make the webView widget a popup child of the main window (and then manage geometry on size/location changes of main window).
I suppose a third option would be to have another enabled tab that contains the video and widgets to open the file. This would help the user know what to do rather than assaulting them with a disabled interface.
I have a repeater which I bind the data using Bind method from the database. There is a Asp:Button with an onclientclick and onclick event. In OnClientClick I open a new window and onclick I am adding the data to the database. This works perfectly on the first Page load. After first click on any of the buttons in the repeater, the click events stops working on subsequent clicks.
I have spending hours on finding a solution for the same, can any one guide me where i am going wrong what needs to be done.
P.S: My application is AJAX Enabled , using WCF and JQUERY
Thanks & Regards,
Phani...
Never Mind I got it solved my self. For others who are trying to solve the same issue, here is the solution:
The code below opens up a new window with out popup blocker blocking the window
OnClientClick of the button write Javascript like below to open a new window and refresh the parent window (I have to do this as the ItemCommand event was not firing until the page is refreshed)
OnClientClick = "target='_blank'; setTimeout("location.reload(true);", timeout);
Phani...