Hi,
I edited the layout a bit for my project's purpose as below:
<com.flavienlaurent.notboringactionbar.KenBurnsView
android:id="@+id/header_picture"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/picture0" />
// I replace the imageview with a custom view
<ImageView
android:id="@+id/header_logo"
android:layout_width="@dimen/header_logo_size"
android:layout_height="@dimen/header_logo_size"
android:layout_centerInParent="true"
android:layout_alignParentTop="true"
android:paddingTop="15dp"
/>
<ImageView
android:id="@+id/header_logo_hide"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_centerHorizontal="true" />
<TextView
android:id="@+id/header_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/header_logo"
android:layout_centerHorizontal="true
android:paddingTop="20dp"
android:textSize="20dp"
android:textStyle="bold" />
</RelativeLayout>
</FrameLayout>
and I use this layout in a fragment, so the code was changed a bit to work in fragment
- The view was inflated in onCreateView and onActivityCreated.
- Instead of interpolating header_logo to the action bar icon, I want header_logo to interpolating to the header_logo_hide. The code changed:
interpolate(mHeaderLogo, mHeaderLogoHide, sSmoothInterpolator.getInterpolation(ratio));
Issue: when open the fragment, the header_logo is not displayed unless I make a initial action like scroll or touch or click.
Please help to advise me.