Set elevation to top of tablayout - android

I used default elevation attribute in xml but the shadow appears bottom of layout, so i want to display the shadow to the top of tablayout like this

Related

Only keep shadow at the bottom of the view

have this layout -
<Stepsview
android:background="#color/white"
android:elevation="#dimen/margin_16"/>
this cast shadow at the bottom as well as top :
and what i need is :
Steps view and ActionBar are 2 different views, one way I see is to combine these 2 views inside a view group and set elevation on the view group only.
Is there any other way only controlling steps view.
Achieved it by dynamically adding the steps to the top abbbar ( container for toolbar ) and setting the elevation to the app bar itself.

Android background with shadow on all sides

Android'd CardView provides an elevation property but the casted shadow is at an angle and thus only shows at the bottom of the view. I'd like to cast a shadow on all sides for a pill-shaped view.
Like so:
you can achieve this by adding the following attributes to your CardView tag in XML
xmlns:card_view="http://schemas.android.com/apk/res-auto"
card_view:cardCornerRadius="16dp"
card_view:cardElevation="16dp"
if 16dp is small for you, you can make it higher

Shadow on curved image view on toolbar

I have a bottom toolbar that has a fab like button in the center.
I am trying to add shadow to this bar. It consists of :
Parent RelativeLayout
RelativeLayout with 4 image views.
ImageView centered in the toolbar(the circle button)
I want to add shadow effect to this toolbar. If I elevate the bottom bar then it hides the ImageView that is not included in the RelativeLayout.
If I also elevate that ImageView I get a Circular shadow effect like below on that ImagView. I only want the top curved portion of the icon to have a shadow effect.

Collapsing toolbar anchored view is hidding when collapse

I need to display a TextView (The circular shape with "0") anchored to the toolbar, like a FAB, but it must be ALWAYS VISIBLE.
My problem is that when I collapse the toolbar (scrolling the recyclerView), at the fully collapsed state, it hides the half of the view...
The TextView layout has this properties:
app:layout_anchor="#id/appbar"
app:layout_anchorGravity="bottom|center_horizontal"
Anyone knows how to solve it?
If you want your TextView be over the toolbar, in this case, you can try to set higher elevation value to TextView. In some cases, it worked for me.
For example:
android:elevation="15dp"

How to add shadow on overlapped layout?

How to add shadow on overlapped layout? I try to use elevation but it doesn't work

Categories

Resources