ShadowLayout
ShadowLayout copied to clipboard
Shadow mispacement on rotation
I'm noticing a weird effect when the device is rotated:
Looks like the shadow is calculated only once when the view is inflated and then reapplied size and orientation changes.
`<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" android:gravity="center" android:orientation="vertical" android:padding="0dp" android:background="@drawable/bg_login">
<ScrollView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:scrollbarThumbVertical="@color/alpha_white"
android:scrollbarSize="3dp">
<LinearLayout
android:id="@+id/login_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"
android:padding="8dp" >
<com.gigamole.library.ShadowLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:sl_shadowed="true"
app:sl_shadow_angle="90"
app:sl_shadow_radius="2dp"
app:sl_shadow_distance="1dp"
app:sl_shadow_color="@android:color/black">
<ImageView
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:paddingTop="0dp"
android:paddingBottom="12dp"
android:paddingStart="48dp"
android:paddingEnd="48dp"
android:layout_gravity="top"
android:contentDescription="@string/cont_descr_app_logo"
android:src="@drawable/logo_white"/>
</com.gigamole.library.ShadowLayout>
...
</LinearLayout>
</ScrollView>
</RelativeLayout>`
The initial orientation doesn't matter - it's OK until you rotate. Rotating back and forth produces the same screens.
P.S. Great library, btw! :)