B4A Library [Class] Multi Type SlidingPanels

[Class/Library] Multi Type SlidingPanels

I wanted to make one SlidingPanels that it could be used in multiple ways. Now that I have finished writing the code I put at your disposal.

At the moment you can do these variants SlidingPanels:

- Classic full screen mode.
- Sliding panels with smaller screen.
- Sliding panels with smaller screen and with zoom!
- With or without friction.

Methods:
- Click.
- Change.

Methods:
- JumpToPanel () - Runs the SlidingPanels up to a specific Panel.
- GetCurrentPanel - Returns the number of the current Panel.
- GetSlidingInProgress - Return if the SlidingPaneles is in progress.
- SetSpeedScroll () - Sets the speed of sliding.

It is possible to easily create a page counter thanks to the events.

[UPDATE V1.10]
- Added the ability to use the touch events of Activity, which is useful when you must insert many objects on the panels. Recommended this mode.
- Added the field area to be used for zooming.

[UPDATE V1.10a]
- Minor bug fix for small display.

[UPDATE V1.20]
- Added the LongClick event.
- Changed the type of data sent with the Click events and LongClick.
- Minor improvements.

[UPDATE V1.21]
- Bugfix in FullScreen mode (loop setup).

IMPORTANT
For most fluidity add this code to the Manifest:
B4X:
SetActivityAttribute(Main, android:hardwareAccelerated, "true")

For suggestions and bug reports please do not hesitate to post it here.
 

Attachments

  • Screenshot_2012-11-14-18-22-53 (ridotta).jpg
    Screenshot_2012-11-14-18-22-53 (ridotta).jpg
    11.4 KB · Views: 2,171
  • Screenshot_2012-11-14-18-23-10 (ridotta).jpg
    Screenshot_2012-11-14-18-23-10 (ridotta).jpg
    13.3 KB · Views: 2,034
  • Screenshot_2012-11-14-18-24-18 (ridotta).jpg
    Screenshot_2012-11-14-18-24-18 (ridotta).jpg
    33.7 KB · Views: 2,069
  • Screenshot_2012-11-15-10-02-38 (ridotta).png
    Screenshot_2012-11-15-10-02-38 (ridotta).png
    18.7 KB · Views: 1,816
  • SlidingPanels_1.21.zip
    69.1 KB · Views: 1,122
Last edited:

Dominex

Active Member
Licensed User
Longtime User
Ok, I tried the new version on the N7 tab, SlidePanelDominex still doesn't work, but, SlidingPanels (Activity Touch) works as intended, YAY!.
Vittoria! :icon_clap:

One thing I noticed on the (activity touch) sample, if I tap on Panel7 I get THIS error
My mistake in the demo. :BangHead:
Redownload the file.
 

tpakis

Active Member
Licensed User
Longtime User
I don't know if i'm doing something wrong but trying to use the demo with fullscreen panels the loop doesn't work, and returns error about center position
 

tpakis

Active Member
Licensed User
Longtime User
Ι used every demo u had in the rar and the problem is there. I tried fullscreen panels with slidinginloop true, but i always get the exception about getcenterposition, and if i go left from the first, it doesn't show the last panel but black space (and then action up = exception)
 

biggiu

Member
Licensed User
Longtime User
SlidingPanel and table class

HI,

Sorry for my English.

I tried the class sliding panel and is very beautiful.
I tried the class table to scrollview and also this is very useful.
I wanted to know if the two classes are compatible.
I tried to create a table on one of the panels of the scrollview but it appears on all panels.
 

Dominex

Active Member
Licensed User
Longtime User
Ι used every demo u had in the rar and the problem is there. I tried fullscreen panels with slidinginloop true, but i always get the exception about getcenterposition, and if i go left from the first, it doesn't show the last panel but black space (and then action up = exception)
I've tried various simulations but does not give me this error. If you do not recreate your error will be difficult for me to remedy it.
:(
 

tpakis

Active Member
Licensed User
Longtime User
Here is a screenshot (At debug it says getcenterposition was called by a tick event)
 

Attachments

  • screen.png
    screen.png
    39.1 KB · Views: 253

Dominex

Active Member
Licensed User
Longtime User
Here is a screenshot (At debug it says getcenterposition was called by a tick event)
Run it in debug mode, when it goes wrong, what is the value of PanelNumber?

[UPDATE]

Try adding this code in the class between the line 142 and 143.
B4X:
PanelNumber = Min(Max(0,PanelNumber),Panels.Length-1)
 
Last edited:

Dominex

Active Member
Licensed User
Longtime User
Very nice class Dominex, good work.

When i load layout with listview in it it wont
catch touch event. i mean i can't swipe when using listview but i can do it with other views (label, buton etc.)

is there a reason for this listview behaviour ?
Thanks.

I think the problem relates to listen for the touch event by the system, you could probably solve the problem by using the touch event of the Activity, and then assigning the data to SlidingPanels or ListView depending on the type of use. Maybe you can do, but I do not think it's that simple.
 

mrwebbit

Member
Licensed User
Longtime User
Problema SlidingPanels limite massimo pannelli

Salve, stavo cercando di implementare un APP usando questa libreria per sfogliare una rivista.

tutto funziona correttamente quando le pagine di prova sono una decina, ma in produzione dovrebbero arrivare almeno a 60, sia in debugging, sia su device (smartphone e tablet) crassha tutto.

non c'è modo di aggiungere dinamicamente in un secondo momento dei pannelli aggiunti o toglierli?

es: se sono al pannello 20, non mi importa di avere il numero 1 o il numero 40, me ne bastano una 10 avanti e indietro, poi man mano che mi sposto in una direzione togliere quelli in eccesso e aggiungere quelli che servono
(per assurdo basterebbero 3 Panel e caricare in avanti di 2 pagine ogni volta che si si sposta di 1), in questo modo l'utilizzo della memoria sarebbe ridotta al minimo.
 

Dominex

Active Member
Licensed User
Longtime User
Salve, stavo cercando di implementare un APP usando questa libreria per sfogliare una rivista.

tutto funziona correttamente quando le pagine di prova sono una decina, ma in produzione dovrebbero arrivare almeno a 60, sia in debugging, sia su device (smartphone e tablet) crassha tutto.

non c'è modo di aggiungere dinamicamente in un secondo momento dei pannelli aggiunti o toglierli?

es: se sono al pannello 20, non mi importa di avere il numero 1 o il numero 40, me ne bastano una 10 avanti e indietro, poi man mano che mi sposto in una direzione togliere quelli in eccesso e aggiungere quelli che servono
(per assurdo basterebbero 3 Panel e caricare in avanti di 2 pagine ogni volta che si si sposta di 1), in questo modo l'utilizzo della memoria sarebbe ridotta al minimo.
Nel tuo caso creerei solo alcuni panel, anche solo tre. Ad esempio con tre panel dove al momento sei sul panel 2 ed a pagina 23 della tua rivista, il panel 1 = pag 22, 2 = pag 23, 3 = pag. 24. Man mano aggiorni il panel attuale lo fai anche con quelli prima e dopo.
 

mrwebbit

Member
Licensed User
Longtime User
L'idea dei 3 Pannel piaceva anche a me ma sono subito imbattuto in un errore anche con la demo quando in modalità Fullscreen gli dico di fare il Loop, mi risponde con l'errore allegato che ti segnalo.

(lanciato solamente la demo scaricata dal sito)
 

Attachments

  • errore_demo_sito.jpg
    errore_demo_sito.jpg
    16.3 KB · Views: 216

Dominex

Active Member
Licensed User
Longtime User
L'idea dei 3 Pannel piaceva anche a me ma sono subito imbattuto in un errore anche con la demo quando in modalità Fullscreen gli dico di fare il Loop, mi risponde con l'errore allegato che ti segnalo.

(lanciato solamente la demo scaricata dal sito)
In effetti è presente un bug di cui non mi sono accorto durante un'evoluzione della classe. Cercherò di risolverlo al più presto. Grazie della segnalazione.
 

erfan

Member
Licensed User
Longtime User
zoom pannelz dose not work properly in androic 4.1
i have xperia ray 4.1.2 and pannels get stock
hope you fix it
 
Last edited:

Dominex

Active Member
Licensed User
Longtime User
zoom pannelz dose not work properly in androic 4.1
i have xperia ray 4.1.2 and pannels get stock
hope you fix it
If it does not work is not due to version 4.1.x, I tried it on more devices are successful.

Have you tried the demo with ActiviyTouch?
 
Top