Add custom toolcontrol to toolbar E4 - java

Currently my custom toolcontrols are outside the toolbars because of the scaling issue in E4. Toolbar does not scale correctly in E4
Now my client want to have different toolbars for all the toolcontrols, so that the user can rearange the order of the toolbar and separate the toolcontrols from each others. How is this possible in E4? I know the toolcontrols inside the toolbar is not scaling the toolbar itself. But is there any workaround to place a toolcontrol inside a toolbar?

I added ahidden icon to the toolbar when adding the custom toolcontrol to it. Eclipse scales the toolbar correct know.

Related

How to show Hamburger Icon, when toolbar icon is enabled

For my App i need to show icon in toolbar. So I referred a question on stackoverflow
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.ic_launcher);
I applied the same to my code but after running the app i noticed my navigational drawer icon i.e. hamburger gone missing.
How can i get it back along with the app icon?
Remember, ToolBar is the more customizable version of ActionBar, and are two different things, though they basically follow the same pattern.
My answer is to user Toolbar and customize it for the required view instead of using the default ActionBar.
If you are using the customized ToolBar, then the below code is not going to work.
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.ic_launcher);
Use ToolBar.
Change from this
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.ic_launcher);
To
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_launcher);

Make home button on toolbar change color when selected

I'm a bit of an Android newbie. I have a toolbar on my MainActivity which has a home button on the left (backarrow). I'm setting it like this
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
activity.setSupportActionBar(toolbar);
activity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
I noticed that on other Android apps when I hit the home button it will change background color momentarily to show the user that the click has been registered, and this is what I want to achieve. How can I do this? Is it a simple config change or is it something I have to implement myself?
Thanks for any help!

Set initial size for collapsing toolbar, expand or collapse

I'm using android support design library to create a collapsing toolbar. It works great, my view collapses when I scroll and expands when I scroll back.
But I wonder, I would like to have a profile in this toolbar, but half the profile would be hidden at first. So for example at first you only see the users profile picture in the toolbar. If you scroll down the list the toolbar collapses and everything gets hidden. But if you scroll the other way, to the top of the list and kind of beyond, the toolbar will expand even more and show you both profile picture and more information like name, description and so on..
Is this possible? To set the toolbar like "half collapsed" or something similar.
After a lot of trying and searching for information about the collapsing toolbar I ended up using another library instead.
https://github.com/umano/AndroidSlidingUpPanel
With this I got the customisation I wanted by setting anchor points. Though I didn't get, or atleast I don't know how to get, the function of the toolbar expanding and changing from toolbar color to an image for example. But for my case, the customisation was the main function and thus more important.

Increase the height of the toolbar in an E4 application

I've an E4 application where the toolbar needed a custom colored button. I'm using a ToolControl and creating a OButton. The problem is the button gets chopped off, Is there a way I can increase the height of the toolbar?

Is there a widget for making configurable toolbar in java

Is there a widget for making configurable toolbar in java ?
Couldnt find anything in swingx but seems a common problem
Use instances of Action to expose your application's functionality. Add these actions to your toolbar buttons. Because JToolBar is a Container you can add() and remove() buttons as needed in your toolbar editor by invoking revalidate() and repaint(). You can persist the current settings as suggested here.

Categories