Android Question AppCompat -Buttons are always in front

jtare

Active Member
Licensed User
I recently updated AppCompat because I updated a lot of stuff in the SDK manager (Android Support Repository, Google Repository.....) to start using firebase but appcompat is not working properly, the ACbuttons and the buttons are always in the front of the activity, does not matter if I bring to the front anything else or send back the buttons, they are always in front.
I used an example of appcompat to recreate this error because my project is to large to paste the code here, also attached a few screenshots.

appcompat code: the red listview represnt what the problem is, it does happen with panels , labels, etc.
B4X:
#Region  Project Attributes
    #ApplicationLabel: AppCompat2
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#AdditionalRes: ..\resource
#Extends: android.support.v7.app.ActionBarActivity


#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

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 Spinner1 As Spinner
    Private acbutton1 As ACButton
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("b4a4lay1")
    Spinner1.AddAll(Array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"))
    Dim p As Phone
    If p.SdkVersion < 11 Then
        Spinner1.DropdownBackgroundColor = Colors.DarkGray
        Spinner1.DropdownTextColor = Colors.White
        Spinner1.TextColor = Colors.White
    Else If p.SdkVersion < 21 Then
        Spinner1.DropdownBackgroundColor = Colors.DarkGray
    End If

    'Set some ActionBar options
    Dim bar As ACActionBar
    bar.Initialize
    bar.Title = "Simple AppCompat example"
    bar.Subtitle = "This is a Subtitle"

    Activity.AddMenuItem("Menu test", "Menu")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Not appcompat code: I just created a new project and added a button and a listview(red list view), here is working properly, the red listview is in front of the button
B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #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

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.

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("main")

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
It is possible to fix this? I already have a published app in the play store and it would not be nice to completely change the layout to a non Material design type of theme.
I figured out that using labels instead of buttons fix the issue but I think buttons are still necessary for some tasks.
Thanks
Screenshot_2016-08-20-19-37-39.png Screenshot_2016-08-20-19-37-46.png Captura de pantalla 2016-08-20 19.35.56.png Captura de pantalla 2016-08-20 19.36.06.png
 
Last edited:

jtare

Active Member
Licensed User
Thanks, I just changed the buttons for labels it was easier. Is this an update error related?
 
Top