German Warum ist das nicht Initialisiert?

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Im Release läuft es aber in debug nicht.
 

Attachments

  • test.zip
    11.7 KB · Views: 344

DonManfred

Expert
Licensed User
Longtime User
Da fehlt eine font datei....

 

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Ich habe nun den Code soweit gekürzt, aber de möchte immer noch ne Initialisierung.
 

Attachments

  • test.zip
    32.9 KB · Views: 334

DonManfred

Expert
Licensed User
Longtime User
Ich habe nun den Code soweit gekürzt, aber de möchte immer noch ne Initialisierung.
Du hast aber schon den Hinweis in dem Thread von der SlidingMenu library gelesen?
The open source project is no longer maintained and there are compatibility issues with newer versions of Android. It is recommended to use B4XDrawer instead.
 

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Das ist mir bewusst.
B4XDrawer war mein erster Versuch.

Das Problem bei B4XDrawer ist, der kann den unteren Haupt-Layout nicht nach rechts verschieben.
Stattdessen wird das Left Menue als Over Top von links auf den Haupt-Layout rein gefahren.
Und wenn man sogar auf dem Haupt-Layout dynamisch geladene Elemente hat, liegt das Left-Menue unter der dyn. Elemente.
Und da gibt es keine Elevator Einstellungen, noch gibt es Z-Order Eingabe.

Es sei denn du kennst da einen Trick.
Hatte ich bereits in einen Anderen Thread erwähnt.
https://www.b4x.com/android/forum/threads/slidemenue-b4xdrawer.103140/#post-647419

 

Attachments

  • upload_2019-3-7_19-58-11.png
    130.3 KB · Views: 289

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Zurück zum Haupt Problem.

Das mit dem Slide-Menue funktioniert erstmal auch wenn dafür keinen Support mehr geben wird.
Und auch in Relase Modus läuft es auf dem Smartphone.
Mich stört es aber trotzdem, wenn ich in Debug-Modus ständig Errors bekommen.

So wie in diesem Fall:


Obwohl alles initialisiert sind.

B4X:
#Region Module Attributes
    #FullScreen: False
    #IncludeTitle: True
    #ApplicationLabel: ScrollViewBigPanel
    #VersionCode: 1
    #VersionName:
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

'Activity module
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.
    
    
    '########### SLIDE Menue ############
    Private sm As SlidingMenu
    Private ic1Menu As ImageView
    Private ic2Menu As ImageView
    Private ic3Menu As ImageView
    Private ic4Menu As ImageView
    Private ic5Menu As ImageView
    Private ic6Menu As ImageView
    Private btactionmenu As ImageView
    Private lb1Menu As Label
    Private lb2Menu As Label
    Private lb3Menu As Label
    Private lb4Menu As Label
    Private lb5Menu As Label
    Private lb6Menu As Label
    Private pArka01Menue As Panel
    Private pArka02Menue As Panel
    Private pArka03Menue As Panel
    Private pArka04Menue As Panel
    Private pArka05Menue As Panel
    Private pArka06Menue As Panel
    Private lbProfilInfo As Label

    Private ScrollView3 As ScrollView
    Private Panel1 As Panel
    '#####################################
    
    Private btnCreateConnection As Button
    Private btnInput As Button
    Private btnOutput As Button
    Private btnSettings As Button
    Private btnSwitchALLOFF As Button
    Private btnSwitchALLON As Button
    Private pArka01BeyazMenue As Panel
    Private pArka02BeyazMenue As Panel
    Private pArka03BeyazMenue As Panel
    Private pArka04BeyazMenue As Panel
    Private pArka05BeyazMenue As Panel
    Private pArka06BeyazMenue As Panel
    Private lbEmailMenu As Label
    Private lbNamen_Kurzel As Label
    Private pRedondoMenu As Panel
    Private pVerdeMenu As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
    
    Activity.LoadLayout("main")
    
    '####################### SLIDE MENUE #############################
    sm.Initialize("sm")
    Dim offset As Int = 22%x
    sm.BehindOffset = offset
    sm.Mode = sm.LEFT
    sm.Menu.LoadLayout("LM_Input_Output")
    
        
    Dim jo As JavaObject = sm

    Dim Gradient1 As GradientDrawable
    Dim Clrs(2) As Int
    Clrs(0) = Colors.ARGB(0,0,0,0)
    Clrs(1) = Colors.ARGB(50,0,0,0)
    Gradient1.Initialize("LEFT_RIGHT", Clrs)
    jo.RunMethod("setShadowDrawable", Array(Gradient1))
    jo.RunMethod("setShadowWidth", Array(4%x))
    
    'Vorbereitung der Menütasten
    Dim jo As JavaObject = sm
    jo.RunMethod("setTouchmodeMarginThreshold", Array(50%x))
    
    'Wir machen die Veranstaltung zum Öffnen (wissen, wann das Menü geöffnet ist)
    Dim jo2 As JavaObject = sm
    Dim event As Object = jo2.CreateEventFromUI("com.jeremyfeinstein.slidingmenu.lib.SlidingMenu$OnOpenListener", "Open", Null)
    jo2.RunMethod("setOnOpenListener", Array(event))


    'WIR WÄHLEN DAS SCHLIESSENDE EREIGNIS (WISSEN, WENN DAS MENÜ GEÖFFNET IST)
    Dim jo3 As JavaObject = sm
    Dim event As Object = jo3.CreateEventFromUI("com.jeremyfeinstein.slidingmenu.lib.SlidingMenu$OnCloseListener", "Close", Null)
    jo3.RunMethod("setOnCloseListener", Array(event))
    
    
    ScrollView3.Panel.LoadLayout("ScrollviewLayout")
    ScrollView3.Panel.Height = Panel1.Height
    
    ICONS_Laden
        
    '#################################################################
    
End Sub


Sub ICONS_Laden
    AjustaImageView(btactionmenu,File.DirAssets,"menu.png")
    AjustaImageView(ic1Menu,File.DirAssets,"menu.png")
    AjustaImageView(ic2Menu,File.DirAssets,"menu.png")
    AjustaImageView(ic3Menu,File.DirAssets,"menu.png")
    AjustaImageView(ic4Menu,File.DirAssets,"menu.png")
    AjustaImageView(ic5Menu,File.DirAssets,"menu.png")
    AjustaImageView(ic6Menu,File.DirAssets,"menu.png")

    Schriftarten_Laden
End Sub

Sub AjustaImageView(Imv As ImageView, Dir As String, FileName As String)
    Private bmp As Bitmap = LoadBitmap(Dir, FileName)
    Dim Delta, Height, Width As Int
    If bmp.Width / bmp.Height > Imv.Width / Imv.Height Then
        Height = bmp.Height / bmp.Width * Imv.Width
        Delta = (Imv.Height - Height) / 2
        Imv.Height = Height
        Imv.Top = Imv.Top + Delta
    Else
        Width = bmp.Width / bmp.Height * Imv.Height
        Delta = (Imv.Width - Width) / 2
        Imv.Width = Width
        Imv.Left = Imv.Left + Delta
    End If
    Imv.Gravity = Gravity.FILL
    Imv.Bitmap = bmp
End Sub

Sub Schriftarten_Laden
    Private cs As CSBuilder
    cs.Initialize
    cs.Append("Test").Size(20).Bold.Append(",").PopAll
    cs.Append(CRLF).PopAll
    cs.Append("Mustermann").Size(10).Bold.PopAll
    lbProfilInfo.Text = cs
End Sub
Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 

OliverA

Expert
Licensed User
Longtime User
Cookies are required to use this site. You must accept them to continue using the site. Learn more…