Share My Creation YouMediaPlayer - Your personal Media Player

stefanoa

Active Member
Licensed User
Longtime User
@Informatix
i'm trying to use you class ScrollPanel with actual class ClsCheckList (i've update with version in your example).
i've inserted code from your example but i see only original scrollview (only with new Divider with parameter set to 1)

i use:
B4X:
Dim lstAudio As ClsCheckList
Dim spSV1 As ClsScrollPanel
Dim lblMirror As Label
then
B4X:
lstAudio.Initialize( Me, svAudio, "", "Audio_Click", "Audio_LongClick",1)
and then
B4X:
spSV1.Initialize(Activity, svAudio, 70dip, 70dip, True) 'Cache is enabled
with other event as you example:
B4X:
Sub svAudio_ScrollChanged(Position As Int)
   spSV1.DisplayFirstChar(Position)
End Sub
Sub spSV1_ShowHide(SenderSP As Object, Visible As Boolean)
  If Visible = False Then
   lblMirror.Visible = False
  Else
   lblMirror.Visible = spSV1.ScrollPanelMovedByUser
  End If
End Sub
Sub spSV1_TextUpdated(SenderSP As Object, Text As String)
  lblMirror.Text = Text
End Sub

that's correct?
 

stefanoa

Active Member
Licensed User
Longtime User
yes i've this code:

B4X:
lstAudio.Initialize( Me, svAudio, "", "Audio_Click", "Audio_LongClick",1)
lstAudio.ExtensionColor = Colors.ARGB(50, 255, 255, 255)

' We attach the ScrollPanel to the ScrollView
spSV1.Initialize(Activity, svAudio, 70dip, 70dip, True) 'Cache is enabled

' We create the listeners to get events in real time
spSV1.SetOnShowHideEvent(Me, "spSV1_ShowHide")
spSV1.SetOnTextUpdatedEvent(Me, "spSV1_TextUpdated")

' Our label "mirror" is invisible at start
lblMirror.Visible = False

but ScrollPanel and lblMirror not appears...
 

Informatix

Expert
Licensed User
Longtime User
Since this code works well in the demo #3, the problem is obviously in your app. I cannot say more without the app code. What does the log say (filtered and unfiltered) ?
The only thing that comes to my mind: you declared your ScrollPanel with Activity as parent while your ScrollView is obviously in a TabHost (why ?). It's better to declare the same parent. BUT you cannot do this with a TabHost. This view has one and only one children. So you have to create a panel, put the ScrollView inside and declare this panel as the ScrollPanel parent. And if you really need this TabHost, the panel becomes the TH child.
 

stefanoa

Active Member
Licensed User
Longtime User
ok. i've replaced tabhost with scrollview and scrollpanel is ok even if the order is incorrect, because I have a list grouped by artist and so the first letter refers to the individual songs and not to artists...

but i've an error on click (and long click) on class clschecklist_pnlsvclick:

if SubExists(CallbackMod, sub_Click) then
CallSub3(CallBackMod, sub_Click, pnl, pnl.tag)

java exception: sub Audio_Click signature does not match expected signature


My code in Audio_Click is:
B4X:
lstAudio.Initialize( Me, scvFiles, "", "Audio_Click", "Audio_LongClick",1)
....

Sub Audio_Click(pnlx As Panel, IDx As Int)
   ' Display album, track, year and duration of the audio file
   If IDx = Extended Then
      Extended = -1
      Return
   End If
   Dim lblLoc As Label
   lblLoc = pnlx.GetView(1)
        ....

any ideas? thanks
 

stefanoa

Active Member
Licensed User
Longtime User
New implementations in version 1.1.4 (see images)
Please see post #1
 
Last edited:

stefanoa

Active Member
Licensed User
Longtime User
I tried various resolutions and with last version seems to work
Base layout is 480x320 scale 1.0 only landscape
Do You have some problems with resolution?
Thks
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
On my phone, almost all views are properly sized but there are still some ScrollViews too tall or too narrow (e.g. when I select artists).

To display only artists with the ScrollPanel, you have to modify the ScrollPanel class by adding the following line after line #362 (v = sv.Panel.GetView(i)) in RefreshCache:
B4X:
If v.Tag <> Null Then Continue

I added filter functions in the latest version of the CheckList class.
 
Last edited:

stefanoa

Active Member
Licensed User
Longtime User
thanks... i've updated your class clsCheckList to 2.1
but the sub RefreshCache is in clsScrollPanel (i've version 1.3). right?
thanks
 

stefanoa

Active Member
Licensed User
Longtime User
@Informatix
for my App, I customized the following points.
Do you think to update the class passing parameters to functions AddItem, AddItemNoChkbx, AddHeader?

B4X:
...
Public Sub AddItem(....)
    lbl1.TextSize =  14      '18  <<< UPDATE
...
    lbl2.TextSize = 12       '16  <<< UPDATE
...
B4X:
...
Public Sub AddItemNoChkbx(....)
    lbl1.TextSize =  14      '18  <<< UPDATE
...
    lbl2.TextSize = 12       '16  <<< UPDATE
...
and to modify the Header:
B4X:
Private PanelHeightHeader As Int: PanelHeightHeader = 1.5 * LabelHeight   'UPDATE
...
Public Sub AddHeader(Text As String)
...
   lblB.TextSize = 14     '18 UPDATE
   pnlH.AddView(lblB, 0, 0, getWidth, PanelHeightHeader)   'UPDATE
   AddToSV(pnlH, PanelHeightHeader, False)               'UPDATE
 

Informatix

Expert
Licensed User
Longtime User
@Informatix
for my App, I customized the following points.
Do you think to update the class passing parameters to functions AddItem, AddItemNoChkbx, AddHeader?

No, because AddCustomItem is there for that.
It's easy to copy/paste the code from the class in a custom item creation sub, then remove the unneeded parts and change some settings. It's what I do in my own apps (AddItem never suits my needs).
 

stefanoa

Active Member
Licensed User
Longtime User
perfect!
now will update to replace additem with AddCustomItem, more flexible..
thanks
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…