android


Strange screen flashin on the first Animation (ObjectAnimator)


I have a small irritating behaviour of my sliding Animation.
I made a video and posted it on youtube.
I could'nt find any app that can make a screen video from non-rooted phone, so I hade to do it this way :)
NOTE: look closely at the first animation, starting from 00:07
You will notice a small flash..that happens only for the first time, I trigger animation...
Afterwards, in the video, I trigger animation few more times, and there is no flash and everything runs smoothly.
Here is the code I use:
private void slideDown(){
// Here I calculate the height of a header and the ListView (That is not populated in the video, therefore - white and empty), as it will be different for different screen sizes
float headerHeight = header.getHeight();
float topicNameHeight = topHeader.getHeight()+1;
float totalHeight = headerHeight+topicNameHeight;
float listSize = listView.getHeight();
int theSizeIWant = (int) (listSize+totalHeight);
//slide down
if (counter==0){
listView.setPivotY(0);
ObjectAnimator slideAnimation = ObjectAnimator.ofFloat(listView, "y",topicNameHeight);
ObjectAnimator rotateAnimation = ObjectAnimator.ofFloat(btn_slider, "rotation",0f,180f);
listView.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, theSizeIWant));
rotateAnimation.setDuration(800);
slideAnimation.setDuration(800);
slideAnimation.start();
rotateAnimation.start();
counter=1;
}
//slide up
else{
ObjectAnimator slideAnimation = ObjectAnimator.ofFloat(listView, "y",totalHeight);
ObjectAnimator rotateAnimation = ObjectAnimator.ofFloat(btn_slider, "rotation",180f,360f);
listView.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (int)listSize));
rotateAnimation.setDuration(800);
slideAnimation.setDuration(800);
slideAnimation.start();
rotateAnimation.start();
counter=0;
}
}
What seems to be the source of the problem?
I know it's a small thing, but it is majorly irritating, and needs to be fixed!

Related Links

cocos2dx crash on android during release of unknown objects, working fine on IOS
How to Show Icon with Menus in android
Realm Migration for Column type long
Bug in just released 1.5?
SetVisibility when use custom ListView
Error when exporting app that used Proguard
Download images and save it
Listview and activity
Parsing runtime errors: saying i have null reference: Android Studio
ModernAsyncTask IllegalStateException
Is it possible to use the “Hamburger icon” animation from Android in another button?
Android Image decoding from base64 to bitmap returns null . while its is working fine in my other test app .
notifyDataSetChanged on CustomAdapter not Working
how to stop an android START.STICKY service after application has been killed and started again
javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException Android
Libgdx text in place rotation

Categories

HOME
android
twitter-bootstrap-3
time-complexity
powerpoint
static
interface
alarm
seo
simulink
3d-reconstruction
gembox-spreadsheet
angularfire2
octave
ycsb
spring-social
symbol
parameter-passing
dimensional-modeling
microsoft-ocr
jquery-ias
libigl
href
beta
google-api-client
fat
fable-f#
pylons
appirater
flooding
userdefaults
anki
linkedhashmap
twos-complement
modalviewcontroller
processwire
video-capture
apic
playframework-2.1
git-rewrite-history
timing
xdocreport
gdata
c9.io
attributeerror
naming
print-css
http-request
angular-http
memory-mapping
rfc3339
opencmis
phpdbg
ovf
reportservice2010
dtsearch
podscms
amq
java-bytecode-asm
android-testing
bbpress
gameplay-kit
shinobi
structuremap4
docpad
xcode-server
segment-io
watch-os-2
signalr.client
rspec2
scaffolding
gogs
udpclient
beanstalk
qbxml
intel-c++
finalbuilder
entity-framework-4.3
cakephp-2.7
apache-spark-1.3
nodelist
mruby
teaspoon
entry-point
jama
matrix-inverse
draw2d-js
file-not-found
menubar
scriptaculous
hibernate-entitymanager
http-patch
isqlquery
jeromq
tlf
resource-management
jsr286
xcelsius
exponentiation
clrstoredprocedure
instantiationexception
non-clustered-index
purepdf
firefox-3
unmanagedresources
information-management
xslcompiledtransform
blind

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App