Pol Hallen
Pol Hallen

Reputation: 1872

set a value to xml

Using sharedpreferences I save a value. I need to set this value (duration) to xml file. How I resolve?

<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
   android:interpolator="@android:anim/accelerate_interpolator"
   android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="1500" />

Upvotes: 0

Views: 81

Answers (1)

Broak
Broak

Reputation: 4187

On your animation code use :

Animation alphaAnim = AnimationUtils.loadAnimation(this, R.anim.animate);
YOURVIEW.startAnimation( alphaAnim ); 
alphaAnim.setDuration(VALUE);

Upvotes: 1

Related Questions