B4A Library DesignSupport - Additional Material Design components

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.

B4X:
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:50)
    at de.amberhome.objects.FloatlabelEditTextWrapper.innerInitialize(FloatlabelEditTextWrapper.java:61)
    at anywheresoftware.b4a.objects.ViewWrapper.Initialize(ViewWrapper.java:65)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:753)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:343)
    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 com.apptuners.feedbackr.login.afterFirstLayout(login.java:102)
    at com.apptuners.feedbackr.login.access$000(login.java:17)
    at com.apptuners.feedbackr.login$WaitForLayout.run(login.java:80)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
 

corwin42

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

Edit: Fixed in V2.23
 
Last edited:

alimanam3386

Active Member
Licensed User
Hi

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

Edit:

yes it is working by bellow event:


B4X:
Sub Activity_ActionBarHomeClick
    Log("Yes, this one works here")
    If NavDrawer.IsDrawerOpen Then
        NavDrawer.CloseDrawer
    Else
        NavDrawer.OpenDrawer
    End If
End Sub
thank you
 
Last edited:

Inman

Well-Known Member
Licensed User
I see it too. Will upload a fix as soon as possible

Edit: Fixed in V2.23
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.
 

corwin42

Expert
Licensed User
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.
I haven't tested it but it should. I guess the sender is not the DSFloatLabelEditText but a normal EditText (or ACEditText) item.
 

Sapta

Member
Licensed User
Hi

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

Edit:

yes it is working by bellow event:


B4X:
Sub Activity_ActionBarHomeClick
    Log("Yes, this one works here")
    If NavDrawer.IsDrawerOpen Then
        NavDrawer.CloseDrawer
    Else
        NavDrawer.OpenDrawer
    End If
End Sub
thank you

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?

B4X:
#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
        NavDrawer.CloseDrawer
    Else
        NavDrawer.OpenDrawer
    End If
End Sub
#End Region
 

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.
 

johndb

Active Member
Licensed User
Is it possible to add an event that is triggered when a Snackbar finishes its display?
 

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

Active Member
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.
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)
 

corwin42

Expert
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
I guess that your support library is too old.
 

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?


Thanks


Edit: Corrected Error.
 
Last edited:

corwin42

Expert
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.Toolbar_NavigationItemClick.CharSequence

Do you need B4A 6.8 to use this lib update?
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?
 

ivan.tellez

Active Member
Licensed User
When do you get the error? On compile time or at runtime?
Neither, its at design time, I just figured it out. My previous code:

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

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

corwin42

Expert
Licensed User
Hi @corwin42.
Is it possible to set the menu items size?
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

Administrator
Staff member
Licensed User
Are you using ACPopupMenu? If so then please start a new thread.
 
Top