1

I am trying to create an anim file. But the lines in set tag has dark bacgrounden and when I move my mouse over that dark backgrounded place it says following message.

Unexpected text found in layout file: "android:interpolator="@android:anim/bounce_interpolator""

Here is the screenshot of the case

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
ucanbizon
  • 37
  • 1
  • 7
  • XML attributes go inside XML elements (the `< >` stuff). Your attribute is outside of any element. – CommonsWare Feb 28 '21 at 20:48
  • There many examples using this sort of usage of attributes. For example [link]https://stackoverflow.com/questions/6510300/fillafter-and-fillenabled-not-working-in-android-view-animation-xml/31808403 see Josh Cole's post. – ucanbizon Feb 28 '21 at 20:57
  • All the ones that I see on that page are inside the XML elements. For example, [this one](https://stackoverflow.com/a/8698156/115145) has the `android:interpolator` attribute inside the `` element. Similarly, in [Josh Cole's answer](https://stackoverflow.com/a/6519233/115145), all of the attributes are inside of the elements. In your case, your attribute is not. – CommonsWare Feb 28 '21 at 21:01
  • Thank you. I got it... – ucanbizon Feb 28 '21 at 21:10

1 Answers1

0

Try moving your XML attribute into the XML element:

<set
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:interpolator="@android:anim/bounce_interpolator">

Also, please note that this is an animation resource and goes in a res/anim/ directory, not res/layout/.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Yes, it is in res/anim directory but the error message says ".... layout file..." by the way, problem solved. Thank you On the other hand, I need to ask, how can I go tothe next line while adding comment in here. Because ENTER key posts immediatelly, I tried alt_enter, crtl_enter. but no chance. Help section says two space at the end of line but nothing. :) – ucanbizon Feb 28 '21 at 21:25
  • @ucanbizon: OK. That might be a bug in the IDE's error message. I could not tell from your screenshot what directory it was in. – CommonsWare Feb 28 '21 at 21:25