So most people are going to say... whaaat? lint does this for me already...
Well, I hate lint(most of the time!) its a cool tool with tons of potential and zero usage for me!
It actually stand in my way of building testing and releasing my application most of the time, and the warnings are sometimes annoyingly annoying :)
I know you can configure this bugger till you drop, but if I don't use/need it what is the point of wasting a lot of time configuring something that on the next Eclipse Android bundle release would go to waste?
In any case what I do is run this "Search in file", for all XMLs in the project:
android:text="(?!@).*?"
Just don't forget to check the regexp check box to the right under the text field...
This simple regexp checks which of my strings are texts, and which uses the strings file...
Enjoy!
Wednesday, April 30, 2014
Wednesday, April 16, 2014
Android animation crops the view
I had this simple Animation XML:
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <translate android:duration="300" android:fromXDelta="100%" android:toXDelta="-10%" /> <translate android:duration="100" android:fromXDelta="-10%" android:startOffset="300" android:toXDelta="0%" /> </set>
Which simply enough should have slide a view from the right, and cross the left border of the screen and then return back to its place.
Simple enough...? Nothing is simple!
As it seemed, the OS cropped the darn view, rendered it with a missing 10% of the view right edge.
I've searched and tried different approaches for hours, (... guys hours for a stupid animation!!!)
After a long while I finally found a blog post from 2011 that made some sense.
Since Chet says, and I agree that these flags, once you are aware of their existence, make clear sense of what they do, and since he explain in detail the 'why', I'm not going to, because he did it magnificently, I'll just sum it up:
fillEnable is by default 'false'
fillAfter is by default 'false', and IS NOT effected by the fillEnabled flag.
fillBefore is by default 'true', and IS effected by the filleEnabled flag.
So to conclude this, here is the solution that worked for me(Note the bold lines):
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <translate android:duration="300" android:fillBefore="false" android:fillEnabled="true" android:fromXDelta="100%" android:toXDelta="-10%" /> <translate android:duration="100" android:fillBefore="false" android:fillEnabled="true" android:fromXDelta="-10%" android:startOffset="300" android:toXDelta="0%" /> </set>
Subscribe to:
Posts (Atom)