1. Black Friday Sale - 50% off

    B4A Standard for $29 instead of $59!
    Buy Now
    Dismiss Notice

B4A Library DesignSupport - Additional Material Design components

Discussion in 'Additional libraries, classes and official updates' started by corwin42, Oct 1, 2015.

  1. Inman

    Inman Well-Known Member Licensed User

    After updating the libraries (both DesignSupport and AppCompat) and cleaning the project, I am getting an error for the line txtemail.Initialize(""), where txtemail is DSFloatlabelEditText. It used to work fine with old version of libraries. Also if I change the type of EditText, it works fine.

    Error occurred on line: 76 (Login)

    java.lang.RuntimeException: Object should first be initialized (DSFloatlabelEditText).
    Did you forget 
    to call Activity.LoadLayout?
        at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:
        at de.amberhome.objects.FloatlabelEditTextWrapper.innerInitialize(FloatlabelEditTextWrapper.java:
        at anywheresoftware.b4a.objects.ViewWrapper.Initialize(ViewWrapper.java:
        at java.lang.reflect.Method.invoke(Native Method)
        at anywheresoftware.b4a.shell.Shell.runVoidMethod(
        at anywheresoftware.b4a.shell.Shell.raiseEventImpl(
        at anywheresoftware.b4a.shell.Shell.raiseEvent(
        at java.lang.reflect.Method.invoke(Native Method)
        at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:
        at com.apptuners.feedbackr.login.afterFirstLayout(login.java:
        at com.apptuners.feedbackr.login.access$
        at com.apptuners.feedbackr.login$WaitForLayout.run(login.java:
        at android.os.Handler.handleCallback(Handler.java:
        at android.os.Handler.dispatchMessage(Handler.java:
        at android.os.Looper.loop(Looper.java:
        at android.app.ActivityThread.main(ActivityThread.java:
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
  2. corwin42

    corwin42 Expert Licensed User

    I see it too. Will upload a fix as soon as possible

    Edit: Fixed in V2.23
    Last edited: Jan 26, 2017
  3. alimanam3386

    alimanam3386 Active Member Licensed User


    The NavigationItemClick does not works for me in new updated library [ I've tested your sample NavigationView1_0.zip ]


    yes it is working by bellow event:

    Sub Activity_ActionBarHomeClick
    Log("Yes, this one works here")
    If NavDrawer.IsDrawerOpen Then
    End If
    End Sub
    thank you
    Last edited: Jan 29, 2017
  4. DonManfred

    DonManfred Expert Licensed User

    it is working fine here. b4a 6.5, Design 2.23, AppCompat 3.3
    alimanam3386 likes this.
  5. Inman

    Inman Well-Known Member Licensed User

    Cool. It is working now.

    Another question. Does DSFloatLabelEditText support Sender object? With an array of DSFloatLabelEditText views, I tried to get Sender inside TextChanged event but got a Null error. Again the same code works if it is EditText.
  6. corwin42

    corwin42 Expert Licensed User

    I haven't tested it but it should. I guess the sender is not the DSFloatLabelEditText but a normal EditText (or ACEditText) item.
  7. Sapta

    Sapta Member Licensed User

    Hi @alimanam3386,

    I have same problem, when i click homebutton (homebutton of the Toolbar. The 3 line menu icon is animated) does not works for me in new updated library, i change code reference by your code, still not work? any solution?

    #Region ToolBar Events
    'Open or Close the drawer if the Toolbar HomeButton is clicked.
    Sub Activity_ActionBarHomeClick
    Log("Yes, this one works here")
    If NavDrawer.IsDrawerOpen Then
    End If
    End Sub
    #End Region
  8. corwin42

    corwin42 Expert Licensed User

    Please start a new thread for this question in the questions forum. Homebutton and ToolBar have nothing to do with DesignSupport library.
    luke2012 likes this.
  9. johndb

    johndb Active Member Licensed User

    Is it possible to add an event that is triggered when a Snackbar finishes its display?
  10. corwin42

    corwin42 Expert Licensed User

    johndb likes this.
  11. corwin42

    corwin42 Expert Licensed User

    Updated library to version 2.30.

    This adds a Dismissed event to the snackbar and supports CharSequences whereever possible.

    Be aware that the snackbar needs a CoordinatorLayout to support swipe to dismiss.
    I'm currently working on Coordinator Layout support but this is quite complex and very time consuming to test. Maybe the next version will have initial support for it.
    johndb and Johan Schoeman like this.
  12. johndb

    johndb Active Member Licensed User

    I tried implementing the Dismissed event and received the following error:

    java.lang.NoSuchMethodError: No virtual method addCallback(Landroid/support/design/widget/BaseTransientBottomBar$BaseCallback;)Landroid/support/design/widget/BaseTransientBottomBar; in class Landroid/support/design/widget/Snackbar; or its super classes (declaration of 'android.support.design.widget.Snackbar' appears in /data/app/com.scsoftstudios.aws-2/base.apk)
    at de.amberhome.objects.SnackbarWrapper.Initialize(SnackbarWrapper.java:101)
    at com.scsoftstudios.aws.actapp._save_click(actapp.java:550)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
    at com.scsoftstudios.aws.actapp$B4AMenuItemsClickListener.onMenuItemClick(actapp.java:191)
    at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:148)
    at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:957)
    at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:947)
    at android.support.v7.widget.ActionMenuView.invokeItem(ActionMenuView.java:616)
    at android.support.v7.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:153)
    at android.view.View.performClick(View.java:5637)
    at android.view.View$PerformClick.run(View.java:22429)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6119)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
  13. corwin42

    corwin42 Expert Licensed User

    I guess that your support library is too old.
  14. ivan.tellez

    ivan.tellez Active Member Licensed User

    Hi @corwin42

    I just update this lib to 2.3 and AppCompat to V3.50:, Now I got an error

    Unknow Type: JavaObject.lang.CharSequence

    Do you need B4A 6.8 to use this lib update?

    If yes, could you please publish previous versions?


    Edit: Corrected Error.
    Last edited: Feb 18, 2017
  15. corwin42

    corwin42 Expert Licensed User

    No. It should work with lower B4A versions.

    When do you get the error? On compile time or at runtime? Can you please post the full error stack?
  16. ivan.tellez

    ivan.tellez Active Member Licensed User

    Neither, its at design time, I just figured it out. My previous code:

    If TxtClave.Text.Length <> 10 Then
    'some warning stuff
    End if
    But it works like this:

    Dim tString As String
    tString = TxtClave.Text
    If tString.Length <> 10 Then
    'some warning stuff
    End if
  17. corwin42

    corwin42 Expert Licensed User

    In V2.31 (and AppCompat V3.51) the getters will return String instead of CharSequence again so the old syntax will work again.
    ivan.tellez likes this.
  18. luke2012

    luke2012 Well-Known Member Licensed User

    Hi @corwin42.
    Is it possible to set the menu items size?
  19. corwin42

    corwin42 Expert Licensed User

    Which menu items you are talking about? The DesignSupport library does not have any Menu objects. If you are talking about the NavigationView there is no direct way to set the size. Maybe it is possible within the Theme but I'm not very familiar with it.
    Erel likes this.
  20. Erel

    Erel Administrator Staff Member Licensed User

    Are you using ACPopupMenu? If so then please start a new thread.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice