I saw Weex's Playground demo use some WXPrerenderManager's methods when rendering WXSDKInstance.
_instance = [[WXSDKInstance alloc] init];
if([WXPrerenderManager isTaskExist:[self.url absoluteString]]){
_instance = [WXPrerenderManager instanceFromUrl:self.url.absoluteString];
}
But I didn't find the code adding prerender task to WXPrerenderManager.
When looking into isTaskExist method, it seems to be used with a configCenter.
So, how to use WXPrerenderManager correctly to pre-render some weex pages?
This is an experimental feature and not been released.
Now only in iOS, the pre-render can works. In Android, only sync and fixed elements can be pre-rendered.
Related
guess it is simple yet I cannot achieve it. I want to get the UiSettings for Mapbox
In build.gradle
implementation 'com.mapbox.maps:android:10.10.0'
implementation 'com.mapbox.plugin:maps-scalebar:10.10.0'
implementation 'com.mapbox.plugin:maps-compass:10.10.0'
implementation 'com.mapbox.plugin:maps-logo:10.10.0'
implementation 'com.mapbox.plugin:maps-core:10.10.0'
in Activity onStart()
mapView = findViewById(R.id.mapView);
mapView.onStart();
mapView.getMapboxMap().loadStyleUri(Style.OUTDOORS);
mapView.getMapboxMap().setNorthOrientation(NorthOrientation.UPWARDS);
mapView.getMapboxMap().setCamera(new CameraOptions.Builder()
.center(Point.fromLngLat(11.0, 52.0))
.zoom(15.5)
.build());
I can bring up the mapView, use the new easeTo methods etc. to update the camera yet I am unable to get the UiSettings as in (earlier versions) with .getUiSettings.
(I am also struggling with modifying the Scalebar and bringing up the compass. Obviously I am not understanding how to use these features in Mapbox v10.)
Thanks for your time and help. This is my first post, hoping it comes out well :-)
Best,
Thomas
failing
mapView.getMapboxMap().getUiSettings()
ScaleBarSettings ss = new ScaleBarSettings();
ss.setEnabled(true)
Xamarin.Essentials' class DeviceDisplay.KeepScreenOn does not have an equivalent in .NET6 MAUI as yet.
Is this intentional? or should I be using something else to stop the screen timing out?
DeviceDisplay class is now in namespace Microsoft.Maui.Devices.
This namespace is automatically referenced in new Maui projects, so you may refer to simply as DeviceDisplay, without needing any using ..; statement.
Typical usage is described in Device Display Information:
... DeviceDisplay.Current.MainDisplayInfo.Width // get Width in pixels.
// To keep screen on:
DeviceDisplay.Current.KeepScreenOn = true;
When accessing multiple properties, it is convenient to copy to a local variable:
IDeviceDisplay devinfo = DeviceDisplay.Current;
// OR if just want MainDisplayInfo:
DisplayInfo display = DeviceDisplay.Current.MainDisplayInfo;
I have the following event listener:
viewer.camera.moveStart.addEventListener(function(removeextra) {
// the camera started to move
clearoriginal();
});
viewer.camera.moveEnd.addEventListener(function(addback) {
// the camera stopped moving
getresults();
});
How can I remove these event listeners? I do not know the syntax.I tried with the following it does not work.
viewer.camera.moveStart.removeEventListener(removeextra);
viewer.camera.moveEnd.removeEventListener(addback);
I looked into Cesium and I think you might rewrite them like this
viewer.camera.moveStart.addEventListener(clearoriginal);
viewer.camera.moveEnd.addEventListener(getresults);
// then to remove
viewer.camera.moveStart.removeEventListener(clearoriginal);
viewer.camera.moveEnd.removeEventListener(getresults);
viewer.camera.moveEnd.removeEventListener('click',
getresults,// pass the method which you add
false
);
addEventListener() and removeEventListener() are not present in older browsers. You can work around this by inserting the following code at the beginning of your scripts, allowing the use of addEventListener() and removeEventListener() in implementations that do not natively support it. However, this method will not work on Internet Explorer 7 or earlier, since extending the Element. a prototype was not supported until Internet Explorer 8.
I always create a spinner with NSProgressIndicator like this
let spinner = NSProgressIndicator()
spinner.style = .spinning
It works fine, but I recently found the
NSProgressIndicator.Style.spinning is deprecated. I have went searched around, but did not quite find out what is the recommended way right now to create a spinner on macOS. Can anyone please help here?
Thank you
It looks like an error in the documentation. In macOS 10.15 NSProgressIndicatorBarStyle and NSProgressIndicatorSpinningStyle are deprecated. Somehow NSProgressIndicatorStyleBar and NSProgressIndicatorStyleSpinning, .bar and .spinning in Swift, were also deprecated in the documentation but they aren't in NSProgressIndicator.h.
typedef NS_ENUM(NSUInteger, NSProgressIndicatorStyle) {
NSProgressIndicatorStyleBar = 0,
NSProgressIndicatorStyleSpinning = 1
};
and
/* Please instead use the more modern versions of these constants.
*/
static const NSProgressIndicatorStyle NSProgressIndicatorBarStyle API_DEPRECATED_WITH_REPLACEMENT("NSProgressIndicatorStyleBar", macos(10.2,10.14)) = NSProgressIndicatorStyleBar;
static const NSProgressIndicatorStyle NSProgressIndicatorSpinningStyle API_DEPRECATED_WITH_REPLACEMENT("NSProgressIndicatorStyleSpinning", macos(10.2,10.14)) = NSProgressIndicatorStyleSpinning;
The style isn't deprecated; they've just been making the names consistent so it's easier to turn them into Swift.
I'm trying to implement openFlow in my project but I cant seem to get the images to show up on my uiview. What isnt clear to me is once I have the dictionary of image links, how do i tell AFOpenView that I want to use that dictionary object as my data source?
I've looked at the demo code and I see that when the flickr request finishes, he saves a copy of the dictionary results, counts them, and then tells OpenFlowView that there are x number of images, but what is never clear is how he tells OpenFlowView to use the dictionary with the results?
- (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didCompleteWithResponse:(NSDictionary *)inResponseDictionary
{
// Hold onto the response dictionary.
interestingPhotosDictionary = [inResponseDictionary retain];
int numberOfImages = [[inResponseDictionary valueForKeyPath:#"photos.photo"] count];
[(AFOpenFlowView *)self.view setNumberOfImages:numberOfImages];
}
See here: http://blog.objectgraph.com/index.php/2010/04/09/how-to-add-coverflow-effect-on-your-iphone-app-openflow/
This tutorial seems to suggest that you have to call the view's setImage method multiple times, once per image.
This tells me that the implementation is confusing and weird, but for this you have to blame the component's author.
The images are loaded on demand in the 'updateCoverImage:' method of AFOpenFlowView.m
'updateCoverImage:' calls 'openFlowView:requestImageForIndex:' in AFOpenFlowViewController.m, which uses interestingPhotosDictionary.
So, it is called on demand whenever an image needs to be loaded. It wraps an operation queue so the images are loaded outside the main thread.