'Create a panel and add it to the frame.
Sub Window_CreateAndAttachView (Id As Int, Frame As RSFrameLayout) As Panel
Dim Content As Panel
Content.Initialize("Content")
Frame.AddView(Content, 400, 300)
Dim btn As Button
btn.Initialize("btnSend")
btn.Text = "Send" ' HERE ----------------------------------> If i want change this ???
Content.AddView(btn, 0dip, 0dip, Frame.Width, 48dip)
Return Content
End Sub
btn.Text = "Send"
Hi ...another question
i see this your code:
B4X:'Create a panel and add it to the frame. Sub Window_CreateAndAttachView (Id As Int, Frame As RSFrameLayout) As Panel Dim Content As Panel Content.Initialize("Content") Frame.AddView(Content, 400, 300) Dim btn As Button btn.Initialize("btnSend") btn.Text = "Send" ' HERE ----------------------------------> If i want change this ??? Content.AddView(btn, 0dip, 0dip, Frame.Width, 48dip) Return Content End Sub
The question is .... can i change
B4X:btn.Text = "Send"
in dynamic mode ??
Example the user click top button "Send" in Float Window and this change Text in "OK, Done"
Thank you very much
'Clicking on this button on the second window (window with id:1) will change the text to "ok, done"
'Make sure you do btn.Tag = "btnSend" in the CreateAndAttachView event
Sub btnSend_Click
'checks if the window is shown or hidden
If mWindow.isExistingId(1) Then
StandOut.SendData(1, 5, Null, 0)
If getViewByTag("btnSend") <> Null Then
Dim btnSend As Button
btnSend = getViewByTag("btnSend")
btnSend.Text = "ok, done"
End If
End If
End Sub
Sub getViewByTag(Tag As String) As View
For Each v As View In mWindow.ContentPanel.GetAllViewsRecursive
If v.Tag = Tag Then
Return v
End If
Next
Return Null
End Sub
Thanks Tomas
So I have answer on 1 and 3 question but second question is still open is it possible to display data recived from serial port (using serial lib) under floating window made with your lib ?
Best regards
Hi
yes you should be able to do that.
You can use mWindow.ContentPanel to get the panel of that window.
Then you can get the view that you want through id, tag, etc.
and then you can work with the view.
Tomas
btn.Text = "Send"
mmhh... sorry Thomas is possibile a little example about change
B4X:btn.Text = "Send"
Thank you very much for your patient
Sub Window_Move (Id As Int, Window As RSStandOutWindow, pView As View, MotionEvent As Object)
'Get window position
Dim win As JavaObject = Window
Dim layout As JavaObject = win.RunMethod("getLayoutParams", Null)
Dim x As Int = layout.GetField ("x")
Dim y As Int = layout.GetField ("y")
Dim h As Int = layout.GetField ("height")
Dim w As Int = layout.GetField ("width")
Log( x & " " & y & " " & h & " " & w )
'Reset the y position to make it slide horizontally
Dim params As RSStandOutLayoutParams
params.Initialize3(Id, w, h, x, 0)
Window.UpdateViewLayout(Id,params)
End Sub
Is there a way to create the service in my app without creating a persistent notification ?
I'm trying to create a sliding window for a Wear Watch device and it works fine. The problem is that it creates a notification that stays on permanently and causes the Wear Watch to display this notification without any way for the user to dismiss it. It's really not viable.
I would only need to be able to create the service as sticky instead of permanent with a notification...
and I'll see if It gets killed.
out of view = background appThe window is always on just out of view
Whats the point to test this, if the Android OS was designed to KILL the app in this case, just read the android documentation.
out of view = background app
Allways "foreground" app = Never use any other apps on the device
The launcher is an partially hidden window
I don't think that this library is still relevant. I've moved this thread to the archived libraries forum.can we still buy this Lib or not ? !! since the Developer is not around anymore !!
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?