B4A Library [Class] ActionBar

barx

Well-Known Member
Licensed User
Longtime User
and no one is under any obligattion to donate to your paypal account either.

I was thinking the same thing when I saw Informatix's post.

I think you guys got the wrong end of the stick. A bit of a translation issue. It happens from time to time when english isn't the home language. I think Informatix was saying he has no problem helping Beginners out.
 

Informatix

Expert
Licensed User
Longtime User
I was thinking the same thing when I saw Informatix's post.

It's not the first time I talk with wheretheidivides. And I'm not sure I really want to help him due to our past talkings. It's something personal here. I have nothing at all against beginners. I think I posted enough messages to prove that.

It's very irritating to read his posts because of his lack of diplomacy. And I don't want to be more diplomatic with him as he is with me. Do you think it was a good idea to start a post with a reminder about the B in Basic?

And if you think that I don't deserve any donation for my work or for the time spent here to help other people, I won't argue against your opinion. You're free to not use my work, to not read me, to not benefit from my tutorials. You're even free to think that my work is crappy and that you can do better. Maybe some day, you will show us some classes, libraries or tutorials that really deserve our attention...
 

Informatix

Expert
Licensed User
Longtime User
I opened the demo up but it wouldn't run. Says refector isnt there or something. So to answer your and erel's questions, yes we do read stuff before asking questions. it's just the people writing stuff are writing for advanced users.

The Reflection library may be found here.

When you look for a library, there's a list here.

You'll find two files in the zip file: a .jar and a .xml. Both must be copied into your additional lib folder. This folder is set in the Paths Config dialog of the B4A IDE.
 

bluedude

Well-Known Member
Licensed User
Longtime User
The B...

stands for Be polite.

And I think that some posts are pretty hard to read because it isn't always easy to write in English for many forum visitors.

Cheers,
 

marcel

Active Member
Licensed User
Longtime User
Hi,

Great work!!

Am I able with this to build something as in my attachment (button bar below)?
 

Attachments

  • bar.jpg
    92 KB · Views: 406

marcel

Active Member
Licensed User
Longtime User
No problem. You can do the three button bars of your screenshot. Look at this tutorial to know how to customize the button appearance.

Small question. Do you have a downloadable source code of that example? Or can you explain to me the background image of the button bar? Is this 1 line width and will be expanded automaticly based on the size of the device? Or is this a very width image? Is this resized automaticly? What is the best way to do this?
 

marcel

Active Member
Licensed User
Longtime User
Some issues with images

Hi,

I have made a simple test. It seems to work out ok. Only I have an issue with the images. They seems to be stretched. Can I switch this off? Or are my pictures not correct? If not what is the correct size? :sign0013:
 

Attachments

  • bar2.png
    39 KB · Views: 387

Informatix

Expert
Licensed User
Longtime User
Small question. Do you have a downloadable source code of that example?

No. But 99% of the code is included in the tutorial.

Or can you explain to me the background image of the button bar? Is this 1 line width and will be expanded automaticly based on the size of the device? Or is this a very width image? Is this resized automaticly? What is the best way to do this?

"bg_defaut.png" is just two pixels wide and is stretched automatically.
 

marcel

Active Member
Licensed User
Longtime User
Use only square images. Add a transparent padding around them to make them squared.

They are 30*30 pixels. I have attached a sample.
 

Attachments

  • mailbox-icon.png
    879 bytes · Views: 396
Last edited:

marcel

Active Member
Licensed User
Longtime User
No. But 99% of the code is included in the tutorial.

"bg_defaut.png" is just two pixels wide and is stretched automatically.

Ok. I have always problem with images. I am not sure what happen to them. If they are resized depending on the screen size? Or do I need to have a set of images depending on the screen size.
 

Informatix

Expert
Licensed User
Longtime User
Sure, Attached the project file.

I see nothing wrong. The displayed images are perfect squares on my devices and they are perfect squares also on your screenshot, so I don't see what's the problem exactly.

Note: if you enable SameWidthForAll, the icons will be enlarged or reduced to fit the action bar width, but they will be only rescaled, not stretched. If they are squared, they remain squared.
 
Last edited:

marcel

Active Member
Licensed User
Longtime User
Note: if you enable SameWidthForAll, the icons will be enlarged or reduced to fit the action bar width, but they will be only rescaled, not stretched. If they are squared, they remain squared.

If you look to the icons f.e. in paint.net or on the screenshot they look more expanded. I am not sure how to explain this. But it is not sharp anymore.

I did get the impression that the SameWidthForAll had to with the size of the buttons? So it resizes the buttons and the images? Can I use a seperate function to influence this enlargement?

Sorry about all the questions.... :sign0013:
 

Informatix

Expert
Licensed User
Longtime User
Can I use a seperate function to influence this enlargement?

Sub SetFixedWidth(Btn As View, NewWidth As Int)
'Sets the button width and centers its content
'This new width is temporary. It will be reset if you call Invalidate or a function modifying the button content.
'This function is ignored if SameWidthForAll has been enabled.

Sub SetIconAsWideAsText(Enabled As Boolean)
'Enlarges the icon to fit the text width
'This function is ignored by buttons with no text and buttons with a text on the left/right side.
 

marcel

Active Member
Licensed User
Longtime User

Thanks, solved the issues.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…