I have an activity with a camera preview which is in the background, and over it there is a linear layout with a set of view children. Now, what I want to achieve is to set some kind of selector with an alpha gradient to this linear layout, which affects the linear layout's children BUT without affecting the camera preview that is under it.
Something like this:
How can I do this? I tried to set a background and making an special view for it but the views below (the camera preview) is always affected by the alpha gradient.
Thanks.
Related
I have a list item that contains an image (red) and another layout (blue)
Normally, the layout would be the first one, but the black layout's width depends on user configurations, so it may not fit the whole content.
I thought about making it a Linear Layout and changing the orientation depending on its width, but i read somewhere its possible to do such things with layout only (maybe constraint layouts).
Is it possible to achieve this result using only "layout responsiveness", or do i have to input some code also?
Is it possible to blend two different views in different modes like Multiply, Add etc.
I have two views one is a RelativeLayout matching parent shape with a background image. Another one is ImageView (solid colored custom shape) inside the parent RelativeLayout.
I need to blend top ImageView to the background image in Multiply mode.
any kind of help would be appreciable.
I would like to develop a layout below. I am really confuse related to that. I used RelativeLayout, FrameLayout to develop this. But I am not getting perfect output. As per below image, the Dark Gray color is overlap the light Gray layout. If I used Relative layout then dark Gray will be in the light Gray area. And if I used FrameLayout then the other controls of light Gray will not set perfectly.
Please guide me the right path. I am stuck in this layout. Thanks in advance.
According to your figure, If all widgets need to show without scrolling vertically , you can have vertical linear-layout here,
TextView
Button,
ImageView
List view with defined height
Other widgets
I want to achieve something like this:
As stated here InsetDrawables can be used to make backgrounds smaller than the View that contains it. However when I do this all my child views (ImageView, TextView) align with the bottom border of the inset background. Any idea how I can achieve this effect?
Btw: FrameLayouts don't work either for devices with Android 2.x because margins are handled differently.
I have a landscape layout that features a vertical LinearLayout of buttons on the left side of the screen and a user-defined picture on the right of the screen. The design I'm working from calls for a double-stroke border around it, which I implemented by creating a rectangular shape background with the border being the outer color and the background of the shape being the inner color. I then just put some padding around the picture, and you get the double-stroke border. The problem is expanding the picture to fill the space in the layout. I don't know the dimensions of the picture, since it is user defined, and I'd like it to expand to exactly fill either dimension while preserving the aspect ratio. Setting fill_parent for both width and height does that, but it also expands the background all the way to completely fill the cell, resulting in a sort of letter boxing effect. Is there any way, short of just adjusting the size of the view after layout, of getting this to only expand the view as much as necessary?
I never got this to work properly, and just ended up adjusting my layout to a different arrangement.