B4A Library SD: Floating Button StandOut

Sure
B4X:
standout.Snotif.SetInfo("Hallo","Float",Me) ' Me is Main Activity
I've been trying your solution for long time with no luck, could you please show me how to do it?

B4X:
#Region  Project Attributes
    #ApplicationLabel: Floating StandOut Example 1
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region
' remenber Add on Manifest this permission:
'    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Private PanelMain As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    Activity.LoadLayout("main")
    
    standout.Snotif.Initialize
    standout.Snotif.Icon = "icon"
    standout.Snotif.SetInfo("Title","Body",Me)
    standout.Snotif.Notify(1)
    FloatingStandOut.PathImage=File.DirAssets
    FloatingStandOut.NameFileImage="image2.png"
    FloatingStandOut.X=50%x
    FloatingStandOut.Y=50%y
    FloatingStandOut.SetStartActivity(True,True,False)
    FloatingStandOut.SetStopFloating(True,True,True)
End Sub

Sub Activity_Resume
    FloatingStandOut.Stop
End Sub

Sub Activity_Pause (UserClosed As Boolean)
'    FloatingStandOut.Start(Me)
End Sub

Sub Button1_Click
    Dim Permission As SpecialPermission
    Permission.Initialize
    If Permission.GetPermission Then
        FloatingStandOut.Start(Me)
    Else
        Permission.OpenSettingPermission
    End If
    
    Activity.Finish
End Sub
 

Star-Dust

Expert
Licensed User
Longtime User
Dear friend,

You added too much stuff and got the opposite result. I didn't write to you to initialize or activate the notification.
In any case, you are definitely making mistakes.

The command to communicate which Task to start is in the service startup.
B4X:
FloatingStandOut.Start (MyActivity)


While if you want there when you click the image opens the activity indicated in the start, the command is this.
B4X:
FloatingStandOut.SetStartActivity (True, True, False)

The first True indicates that with a single click the activity opens, the second true that with 2 clicks the activity will open, the third Boolean relates to the long click.
The example already does this, you don't have to change it. If you change it opt for a different thing.
 
The quoted code is exactly the provided example, I just added the highlighted lines to set the notification info with no success..
I just want you please to show me how to set the notification info in the provided example.
Thanks,
 

Star-Dust

Expert
Licensed User
Longtime User
Sorry, I misunderstood the question. English is not my main language.

I have researched it thoroughly, it is not possible to change the service notification, because it is already started and generates error.

I will try to post an update in the next few days that will allow you to make this change before the service starts
 

Star-Dust

Expert
Licensed User
Longtime User
Update 0.08
This library had not been updated for three years. The time has come to do it​
With version 0.08 it is possible to change the Title and the Body of the notification.​
You can get the full version by making a donation.​

Example:
B4X:
    Activity.LoadLayout("main")

    FloatingStandOut.PathImage=File.DirAssets
    FloatingStandOut.NameFileImage="image2.png"
    FloatingStandOut.X=50%x
    FloatingStandOut.Y=50%y
    FloatingStandOut.SetStartActivity(True,True,False)
    FloatingStandOut.SetStopFloating(True,True,True)
    FloatingStandOut.NotificationTitle="Title"  ' <------ New
    FloatingStandOut.NotificationBody="Body"   ' <------ New
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
Update 0.08 DEMO
This library had not been updated for three years. The time has come to do it​

And I only saw this NOW?!?!?
I remember when @JordiCP first launched his "original" lib and I had issues making it work on a low end Android 5 (?) device, and so we collaborated (mostly I just tested out his stuff until it worked)...
You have done an amazing job!
 

Star-Dust

Expert
Licensed User
Longtime User
Update rel 0.09
Fixed bug that prevented memorizing the last position
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…