B4A Library StdActionBar - Another ActionBar library

Discussion in 'Additional libraries, classes and official updates' started by Erel, Jan 16, 2014.

  1. Erel

    Erel Administrator Staff Member Licensed User

    You can catch the back key in Activity_KeyPress. If the EditText is not empty then clear it and return True (this will consume the back key event).
     
  2. Inman

    Inman Well-Known Member Licensed User

    Ok, but can I remove that EditText completely from actionbar?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    You can either hide it by setting its Visible property to False or you can remove it with EditText.RemoveView.
     
  4. Inman

    Inman Well-Known Member Licensed User

    Ah yes. I was too deep looking for a function to remove Menu/Actionbar items that I didn't remember .RemoveView :)

    Thanks Erel
     
  5. DSD

    DSD Member Licensed User

    I'm not seeing the title of the ActionBar buttons I've added.
    The app is using the Holo Light theme, could this be the reason why the text on the buttons are not shown?

    I can only see the two images not image and text...

    Here's code I'm using when adding two buttons to the actionbar:
    Code:
    Activity.AddMenuItem3("Save""mnuSave"LoadBitmap(File.DirAssets, "save.png"), True)
    Activity.AddMenuItem3("Cancel""mnuCancel"LoadBitmap(File.DirAssets, "remove.png"), True)
     
  6. Inman

    Inman Well-Known Member Licensed User

    I believe the button titles are more like tooltips. If you longpress on a button, you can see the title.
     
  7. DSD

    DSD Member Licensed User

    Thanks for the reply.
    I guess it's the opposite for menu items not being shown on the actionbar, their icon will disappear and only the title will show?
    Is this behavior for both buttons on actionbar and in actionbar menu by design or is it simply not implemented in the stdActionBar?
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    This is how Android Action bar works. If there is enough room for the image then only the image is displayed. If there isn't enough room the text will be displayed in the menu.
     
  9. irda

    irda Member Licensed User

    I have the same problem. My application has 9 tabs, but in some devices (7" phone, galaxy tab 3lite) the tabs are changed to drop-down. My client doesn't like this, he wants tabs in all devices.

    What I want always.JPG Bad menu.JPG

    It's the same program, it's configurated to tabs, no dropdown menu. Is it possible to show always the tabs?

    All help is appreciated. Thanks.
     

    Attached Files:

    Last edited: Apr 5, 2014
    Jerez likes this.
  10. johndb

    johndb Active Member Licensed User

    If you always need to show tabs I would use the Tabhost view and not rely on the features of the stdactionbar at all.
     
  11. irda

    irda Member Licensed User

    That was my first option. The problem is the tabhost view doesn't work correctly because tabs neither slide. Besides, if there are a lot of tabs, the text of these tabs is resized and the view is not good.
     
  12. johndb

    johndb Active Member Licensed User

    I understand what you are saying. There would definitely be a use for a new custom view that is similar to a tabhost but that would allow horizontal scrolling, perhaps with an arrow indicator on either side as well. I have never come across one of these while browsing the forums or checking the libraries. I neither have the time to create one nor, and more importantly, the knowledge yet. I think that many of us would use this type of view (Horizontally scrollable and user defined tab width, height) in our projects. Anyone up for the challenge?
     
    Last edited: Apr 5, 2014
  13. Erel

    Erel Administrator Staff Member Licensed User

    This is how the native action bar works. However the dropdown menu should be synchronized with the current page.
     
  14. irda

    irda Member Licensed User

    The dropdown is synchronized. Just thought it would be possible to always display tabs. Many thanks.
     
  15. cbc551

    cbc551 Member Licensed User

    Erel, Is there any way to put the image of the 3 bars instead of the arrow to the left of the icon?
     

    Attached Files:

  16. corwin42

    corwin42 Expert Licensed User

    You can use the StdActionBarHelper library for this. The example of this library shows how to use the AHNavigationDrawer (slide menu) with the standard ActionBar.
     
    cbc551 likes this.
  17. tipallandgo

    tipallandgo Member Licensed User

    Is it possible to support < ICS using the support library? My reason is that our target audience are students from our school. There might be cases where some of them are still using < ICS.
     
  18. Erel

    Erel Administrator Staff Member Licensed User

  19. bluedude

    bluedude Well-Known Member Licensed User

    Hi,

    I have started using this for my new UI template and combined this action bar with the actionbar helper, mListview and AHNavigationDrawer. It almost works but unfortunately if the StdViewPage is showing (tabs) the menu shows under the tabs instead of just under the actionbar.

    The menu should cover the tabs and needs to show up right under the actionbar.

    Attached is the project.
     

    Attached Files:

  20. Erel

    Erel Administrator Staff Member Licensed User

    Can you post a screenshot?
     
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