B4A Library DesignSupport - Additional Material Design components

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

  1. DonManfred

    DonManfred Expert Licensed User

    Look at the layouts used in the Navigationexample...
     
  2. A Z M JANNAT UL KARIM

    A Z M JANNAT UL KARIM Member Licensed User

    DonManfred, I feel naive !!! That one how I missed? Thank you for the support :)
    Is it possible I can change those Label value from the code window?
    Sorry again for my lame questions. Feels that I need to go Long Road.
     
  3. DonManfred

    DonManfred Expert Licensed User

    Why not? Note that you need to understand what is happening in the Navdrawer.

    Code:
    NavDrawer.NavigationView.LoadLayout( "navheaderLayout.bal", NavDrawer.DefaultHeaderHeight)
    You are getting the NavDrawers Navigationview and load a Layout to it.
    So. The Navdrawers Navigationview will contain all from the layout. The Navigationview is the base panel and it contains two Labels.

    Try to imagine what happens in this code.
    Sidenote: instead of logging you surely can change the Text....

    Code:
    NavDrawer.NavigationView.LoadLayout( "navheaderLayout.bal", NavDrawer.DefaultHeaderHeight)
        
    Log("Headercount = "&NavDrawer.NavigationView.HeaderCount)
        
    Dim hpnl As Panel = NavDrawer.NavigationView.GetHeaderView(0)
        
    For Each v As View In hpnl.GetAllViewsRecursive
            
    If v Is Label Then
                
    Dim lbl As Label = v
                
    Log(lbl.Text)
            
    End If
        
    Next
     
    corwin42 likes this.
  4. A Z M JANNAT UL KARIM

    A Z M JANNAT UL KARIM Member Licensed User

    Manfred, you are a life saver. It worked !!! Thank you very much. I do not know the processes very well and yet to familiar with a lot of options. Seems to be I need to start with the Beginners Guide again. If you have any survival guide for me please dont hesitate to mention.

    Again thank you :)
     
  5. wimpie3

    wimpie3 Well-Known Member Licensed User

    Is it possible to change the font of the menu items in a NavigationDrawer?
     
  6. DonManfred

    DonManfred Expert Licensed User

  7. wimpie3

    wimpie3 Well-Known Member Licensed User

    This only works because the header is a B4A panel, which contains labels.

    The menu items are constructed are constructed by the library - I guess we need Java reflection to get those labels.
     
  8. yiankos1

    yiankos1 Active Member Licensed User

    Good morning,
    Is there any way to change hint text size for floating edit text.
    Thank you for your time.

    EDIT:
    If you edit this file: (project directory)\Objects\bin\extra\res11\res\values\values.xml

    this section:

    Code:
    <style name="TextAppearance.Design.Hint" parent="TextAppearance.AppCompat.Caption">
            <item name=
    "android:textSize">12sp</item>
            <item name=
    "android:textColor">?attr/colorControlActivated</item>

        </style>
    it is only changes font size of hint when it goes up(when you enter text).
    That what i want is to change font size of hint when nothing is entered.
     
    Last edited: Jun 16, 2017
  9. ihabsharaf

    ihabsharaf Member Licensed User

    hi
    how to redraw NavDrawers items
    and build right to left drawer
     
  10. MichalK73

    MichalK73 Active Member Licensed User

    I use TabLayout at the bottom of the Activity as a menu with icons.
    For example, it adds 3 items consisting of the same icons and assigns Tag. It is always set to the first position or I can set from 1 to 3.
    When using TabSelected, it checks to see if the Tab selection has changed. If the user clicks on an icon that is set as home then it does not execute the code after checking the Tag.
    For example, initially SelectTab is set to 1. If a user clicks on the ikone with position 1, it will not execute the code, but at 2 and 3 will execute. Then you can select 1 but not last used.

    Can it be done by some way that TabSelected executes the code in the selected position?
     
  11. desof

    desof Well-Known Member Licensed User

    How can I load a different Layout on each Panel?

    Code:
    For i = 0 To 2
            
    'Cree un panel para la página con un color aleatorio.
            Dim p As Panel       
            p.Initialize(
    "")
            p.Color = 
    Colors.RGB(223,224,226)   
            
    Dim pageName As String
            pageName = 
    ""' & i       
            PC.AddPage(p, pageName)               
            subMenu.AddWithGroup2(
    3100+i, 100+i, pageName, xml.GetDrawable("ic_bookmark_black_24dp"))
        
    Next
     
  12. DonManfred

    DonManfred Expert Licensed User

    Code:
    p.LoadLayout(...)
     
    desof likes this.
  13. shashkiranr

    shashkiranr Active Member Licensed User

    Hi All,

    Is there a way to change the color of the tab when it is clicked? Apart from loading custom view into the tab.

    Best,
    SK
     
  14. Fusseldieb

    Fusseldieb Active Member Licensed User

    is it possible to add a notification counter in the navigation drawer view? like this:

    [​IMG]
     
  15. corwin42

    corwin42 Expert Licensed User

    This should be possible with a custom view. See the example. There is a SwitchCompat object in the menu. A counter should be possible similar.
     
  16. tzfpg

    tzfpg Active Member Licensed User

    Hi all,
    i had problem with FloatLabelEditText show password toggle, i try with sample in first page but when run got error.
    Code:
    --------- beginning of main
    ** 
    Activity (main) Pause, UserClosed = true **
    ** 
    Activity (main) Create, isFirst = false **
    ** 
    Activity (main) Resume **
    ** 
    Activity (main) Pause, UserClosed = true **
    Copying updated assets files (
    1)
    ** 
    Activity (main) Create, isFirst = true **
    java.lang.NoSuchMethodError: No virtual method setPasswordVisibilityToggleEnabled(Z)V 
    in class Lde/amberhome/objects/FloatlabelEditTextWrapper$InnerTextInputLayout; or its super classes (declaration of 'de.amberhome.objects.FloatlabelEditTextWrapper$InnerTextInputLayout' appears in /data/app/example.floatinglabeledittext-1/base.apk)
        at de.amberhome.objects.FloatlabelEditTextWrapper.DesignerCreateView(FloatlabelEditTextWrapper.java:105)
        at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:
    70)
        at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:
    158)
        at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:
    209)
        at java.lang.reflect.Method.invoke(Native Method)
        at anywheresoftware.b4a.shell.Shell.runMethod(
    Shell.java:710)
        at anywheresoftware.b4a.shell.Shell.raiseEventImpl(
    Shell.java:342)
        at anywheresoftware.b4a.shell.Shell.raiseEvent(
    Shell.java:249)
        at java.lang.reflect.Method.invoke(Native Method)
        at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:
    139)
        at example.floatinglabeledittext.main.afterFirstLayout(main.java:
    102)
        at example.floatinglabeledittext.main.access$
    000(main.java:17)
        at example.floatinglabeledittext.main$WaitForLayout.run(main.java:
    80)
        at android.os.Handler.handleCallback(Handler.java:
    836)
        at android.os.Handler.dispatchMessage(Handler.java:
    103)
        at android.os.Looper.loop(Looper.java:
    203)
        at android.app.ActivityThread.main(ActivityThread.java:
    6251)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:
    1063)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
    924)
    ** 
    Activity (main) Resume **
    what i miss?
     
  17. corwin42

    corwin42 Expert Licensed User

    I guess your support repository is too old.

    You will need design support library 24.2.0 or newer.
     
  18. beaker

    beaker Member Licensed User

    I've just implemented the NavigationDrawer from this library in one of my apps and it's looking great. However, I have an issue regarding .ItemCollapsed. Here's a snippet of my code which all works just fine, except that I was hoping that the the ACSubMenu "smAccount" would be collapsed until tapped on. Have I misunderstood what ".ItemCollapsed" does or am I doing something wrong?

    Code:
    Dim smAccount As ACSubMenu
    smAccount = NavDrawer.NavigationView.Menu.AddSubMenu(
    110001000"Account")
    smAccount.AddWithGroup2(
    1, miUpgrade, 1001"Upgrade", xml.GetDrawable("ic_account_circle_black_24dp")).ItemCollapsed=True
     
    If auth.CurrentUser.IsInitialized Then
       smAccount.AddWithGroup2(
    1, miSignout, 1001"Sign Out", xml.GetDrawable("ic_account_off_black_24dp")).ItemCollapsed=True
       smAccount.AddWithGroup2(
    1, miSync, 1002"Sync", xml.GetDrawable("ic_cloud_sync_black_24dp")).ItemCollapsed=True
    Else
       smAccount.AddWithGroup2(
    1, miSignin, 1001"Sign In", xml.GetDrawable("ic_account_circle_black_24dp")).ItemCollapsed=True
    End If
    I've even tried adding this code too but it still doesn't collapse.
    Code:
    NavDrawer.NavigationView.Menu.FindItem(1000).ItemCollapsed=True
     
  19. DonManfred

    DonManfred Expert Licensed User

  20. beaker

    beaker Member Licensed User

    Thanks DonManfred. I've now removed all of my .ItemCollapsed values and added
    Code:
    smAccount.Close
    after adding all my items to the submenu. Unfortunately it's made no difference :(. The submenu is still 'expanded' (see attached screenshot). Again, I might be misunderstanding what submenu.close does but what I'm after is getting the items below the submenu heading (in this case "Account") not to show until I tap on "Account", at which point I want the menu to expand and show the items belonging to that submenu.
     

    Attached Files:

Loading...
  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