Android - How to add animation (Zoom in) only to background image without affecting others?



I'm thinking of making an app's first view like this: it's just a basic search view with one EditText and two Button on it. I want the background image zooming in and out when user stay on this view, typing or doing nothing.


So I add zoomin.xml and set the animation to the view. Zooming is working but only problem is that it's zooming everything. I know it's because I set background image in the root element of the xml, but I don't know how to make it ONLY zoom in the background picture without affecting other views.


Here's my background image code in root element.



<LinearLayout
xmlns:android="http://ift.tt/nIICcg"
xmlns:tools="http://ift.tt/LrGmb4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity"
android:background="@drawable/bcg2"
android:orientation="vertical"
android:gravity="center">


So I'm thinking if any floating view will do this? But I don't know how to do it. Or any other suggestion?


Thanks!


No comments:

Post a Comment