动画视图并在动画后保持可见

时间:2015-05-14 00:47:54

标签: java android android-animation

我有两个指标,每个指标都需要隐身才能启动。我希望它们在动画制作后可见,我该怎么做?现在他们的动画然后消失了,这是代码:

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

我的xml是:

var express = require("express");
var jwt = require('jsonwebtoken');
var router = express.Router();


router.use(function(req,res,next){
    var token = req.body.token || req.query.token;
    if (token) {
        jwt.verify(token,"secretTingz",{algorithms:["RS256"]},function(err,decoded){
            if (err) {
                if (token.expired) {
                    // HOW DO I GET THIS PIECE OF CODE TO RUN FOR EVERY VALID ROUTE THAT NEEDS A NEW TOKEN WITHOUT DUPLICATING CODE?
                    var token = jwt.sign({user:"MilnerJenkins"},cert,{algorithm:"RS256",expiresInMinutes:1});
                    req.token = token;
                    next();
                }else{
                    return res.json({message:"Failed to authenticate token"});
                }
            }else{
                req.decoded = decoded;
                next();
            }
        })
    }else{
        return res.status(403).send({
            message: "No token!"
        });
    }
});

apiRoutes.get("/stuff",function(req,res){
    var token;
    if (req.token) {
        token = req.token;
    };
    res.json({message: "Dope API son!",token:token});
});

apiRoutes.get("/users",function(req,res){
    var token;
    if (req.token) {
        token = req.token;
    };
    User.find({},function(err,users){
        res.json({users: users, token: token});
    });
});

1 个答案:

答案 0 :(得分:1)

尝试执行此操作:fadeInAnimation.setFillAfter(true)

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