Android - Toolbar popup custom layout - java

Was wondering how you would go about implementing a custom layout for a toolbar popup, the one you get when you press on the settings button.
I need to increase the padding on the top and bottom of the popup, and also add in a custom font here. The only way I can think to do it would be to basically inflate a custom layout here but I'm not sure how it can be done. Most of the documentation I find online about it is just about styling it instead of adding in a new layout.
I thought maybe doing something like:
app:actionLayout="#layout/menu_settings_popup"
Would work, but unfortunately it doesn't. Also trying to set the layout and background in styles didn't
Would appreciate any help with this. Thanks

I think this would be what you need:
https://scriptedpapers.com/2015/02/12/android-action-bar-and-overflow-menu-customization-with-theme-appcompat/

Related

How to control the width or the visibility of an activity

I'm using this awesome library Dragger to add drag features to my activity, but is there a way to limit the width of the activity when it shows up or dragged..!? I don't want it to fill the entire screen..! kinda like the drawer navigation menu (see the pic below).
I was thinking of Dialog Activity, but it seems to be concerned with dialogs only and won't allow filling the other 3 sides or I not fully understand it..!
Any help?
Activity is not a view, so it does not have a size. Its' layout views do however.
You can try changing their sizes. Or, as it is an animation lib, you can try modifying existing or adding your own animations where views change sizes when moving. You can modify this param:
<item name="android:windowAnimationStyle">#null</item>
This might help you.

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.

Create a sidebar in vaadin

I want to create a sidebar like following (screenshot from IntelliJ IDEA) in Vaadin.
I googled for a way but may be my search terms are not that good I couldn't find much about creating something like this.
I am going to create this using some buttons placed in a vertical layout where each button shows/hides another layout which contains the widget for each button.
Is this a suitable approach? Are there any better ways to do this?
Also, how can I make the button text vertical, if I were going to implement this in described approach?

Eclipse android widget moving

I am designing my activity screen using eclipse but whenever I move an object e.g. a button it snaps around and I find it hard to position things where i want them.
Is there some setting I can change as as soon as I add a second button it snaps the other button to another position it is so annoying!
Also if I have an image button why can't i resize this, even with a normal button if i try to make it larger it just fits to the text and wont make the button bigger or it just flicks to a random place on the activity?
thanks
Probably you're trying to place components freely in the View but you're not considering the LayoutManager behavior. If you try to position your component in a LinearLayout, for example, the components will be placed following its rules, and these components will not stay where you drop them.
Try to understand better how the layouts works on Android. But for now, the AbsoluteLayout or RelativeLayout may be what you're looking for.
About the components size, you'll need to understand better how to use layout properties for these components. See the question How to size buttons for more information.

How do I go about setting the exact style for tabs in a JTabbedPane?

I have looked around and I cannot figure out how to do it. Should I use the Synth look & feel? How would I go about doing this?
In How to Use Tabbed Panes, TabComponentsDemo shows how to put "custom components on tabs."

Categories