How to setAutoPlayAnimations when initialize in Application? - fresco

I need to use gif support in my app, yet I have to enable autoplay by doing this in each view.
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setControllerListener(controllerListener)
.setAutoPlayAnimations(true)
.setUri()
.build();
Consider there are so many views in my app need to display gif image, by doing this for every view just looks a little bit silly, so is there any way to set this config for all views when Fresco was initialized in application?

Related

How advanced can I make the controller?

Specifically is it possible to draw a line on your phone and pass that shape to the screen? Or can I only have buttons on the controller. Thanks!
Your controller is a (mobile) website. That means you can have everything a mobile website can also do such as buttons (touchevent), swipe/gestures functionality (touchmove etc, see e.g. hammer.js), use device motions, camera,...
So if you manage to draw lines on a mobile website, you can also use it for an AirConsole controller. Just keep in mind the latency: drawing lines in realtime on your phone and displaying it on the screen may have some delay.
Also sending messages on a touchmove event is a limitation.

Image Hosting Website Script Deactivates FancyBox Capability

I'm running a Vanilla Forum with a FileUpload plugin, allowing users to upload images and insert the corresponding code directly into the body of their post. These images work with FancyBox when clicked, linking together nicely within the page. However, should a user use a third-party image hosting site (i.e. Imagevenue, Imageshack, Postimage.org) and copy and paste the resulting image code, it deactivates the FancyBox feature associated with all images previously on the page, so when you click on an image uploaded via FileUpload it opens in a new window now instead of in a FancyBox.
My question is one of two things:
a) Is it possible to fix this formatting issue so that if a user does choose to use a third-party image hosting service then it will not affect the fancybox of my previous images.
or
b) Is it possible to block this type of image code from being inputted in the body of a post to prevent this from ever happening.
Thank you and please reply if you would like more information!
Most likely the generated code from those third-party hosting sites has not an image extension (JPG, PNG, GIF) so fancybox doesn't know what type of content needs to handle.
If you are binding fancybox like
$(".fancybox").fancybox();
... you could force the type of content to image like
$(".fancybox").fancybox({
type : "image"
});
I don't really see how pasting the code of a new image will disable the code for existing ones if you want to elaborate.

In a single page desktop-like application, should I dynamically instanciate a controller for a window? How?

I'm asking this because I really don't know where I should handle events of my dynamically created window.
When someone clicks on a desktop icon, the window (if it doesn't exist) will be dynamically created. Should I create a controller when creating the window and hook to it? If yes, how?
Here you can read different approaches I've thought about:
Create a controller that will instanciate the Window (as its view), I will handle everything there
Create the window only and hook everything in my taskbar controller (which is where the window is created). In this case, the Taskbar controller will become very big.
Pre-create all window controllers and eventually windows too and hide them (when page is ready). Then just show/hide them, so I will have "static" references to all controllers with getController in Application
Which approach should I use?
Edit 1:
I'm trying to dynamically instanciate (and reference it through another controller) a controller. I'm having hard time expecially in referencing it. Any suggestion on how it should be done?
I found Ext's MVC unusable with desktop demo as it's possible to have multiple windows (views) of the same type tied to a single controller. Each window has it's own state and it's hard to differentiate between the views in the controller.
I solved the problem by myself: I preinstanciate the controller as I do with all controllers, by inserting them in Application controllers array. After this, I instanciate the view on that controller when a method is called, then I simply use refs to access this view.
The method is quite clean and using refs feel so good. Obviusly the controller has a method hasWindow which checks if the controller view has been created already.

using WP7 Panorama with views based if a user is logged in or not

I am hoping someone can point me in the right direction. I want to create a wp7 panorama type applicaton.
The applicaton requires the user to be logged in for the user to be able to work with a group of panorma items.
So I start creating a Panorama application deleting the MainPage.xaml file and create a new panorama page in my Views folder called MainDetailsView. I have updated the VMAppManifest file to point to the new view.
What is the best way to create a login view that fits into the panorama styled application. Do Ijust create all of the panormaitems I want within MainDetailsView, binding the visibility of each of the PanoramaItems to a converter. If the user is logged in then set the visibilty to true else set it to false?
How then does this fit using the mvvm pattern?
Your login UI could be embedded within a Popup that you show on top of the panorama when required.
Also, Peter Torr has a couple of posts on how to exit a Windows Phone application and how to redirect an initial navigation that touch on that scenario.

RPX/Janrain - using an image map instead of the widget

I would like to use an image map for my Rpx/Janrain basic account instead of the widget they provide. I have tried looking through the javascript file, but it is minified so useless to me.
I just want the "login buttons" to be displayed in my header image with an area map and depending on the image area clicked launch in to the login for that service.
Thanks!
A bit late to the game but I will answer this for posterity. Unfortunately this isn't possible with the Basic app. Pro level and up allows you to customize your method of login. You would set janrain.settings.custom = true; in the settings in the head and use the janrain.engage.signin.triggerFlow(provider) function in the image map areas to kick off the various identity provider sign in pages.
See http://developers.janrain.com/documentation/widgets/social-sign-in-widget/users-guide/coding-the-widget-appearance/ for examples.

Resources