Add a long shadow on any Android View
LongShadow
Add a long shadow on any Android View
<com.github.florent37.longshadow.LongShadow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/shadow"
app:shadow_angle="60"
app:shadow_color="#739440"
android:background="#99ca55">
<TextView
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="120dp"
android:gravity="center"
android:textColor="#FFF"
android:textSize="30sp"
android:layout_gravity="center"
android:text="hello world!" />
</com.github.florent37.longshadow.LongShadow>
dependencies {
compile 'com.github.florent37:longshadow:(lastversion)'
}
Any View
You can add a long shadow on any view, even custom views
<com.github.florent37.longshadow.LongShadow
android:layout_width="match_parent"
android:layout_height="100dp"
android:id="@+id/shadow2"
app:shadow_angle="140"
app:shadow_color="#406694"
android:background="#55a9ca">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="left|center_vertical"
android:layout_marginLeft="70dp"
app:srcCompat="@drawable/ic_android_white_24dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="right|center_vertical"
android:layout_marginRight="70dp"
app:srcCompat="@drawable/ic_android_white_24dp" />
</com.github.florent37.longshadow.LongShadow>