Android 3.0 "holographic" theme borders - android

I am trying to draw and animate several ImageView items on a screen and I would like to have the images display the blue borders used in other Honeycomb apps (examples of borders here: http://www.youtube.com/watch?v=UPSBctbYc9Q # 1:10).
I've seen hacks/workarounds for older versions of Android using a background image, but I was hoping to avoid that. Can anyone help me to add such borders?
Thanks

I'd suggest just creating a custom view using FrameLayout as its base to layer up the background/border, and then the ImageView on top using an appropriate padding value such that the border remains visible.

Related

shadow to layout by 100% radius

I want add shadow to layouts like below image :
http://s9.picofile.com/file/8321463292/android.png
I do not want use android:elevation, because not working for android 4.3
Also, I use these libraries but not work correct for me :
https://github.com/loopeer/shadow
https://github.com/dmytrodanylyk/shadow-layout
https://github.com/Devlight/ShadowLayout
https://github.com/harjot-oberai/MaterialShadows
https://github.com/xuehuayous/Android-ShadowView
How i can set shadow to layouts like top image ? ( smooth, 100% radius and colorful)
Thank you
I have two suggestions to make shadow as per your requirement
you can use 9-patch image, may be this link will help you to create 9-patch with shadow
alternate
solution is to make gradient and set background to your button view.

Android layout development

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

Set content to edge of Cardview pre 5.0

I'm using the CardView layout from the v7 support library as a primary design pattern in my app. It works great on Lollipop as you'd expect and looks like this:
If I run this same app on 4.4 or below the content in the card doesn't go to the edge as seen here:
Is there a way that I can get the content to go to the edges on all versions of Android and not just 5.0?
Thanks
Unfortunately the creators of the CardView didn't come up with an efficient way to create rounded corners that would work for any layout on devices running earlier versions that Lollipop. Because of that, padding is simply added to the content of the cards. To prevent this padding use this method:
cardView.setPreventCornerOverlap(false);
If you do this however, the ImageView's corners will be drawn over the rounded corners of the CardView. A solution to this problem is to create a custom ImageView (or Drawable, or Picasso transfromation...) that draws rounded corners. Check this Gist on how to do that.
Since you are using a common layout for cards with a header image, you could check this library by the same author which creates the rounded corners without padding.

How to set border of Gridview

I am developing an Android app. And i am trying to show a DashBoard. DashBoard is working fine. I have taken gridview to display it, But I want to set the border of that gridview. How can i achieve it ? if anyone can suggest me something useful.
You can override GridView drawing and draw border from there.
You can add rectangular shape as the background.
You can put your GridView inside another layout, set background color for that layout and set margin for the GridView. (not really good as Android has to draw big single-color view and then cover it with GridView)
Lots of ideas here: How do I put a border around an Android textview?

what is the use of shadow

What is the use of shadow in Android?
How do I implement shadow in thumbnails?
If someone has a sample screenshot, do you mind sharing it?
Shadows can be added to TextViews through XML or programmatically.
If you'r wanting to add a shadow to a standard view (or any subclasses) this thread should point you in the right direction.
Not knowing what are your objects could be tricky. you can define what's the background in the picture and filter it, then you can strech your image in the direction of the shadow. now filter everything but the background, so you've got 3 layers - background, shadows and objects. place the shadows on the background and on top of that the objects.

Categories

Resources