Blend two views in Android - android

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.

Related

Alpha gradient to layout without affecting the views that are under it

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.

Android: ImageView Border With Buttons

I am looking to make an ImageView that I can manipulate with touch (translate, scale and rotate). I currently have one that uses ScaleType.MATRIX and can be translated and scaled. I would like to be able to wrap this ImageView with a border, and put ImageButton objects in the corners to act as a 'close' and 'scale/rotate' button. Much like in the image below (taken from the Aviary app):
I cannot figure out where to start with this. In order to manipulate the ImageView I need to set the view to MATCH_PARENT, and use a Matrix to manipulate the drawable within it. But then how am I supposed to wrap the drawable in a border?
Or am I supposed to manipulate the ImageView directly instead of the drawable? If so, how would I go about doing that with a Matrix?
Create a frame layout and add the four buttons on it the add the frame to your layout. Use the onclick of that buttons to create different functions you mention.

Android tabbar, which active item overlaps adjacent items (see image)

I need to make tabbar of the following desigh:
Its active item overlaps adjacent items.
My problem is that I don't know how to make different tabs overlap each other (as far as I know, it isn't possible to change z-order of views programmatically). How to do it?
P.S. By the way, that is not necessary for me to use particularly tabbar. That can be, for example, 3 buttons in horizontal linear layout or any other combination of views which allows to make tabbar functionality.
I made this one by creating 3 buttons with rounded angles, big container with rounded angles (only top of it is displayed on my image) and linear layout behing above mentioned views, which fills space between bottom angles of any 2 adjacent buttons.
This linear layout consists of 4 parts which change its background color to appropriate one dynamically in buttons' onclicklistener (same for 3 buttons).
Shadows are implemented via gradient of black (with different alpha) in button's background drawables (which are layer-list with 3 shape items - background shape, padded shadow shape and again padded background shape).

Android. Draw bitmap between two layouts

I want to make application which will have background and some picture with alpha channel in front. Between them i want to draw bitmap/animation.
How can i do it ?
That is easy. You can use FrameLayout as the root layout and set a background to it. Then add two more LinearLayouts which fill the screen. In the first you may add your animated views like ImageView, while in the second you can insert an ImageView or ImageButton with a transparent image in it.
There are many other ways to do this like using a custom view for your animated layer etc. Check my example here: How can I use the animation framework inside the canvas?

Design in Android, Shapes

I wounder how its possible to make a shape like the example, with round corners and padding from the screen borders, and also put text inside, how is this possible?
You can either use image buttons that contain image background with e.g. rounded corners or draw your own shapes, Android Shapes.
Using ImageButton you can define hover, focus and default state of a button and appy a background image to each state.
Here is a small code example with source, tutorial.

Categories

Resources