启动画面与动画形成一个单词

时间:2018-03-12 22:38:13

标签: android

大家好我想做的每个人用闪光灯进行屏幕动画显示从顶部到中间的图像一个接一个的屏幕,然后做一个小动画,例如图像img1从屏幕的顶部到中间然后img2从高到中间的屏幕是图像img1右边的这个地方......最后,图像形成一个单词 这是我使用的代码

   final int TIME_OUT = 400;

    final ImageView imageView1 = (ImageView) findViewById(R.id.img1);
    final ImageView imageView2 = (ImageView) findViewById(R.id.img2);
    final ImageView imageView3 = (ImageView) findViewById(R.id.img3);
    final ImageView imageView4 = (ImageView) findViewById(R.id.img4);
    final ImageView imageView5 =(ImageView)findViewById(R.id.img5);
    final ImageView imageView6 =(ImageView)findViewById(R.id.img6);
    final ImageView imageView7 =(ImageView)findViewById(R.id.img7);
    final ImageView imageView8 =(ImageView)findViewById(R.id.img8);
    final ImageView imageView9 =(ImageView)findViewById(R.id.img9);
    final ImageView imageView10 =(ImageView)findViewById(R.id.img10);
    final ImageView imageView11 =(ImageView)findViewById(R.id.img11);
    new Handler().postDelayed(new Runnable() {
        // This method will be executed once the timer is over
        @Override
        public void run() {
            imageView1.setVisibility(View.VISIBLE);
        }
    }, TIME_OUT);

    new Handler().postDelayed(new Runnable() {
        // This method will be executed once the timer is over
        @Override
        public void run() {
            imageView2.setVisibility(View.VISIBLE);
        }
    }, TIME_OUT * 2);

    new Handler().postDelayed(new Runnable() {
        // This method will be executed once the timer is over
        @Override
        public void run() {
            imageView3.setVisibility(View.VISIBLE);
        }
    }, TIME_OUT * 3);
    new Handler().postDelayed(new Runnable() {
        // This method will be executed once the timer is over
        @Override
        public void run() {
            imageView4.setVisibility(View.VISIBLE);
        }
    }, TIME_OUT * 4);
    new Handler().postDelayed(new Runnable() {
        // This method will be executed once the timer is over
        @Override
        public void run() {
            imageView5.setVisibility(View.VISIBLE);
        }
    }, TIME_OUT * 5);
    new Handler().postDelayed(new Runnable() {
        // This method will be executed once the timer is over
        @Override
        public void run() {
            imageView6.setVisibility(View.VISIBLE);
        }
    }, TIME_OUT * 6);
    new Handler().postDelayed(new Runnable() {
        // This method will be executed once the timer is over
        @Override
        public void run() {
            imageView7.setVisibility(View.VISIBLE);
        }
    }, TIME_OUT * 7);
    new Handler().postDelayed(new Runnable() {
        // This method will be executed once the timer is over
        @Override
        public void run() {
            imageView8.setVisibility(View.VISIBLE);
        }
    }, TIME_OUT * 8);
    new Handler().postDelayed(new Runnable() {
        // This method will be executed once the timer is over
        @Override
        public void run() {
            imageView9.setVisibility(View.VISIBLE);
        }
    }, TIME_OUT * 9);
    new Handler().postDelayed(new Runnable() {
        // This method will be executed once the timer is over
        @Override
        public void run() {
            imageView10.setVisibility(View.VISIBLE);
        }
    }, TIME_OUT * 10);
    new Handler().postDelayed(new Runnable() {
        // This method will be executed once the timer is over
        @Override
        public void run() {
            imageView11.setVisibility(View.VISIBLE);
        }
    }, TIME_OUT * 11);
    splashTread=new Thread(){
        @Override
        public void run(){
            try {
                int waited = 0;
                // Splash screen pause time
                while (waited < 3000) {
                    sleep(180);
                    waited += 90;
                }
                Intent intent = new Intent(splash.this,MainActivity.class);
                intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
                startActivity(intent);
                finish();
                splash.this.finish();

            }catch (InterruptedException e) {
                // do nothing
            } finally {
                splash.this.finish();
            }

        }
    };
    splashTread.start();

}

}

1 个答案:

答案 0 :(得分:0)

尝试使用这个令人敬畏的第三方库。 Lottie

根据您的要求创建After Effects Adob​​e动画文件,然后使用此库在您的应用中解析并使用它。