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

Scrollview doesn't show scrollbar
BluetoothGattCallback seems no response in “startService”
How to make validation for Email in android?
How do I send data from Unity gear VR app over bluetooth?
Android Overwriting current Alarm
Dagger 2 robolectric test not compiling
android : custom progress bar
Shared Elements Between Fragments
Schedule a function to run at a future time with Cordova on Android
force toolbar to arrange children rtl android?
How can I post a parameter through JsonObjectRequest
Android how to open fragment from listview element
Android - How to add to ViewFlipper 2 different layouts s.t each has one YouTubePlayerView?
Parsing JSONObject to AlertDialog
google::protobuf used in android ndk develop
Is it good to add a listview inside Persistent bottom sheet in android?

Categories

HOME
android
algorithm
google-app-engine
microsoftgraph
developer-tools
wakanda
jax-rs
yahoo-finance
jsf-2.2
rendering
ms-access-2016
aws-cli
code-coverage
crystal-reports-2013
elasticsearch-5
resultset
x-cart
google-form
libc
frequency-distribution
altera
feathersjs
poedit
pylons
outliers
angular-translate
carrierwave
scatter3d
cart
r-grid
contacts
openerp-7
parse-tree
sim-card
gdata
metawidget
p4merge
tasm
subclipse
smoothstate.js
double-click
openresty
facebook-pixel
jqchart
type-theory
cronexpression
model-associations
expectations
clipboard.js
thread-sleep
piracy-prevention
concept-insights
toolkit
amiga
rdflib
apache-spark-1.3
nodelist
android-vibration
spy++
iso-prolog
linkedin-jsapi
encryption-asymmetric
jquery-slider
paste
android-framework
mt4j
observium
workitem
kaleidoscope
swfobject
booksleeve
apache-commons-dbutils
mysql-error-1205
multiplatform
photolibrary
diagrams
instantiationexception
vs-android
drupal-fivestar
binomial-heap
feasibility
interop-domino
complex-event-processing
xpsdocument
great-circle

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