0
Completed

Menu opened by a gesture

Ekaterina (head of support) 5 years ago in iRidium Script / Interface scripts updated by Эмиль Боев 5 years ago 13
In the project below you can see how to create the navigation menu for the project for smart phone. The menu gradually appears from the left side of the screen by clicking the button in the corner of the screen or with the left-to-right gesture. You can close the menu with a gesture or by clicking on a visible area of the opened page (at that none of the buttons on the page will be clicked)

To use the menu in your interface, drag the example in your project (by the name) and edit the script with respect to the comments.

Answer

+2
PINNED
Gesture, swipe.

Here is my fixed version of left menu slide example: http://beetoo.me/resources/BeeToo_Menu_Swipe.irpz
Small class BeeToo.Gesture introduced.
Everyone welcome to use it. It licensed under MIT license.

How it works video:
Sorry, but this is a bad example of swipe gesture handling.

Why?


It's unresponsive and crappy.

But why??!!

Because proper swipe handling depends on the corrdinates of user's pointer (i.e. finger) while we are inside of swipe gesture process.
Example: Android Sliding Menu

I suppose, that proper implementation really may be realized with help of iRidium Script API.
Because we have event: IR.EVENT_GESTURE_BEGIN.
When it occurs, we are inside gesture process.
Now we need to handle move event and handle coordinates.

Unfortunately, we do not have special event IR.EVENT_GESTURE_END, but we may look for IR.EVENT_TOUCH_UP.

When IR.EVENT_TOUCH_UP occurs, gesture finished and we may do proper action.
For exmaple: move left sliding menu to the key position (showed or hidden).

What do you think?
That is all we have for a moment. If you have better example, you can share it with community.
But now you are talking about "why I cannot do better", and that's all. Or not?
No, it's misunderstanding.

I'm talking about: "can one do better right now by means of current IRidium Script API?"

IMHO, we can. But I'm not sure.
You can get only gesture_begin in the current iRidium version. The more convenient event system will be available with the next global release of Client (this year).
Thank you for answering.
So, in other words: it is not possible with current event system?
In fact one can see in the log of i2control (running on mobile device), that all appropriate events take place:

  1. DEBUG Gesture swipe_right begin
  2. DEBUG Gesture swipe_right change
  3. DEBUG Gesture swipe_right end
The only need: fire this event into script engine.
They will be available with the next big release of iridium app. We are working on a big update of event system structure and let u know when it will be availabe for testing.
+2
PINNED
Gesture, swipe.

Here is my fixed version of left menu slide example: http://beetoo.me/resources/BeeToo_Menu_Swipe.irpz
Small class BeeToo.Gesture introduced.
Everyone welcome to use it. It licensed under MIT license.

How it works video:
Hi!

After swiping to the right, the Menu + Settings are opened.

Is it possible to make from this "Menu + Settings" a list, that can be swiped from lower to upper and back?

This because this is very convinient if there are more then 5 zones.

It would be great if this is possible, and this great example can be improved with a (dynamic or static) list.

Thanks

Theo

You may try to place list inside of hidden left menu.
Suppose, it should work normally with no problems.

Добрый день, попробовал BeeToo_Menu_Swipe.irpz понравилось, спасибо большое, переделал на 2048*1536 и PopUp "Menu" сделал размером с страницу (2048*1536), столкнулся с проблемой что сложно открыть полностью на (2048) PopUp "Menu" нужно чтоб конец жеста минус начало было более чем 2048, соответственно открыть полностью практически не реально, можно както модифицировать скрипт, чтоб при жесте длинее половины экрана PopUp открывался и закрывался до конца? Или может быть я внес неправильные изменения. Помогите пожалуйста.

Можете прислать на почту aborovsky@beetoo.me ваш проект? Чтобы попробовать помочь вам...