Java Code Examples for android.widget.LinearLayout.startAnimation()

The following are Jave code examples for showing how to use startAnimation() of the android.widget.LinearLayout class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: FriendBook   File: StartActivity.java   View Source Code Vote up 6 votes
private void initDisPlay() {
    tvSkip = findViewById(R.id.tv_skip);
    tvSkip.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            skip();
        }
    });
    View contentView = findViewById(R.id.content_view);
    if (DisplayUtil.hasVirtualNavigationBar(this)) {
        contentView.setPadding(0, 0, 0, DisplayUtil.getNavigationBarHeight(this));
    }
    TextView tvVersionName = findViewById(R.id.tv_version_name);
    tvVersionName.setText(BuildConfig.VERSION_NAME);
    LinearLayout llWelcome = (LinearLayout) findViewById(R.id.ll_welcome);
    TextView tvDate = findViewById(R.id.tv_date);
    SimpleDateFormat format2 = new SimpleDateFormat("yyyy年MM月dd日,EEEE");
    tvDate.setText(format2.format(new Date()));
    Animation animation = AnimationUtils.loadAnimation(this, R.anim.alpha_in);
    llWelcome.startAnimation(animation);
}
 
Example 2
Project: Gif-Load-ReTry-Refresh   File: LoadReTryRefreshManager.java   View Source Code Vote up 6 votes
public void onLoadSuccess(Fragment fragment,ShowRefreshViewListener showRefreshViewListener){
    if (hashMap_fragment_loadView.containsKey(fragment)){
        if (!hashMap_fragment_isSuccess.get(fragment)){
            hashMap_fragment_isSuccess.remove(fragment);
            hashMap_fragment_isSuccess.put(fragment,true);
            View loadView=hashMap_fragment_loadView.get(fragment);
            LinearLayout loadretry_parent=(LinearLayout)loadView.findViewById(R.id.loadretry_parent);
            AlphaAnimation alphaAnimation = new AlphaAnimation(1,0);
            alphaAnimation.setDuration(loadRetryRefreshConfig.getEndAnimTime());
            loadretry_parent.startAnimation(alphaAnimation);
            loadretry_parent.setVisibility(View.GONE);
        }else{
            showRefreshViewListener.colseRefreshView();
        }
    }
}
 
Example 3
Project: FindSpot   File: SplashActivity.java   View Source Code Vote up 6 votes
private void StartAnimations() {
        Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
        anim.reset();
        LinearLayout l = (LinearLayout) findViewById(R.id.lin_lay);
        l.clearAnimation();
        l.startAnimation(anim);

        anim = AnimationUtils.loadAnimation(this, R.anim.translate);
        anim.reset();
        ImageView iv = (ImageView) findViewById(R.id.bard_splash);
        iv.clearAnimation();
        iv.startAnimation(anim);

    splashTread = new Thread() {
        @Override
        public void run() {
            try {
                int waited = 0;
                // Splash screen pause time
                while (waited < 3500) {
                    sleep(100);
                    waited += 100;
                }
                Intent intent = new Intent(SplashActivity.this,
                        MainActivity.class);
                intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
                startActivity(intent);
                SplashActivity.this.finish();
            } catch (InterruptedException e) {
                // do nothing
            } finally {
                SplashActivity.this.finish();
            }

        }
    };
    splashTread.start();

}
 
Example 4
Project: Android_ImagePicker   File: ImagePickerDialog.java   View Source Code Vote up 6 votes
private void initializeComponent(View view) {

        RelativeLayout rlParent = view.findViewById(library.imagepicker.R.id.dialog_image_picker_rl_parent);
        TextView tvGallery = view.findViewById(library.imagepicker.R.id.dialog_image_picker_tv_gallery);
        TextView tvCamera = view.findViewById(library.imagepicker.R.id.dialog_image_picker_tv_camera);
        TextView tvCancel = view.findViewById(library.imagepicker.R.id.dialog_image_picker_tv_cancel);
        LinearLayout llAnimateLayout = view.findViewById(library.imagepicker.R.id.dialog_image_picker_ll_dialog);

        Animation animation = AnimationUtils.loadAnimation(getActivity(), library.imagepicker.R.anim.bottom_up);
        llAnimateLayout.startAnimation(animation);
        llAnimateLayout.setVisibility(View.VISIBLE);

        rlParent.setOnClickListener(this);
        tvGallery.setOnClickListener(this);
        tvCamera.setOnClickListener(this);
        tvCancel.setOnClickListener(this);
    }
 
Example 5
Project: DoApp   File: Splashscreen.java   View Source Code Vote up 5 votes
private void StartAnimations() {


        Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
        anim.reset();
        LinearLayout l = (LinearLayout) findViewById(R.id.lin_lay);
        l.clearAnimation();
        l.startAnimation(anim);
        anim = AnimationUtils.loadAnimation(this, R.anim.rotate);
        anim.reset();

        ImageView iv = (ImageView) findViewById(R.id.splash);

        iv.clearAnimation();
        iv.startAnimation(anim);

        splashTread = new Thread() {
            @Override
            public void run() {
                try {
                    int waited = 0;
                    while (waited < 3500) {
                        sleep(100);
                        waited += 100;
                    }
                    Intent intent = new Intent(Splashscreen.this,
                            MainActivity.class);
                    intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);

                    startActivity(intent);
                    Splashscreen.this.finish();

                } catch (InterruptedException e) {

                } finally {
                    Splashscreen.this.finish();
                }
            }
        };
        splashTread.start();
    }