0
Voltooid

Меню, открываемое жестом

Ekaterina (head of support) 9 jaar geleden in iRidium Script / Interface scripts bijgewerkt door Эмиль Боев 8 jaar geleden 13
В проекте показано, как сделать меню навигации по проекту для смартфона, которое плавно появляется из-за левого края экрана по нажатию кнопки в углу экрана или жестом слева-направо. Закрыть меню можно также жестом или нажатием на видимую область ранее открытой страницы (при этом какие-либо кнопки страницы не будут нажаты).

Чтобы использовать меню в своем интерфейсе, перетащите этот пример в свой проект (тащим проект за имя), и редактируйте скрипт в соответствии с комментариями.

Antwoord

+2
VASTGEZET
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
VASTGEZET
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 ваш проект? Чтобы попробовать помочь вам...