Tumgik
#orientationchange
viktortalon · 2 months
Photo
Tumblr media
Rex: Malewifed
Turning dominant men into submissive well dressed husbands my beloved
Posted using PostyBirb
0 notes
compbrotherhk · 2 years
Text
Tumblr media
jQuery Mobile Orientation & Page Events jQuery Mobile Orientation 小教學 手機使用者,有時會橫向有時會直向望手機銀幕,這個習慣視乎手機使用者自身的需要或那種方式較清楚去呈現或查閱手機中的文字、圖片或影片內容。由於我們無法估計手機使用者是即將會用那種方向(直向/橫向)去使用你的手機應用程式,所以手機應用程式編寫員可以善用 jQuery Mobile Orientation Event 去應對這種情況,當手機用戶由橫轉直或由直轉橫,jQuery Mobile orientationchange Event 就會被偵測到 (triggered)。
0 notes
cssscriptcom · 5 years
Text
Trigger A Function When The User Goes Idle - idle-tracker
Trigger A Function When The User Goes Idle – idle-tracker
A small idle tracker library that tracks user interactions on the webpage and fires a callback function if the user goes idle.
Default events the library listens for:
change
keydown
mousedown
mousemove
mouseup
orientationchange
resize
scroll
touchend
touchmove
touchstart
visibilitychange
How to use it:
Install the library with package managers.
# Yarn $ yarn add idle-tracker # NPM $ npm install…
View On WordPress
0 notes
shinobu · 7 years
Text
スマホのときはslickを無効にする
公式サイトの「settings: 'unslick'」が効かなかったのですが、リサイズしたときに$('.js-slider').slick('resize');を走らせる必要があるようです。
responsiveオプションのsettings: 'unslick'を明記したあと
$('.my-class').slick({ mobileFirst: true, slidesToShow: 2, slidesToScroll: 2, responsive: [ { breakpoint: 768, settings: 'unslick' } ] });
リサイズしたときにslickのイベントを実行させる
$(window).on('resize orientationchange', function() { $('.js-slider').slick('resize'); });
2 notes · View notes
leolarsonblog · 4 years
Text
Handling Device Orientation Efficiently in Vulkan With Pre-Rotation
By Omar El Sheikh, Android Engineer
Francesco Carucci, Developer Advocate
Vulkan provides developers with the power to specify much more information to devices about rendering state compared to OpenGL. With that power though comes some new responsibilities; developers are expected to explicitly implement things that in OpenGL were handled by the driver. One of these things is device orientation and its relationship to render surface orientation. Currently, there are 3 ways that Android can handle reconciling the render surface of the device with the orientation of the device :
The device has a Display Processing Unit (DPU) that can efficiently handle surface rotation in hardware to match the device orientation (requires a device that supports this)
The Android OS can handle surface rotation by adding a compositor pass that will have a performance cost depending on how the compositor has to deal with rotating the output image
The application itself can handle the surface rotation by rendering a rotated image onto a render surface that matches the current orientation of the display
What Does This Mean For Your Apps?
There currently isn't a way for an application to know whether surface rotation handled outside of the application will be free. Even if there is a DPU to take care of this for us, there will still likely be a measurable performance penalty to pay. If your application is CPU bound, this becomes a huge power issue due to the increased GPU usage by the Android Compositor which usually is running at a boosted frequency as well; and if your application is GPU bound, then it becomes a potentially large performance issue on top of that as the Android Compositor will preempt your application's GPU work causing your application to drop its frame rate.
On Pixel 4XL, we have seen on shipping titles that SurfaceFlinger (the higher-priority task that drives the Android Compositor) both regularly preempts the application’s work causing 1-3ms hits to frametimes, as well as puts increased pressure on the GPU’s vertex/texture memory as the Compositor has to read the frame to do its composition work.
Handling orientation properly stops GPU preemption by SurfaceFlinger almost entirely, as well as sees the GPU frequency drop 40% as the boosted frequency used by the Android Compositor is no longer needed.
To ensure surface rotations are handled properly with as little overhead as possible (as seen in the case above) we recommend implementing method 3 - this is known as pre-rotation. The primary mechanism with which this works is by telling the Android OS that we are handling the surface rotation by specifying in the orientation during swapchain creation through the passed in surface transform flags, which stops the Android Compositor from doing the rotation itself.
Knowing how to set the surface transform flag is important for every Vulkan application, since applications tend to either support multiple orientations, or support a single orientation where its render surface is in a different orientation to what the device considers its identity orientation; For example a landscape-only application on a portrait-identity phone, or a portrait-only application on a landscape-identity tablet.
In this post we will describe in detail how to implement pre-rotation and handle device rotation in your Vulkan application.
Modify AndroidManifest.xml
To handle device rotation in your app, change the application’s AndroidManifest.xml to tell Android that your app will handle orientation and screen size changes. This prevents Android from destroying and recreating the Android activity and calling the onDestroy() function on the existing window surface when an orientation change occurs. This is done by adding the orientation (to support API level <13) and screenSize attributes to the activity’s configChanges section:
<activity android:name="android.app.NativeActivity" android:configChanges="orientation|screenSize">
If your application fixes its screen orientation using the screenOrientation attribute you do not need to do this. Also if your application uses a fixed orientation then it will only need to setup the swapchain once on application startup/resume.
Get the Identity Screen Resolution and Camera Parameters
The next thing that needs to be done is to detect the device’s screen resolution that is associated with the VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR as this resolution is the one that the Swapchain will always need to be set to. The most reliable way to get this is to make a call to vkGetPhysicalDeviceSurfaceCapabilitiesKHR() at application startup and storing the returned extent - swapping the width and height based on the currentTransform that is also returned in order to ensure we are storing the identity screen resolution:
VkSurfaceCapabilitiesKHR capabilities; vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physDevice, surface, &capabilities); uint32_t width = capabilities.currentExtent.width; uint32_t height = capabilities.currentExtent.height; if (capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR || capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { // Swap to get identity width and height capabilities.currentExtent.height = width; capabilities.currentExtent.width = height; } displaySizeIdentity = capabilities.currentExtent;
displaySizeIdentity is a VkExtent2D that we use to store said identity resolution of the app's window surface in the display’s natural orientation.
Detect Device Orientation Changes (Android 10+)
To know when the application has encountered an orientation change, the most reliable means of tracking this change involves checking the return value of vkQueuePresentKHR() and seeing if it returned VK_SUBOPTIMAL_KHR
auto res = vkQueuePresentKHR(queue_, &present_info); if (res == VK_SUBOPTIMAL_KHR){ orientationChanged = true; }
One thing to note about this solution is that it only works on devices running Android Q and above as that is when Android started to return VK_SUBOPTIMAL_KHR from vkQueuePresentKHR()
orientationChanged is a boolean stored somewhere accessible from the applications main rendering loop
Detecting Device Orientation Changes (Pre-Android 10)
For devices running older versions of Android below 10, a different implementation is needed since we do not have access to VK_SUBOPTIMAL_KHR.
Using Polling
On pre-10 devices we can poll the current device transform every pollingInterval frames, where pollingInterval is a granularity decided on by the programmer. The way we do this is by calling vkGetPhysicalDeviceSurfaceCapabilitiesKHR() and then comparing the returned currentTransform field with that of the currently stored surface transformation (in this code example stored in pretransformFlag)
currFrameCount++; if (currFrameCount >= pollInterval){ VkSurfaceCapabilitiesKHR capabilities; vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physDevice, surface, &capabilities); if (pretransformFlag != capabilities.currentTransform) { window_resized = true; } currFrameCount = 0; }
On a Pixel 4 running Android Q, polling vkGetPhysicalDeviceSurfaceCapabilitiesKHR() took between .120-.250ms and on a Pixel 1XL running Android O polling took .110-.350ms
Using Callbacks
A second option for devices running below Android 10 is to register an onNativeWindowResized() callback to call a function that sets the orientationChanged flag to signal to the application an orientation change has occurred:
void android_main(struct android_app *app) { ... app->activity->callbacks->onNativeWindowResized = ResizeCallback; }
Where ResizeCallback is defined as:
void ResizeCallback(ANativeActivity *activity, ANativeWindow *window){ orientationChanged = true; }
The drawback to this solution is that onNativeWindowResized() only ever gets called on 90 degree orientation changes (going from landscape to portrait or vice versa), so for example an orientation change from landscape to reverse landscape will not trigger the swapchain recreation, requiring the Android compositor to do the flip for your application.
Handling the Orientation Change
To actually handle the orientation change, we first have a check at the top of the main rendering loop for whether the orientationChanged variable has been set to true, and if so we'll go into the orientation change routine:
bool VulkanDrawFrame() { if (orientationChanged) { OnOrientationChange(); }
And within the OnOrientationChange() function we will do all the work necessary to recreate the swapchain. This involves destroying any existing Framebuffers and ImageViews; recreating the swapchain while destroying the old swapchain (which will be discussed next); and then recreating the Framebuffers with the new swapchain’s DisplayImages. Note that attachment images (depth/stencil images for example) usually do not need to be recreated as they are based on the identity resolution of the pre-rotated swapchain images.
void OnOrientationChange() { vkDeviceWaitIdle(getDevice()); for (int i = 0; i < getSwapchainLength(); ++i) { vkDestroyImageView(getDevice(), displayViews_[i], nullptr); vkDestroyFramebuffer(getDevice(), framebuffers_[i], nullptr); } createSwapChain(getSwapchain()); createFrameBuffers(render_pass, depthBuffer.image_view); orientationChanged = false; }
And at the end of the function we reset the orientationChanged flag to false to show that we have handled the orientation change.
Swapchain Recreation
In the previous section we mention having to recreate the swapchain. The first steps to doing so involves getting the new characteristics of the rendering surface:
void createSwapChain(VkSwapchainKHR oldSwapchain) { VkSurfaceCapabilitiesKHR capabilities; vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physDevice, surface, &capabilities); pretransformFlag = capabilities.currentTransform;
With the VkSurfaceCapabilities struct populated with the new information, we can now check to see whether an orientation change has occurred by checking the currentTransform field and store it for later in the pretransformFlag field as we will be needing it for later when we make adjustments to the MVP matrix.
In order to do so we must make sure that we properly specify some attributes within the VkSwapchainCreateInfo struct:
VkSwapchainCreateInfoKHR swapchainCreateInfo{ ... .sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, .imageExtent = displaySizeIdentity, .preTransform = pretransformFlag, .oldSwapchain = oldSwapchain, }; vkCreateSwapchainKHR(device_, &swapchainCreateInfo, nullptr, &swapchain_)); if (oldSwapchain != VK_NULL_HANDLE) { vkDestroySwapchainKHR(device_, oldSwapchain, nullptr); }
The imageExtent field will be populated with the displaySizeIdentity extent that we stored at application startup. The preTransform field will be populated with our pretransformFlag variable (which is set to the currentTransform field of the surfaceCapabilities). We also set the oldSwapchain field to the swapchain that we are about to destroy.
It is important that the surfaceCapabilities.currentTransform field and the swapchainCreateInfo.preTransform field match because this lets the Android OS know that we are handling the orientation change ourselves, thus avoiding the Android Compositor.
MVP Matrix Adjustment
The last thing that needs to be done is actually apply the pre-transformation. This is done by applying a rotation matrix to your MVP matrix. What this essentially does is apply the rotation in clip space so that the resulting image is rotated to the device current orientation. You can then simply pass this updated MVP matrix into your vertex shader and use it as normal without the need to modify your shaders.
glm::mat4 pre_rotate_mat = glm::mat4(1.0f); glm::vec3 rotation_axis = glm::vec3(0.0f, 0.0f, 1.0f); if (pretransformFlag & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { pre_rotate_mat = glm::rotate(pre_rotate_mat, glm::radians(90.0f), rotation_axis); } else if (pretransformFlag & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { pre_rotate_mat = glm::rotate(pre_rotate_mat, glm::radians(270.0f), rotation_axis); } else if (pretransformFlag & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { pre_rotate_mat = glm::rotate(pre_rotate_mat, glm::radians(180.0f), rotation_axis); } MVP = pre_rotate_mat * MVP;
Consideration - Non-Full Screen Viewport and Scissor
If your application is using a non-full screen viewport/scissor region, they will need to be updated according to the orientation of the device. This requires that we enable the dynamic Viewport and Scissor options during Vulkan’s pipeline creation:
VkDynamicState dynamicStates[2] = { VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR, }; VkPipelineDynamicStateCreateInfo dynamicInfo = { .sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO, .pNext = nullptr, .flags = 0, .dynamicStateCount = 2, .pDynamicStates = dynamicStates, }; VkGraphicsPipelineCreateInfo pipelineCreateInfo = { .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, ... .pDynamicState = &dynamicInfo, ... }; VkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineCreateInfo, nullptr, &mPipeline);
The actual computation of the viewport extent during command buffer recording looks like this:
int x = 0, y = 0, w = 500, h = 400; glm::vec4 viewportData; switch (device->GetPretransformFlag()) { case VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR: viewportData = {bufferWidth - h - y, x, h, w}; break; case VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR: viewportData = {bufferWidth - w - x, bufferHeight - h - y, w, h}; break; case VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR: viewportData = {y, bufferHeight - w - x, h, w}; break; default: viewportData = {x, y, w, h}; break; } const VkViewport viewport = { .x = viewportData.x, .y = viewportData.y, .width = viewportData.z, .height = viewportData.w, .minDepth = 0.0F, .maxDepth = 1.0F, }; vkCmdSetViewport(renderer->GetCurrentCommandBuffer(), 0, 1, &viewport);
Where x and y define the coordinates of the top left corner of the viewport, and w and h define the width and height of the viewport respectively.
The same computation can be used to also set the scissor test, and is included below for completeness:
int x = 0, y = 0, w = 500, h = 400; glm::vec4 scissorData; switch (device->GetPretransformFlag()) { case VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR: scissorData = {bufferWidth - h - y, x, h, w}; break; case VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR: scissorData = {bufferWidth - w - x, bufferHeight - h - y, w, h}; break; case VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR: scissorData = {y, bufferHeight - w - x, h, w}; break; default: scissorData = {x, y, w, h}; break; } const VkRect2D scissor = { .offset = { .x = (int32_t)viewportData.x, .y = (int32_t)viewportData.y, }, .extent = { .width = (uint32_t)viewportData.z, .height = (uint32_t)viewportData.w, }, }; vkCmdSetScissor(renderer->GetCurrentCommandBuffer(), 0, 1, &scissor);
Consideration - Fragment Shader Derivatives
If your application is using derivative computations such as dFdx and dFdy, additional transformations may be needed to account for the rotated coordinate system as these computations are executed in pixel space. This requires the app to pass some indication of the preTransform into the fragment shader (such as an integer representing the current device orientation) and use that to map the derivative computations properly:
For a 90 degree pre-rotated frame
dFdx needs to be mapped to dFdy
dFdy needs to be mapped to dFdx
For a 270 degree pre-rotated frame
dFdx needs to be mapped to -dFdy
dFdy needs to be mapped to -dFdx
For a 180 degree pre-rotated frame,
dFdx needs to be mapped to -dFdx
dFdy needs to be mapped to -dFdy
Conclusion
In order for your application to get the most out of Vulkan on Android, implementing pre-rotation is a must. The most important takeaways from this blogpost are:
Ensure that during swapchain creation or recreation, the pretransform flag is set so that it matches the flag returned by the Android operating system. This will avoid the compositor overhead
Keep the swapchain size fixed to the identity resolution of the app's window surface in the display’s natural orientation
Rotate the MVP matrix in clip space to account for the devices orientation since the swapchain resolution/extent no longer update with the orientation of the display
Update viewport and scissor rectangles as needed by your application
Here is a link to a minimal example of pre-rotation being implemented for an android application:
https://github.com/google/vulkan-pre-rotation-demo
Handling Device Orientation Efficiently in Vulkan With Pre-Rotation published first on https://phonetracking.tumblr.com/
0 notes
donaldlockhart · 4 years
Text
Handling Device Orientation Efficiently in Vulkan With Pre-Rotation
By Omar El Sheikh, Android Engineer
Francesco Carucci, Developer Advocate
Vulkan provides developers with the power to specify much more information to devices about rendering state compared to OpenGL. With that power though comes some new responsibilities; developers are expected to explicitly implement things that in OpenGL were handled by the driver. One of these things is device orientation and its relationship to render surface orientation. Currently, there are 3 ways that Android can handle reconciling the render surface of the device with the orientation of the device :
The device has a Display Processing Unit (DPU) that can efficiently handle surface rotation in hardware to match the device orientation (requires a device that supports this)
The Android OS can handle surface rotation by adding a compositor pass that will have a performance cost depending on how the compositor has to deal with rotating the output image
The application itself can handle the surface rotation by rendering a rotated image onto a render surface that matches the current orientation of the display
What Does This Mean For Your Apps?
There currently isn't a way for an application to know whether surface rotation handled outside of the application will be free. Even if there is a DPU to take care of this for us, there will still likely be a measurable performance penalty to pay. If your application is CPU bound, this becomes a huge power issue due to the increased GPU usage by the Android Compositor which usually is running at a boosted frequency as well; and if your application is GPU bound, then it becomes a potentially large performance issue on top of that as the Android Compositor will preempt your application's GPU work causing your application to drop its frame rate.
On Pixel 4XL, we have seen on shipping titles that SurfaceFlinger (the higher-priority task that drives the Android Compositor) both regularly preempts the application’s work causing 1-3ms hits to frametimes, as well as puts increased pressure on the GPU’s vertex/texture memory as the Compositor has to read the frame to do its composition work.
Handling orientation properly stops GPU preemption by SurfaceFlinger almost entirely, as well as sees the GPU frequency drop 40% as the boosted frequency used by the Android Compositor is no longer needed.
To ensure surface rotations are handled properly with as little overhead as possible (as seen in the case above) we recommend implementing method 3 - this is known as pre-rotation. The primary mechanism with which this works is by telling the Android OS that we are handling the surface rotation by specifying in the orientation during swapchain creation through the passed in surface transform flags, which stops the Android Compositor from doing the rotation itself.
Knowing how to set the surface transform flag is important for every Vulkan application, since applications tend to either support multiple orientations, or support a single orientation where its render surface is in a different orientation to what the device considers its identity orientation; For example a landscape-only application on a portrait-identity phone, or a portrait-only application on a landscape-identity tablet.
In this post we will describe in detail how to implement pre-rotation and handle device rotation in your Vulkan application.
Modify AndroidManifest.xml
To handle device rotation in your app, change the application’s AndroidManifest.xml to tell Android that your app will handle orientation and screen size changes. This prevents Android from destroying and recreating the Android activity and calling the onDestroy() function on the existing window surface when an orientation change occurs. This is done by adding the orientation (to support API level <13) and screenSize attributes to the activity’s configChanges section:
<activity android:name="android.app.NativeActivity" android:configChanges="orientation|screenSize">
If your application fixes its screen orientation using the screenOrientation attribute you do not need to do this. Also if your application uses a fixed orientation then it will only need to setup the swapchain once on application startup/resume.
Get the Identity Screen Resolution and Camera Parameters
The next thing that needs to be done is to detect the device’s screen resolution that is associated with the VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR as this resolution is the one that the Swapchain will always need to be set to. The most reliable way to get this is to make a call to vkGetPhysicalDeviceSurfaceCapabilitiesKHR() at application startup and storing the returned extent - swapping the width and height based on the currentTransform that is also returned in order to ensure we are storing the identity screen resolution:
VkSurfaceCapabilitiesKHR capabilities; vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physDevice, surface, &capabilities); uint32_t width = capabilities.currentExtent.width; uint32_t height = capabilities.currentExtent.height; if (capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR || capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { // Swap to get identity width and height capabilities.currentExtent.height = width; capabilities.currentExtent.width = height; } displaySizeIdentity = capabilities.currentExtent;
displaySizeIdentity is a VkExtent2D that we use to store said identity resolution of the app's window surface in the display’s natural orientation.
Detect Device Orientation Changes (Android 10+)
To know when the application has encountered an orientation change, the most reliable means of tracking this change involves checking the return value of vkQueuePresentKHR() and seeing if it returned VK_SUBOPTIMAL_KHR
auto res = vkQueuePresentKHR(queue_, &present_info); if (res == VK_SUBOPTIMAL_KHR){ orientationChanged = true; }
One thing to note about this solution is that it only works on devices running Android Q and above as that is when Android started to return VK_SUBOPTIMAL_KHR from vkQueuePresentKHR()
orientationChanged is a boolean stored somewhere accessible from the applications main rendering loop
Detecting Device Orientation Changes (Pre-Android 10)
For devices running older versions of Android below 10, a different implementation is needed since we do not have access to VK_SUBOPTIMAL_KHR.
Using Polling
On pre-10 devices we can poll the current device transform every pollingInterval frames, where pollingInterval is a granularity decided on by the programmer. The way we do this is by calling vkGetPhysicalDeviceSurfaceCapabilitiesKHR() and then comparing the returned currentTransform field with that of the currently stored surface transformation (in this code example stored in pretransformFlag)
currFrameCount++; if (currFrameCount >= pollInterval){ VkSurfaceCapabilitiesKHR capabilities; vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physDevice, surface, &capabilities); if (pretransformFlag != capabilities.currentTransform) { window_resized = true; } currFrameCount = 0; }
On a Pixel 4 running Android Q, polling vkGetPhysicalDeviceSurfaceCapabilitiesKHR() took between .120-.250ms and on a Pixel 1XL running Android O polling took .110-.350ms
Using Callbacks
A second option for devices running below Android 10 is to register an onNativeWindowResized() callback to call a function that sets the orientationChanged flag to signal to the application an orientation change has occurred:
void android_main(struct android_app *app) { ... app->activity->callbacks->onNativeWindowResized = ResizeCallback; }
Where ResizeCallback is defined as:
void ResizeCallback(ANativeActivity *activity, ANativeWindow *window){ orientationChanged = true; }
The drawback to this solution is that onNativeWindowResized() only ever gets called on 90 degree orientation changes (going from landscape to portrait or vice versa), so for example an orientation change from landscape to reverse landscape will not trigger the swapchain recreation, requiring the Android compositor to do the flip for your application.
Handling the Orientation Change
To actually handle the orientation change, we first have a check at the top of the main rendering loop for whether the orientationChanged variable has been set to true, and if so we'll go into the orientation change routine:
bool VulkanDrawFrame() { if (orientationChanged) { OnOrientationChange(); }
And within the OnOrientationChange() function we will do all the work necessary to recreate the swapchain. This involves destroying any existing Framebuffers and ImageViews; recreating the swapchain while destroying the old swapchain (which will be discussed next); and then recreating the Framebuffers with the new swapchain’s DisplayImages. Note that attachment images (depth/stencil images for example) usually do not need to be recreated as they are based on the identity resolution of the pre-rotated swapchain images.
void OnOrientationChange() { vkDeviceWaitIdle(getDevice()); for (int i = 0; i < getSwapchainLength(); ++i) { vkDestroyImageView(getDevice(), displayViews_[i], nullptr); vkDestroyFramebuffer(getDevice(), framebuffers_[i], nullptr); } createSwapChain(getSwapchain()); createFrameBuffers(render_pass, depthBuffer.image_view); orientationChanged = false; }
And at the end of the function we reset the orientationChanged flag to false to show that we have handled the orientation change.
Swapchain Recreation
In the previous section we mention having to recreate the swapchain. The first steps to doing so involves getting the new characteristics of the rendering surface:
void createSwapChain(VkSwapchainKHR oldSwapchain) { VkSurfaceCapabilitiesKHR capabilities; vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physDevice, surface, &capabilities); pretransformFlag = capabilities.currentTransform;
With the VkSurfaceCapabilities struct populated with the new information, we can now check to see whether an orientation change has occurred by checking the currentTransform field and store it for later in the pretransformFlag field as we will be needing it for later when we make adjustments to the MVP matrix.
In order to do so we must make sure that we properly specify some attributes within the VkSwapchainCreateInfo struct:
VkSwapchainCreateInfoKHR swapchainCreateInfo{ ... .sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, .imageExtent = displaySizeIdentity, .preTransform = pretransformFlag, .oldSwapchain = oldSwapchain, }; vkCreateSwapchainKHR(device_, &swapchainCreateInfo, nullptr, &swapchain_)); if (oldSwapchain != VK_NULL_HANDLE) { vkDestroySwapchainKHR(device_, oldSwapchain, nullptr); }
The imageExtent field will be populated with the displaySizeIdentity extent that we stored at application startup. The preTransform field will be populated with our pretransformFlag variable (which is set to the currentTransform field of the surfaceCapabilities). We also set the oldSwapchain field to the swapchain that we are about to destroy.
It is important that the surfaceCapabilities.currentTransform field and the swapchainCreateInfo.preTransform field match because this lets the Android OS know that we are handling the orientation change ourselves, thus avoiding the Android Compositor.
MVP Matrix Adjustment
The last thing that needs to be done is actually apply the pre-transformation. This is done by applying a rotation matrix to your MVP matrix. What this essentially does is apply the rotation in clip space so that the resulting image is rotated to the device current orientation. You can then simply pass this updated MVP matrix into your vertex shader and use it as normal without the need to modify your shaders.
glm::mat4 pre_rotate_mat = glm::mat4(1.0f); glm::vec3 rotation_axis = glm::vec3(0.0f, 0.0f, 1.0f); if (pretransformFlag & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { pre_rotate_mat = glm::rotate(pre_rotate_mat, glm::radians(90.0f), rotation_axis); } else if (pretransformFlag & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { pre_rotate_mat = glm::rotate(pre_rotate_mat, glm::radians(270.0f), rotation_axis); } else if (pretransformFlag & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { pre_rotate_mat = glm::rotate(pre_rotate_mat, glm::radians(180.0f), rotation_axis); } MVP = pre_rotate_mat * MVP;
Consideration - Non-Full Screen Viewport and Scissor
If your application is using a non-full screen viewport/scissor region, they will need to be updated according to the orientation of the device. This requires that we enable the dynamic Viewport and Scissor options during Vulkan’s pipeline creation:
VkDynamicState dynamicStates[2] = { VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR, }; VkPipelineDynamicStateCreateInfo dynamicInfo = { .sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO, .pNext = nullptr, .flags = 0, .dynamicStateCount = 2, .pDynamicStates = dynamicStates, }; VkGraphicsPipelineCreateInfo pipelineCreateInfo = { .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, ... .pDynamicState = &dynamicInfo, ... }; VkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineCreateInfo, nullptr, &mPipeline);
The actual computation of the viewport extent during command buffer recording looks like this:
int x = 0, y = 0, w = 500, h = 400; glm::vec4 viewportData; switch (device->GetPretransformFlag()) { case VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR: viewportData = {bufferWidth - h - y, x, h, w}; break; case VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR: viewportData = {bufferWidth - w - x, bufferHeight - h - y, w, h}; break; case VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR: viewportData = {y, bufferHeight - w - x, h, w}; break; default: viewportData = {x, y, w, h}; break; } const VkViewport viewport = { .x = viewportData.x, .y = viewportData.y, .width = viewportData.z, .height = viewportData.w, .minDepth = 0.0F, .maxDepth = 1.0F, }; vkCmdSetViewport(renderer->GetCurrentCommandBuffer(), 0, 1, &viewport);
Where x and y define the coordinates of the top left corner of the viewport, and w and h define the width and height of the viewport respectively.
The same computation can be used to also set the scissor test, and is included below for completeness:
int x = 0, y = 0, w = 500, h = 400; glm::vec4 scissorData; switch (device->GetPretransformFlag()) { case VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR: scissorData = {bufferWidth - h - y, x, h, w}; break; case VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR: scissorData = {bufferWidth - w - x, bufferHeight - h - y, w, h}; break; case VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR: scissorData = {y, bufferHeight - w - x, h, w}; break; default: scissorData = {x, y, w, h}; break; } const VkRect2D scissor = { .offset = { .x = (int32_t)viewportData.x, .y = (int32_t)viewportData.y, }, .extent = { .width = (uint32_t)viewportData.z, .height = (uint32_t)viewportData.w, }, }; vkCmdSetScissor(renderer->GetCurrentCommandBuffer(), 0, 1, &scissor);
Consideration - Fragment Shader Derivatives
If your application is using derivative computations such as dFdx and dFdy, additional transformations may be needed to account for the rotated coordinate system as these computations are executed in pixel space. This requires the app to pass some indication of the preTransform into the fragment shader (such as an integer representing the current device orientation) and use that to map the derivative computations properly:
For a 90 degree pre-rotated frame
dFdx needs to be mapped to dFdy
dFdy needs to be mapped to dFdx
For a 270 degree pre-rotated frame
dFdx needs to be mapped to -dFdy
dFdy needs to be mapped to -dFdx
For a 180 degree pre-rotated frame,
dFdx needs to be mapped to -dFdx
dFdy needs to be mapped to -dFdy
Conclusion
In order for your application to get the most out of Vulkan on Android, implementing pre-rotation is a must. The most important takeaways from this blogpost are:
Ensure that during swapchain creation or recreation, the pretransform flag is set so that it matches the flag returned by the Android operating system. This will avoid the compositor overhead
Keep the swapchain size fixed to the identity resolution of the app's window surface in the display’s natural orientation
Rotate the MVP matrix in clip space to account for the devices orientation since the swapchain resolution/extent no longer update with the orientation of the display
Update viewport and scissor rectangles as needed by your application
Here is a link to a minimal example of pre-rotation being implemented for an android application:
https://github.com/google/vulkan-pre-rotation-demo
Handling Device Orientation Efficiently in Vulkan With Pre-Rotation published first on https://phonetracking.tumblr.com/
0 notes
elisearees · 5 years
Text
MRAID Sample Ads
MRAID Sample Ads
Introduction
This document provides sample ads that demonstrate the basic functionality of the ad types described in the MRAID v1.0 and v2.0 standards and supported in Opera Mediaworks’ SDKs. Each example below provides an HTML code snippet, a list of the methods and events used, and the expected behavior for a given ad type. The ads were successfully tested using AdMarvel’s iOS and Android Tester Apps. They were also successfully tested using the MRAID web tester, a tool that simulates an SDK environment. Any exceptions in web tester behavior are noted in the respective sections.
Audience
This document is for anyone creating MRAID-compliant ads meant to run in Opera Mediaworks SDKs. Some familiarity with the MRAID specification is required.
MRAID v2.0 Ads
Each ad type here uses at least some functionality that is only available in MRAID v2.0. The URLs contain raw HTML code and must be used as HTML snippets/fragments. They are not complete HTML documents/pages. Following are the available ad types:
Expand with Orientation Locked to Portrait
Expand Stay Centered Using Size Change
Simple Resize
Video Interstitial
Diagnostic Ad
Expand with Orientation Locked to Portrait
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_expand_with_locked_portrait_orientation.txt
Methods
expand
close
addEventListener
removeEventListener
open
getState
setOrientationProperties
playVideo
supports
storePicture
createCalendarEvent
Events
ready
stateChange
Expected Behavior
This ad renders as a 320×50 banner that attempts to expand when clicked. No special expand properties are set, but setOrientationProperties() is called to lock the orientation so that the ad expands in portrait only. The expanded ad has buttons for various click actions that use the new MRAID v2.0 methods, such as playVideo() instead of open(), when appropriate. They also check the supports() method where possible, and if the current device does not support the given action, displays an alert instead of processing the action.
Expand Stay Centered Using Size Change
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_expand_stay_centered.txt
Methods Used
expand
close
addEventListener
removeEventListner
open
getState
playVideo
supports
storePicture
createCalendarEvent
Events Used
ready
stateChange
sizeChange
Expected Behavior
This ad renders as a 320×50 banner that attempts to expand when clicked. No special expand properties are set. The ad uses the sizeChange events to keep the 320×250 expanded ad contents centered on the screen both horizontally and vertically. The expanded ad has buttons for various click actions that use the new MRAID v2.0 methods, such as playVideo() instead of open(), when appropriate. They also check the supports() method where possible and, if the current device doesn’t support the given action, displays an alert this instead of processing the action.
Simple Resize
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_simple_resize.txt
Methods Used
close
addEventListener
removeEventListener
open
getState
resize
setResiveProperties
playVideo
supports
storePicture
createCalendarEvent
Events Used
ready
stateChange
orientationchange (covered in MRAID v2.0 Ads above)
Expected Behavior
This ad renders as a 320×50 banner that attempts to resize to a 320×250 non-modal ad when clicked. The resize properties are setup so that the width is 320, the height is 250, the offsetX is 0, offsetY is 0, and allowOffscreen is false. This means that the ad resizes down if there is space, but will resize to fit on screen if there is not, so a banner on the bottom of the app would resize up. Since resize ads are unable to lock orientation, this collapses itself on a rotation change to prevent any unexpected behavior. The resized ad has buttons for click actions that use the new MRAID v2.0 methods, such as playVideo() instead of open(), when appropriate. They also check the supports() method where possible, and if the current device does not support the given action, then the device displays an alert instead of processing the action.
Video Interstitial
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_video_interstitial.txt
Methods Used
addEventListener
removeEventListner
open
getState
isViewable
supports
close
useCustomClose
setOrientationProperties
getScreenSize
Events Used
ready
viewableChange
Expected Behavior
This ad renders as a full screen video interstitial. It forces landscape orientation using setOrientationProperties() and uses the getScreenSize() method to scale the video to the max size for the device without chopping any of the video. It uses the viewableChange event to tell when it is displayed and therefore should start the video. This ad assumes the device supports HTML5 video and the video object can be used to play video. If the SDK supports inlineVideo, then the close button is hidden and the video auto-closes when the video completes. If the SDK does not support inlineVideo, then the close button remains and it is assumed the video will play full-screen.
This ad works in the web tester with the following exceptions:
The useCustomClose method does not hide the close button when the simulated device is rotated to landscape.
The audio continues even after clicking the close button that closes the ad video.
The video renders small and does not play full-screen.
Diagnostic Ad
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_diagnostics.txt
Methods Used
addEventListener
removeEventListner
getState
isViewable
supports
close
useCustomClose
getScreenSize
getCurrentPosition
getDefaultPosition
getMaxSize
getVersion
getPlacementType
expand
getExpandProperties
setExpandProperties
useCustomClose
open
playVideo
storePicture
createCalendarEvent
Events Used
ready
error
sizeChange
stateChange
viewableChange
Expected Behavior
This ad is intended to help diagnose problems that are occurring in the MRAID container. It can run as a banner or an interstitial. Since there is a lot of information to fit in this ad, run it as at least a 320×250 banner. Also, it is much easier to use in a simulator than on device where values are hard to edit. This ad provides access to all MRAID v2 APIs and also listens to all MRAID v2.0 events. When an event fires the affected value flashes green for a second to provide a visual clue that this values changed. This ad is also useful for testing cases not covered by the specific test ads above. Potential useful test cases include more complicated resize scenarios, resize and then expand, two part expands, etc.
The testing AdMarvel performed in the web tester was limited compared to the functionality this ad exposes. However, here are the issues:
The setOrientationProperties does not always work.
The value of useCustomClose does not always revert false when the checkmark is removed.
MRAID v1.0 Ads
These ads run fine in both MRAID v1.0 and v2.0, though the behavior might be slightly different depending on the SDK implementation. The URLs contain raw HTML code and must be used as HTML snippets/fragments. However, they are not complete HTML documents/pages. Following are the available ad types:
Expand with Custom Close
Expand Using getExpandProperties to Center
Simple Interstitial
Expand with Custom Close
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v1_expand_with_custom_close.txt
Methods Used
expand
close
addEventListener
removeEventListner
setExpandProperties
open
getState
Events Used
ready
stateChange
orientationchange (not covered in MRAID v1.0)
Expected Behavior
This ad renders as a 320×50 banner that expands when clicked. The expand properties set a 320×250 size and useCustomClose to true to hide the SDK close button. On MRAID v1.0, this is a modal full screen expansion or a non-modal partial screen expansion. On MRAID v2.0, you are guaranteed a full screen expansion. Since orientation locking was not possible in MRAID v1.0, this ad collapses itself on rotation change to prevent any unexpected behavior. The expanded ad has buttons for various click actions, all handled by calling open().
Expand Using getExpandProperties to Center
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v1_expand_centered.txt
Methods Used
expand()
close()
addEventListener
removeEventListner
getExpandProperties
open
getState
Events Used
ready
stateChange
orientationchange (not covered in MRAID v1.0)
window.orientation (not covered in MRAID v1.0)
Expected Behavior
This ad renders as a 320×50 banner that expands when clicked. The expand properties are not set, so a full screen expansion is intended and the SDK provided close button is used. Also, the getExpandProperties are read prior to expansion to get the screen dimensions and to center the 320×250 when expanded. The behavior on MRAID v1.0 and MRAID v2.0 should be very similar since this is a full screen expansion on both. Since orientation locking wasn’t possible in MRAID v1.0, this ad collapses itself on rotation change to prevent any unexpected behavior. The expanded ad has buttons for various click actions, all handled by calling open().
This ad worked as expected in the web tester in portrait orientation. However, the ad does not work as expected in landscape. The dimensions returned in getExpandProperties() for landscape are incorrect (though this could be due to the device geometry setup) and since window.orientation does not have a valid value, the creative cannot adjust.
Simple Interstitial
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v1_simple_interstitial.txt
Methods Used
addEventListener
removeEventListner
open
getState
isViewable
Events Used
ready
viewableChange
Expected Behavior
This ad renders as a full screen 320×480 interstitial. The important part of this ad is that it uses the viewableChange event to tell when it is displayed. In this case, this event just makes the ad visible. However, most ads use this to fire impressions as well as start the ad experience. The behavior on MRAID v1.0 and MRAID v2.0 is the same for this ad. The interstitial has buttons for various click actions, all handled by calling open().
Last Updated Sep 18, 2015
Linking News, the best press release distribution service provider, has the strongest network in the entire industry, including more than 10,000 news outlets and over 1,000 social media networks around the globe. We distribute your company’s news or articles to thousands of the world’s top media outlets and over 30,000+ journalists. Your story will be syndicated to many news and media sites, including ABC, NBC, CBS, FOX, and many more notable names, with the White Label Press Release Distribution Solution (unbranded or private label press release service).
Visit www.linkingnews.com.
Linking News, the best press release distribution service provider, has the strongest network in the entire industry, including more than 10,000 news outlets and over 1,000 social media networks around the globe. Your press release will be guaranteed to be published on 300+ news and media sites, including ABC, NBC, CBS, FOX, and many more notable names, with the white label press release distribution solution (unbranded or private label press release service).
Best Press Release Distribution Service
Order Now
The post MRAID Sample Ads appeared first on Linking News.
from https://www.linkingnews.com/mraidsampleads/
from http://pressreleasedistn.weebly.com/blog/mraid-sample-ads
from http://valeriegbray.weebly.com/blog/mraid-sample-ads
0 notes
janajpotter · 5 years
Text
MRAID Sample Ads
MRAID Sample Ads
Introduction
This document provides sample ads that demonstrate the basic functionality of the ad types described in the MRAID v1.0 and v2.0 standards and supported in Opera Mediaworks’ SDKs. Each example below provides an HTML code snippet, a list of the methods and events used, and the expected behavior for a given ad type. The ads were successfully tested using AdMarvel’s iOS and Android Tester Apps. They were also successfully tested using the MRAID web tester, a tool that simulates an SDK environment. Any exceptions in web tester behavior are noted in the respective sections.
Audience
This document is for anyone creating MRAID-compliant ads meant to run in Opera Mediaworks SDKs. Some familiarity with the MRAID specification is required.
MRAID v2.0 Ads
Each ad type here uses at least some functionality that is only available in MRAID v2.0. The URLs contain raw HTML code and must be used as HTML snippets/fragments. They are not complete HTML documents/pages. Following are the available ad types:
Expand with Orientation Locked to Portrait
Expand Stay Centered Using Size Change
Simple Resize
Video Interstitial
Diagnostic Ad
Expand with Orientation Locked to Portrait
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_expand_with_locked_portrait_orientation.txt
Methods
expand
close
addEventListener
removeEventListener
open
getState
setOrientationProperties
playVideo
supports
storePicture
createCalendarEvent
Events
ready
stateChange
Expected Behavior
This ad renders as a 320×50 banner that attempts to expand when clicked. No special expand properties are set, but setOrientationProperties() is called to lock the orientation so that the ad expands in portrait only. The expanded ad has buttons for various click actions that use the new MRAID v2.0 methods, such as playVideo() instead of open(), when appropriate. They also check the supports() method where possible, and if the current device does not support the given action, displays an alert instead of processing the action.
Expand Stay Centered Using Size Change
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_expand_stay_centered.txt
Methods Used
expand
close
addEventListener
removeEventListner
open
getState
playVideo
supports
storePicture
createCalendarEvent
Events Used
ready
stateChange
sizeChange
Expected Behavior
This ad renders as a 320×50 banner that attempts to expand when clicked. No special expand properties are set. The ad uses the sizeChange events to keep the 320×250 expanded ad contents centered on the screen both horizontally and vertically. The expanded ad has buttons for various click actions that use the new MRAID v2.0 methods, such as playVideo() instead of open(), when appropriate. They also check the supports() method where possible and, if the current device doesn’t support the given action, displays an alert this instead of processing the action.
Simple Resize
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_simple_resize.txt
Methods Used
close
addEventListener
removeEventListener
open
getState
resize
setResiveProperties
playVideo
supports
storePicture
createCalendarEvent
Events Used
ready
stateChange
orientationchange (covered in MRAID v2.0 Ads above)
Expected Behavior
This ad renders as a 320×50 banner that attempts to resize to a 320×250 non-modal ad when clicked. The resize properties are setup so that the width is 320, the height is 250, the offsetX is 0, offsetY is 0, and allowOffscreen is false. This means that the ad resizes down if there is space, but will resize to fit on screen if there is not, so a banner on the bottom of the app would resize up. Since resize ads are unable to lock orientation, this collapses itself on a rotation change to prevent any unexpected behavior. The resized ad has buttons for click actions that use the new MRAID v2.0 methods, such as playVideo() instead of open(), when appropriate. They also check the supports() method where possible, and if the current device does not support the given action, then the device displays an alert instead of processing the action.
Video Interstitial
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_video_interstitial.txt
Methods Used
addEventListener
removeEventListner
open
getState
isViewable
supports
close
useCustomClose
setOrientationProperties
getScreenSize
Events Used
ready
viewableChange
Expected Behavior
This ad renders as a full screen video interstitial. It forces landscape orientation using setOrientationProperties() and uses the getScreenSize() method to scale the video to the max size for the device without chopping any of the video. It uses the viewableChange event to tell when it is displayed and therefore should start the video. This ad assumes the device supports HTML5 video and the video object can be used to play video. If the SDK supports inlineVideo, then the close button is hidden and the video auto-closes when the video completes. If the SDK does not support inlineVideo, then the close button remains and it is assumed the video will play full-screen.
This ad works in the web tester with the following exceptions:
The useCustomClose method does not hide the close button when the simulated device is rotated to landscape.
The audio continues even after clicking the close button that closes the ad video.
The video renders small and does not play full-screen.
Diagnostic Ad
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_diagnostics.txt
Methods Used
addEventListener
removeEventListner
getState
isViewable
supports
close
useCustomClose
getScreenSize
getCurrentPosition
getDefaultPosition
getMaxSize
getVersion
getPlacementType
expand
getExpandProperties
setExpandProperties
useCustomClose
open
playVideo
storePicture
createCalendarEvent
Events Used
ready
error
sizeChange
stateChange
viewableChange
Expected Behavior
This ad is intended to help diagnose problems that are occurring in the MRAID container. It can run as a banner or an interstitial. Since there is a lot of information to fit in this ad, run it as at least a 320×250 banner. Also, it is much easier to use in a simulator than on device where values are hard to edit. This ad provides access to all MRAID v2 APIs and also listens to all MRAID v2.0 events. When an event fires the affected value flashes green for a second to provide a visual clue that this values changed. This ad is also useful for testing cases not covered by the specific test ads above. Potential useful test cases include more complicated resize scenarios, resize and then expand, two part expands, etc.
The testing AdMarvel performed in the web tester was limited compared to the functionality this ad exposes. However, here are the issues:
The setOrientationProperties does not always work.
The value of useCustomClose does not always revert false when the checkmark is removed.
MRAID v1.0 Ads
These ads run fine in both MRAID v1.0 and v2.0, though the behavior might be slightly different depending on the SDK implementation. The URLs contain raw HTML code and must be used as HTML snippets/fragments. However, they are not complete HTML documents/pages. Following are the available ad types:
Expand with Custom Close
Expand Using getExpandProperties to Center
Simple Interstitial
Expand with Custom Close
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v1_expand_with_custom_close.txt
Methods Used
expand
close
addEventListener
removeEventListner
setExpandProperties
open
getState
Events Used
ready
stateChange
orientationchange (not covered in MRAID v1.0)
Expected Behavior
This ad renders as a 320×50 banner that expands when clicked. The expand properties set a 320×250 size and useCustomClose to true to hide the SDK close button. On MRAID v1.0, this is a modal full screen expansion or a non-modal partial screen expansion. On MRAID v2.0, you are guaranteed a full screen expansion. Since orientation locking was not possible in MRAID v1.0, this ad collapses itself on rotation change to prevent any unexpected behavior. The expanded ad has buttons for various click actions, all handled by calling open().
Expand Using getExpandProperties to Center
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v1_expand_centered.txt
Methods Used
expand()
close()
addEventListener
removeEventListner
getExpandProperties
open
getState
Events Used
ready
stateChange
orientationchange (not covered in MRAID v1.0)
window.orientation (not covered in MRAID v1.0)
Expected Behavior
This ad renders as a 320×50 banner that expands when clicked. The expand properties are not set, so a full screen expansion is intended and the SDK provided close button is used. Also, the getExpandProperties are read prior to expansion to get the screen dimensions and to center the 320×250 when expanded. The behavior on MRAID v1.0 and MRAID v2.0 should be very similar since this is a full screen expansion on both. Since orientation locking wasn’t possible in MRAID v1.0, this ad collapses itself on rotation change to prevent any unexpected behavior. The expanded ad has buttons for various click actions, all handled by calling open().
This ad worked as expected in the web tester in portrait orientation. However, the ad does not work as expected in landscape. The dimensions returned in getExpandProperties() for landscape are incorrect (though this could be due to the device geometry setup) and since window.orientation does not have a valid value, the creative cannot adjust.
Simple Interstitial
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v1_simple_interstitial.txt
Methods Used
addEventListener
removeEventListner
open
getState
isViewable
Events Used
ready
viewableChange
Expected Behavior
This ad renders as a full screen 320×480 interstitial. The important part of this ad is that it uses the viewableChange event to tell when it is displayed. In this case, this event just makes the ad visible. However, most ads use this to fire impressions as well as start the ad experience. The behavior on MRAID v1.0 and MRAID v2.0 is the same for this ad. The interstitial has buttons for various click actions, all handled by calling open().
Last Updated Sep 18, 2015
Linking News, the best press release distribution service provider, has the strongest network in the entire industry, including more than 10,000 news outlets and over 1,000 social media networks around the globe. We distribute your company’s news or articles to thousands of the world’s top media outlets and over 30,000+ journalists. Your story will be syndicated to many news and media sites, including ABC, NBC, CBS, FOX, and many more notable names, with the White Label Press Release Distribution Solution (unbranded or private label press release service).
Visit www.linkingnews.com.
Linking News, the best press release distribution service provider, has the strongest network in the entire industry, including more than 10,000 news outlets and over 1,000 social media networks around the globe. Your press release will be guaranteed to be published on 300+ news and media sites, including ABC, NBC, CBS, FOX, and many more notable names, with the white label press release distribution solution (unbranded or private label press release service).
Best Press Release Distribution Service
Order Now
The post MRAID Sample Ads appeared first on Linking News.
from https://www.linkingnews.com/mraidsampleads/ from http://bit.ly/2ZIOope
0 notes
valeriegbray · 5 years
Text
MRAID Sample Ads
MRAID Sample Ads
Introduction
This document provides sample ads that demonstrate the basic functionality of the ad types described in the MRAID v1.0 and v2.0 standards and supported in Opera Mediaworks’ SDKs. Each example below provides an HTML code snippet, a list of the methods and events used, and the expected behavior for a given ad type. The ads were successfully tested using AdMarvel’s iOS and Android Tester Apps. They were also successfully tested using the MRAID web tester, a tool that simulates an SDK environment. Any exceptions in web tester behavior are noted in the respective sections.
Audience
This document is for anyone creating MRAID-compliant ads meant to run in Opera Mediaworks SDKs. Some familiarity with the MRAID specification is required.
MRAID v2.0 Ads
Each ad type here uses at least some functionality that is only available in MRAID v2.0. The URLs contain raw HTML code and must be used as HTML snippets/fragments. They are not complete HTML documents/pages. Following are the available ad types:
Expand with Orientation Locked to Portrait
Expand Stay Centered Using Size Change
Simple Resize
Video Interstitial
Diagnostic Ad
Expand with Orientation Locked to Portrait
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_expand_with_locked_portrait_orientation.txt
Methods
expand
close
addEventListener
removeEventListener
open
getState
setOrientationProperties
playVideo
supports
storePicture
createCalendarEvent
Events
ready
stateChange
Expected Behavior
This ad renders as a 320×50 banner that attempts to expand when clicked. No special expand properties are set, but setOrientationProperties() is called to lock the orientation so that the ad expands in portrait only. The expanded ad has buttons for various click actions that use the new MRAID v2.0 methods, such as playVideo() instead of open(), when appropriate. They also check the supports() method where possible, and if the current device does not support the given action, displays an alert instead of processing the action.
Expand Stay Centered Using Size Change
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_expand_stay_centered.txt
Methods Used
expand
close
addEventListener
removeEventListner
open
getState
playVideo
supports
storePicture
createCalendarEvent
Events Used
ready
stateChange
sizeChange
Expected Behavior
This ad renders as a 320×50 banner that attempts to expand when clicked. No special expand properties are set. The ad uses the sizeChange events to keep the 320×250 expanded ad contents centered on the screen both horizontally and vertically. The expanded ad has buttons for various click actions that use the new MRAID v2.0 methods, such as playVideo() instead of open(), when appropriate. They also check the supports() method where possible and, if the current device doesn’t support the given action, displays an alert this instead of processing the action.
Simple Resize
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_simple_resize.txt
Methods Used
close
addEventListener
removeEventListener
open
getState
resize
setResiveProperties
playVideo
supports
storePicture
createCalendarEvent
Events Used
ready
stateChange
orientationchange (covered in MRAID v2.0 Ads above)
Expected Behavior
This ad renders as a 320×50 banner that attempts to resize to a 320×250 non-modal ad when clicked. The resize properties are setup so that the width is 320, the height is 250, the offsetX is 0, offsetY is 0, and allowOffscreen is false. This means that the ad resizes down if there is space, but will resize to fit on screen if there is not, so a banner on the bottom of the app would resize up. Since resize ads are unable to lock orientation, this collapses itself on a rotation change to prevent any unexpected behavior. The resized ad has buttons for click actions that use the new MRAID v2.0 methods, such as playVideo() instead of open(), when appropriate. They also check the supports() method where possible, and if the current device does not support the given action, then the device displays an alert instead of processing the action.
Video Interstitial
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_video_interstitial.txt
Methods Used
addEventListener
removeEventListner
open
getState
isViewable
supports
close
useCustomClose
setOrientationProperties
getScreenSize
Events Used
ready
viewableChange
Expected Behavior
This ad renders as a full screen video interstitial. It forces landscape orientation using setOrientationProperties() and uses the getScreenSize() method to scale the video to the max size for the device without chopping any of the video. It uses the viewableChange event to tell when it is displayed and therefore should start the video. This ad assumes the device supports HTML5 video and the video object can be used to play video. If the SDK supports inlineVideo, then the close button is hidden and the video auto-closes when the video completes. If the SDK does not support inlineVideo, then the close button remains and it is assumed the video will play full-screen.
This ad works in the web tester with the following exceptions:
The useCustomClose method does not hide the close button when the simulated device is rotated to landscape.
The audio continues even after clicking the close button that closes the ad video.
The video renders small and does not play full-screen.
Diagnostic Ad
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_diagnostics.txt
Methods Used
addEventListener
removeEventListner
getState
isViewable
supports
close
useCustomClose
getScreenSize
getCurrentPosition
getDefaultPosition
getMaxSize
getVersion
getPlacementType
expand
getExpandProperties
setExpandProperties
useCustomClose
open
playVideo
storePicture
createCalendarEvent
Events Used
ready
error
sizeChange
stateChange
viewableChange
Expected Behavior
This ad is intended to help diagnose problems that are occurring in the MRAID container. It can run as a banner or an interstitial. Since there is a lot of information to fit in this ad, run it as at least a 320×250 banner. Also, it is much easier to use in a simulator than on device where values are hard to edit. This ad provides access to all MRAID v2 APIs and also listens to all MRAID v2.0 events. When an event fires the affected value flashes green for a second to provide a visual clue that this values changed. This ad is also useful for testing cases not covered by the specific test ads above. Potential useful test cases include more complicated resize scenarios, resize and then expand, two part expands, etc.
The testing AdMarvel performed in the web tester was limited compared to the functionality this ad exposes. However, here are the issues:
The setOrientationProperties does not always work.
The value of useCustomClose does not always revert false when the checkmark is removed.
MRAID v1.0 Ads
These ads run fine in both MRAID v1.0 and v2.0, though the behavior might be slightly different depending on the SDK implementation. The URLs contain raw HTML code and must be used as HTML snippets/fragments. However, they are not complete HTML documents/pages. Following are the available ad types:
Expand with Custom Close
Expand Using getExpandProperties to Center
Simple Interstitial
Expand with Custom Close
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v1_expand_with_custom_close.txt
Methods Used
expand
close
addEventListener
removeEventListner
setExpandProperties
open
getState
Events Used
ready
stateChange
orientationchange (not covered in MRAID v1.0)
Expected Behavior
This ad renders as a 320×50 banner that expands when clicked. The expand properties set a 320×250 size and useCustomClose to true to hide the SDK close button. On MRAID v1.0, this is a modal full screen expansion or a non-modal partial screen expansion. On MRAID v2.0, you are guaranteed a full screen expansion. Since orientation locking was not possible in MRAID v1.0, this ad collapses itself on rotation change to prevent any unexpected behavior. The expanded ad has buttons for various click actions, all handled by calling open().
Expand Using getExpandProperties to Center
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v1_expand_centered.txt
Methods Used
expand()
close()
addEventListener
removeEventListner
getExpandProperties
open
getState
Events Used
ready
stateChange
orientationchange (not covered in MRAID v1.0)
window.orientation (not covered in MRAID v1.0)
Expected Behavior
This ad renders as a 320×50 banner that expands when clicked. The expand properties are not set, so a full screen expansion is intended and the SDK provided close button is used. Also, the getExpandProperties are read prior to expansion to get the screen dimensions and to center the 320×250 when expanded. The behavior on MRAID v1.0 and MRAID v2.0 should be very similar since this is a full screen expansion on both. Since orientation locking wasn’t possible in MRAID v1.0, this ad collapses itself on rotation change to prevent any unexpected behavior. The expanded ad has buttons for various click actions, all handled by calling open().
This ad worked as expected in the web tester in portrait orientation. However, the ad does not work as expected in landscape. The dimensions returned in getExpandProperties() for landscape are incorrect (though this could be due to the device geometry setup) and since window.orientation does not have a valid value, the creative cannot adjust.
Simple Interstitial
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v1_simple_interstitial.txt
Methods Used
addEventListener
removeEventListner
open
getState
isViewable
Events Used
ready
viewableChange
Expected Behavior
This ad renders as a full screen 320×480 interstitial. The important part of this ad is that it uses the viewableChange event to tell when it is displayed. In this case, this event just makes the ad visible. However, most ads use this to fire impressions as well as start the ad experience. The behavior on MRAID v1.0 and MRAID v2.0 is the same for this ad. The interstitial has buttons for various click actions, all handled by calling open().
Last Updated Sep 18, 2015
Linking News, the best press release distribution service provider, has the strongest network in the entire industry, including more than 10,000 news outlets and over 1,000 social media networks around the globe. We distribute your company’s news or articles to thousands of the world’s top media outlets and over 30,000+ journalists. Your story will be syndicated to many news and media sites, including ABC, NBC, CBS, FOX, and many more notable names, with the White Label Press Release Distribution Solution (unbranded or private label press release service).
Visit www.linkingnews.com.
Linking News, the best press release distribution service provider, has the strongest network in the entire industry, including more than 10,000 news outlets and over 1,000 social media networks around the globe. Your press release will be guaranteed to be published on 300+ news and media sites, including ABC, NBC, CBS, FOX, and many more notable names, with the white label press release distribution solution (unbranded or private label press release service).
Best Press Release Distribution Service
Order Now
The post MRAID Sample Ads appeared first on Linking News.
from https://www.linkingnews.com/mraidsampleads/
from http://pressreleasedistn.weebly.com/blog/mraid-sample-ads
0 notes
pressreleasedistn · 5 years
Text
MRAID Sample Ads
MRAID Sample Ads
Introduction
This document provides sample ads that demonstrate the basic functionality of the ad types described in the MRAID v1.0 and v2.0 standards and supported in Opera Mediaworks’ SDKs. Each example below provides an HTML code snippet, a list of the methods and events used, and the expected behavior for a given ad type. The ads were successfully tested using AdMarvel’s iOS and Android Tester Apps. They were also successfully tested using the MRAID web tester, a tool that simulates an SDK environment. Any exceptions in web tester behavior are noted in the respective sections.
Audience
This document is for anyone creating MRAID-compliant ads meant to run in Opera Mediaworks SDKs. Some familiarity with the MRAID specification is required.
MRAID v2.0 Ads
Each ad type here uses at least some functionality that is only available in MRAID v2.0. The URLs contain raw HTML code and must be used as HTML snippets/fragments. They are not complete HTML documents/pages. Following are the available ad types:
Expand with Orientation Locked to Portrait
Expand Stay Centered Using Size Change
Simple Resize
Video Interstitial
Diagnostic Ad
Expand with Orientation Locked to Portrait
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_expand_with_locked_portrait_orientation.txt
Methods
expand
close
addEventListener
removeEventListener
open
getState
setOrientationProperties
playVideo
supports
storePicture
createCalendarEvent
Events
ready
stateChange
Expected Behavior
This ad renders as a 320×50 banner that attempts to expand when clicked. No special expand properties are set, but setOrientationProperties() is called to lock the orientation so that the ad expands in portrait only. The expanded ad has buttons for various click actions that use the new MRAID v2.0 methods, such as playVideo() instead of open(), when appropriate. They also check the supports() method where possible, and if the current device does not support the given action, displays an alert instead of processing the action.
Expand Stay Centered Using Size Change
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_expand_stay_centered.txt
Methods Used
expand
close
addEventListener
removeEventListner
open
getState
playVideo
supports
storePicture
createCalendarEvent
Events Used
ready
stateChange
sizeChange
Expected Behavior
This ad renders as a 320×50 banner that attempts to expand when clicked. No special expand properties are set. The ad uses the sizeChange events to keep the 320×250 expanded ad contents centered on the screen both horizontally and vertically. The expanded ad has buttons for various click actions that use the new MRAID v2.0 methods, such as playVideo() instead of open(), when appropriate. They also check the supports() method where possible and, if the current device doesn’t support the given action, displays an alert this instead of processing the action.
Simple Resize
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_simple_resize.txt
Methods Used
close
addEventListener
removeEventListener
open
getState
resize
setResiveProperties
playVideo
supports
storePicture
createCalendarEvent
Events Used
ready
stateChange
orientationchange (covered in MRAID v2.0 Ads above)
Expected Behavior
This ad renders as a 320×50 banner that attempts to resize to a 320×250 non-modal ad when clicked. The resize properties are setup so that the width is 320, the height is 250, the offsetX is 0, offsetY is 0, and allowOffscreen is false. This means that the ad resizes down if there is space, but will resize to fit on screen if there is not, so a banner on the bottom of the app would resize up. Since resize ads are unable to lock orientation, this collapses itself on a rotation change to prevent any unexpected behavior. The resized ad has buttons for click actions that use the new MRAID v2.0 methods, such as playVideo() instead of open(), when appropriate. They also check the supports() method where possible, and if the current device does not support the given action, then the device displays an alert instead of processing the action.
Video Interstitial
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_video_interstitial.txt
Methods Used
addEventListener
removeEventListner
open
getState
isViewable
supports
close
useCustomClose
setOrientationProperties
getScreenSize
Events Used
ready
viewableChange
Expected Behavior
This ad renders as a full screen video interstitial. It forces landscape orientation using setOrientationProperties() and uses the getScreenSize() method to scale the video to the max size for the device without chopping any of the video. It uses the viewableChange event to tell when it is displayed and therefore should start the video. This ad assumes the device supports HTML5 video and the video object can be used to play video. If the SDK supports inlineVideo, then the close button is hidden and the video auto-closes when the video completes. If the SDK does not support inlineVideo, then the close button remains and it is assumed the video will play full-screen.
This ad works in the web tester with the following exceptions:
The useCustomClose method does not hide the close button when the simulated device is rotated to landscape.
The audio continues even after clicking the close button that closes the ad video.
The video renders small and does not play full-screen.
Diagnostic Ad
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v2_diagnostics.txt
Methods Used
addEventListener
removeEventListner
getState
isViewable
supports
close
useCustomClose
getScreenSize
getCurrentPosition
getDefaultPosition
getMaxSize
getVersion
getPlacementType
expand
getExpandProperties
setExpandProperties
useCustomClose
open
playVideo
storePicture
createCalendarEvent
Events Used
ready
error
sizeChange
stateChange
viewableChange
Expected Behavior
This ad is intended to help diagnose problems that are occurring in the MRAID container. It can run as a banner or an interstitial. Since there is a lot of information to fit in this ad, run it as at least a 320×250 banner. Also, it is much easier to use in a simulator than on device where values are hard to edit. This ad provides access to all MRAID v2 APIs and also listens to all MRAID v2.0 events. When an event fires the affected value flashes green for a second to provide a visual clue that this values changed. This ad is also useful for testing cases not covered by the specific test ads above. Potential useful test cases include more complicated resize scenarios, resize and then expand, two part expands, etc.
The testing AdMarvel performed in the web tester was limited compared to the functionality this ad exposes. However, here are the issues:
The setOrientationProperties does not always work.
The value of useCustomClose does not always revert false when the checkmark is removed.
MRAID v1.0 Ads
These ads run fine in both MRAID v1.0 and v2.0, though the behavior might be slightly different depending on the SDK implementation. The URLs contain raw HTML code and must be used as HTML snippets/fragments. However, they are not complete HTML documents/pages. Following are the available ad types:
Expand with Custom Close
Expand Using getExpandProperties to Center
Simple Interstitial
Expand with Custom Close
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v1_expand_with_custom_close.txt
Methods Used
expand
close
addEventListener
removeEventListner
setExpandProperties
open
getState
Events Used
ready
stateChange
orientationchange (not covered in MRAID v1.0)
Expected Behavior
This ad renders as a 320×50 banner that expands when clicked. The expand properties set a 320×250 size and useCustomClose to true to hide the SDK close button. On MRAID v1.0, this is a modal full screen expansion or a non-modal partial screen expansion. On MRAID v2.0, you are guaranteed a full screen expansion. Since orientation locking was not possible in MRAID v1.0, this ad collapses itself on rotation change to prevent any unexpected behavior. The expanded ad has buttons for various click actions, all handled by calling open().
Expand Using getExpandProperties to Center
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v1_expand_centered.txt
Methods Used
expand()
close()
addEventListener
removeEventListner
getExpandProperties
open
getState
Events Used
ready
stateChange
orientationchange (not covered in MRAID v1.0)
window.orientation (not covered in MRAID v1.0)
Expected Behavior
This ad renders as a 320×50 banner that expands when clicked. The expand properties are not set, so a full screen expansion is intended and the SDK provided close button is used. Also, the getExpandProperties are read prior to expansion to get the screen dimensions and to center the 320×250 when expanded. The behavior on MRAID v1.0 and MRAID v2.0 should be very similar since this is a full screen expansion on both. Since orientation locking wasn’t possible in MRAID v1.0, this ad collapses itself on rotation change to prevent any unexpected behavior. The expanded ad has buttons for various click actions, all handled by calling open().
This ad worked as expected in the web tester in portrait orientation. However, the ad does not work as expected in landscape. The dimensions returned in getExpandProperties() for landscape are incorrect (though this could be due to the device geometry setup) and since window.orientation does not have a valid value, the creative cannot adjust.
Simple Interstitial
Ad HTML Snippet URL
http://admarvel.s3.amazonaws.com/demo/mraid/MRAID_v1_simple_interstitial.txt
Methods Used
addEventListener
removeEventListner
open
getState
isViewable
Events Used
ready
viewableChange
Expected Behavior
This ad renders as a full screen 320×480 interstitial. The important part of this ad is that it uses the viewableChange event to tell when it is displayed. In this case, this event just makes the ad visible. However, most ads use this to fire impressions as well as start the ad experience. The behavior on MRAID v1.0 and MRAID v2.0 is the same for this ad. The interstitial has buttons for various click actions, all handled by calling open().
Last Updated Sep 18, 2015
Linking News, the best press release distribution service provider, has the strongest network in the entire industry, including more than 10,000 news outlets and over 1,000 social media networks around the globe. We distribute your company’s news or articles to thousands of the world’s top media outlets and over 30,000+ journalists. Your story will be syndicated to many news and media sites, including ABC, NBC, CBS, FOX, and many more notable names, with the White Label Press Release Distribution Solution (unbranded or private label press release service).
Visit www.linkingnews.com.
Linking News, the best press release distribution service provider, has the strongest network in the entire industry, including more than 10,000 news outlets and over 1,000 social media networks around the globe. Your press release will be guaranteed to be published on 300+ news and media sites, including ABC, NBC, CBS, FOX, and many more notable names, with the white label press release distribution solution (unbranded or private label press release service).
Best Press Release Distribution Service
Order Now
The post MRAID Sample Ads appeared first on Linking News.
from https://www.linkingnews.com/mraidsampleads/
0 notes
technato · 6 years
Text
Interactive: The Top Programming Languages 2018
Find the programming languages that are most important to you
#medium-content{ float:none; margin:0 auto; } .static-wrapper{ position:relative; } .article-detail .byline{ text-align:left; margin:0; }
Click here to read about the trends shaping this year’s Top Programming Languages
This app ranks the popularity of dozens of programming languages. You can filter them by excluding sectors that aren’t relevant to you, such as “Web” or “Embedded.” (Which sectors a language can be found listed in is based on typical use patterns we’ve seen in the wild.) Rankings are created by weighting and combining 11 metrics from 9 sources. We have one less source this year, as the Dice job site shut down its API. However, the Dice metric is still available for previous years’ data. (Read more about our method and sources).
The default set of weights produces our IEEE Spectrum ranking—but there are preset weights for those more interested in what’s trending or most looked for by employers. Don’t like the presets? Create your own ranking by adjusting the weights yourself. To compare with a previous year’s data, click “Add a Comparison” and then click “Edit Ranking,” which will give you the option to compare with data from 2014 to 2017.
This app was originally developed in collaboration with IEEE Spectrum by data journalist Nick Diakopoulous.
#container { margin-top: 0px; margin-bottom: 25px; }
https://spectrum.ieee.org/ns/IEEE_TPL_2018/lib/d3.v3.js https://spectrum.ieee.org/ns/IEEE_TPL_2018/lib/underscore.js https://spectrum.ieee.org/ns/IEEE_TPL_2018/lib/backbone.js
https://spectrum.ieee.org/ns/IEEE_TPL_2018/lib/tooltips/tipr/tipr.js https://spectrum.ieee.org/ns/IEEE_TPL_2018/data/DataModels.js?v=2 https://spectrum.ieee.org/ns/IEEE_TPL_2018/MainView.js?v=2 https://spectrum.ieee.org/ns/IEEE_TPL_2018/AppRouter.js?v=2
Choose a Ranking
(choose a weighting or make your own)
IEEE Spectrum
Trending
Jobs
Open
Custom
Edit Ranking
|
Add a Comparison
|
Choose a Comparison
(choose a weighting or make your own)
IEEE Spectrum
Trending
Jobs
Open
Custom
Edit Ranking
Language Types
(click to hide)
Web
Mobile
Enterprise
Embedded
// TODO switch back to this other jquery code //var $jQuery = $.noConflict(true); //$jQuery(document).ready(function($) { $(document).ready(function() { // Set the URL root for accessing the server // TODO: Change the data root for deployment //window.DATA_ROOT = “/ns/IEEE_TPL/data”; window.DATA_ROOT = “/ns/IEEE_TPL_2018/data”; window.BASE_FOLDER = “/ns/IEEE_TPL_2018/”
// Give us a global app router window.appRouter = new AppRouter();
// Give us a new main view to render the data for the app // The MainView Backbone View will look for the div with id = container, and render there. window.mainView = new MainView();
// Bind an orientation change event to the window $(window).on(‘orientationchange’, function(event){ orientationHandler(); });
// Initialize tooltips $(‘.tip’).tipr(); });
// ————————————————————————————— // orientationHandler – Event handler called if the orientation of device (i.e. phone) is changed // ————————————————————————————— function orientationHandler(event) { // Call the mainView’s updateOrientation() window.mainView.updateOrientation(); }
// ————————————————————————————— // numberWithCommas – Format a number with commas // ————————————————————————————— function numberWithCommas(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, “,”); }
<!–
window._tpm = window._tpm || []; window._tpm[‘paywallID’] = ‘42070140’; window._tpm[‘trackPageview’] = true; window._tpm[‘onMeterActive’] = function() { setTimeout(function(){ getTPMeter().showOffer(); }, 5000); } //code.tinypass.com/tpl/d1/tpm.js–>
Interactive: The Top Programming Languages 2018 syndicated from https://jiohowweb.blogspot.com
0 notes
alltomtrav · 6 years
Photo
Tumblr media
New Post has been published on http://www.alltomtrav.info/v75-resultat-och-startlista-till-mantorp-26-november-2017/?Allt+Om+Trav
V75 resultat och startlista till Mantorp 26 november 2017
V75 resultat och startlista till Mantorp 26 november 2017 redovisar vi här nedan.
Fram till första start på V75 Mantorp redovisas startlistan. Efter första avdelningen redovisas resultatet löpande LÄNGST NED PÅ SIDAN för V75 från Mantorp 26 november 2017 med vinnare, odds och värde efter att varje avdelning har avgjorts. Fullständigt V75 resultat från Mantorp redovisas efter sista V75 avdelningen
.errordiv padding:10px; margin:10px; border: 1px solid #555555;color: #000000;background-color: #f8f8f8; width:500px; #advanced_iframe visibility:visible;opacity:1;#ai-layer-div-advanced_iframe p height:100%;margin:0;padding:0 #ai-div-advanced_iframe width : 705px; height : 5000px; overflow : hidden; position : relative; #advanced_iframe position : absolute; top : -101px; left : -266px; width : 705; height : 5000; var ai_iframe_width_advanced_iframe = 0; var ai_iframe_height_advanced_iframe = 0;var aiIsIe8=false; if (typeof aiReadyCallbacks === 'undefined') var aiReadyCallbacks = []; else if (!(aiReadyCallbacks instanceof Array)) var aiReadyCallbacks = []; var onloadFiredadvanced_iframe = false; function aiShowIframe() jQuery("#advanced_iframe").css("visibility", "visible"); function aiShowIframeId(id_iframe) jQuery("#"+id_iframe).css("visibility", "visible"); function aiResizeIframeHeight(height) aiResizeIframeHeight(height,advanced_iframe); function aiResizeIframeHeightId(height,width,id) resetShowPartOfAnIframe(id);aiResizeIframeHeightById(id,height);function loadElem_advanced_iframe(elem) function aiModifyParent_advanced_iframe() var aiReadyAiFunct_advanced_iframe = function aiReadyAi_advanced_iframe() aiModifyParent_advanced_iframe();aiAutoZoomViewport("#ai-div-advanced_iframe","true");;aiReadyCallbacks.push(aiReadyAiFunct_advanced_iframe);if (window.jQuery) aiModifyParent_advanced_iframe();
var ifrm_advanced_iframe = document.getElementById("advanced_iframe");var hiddenTabsDoneadvanced_iframe = false; function resizeCallbackadvanced_iframe() function aiChangeUrl(loc) var recalculateIframeResizeadvanced_iframe = 0; var recalculateIframeOrientationchangeadvanced_iframe = 0; function recalculateIframeadvanced_iframe() clearTimeout(recalculateIframeResizeadvanced_iframe); clearTimeout(recalculateIframeOrientationchangeadvanced_iframe);aiAutoZoomViewport("#ai-div-advanced_iframe","true"); function initResponsiveIframeadvanced_iframe() jQuery(window).resize(function() recalculateIframeResize = window.setTimeout("recalculateIframeadvanced_iframe()",100); ); if (window.addEventListener) window.addEventListener("orientationchange", function() recalculateIframeOrientationchange = window.setTimeout("recalculateIframeadvanced_iframe()",100); , false); aiReadyCallbacks.push(initResponsiveIframeadvanced_iframe);
0 notes
thewebjuice · 7 years
Text
Learn to detect discrete Orientation Changes using orientationchange
Introduction to discrete orientation change
Discrete Orientation change refers to the change in the orientation of a device. To be precise from landscape to portrait or vice versa. So what is so new in this?  In order to change certain things on the web page, you require detecting the orientation of the page. This is a very powerful API and can help you in various ways while you use it…
View On WordPress
0 notes
touchscreentablets8 · 7 years
Text
Researchers have described the causes of the fire Galaxy Note 7 – RBC
Samsung Galaxy Note 7
Photo: Reuters/Pixstream
the explosion of smartphones Samsung Galaxy Note 7 was due to the shortcomings of the design of the batteries and the technological process of Assembly of the device. An official cause named manufacturer
on January 23 in Seoul Corporation Samsung Electronics at a press conference summed up the results of the investigation of the reasons of ignition of smartphones Galaxy Note 7. The company researched more than 200 thousand thousand smartphones and 30 batteries and came to the conclusion that the cause of the incidents were the shortcomings of the design of the batteries and the technological process of Assembly of the device, stated in received by RBC message to Samsung.
Analysis engineers engaged in the concern, together with experts from independent research organizations — UL, and TUV Rheinland Exponent. Experts check the hardware and software part of Galaxy Note 7, Assembly, quality control and delivery to points of sale.
Samsung Galaxy Note 7 went on sale in August 2016. But in September, the manufacturer recalled 2.5 million of smartphones worldwide from-for problems with the battery which overheated and sometimes caught fire. In October, the company announced that it would stop production and sales of Galaxy Note 7 due to security threats to users. Smartphones were sold in several countries, including the US and the UK. In Russia the official launch did not take place.
‘); setTimeout(arguments.callee, 50); return; } if (!window.jwplayer) { s = document.createElement(‘script’); s.src = “//content.rbc.medialand.ru/templates_r/jwplayer/jwplayer.js”; s.type = ‘text/javascript’; parEl.parentNode.insertBefore(s, parEl); setTimeout(arguments.callee, 50); return; } if (!window.jwplayer.key) window.jwplayer.key = ‘t3/gzoTw74tQdZgYlxSwzsrmSt96w0Y8EcIvqw==’; var styleStr = “”; styleStr += “width : auto;”; //2006 try { if (true === parent.rosbusinessconsulting.config.get(‘articleColumn’)) { styleStr += ” margin-right : 0;”; } } catch (e) {} try { if (!parent.deviceType) { if (parent.projectVersion == ‘rbc7′ || parent.bannersVersion == ‘v7′) { styleStr += ” margin : 0px -110px 0px 0px;”; } else { styleStr += ” margin : 0px -216px 0px 0px;”; } } } catch (e) {} try { if (parent.projectVersion == ‘rbc7′ ; || parent.bannersVersion == ‘v7′) { styleStr += ‘ max-width: 770px;’; } } catch (e) {} parEl.style.display=’block’; parEl.style.cssText += styleStr; parEl.innerHTML = “; s = document.createElement(‘script’); s.src = “//static.videonow.ru/vn_init.js”; s.setAttribute(“data-profile”, “1351319″); s.type = ‘text/javascript’; s.defer = true; parEl.parentNode.insertBefore(s, parEl); window.addEventListener(“orientationchange”, function() { setTimeout(function () { window.scrollBy(0,1);} ,200); }) } run(); })(random); } else { (function(d, url) { setTimeout(function() { if (window.dfp_sync_var) return; var s = document.createElement(‘script’); s.type = ‘text/javascript’; s.src = url; d.parentNode.insertBefore(s, d); }, 200); })(d, ‘http://ift.tt/2fHRLp3; + random + extra +’&dre ferer=’+escape(dreferrer));} }//–>
After a review in September 2016, quotations of the manufacturer on the Korean stock exchange fell by 10%, or $ 22 billion, according to Bloomberg. The total losses of the Corporation from a scandal made up by estimates of The Wall Street Journal (WSJ) about $ 5 billion.
the company noted that the head of the mobile division of Samsung Dong-Jin Ko apologized to users Galaxy 7, mobile operators and business partners. In the future, to avoid similar problems, the company introduced a multi-security Protocol and scanner batteries.
According to Ko, the company formed a working group of external consultants and experts who study the battery. Experts will advise Samsung security batteries, and innovative developments in this field.
Before the South Korean concern has summed up the results of an internal investigation, the WSJ wrote, citing its sources, that cause problems the model could be too big size battery, and a manufacturing defect.
via Blogger http://ift.tt/2joSTQl http://ift.tt/2j5fkJo
0 notes
chikaboca · 7 years
Text
Donatori 2016
(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/sr_RS/all.js#xfbml=1&appId=207075749338859"; fjs.parentNode.insertBefore(js, fjs); }(document, "script", "facebook-jssdk"));
BFC škola fudbala
Table of Contents
BFC škola fudbala
5asec
I&D COM
POINT!
Opština Nova Varoš
Kreativni centar
Amarodel
Nikola Rokvić
Konzilijum
Srednja brodarska škola
Novartis oncology
DeForMe
Vile porodice Kokić
Cip Centar
Ministarstvo pravde RS
Ministarstvo omladine i sporta RS
AstraZeneca
Sanofi
Pfizer
CBRE Serbia
5asec
I&D COM
POINT!
Opština Nova Varoš
Kreativni centar
Amarodel
Nikola Rokvić
Konzilijum
Srednja brodarska škola
Novartis oncology
DeForMe
Vile porodice Kokić
Cip Centar
Ministarstvo pravde RS
Ministarstvo omladine i sporta RS
AstraZeneca
Sanofi
Pfizer
CBRE Serbia
jQuery(document).ready(function ($) { var options = { $AutoPlay: 1, $AutoPlaySteps: 3, $AutoPlayInterval:0, $PauseOnHover: 1, $ArrowKeyNavigation: 1, $SlideEasing: $JssorEasing$.$EaseInBack, $SlideDuration: 1500, $SlideWidth: 980, $SlideHeight: 180, $SlideSpacing: 1, $DisplayPieces: 7, $PlayOrientation: 1, $DragOrientation: 1,$ArrowNavigatorOptions: { $Class: $JssorArrowNavigator$, $ChanceToShow: 1, $AutoCenter: 2, $Steps : 3, },}; var wps_logos_slider = new $JssorSlider$("slider2_container", options);function ScaleSlider() { var bodyWidth = document.body.clientWidth; if (bodyWidth) wps_logos_slider.$ScaleWidth(Math.min(bodyWidth,300)); else window.setTimeout(ScaleSlider, 30); } ScaleSlider(); $(window).bind("load", ScaleSlider); $(window).bind("resize", ScaleSlider); $(window).bind("orientationchange", ScaleSlider); $("#slider2_container").show(); });
0 Dopada mi se
Donatori 2016 was originally published on Čika Boca
0 notes
androappdeveloper · 7 years
Text
Global HMD launched the first Nokia smartphone based on Android – RBC
the Finnish company HMD Global has introduced a new smartphone Nokia 6 operating on the Android platform, the corresponding message is published on the website of the company.
As representatives of the HMD Global, sales of Nokia 6 will start in early 2017, to purchase the smartphone will be available only in China through the retailer JD.com.
“Nokia 6 marks the first step in the fulfillment of the ambitions of the HMD, in order to set a new standard in design, quality of materials and manufacturing innovations,” — said in a statement.
‘); setTimeout(arguments.callee, 50); return; } if (!window.jwplayer) { s = document.createElement(‘script’); s.src = “//content.rbc.medialand.ru/templates_r/jwplayer/jwplayer.js”; s.type = ‘text/javascript’; parEl.parentNode.insertBefore(s, parEl); setTimeout(arguments.callee, 50); return; } if (!window.jwplayer.key) window.jwplayer.key = ‘t3/gzoTw74tQdZgYlxSwzsrmSt96w0Y8EcIvqw==’; var styleStr = “”; styleStr += “width : auto;”; //2006 try { if (true === parent.rosbusinessconsulting.config.get(‘articleColumn’)) { styleStr += ” margin-right : 0;”; } } catch (e) {} try { if (!parent.deviceType) { if (parent.projectVersion == ‘rbc7′ || parent.bannersVersion == ‘v7′) { styleStr += ” margin : 0px -110px 0px 0px;”; } else { styleStr += ” margin : 0px -216px 0px 0px;”; } } } catch (e) {} try { if (parent.projectVersion == ‘rbc7′ ; || parent.bannersVersion == ‘v7′) { styleStr += ‘ max-width: 770px;’; } } catch (e) {} parEl.style.display=’block’; parEl.style.cssText += styleStr; parEl.innerHTML = “; s = document.createElement(‘script’); s.src = “//static.videonow.ru/vn_init.js”; s.setAttribute(“data-profile”, “1351319″); s.type = ‘text/javascript’; s.defer = true; parEl.parentNode.insertBefore(s, parEl); window.addEventListener(“orientationchange”, function() { setTimeout(function () { window.scrollBy(0,1);} ,200); }) } run(); })(random); } else { (function(d, url) { setTimeout(function() { if (window.dfp_sync_var) return; var s = document.createElement(‘script’); s.type = ‘text/javascript’; s.src = url; d.parentNode.insertBefore(s, d); }, 200); })(d, ‘http://ift.tt/2fHRLp3; + random + extra +’&dre ferer=’+escape(dreferrer));} }//–>
the cost of the new phone, according to Global HMD, will be 1.7 million yuan ($ 244). The internal memory of the smartphone is 64 GB, RAM — 4 gigabytes.
Photo by press service
in addition, Nokia 6 is equipped with two cameras — a rear 16 MP and front 8 MP.
the phone screen Size is 5.5 inch with Full HD resolution.
In may last year, HMD Global for $ 350 million bought Microsoft a part of the business for the production of phones. In November of the same year it became known that the company acquired from Microsoft the smartphone and tablet businesses. In addition, the same HMD Global has signed an agreement with Nokia about using the brand for at least ten years.
Later, December 13, HMD Global introduced two new mobile phones under the Nokia brand. They both had the 2.4 inch screen, FM radio and MP3 player.
via Blogger http://ift.tt/2iRSfv3 http://ift.tt/mVP99O
0 notes