Comparing a hit with next/previous hit - algolia

I’m looking to implement a separator between hits that’s conditional based on a comparison with the next/previous hit.
An example of what I’m trying to accomplish can be found here
I’m developing in React Native where I’m using connectInfiniteHits from react-instantsearch-native, but I’ve hit a wall in regards to accessing the next hit from a given hit.
Any pointers on how to accomplish this?

Related

Google Actions - can I trigger an action on one device by chaning another device status?

Im new to Google actions and really appreciate any help.
Here is a scenario just to make my question clear:
I have 3 smart light switches in 1 room. I would like to turn one of the switches on (physically) and have google home to turn on the remaining 2 switches for me.
So i understand that i can write a command to turn the 2 light switches on, i dont see any problems here. The tricky part is - how do i create a trigger from physically changing the status of the first switch. Is that even possible?
If yes where should i start? im not sure from which end to approach it. Im new to this and would really appreciate some help.
The platform does not provide a way to trigger any actions on a device state change, so your use case would not be possible using the Google Assistant.

Getting a page curl effect with Unity / Flutter, doable?

I've got an application built in flutter where we have a page transition that currently just sticks to pretty out of the box stack/slide.
We're trying to create a page curl effect similar to https://www.youtube.com/watch?v=e1znh05-iXY on the transition but not having much luck faking it with 2D animation/clip-path coupled with the gesture controlling the path similarly to the video being extremely difficult, almost impossible
Until we have some sort of 3D support within Flutter - the only way to do it that I can think of is using Unity3D via https://pub.dartlang.org/packages/flutter_unity_widget
But I don't know how this will work when we need it for every page?
OR
Going the other way and importing our Flutter app as a library in Unity to render every page within Unity.
Could I please gets some thoughts on whether either approach will work and any advice on a potential path forward?
Thanks in advance guys.
see this plugin, it's close to what you need you can take inspiration :)
https://pub.dartlang.org/packages/flip_card

FLP: Setting Custom Initial Focus on App Launch Fails

I am trying to set initial focus to the first input field in each page of my app.
I have implemented the code in the following post and it is working great:
How to Set Initial Focus in a View?
But I found that it is not working for first view/page in app when it opens from Fiori Launchpad. I found the following code which is getting executed after my onAfterShow:
From sap/ushell/renderers/fiori2/Shell-dbg.controller.js
Could you please help to solve this?
I am using SAP UI5 version 1.56.7.
Author of that answer here. After browsing through the source code and documentation quite a while, I have to admit I couldn't find any acceptable solutions to this question either. My impression is that FLP developers want to make sure that the app doesn't interfere with setting the initial focus.
The lack of APIs and documentation thereof strongly suggests that there are compelling reasons behind this prevention (probably a11y related).
My advice is not to rely on timeouts but maintaining consistent UX by keeping the focus on the app title on its launch - as designed by SAP.
Solved the issue by passing around 200ms into setTimeout function for first page and it is working fine

Facebook/Unity SDK basics

I have some basic questions that I couldn't figure out after searching for quite some time now. All tutorials and guides I've come across have the code already set up and I can't find them of much use. For instance, the Friend Smash example has the code integrated with buttons and other scripts that I can't use it in my own game.
I used Parse to upload my game and test it on facebook and it's working fine, but I want to add the social features to it (login, share, score etc.)
Picking up the code snippets that I'm supposed to use either brings me up errors (undefined variables etc.) or messes things up (I get the not-working, bugged login window on top of the running game inside Unity, while nothing happens if I build and run it).
Where am I supposed to put the code? For example:
https://developers.facebook.com/docs/unity/reference/current/FB.Init
In the "Example" part, where am I supposed to put this line?
FB.Init(SetInit, OnHideUnity);
Same thing here:
https://developers.facebook.com/docs/unity/reference/current/FB.Feed
If I use the "Example" code as it is I get errors.
Do I have to use specific names for the scripts?
This is my first time uploading a game and trying to add social features to it so these questions may seem simple, but I couldn't find an answer anywhere.
You should create your own class instead of "Example" class, where you put all your Facebook specific functions. Then you should invoke your methods with your own components, buttons, triggers, whatever.
It is also you, who should take care of pausing the game while running social functions (login, share etc.).

Google Earth with WPF without using HwndHost

In my project, I want to embed Google Earth inside one of the User controls. I have seen many example in web where people say how to do it using winforms. I have seen few more sample who actually integrate it in WPF but using WindowsFormsHost/HwndHost I am eliminating this to avoid the airspace problem.
What exactly in my mind is something like to have a rendering Engine class and have an image in the control and use back buffering to draw data from rendering Engine class on the Image.
Has any one integrated Google Earth without using WindowsFormsHost/HwndHost? Any help would be greatly appreciated. Thanks in advance.
Try using D3DImage. WPF gives a callback to fill in the back buffer. Have a look at great sample by Dr WPF on Code Project. You can find the sample here.
http://www.codeproject.com/Articles/28526/Introduction-to-D3DImage
~Yogesh