Beta 1.7: HorizontalScrollView

KashMalaga

Member
Licensed User
Longtime User
Im using the new beta and works great the new HorizontalScroll.

I only found one issue but donkt know why happen.

Im using a custom menu using a HorizontalScroll insted the normal menu (activity.additem....)

B4X:
Sub Activity_KeyPress(KeyCode As Int) As Boolean

Select KeyCode
Case KeyCodes.KEYCODE_MENU
   'HorizontalScroll.BringToFront
   'webview.SendToBack
................

As you can imagine, when Webview its running and menu is pressed Horizontal scroll appears but get to background fast. ofc i tried the comented lines from above.

Any ideas?:sign0085:
 

KashMalaga

Member
Licensed User
Longtime User
Can you make a small project that demonstrates the issue and upload it?

Here is a quick pretty example.

Only works the first orange icon.
Menu option to show horizontalscroll and hide it, back button to exit in this case

PS. if you are going to test in on HoneyComb tablets you will see anything, i didnt write aceleredhw on xml, but still at least doesnt working for me.
 
Last edited:
Upvote 0

agraham

Expert
Licensed User
Longtime User
What do you think the problem is? I can see nothing wrong with HorizontalScrollView.

You need to put activado=False in Sub View_Click to make it behave properly.

If I then use

webview1.LoadUrl("http://www.b4x.com/")

in Sub test, because my phone doesn't do Flash it works as expected for me.


It's better to post projects using File -> Export As Zip to keep things small.
 
Upvote 0

KashMalaga

Member
Licensed User
Longtime User
So if for you its working right using a normal website, if have flash content you press Menu, the HorizontalScroll appears at background of the player and there is no way to show in front
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
I would guess that is because your WebView is overlapping the HorizontalScrollView and the Flash is being drawn on a display Surface that is the same size as the WebVview but is actually being rendered on top of everything else. It will probably behave like that for all other Views. Have you tried resizing the WebView?
 
Upvote 0

KashMalaga

Member
Licensed User
Longtime User

Holy shit!!its works fine with your test page...
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Holy shit!!its works fine with your test page...
Probably because that is being rendered normally on the actual WebView by the UI thread. OpenGL, and I would expect Flash, are rendered on separate Surfaces by a separate rendering thread other than the normal UI thread.
 
Upvote 0

KashMalaga

Member
Licensed User
Longtime User
Probably because that is being rendered normally on the actual WebView by the UI thread. OpenGL, and I would expect Flash, are rendered on separate Surfaces by a separate rendering thread other than the normal UI thread.
Then why was working fine using normal menu?
resizing weview isnt be The good way.

Thanks for your fast replys
 
Upvote 0

KashMalaga

Member
Licensed User
Longtime User
After one day testing, there is no solution resizing webview component cause for phone part of the screen are not used for saving space for menu.

I tried everything, stop webview, goback, disable, hide, but there is no way to stop the play. So the menu will stay appears under the webview component.

Any other idea Agraham or Erel?:sign0085:
 
Upvote 0

KashMalaga

Member
Licensed User
Longtime User
Resize or displace the WebView when you want to show your menu. Restore it afterwards when you make the menu invisible.

Tried to do that, and works fine for some pages, but for others doesnt resize

B4X:
Case KeyCodes.KEYCODE_MENU
   If activado = True Then
      HorizontalScroll.Visible = False
      working=False
      webview1.SetLayout(1, 1, Activity.Width, Activity.Height)
   Else
      webview1.SetLayout(1, 1, Activity.Width, Activity.Height-100)
      HorizontalScroll.Visible = True
      working=True
      
   End If
 
Upvote 0

droman

Member
Licensed User
Longtime User
Me he tomado la libertad de reescribirte una parte del código:

B4X:
Sub FillHorizontalScrollView
   Dim BitmapCadena(21) As Bitmap 
   Dim Panel0 As Panel
   Dim PanelTop, PanelHeight, PanelWidth As Int
   
   BitmapCadena(0).Initialize(File.DirAssets,"1.antena3.jpg")
   BitmapCadena(1).Initialize(File.DirAssets,"2.telecinco.jpg")
   BitmapCadena(2).Initialize(File.DirAssets,"3.la-sexta.jpg")
   BitmapCadena(3).Initialize(File.DirAssets,"4.canal_sur.jpg")

   
   PanelTop=0
   Panel0=HorizontalScroll.Panel
   Panel0.Color=Colors.Gray

   For i=0 To 3 'Para hacer los 21 que habias declarado pon esto: BitmapCadena.Length-1
      Dim Panel1 As Panel
      Dim ImageView1 As ImageView
      Panel1.Initialize("View")
      Panel1.Tag=i
      PanelHeight=72dip
      PanelWidth=72dip
      
   
      
      Panel0.AddView(Panel1,PanelTop,0,PanelWidth,PanelHeight)
      'Panel1.Color=Colors.Black
      ImageView1.Initialize("View")
      ImageView1.Tag=i
      Panel1.AddView(ImageView1,0dip,0dip,72dip,72dip)
      ImageView1.Bitmap=BitmapCadena(i)
       PanelTop=PanelTop+PanelWidth+1dip
   
   Next
   Panel0.Width=PanelTop
End Sub

Ahora es mucho más corto y para añadir más cadenas solo tienes que cambiar una variable.
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…