Java Code Examples for android.widget.LinearLayout#clearAnimation()

The following examples show how to use android.widget.LinearLayout#clearAnimation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SplashActivity.java    From android-spotify-demo with MIT License 4 votes vote down vote up
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.splash);
    iv.clearAnimation();
    iv.startAnimation(anim);

    Thread splashTread = new Thread() {
        @Override
        public void run() {
            try {
                int waited = 0;
                // Splash screen pause time
                while (waited < 2500) {
                    sleep(100);
                    waited += 100;
                }

                Intent intent = new Intent(SplashActivity.this,
                        SpotifyLoginActivity.class);
                intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);

                startActivity(intent);
                overridePendingTransition(R.anim.pull_up_from_bottom, R.anim.hold);

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

        }
    };
    splashTread.start();
}
 
Example 2
Source File: PhotoActivity.java    From Effects-Pro with MIT License 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_photo);

	image_holder = (ImageView) findViewById(R.id.source_image);
	btn_holder = (LinearLayout) findViewById(R.id.btn_holder);
	undo_btn = (ImageView) findViewById(R.id.undo_btn);
	save_btn = (ImageView) findViewById(R.id.save_btn);

	loading_dialog = new LoadingDialog(PhotoActivity.this);

	effect_box = (LinearLayout) findViewById(R.id.effects_holder);

	apply_set = (LinearLayout) findViewById(R.id.effect_set_box);

	toolbox = (RelativeLayout) findViewById(R.id.toolbox);

	hue_value = (SeekBar) findViewById(R.id.hue_value);
	hue_label = (TextView) findViewById(R.id.hue_label);
	sat_value = (SeekBar) findViewById(R.id.sat_value);
	sat_label = (TextView) findViewById(R.id.sat_label);

	bright_value = (SeekBar) findViewById(R.id.brightness_value);
	bright_label = (TextView) findViewById(R.id.brightness_label);
	cont_value = (SeekBar) findViewById(R.id.contrast_value);
	cont_label = (TextView) findViewById(R.id.contrast_label);

	gRed_value = (SeekBar) findViewById(R.id.gRed_value);
	gRed_label = (TextView) findViewById(R.id.gRed_label);
	gGreen_value = (SeekBar) findViewById(R.id.gGreen_value);
	gGreen_label = (TextView) findViewById(R.id.gGreen_label);
	gBlue_value = (SeekBar) findViewById(R.id.gBlue_value);
	gBlue_label = (TextView) findViewById(R.id.gBlue_label);

	bRed_value = (SeekBar) findViewById(R.id.bRed_value);
	bRed_label = (TextView) findViewById(R.id.bRed_label);
	bGreen_value = (SeekBar) findViewById(R.id.bGreen_value);
	bGreen_label = (TextView) findViewById(R.id.bGreen_label);
	bBlue_value = (SeekBar) findViewById(R.id.bBlue_value);
	bBlue_label = (TextView) findViewById(R.id.bBlue_label);

	rotate_value = (SeekBar) findViewById(R.id.rotate_value);
	rotate_label = (TextView) findViewById(R.id.rotate_label);

	boost_value = (SeekBar) findViewById(R.id.boost_value);
	boost_label = (TextView) findViewById(R.id.boost_label);

	cdepth_value = (SeekBar) findViewById(R.id.cdepth_value);
	cdepth_label = (TextView) findViewById(R.id.cdepth_label);

	if (savedInstanceState == null) {
		source_id = getIntent().getExtras().getInt(Constants.EXTRA_KEY_IMAGE_SOURCE);
		imageUri = getIntent().getData();
		effects = new ArrayList<String>();
		try {
			loadImage();
		} catch (Exception e) {
			Toaster.make(getApplicationContext(), R.string.error_img_not_found);
			backToMain();
		}
	} else {
		effects = savedInstanceState.getStringArrayList(Constants.KEY_EFFECTS_LIST);
		imageUrl = savedInstanceState.getString(Constants.KEY_URL);
		source_id = savedInstanceState.getInt(Constants.KEY_SOURCE_ID);
		setImage((Bitmap) savedInstanceState.getParcelable(Constants.KEY_BITMAP));
	}

	if (effects.size() > 0) {
		btn_holder.setVisibility(View.VISIBLE);
		flyIn();
	} else {
		btn_holder.clearAnimation();
	}

}