Code example for RelativeLayout

Methods: getHeight, getId, setAnimationCacheEnabled, startAnimation

0
			mContainer = (RelativeLayout) findViewById(objId);
		} else { 
			mContainer = (RelativeLayout) fl.getChildAt(startIndex - 1);
		} 
		float distance = max_distance - mlstack.size() * mutex_distance;
		int id = mContainer.getId();
		mlstack.add(id);
		if (mMap.containsKey(id)) {
 
		} else { 
			Map map = new HashMap();
			map.put(LayoutMetaData.MOVE_DIS, distance);
			mMap.put(id, map);
		} 
		Log.d(TAG, mContainer.getTag() + "");
		// Find the center of the container 
		final float centerX = mContainer.getWidth() / 2.0f;
		final float centerY = mContainer.getHeight() / 2.0f;
 
		// Create a new 3D rotation with the supplied parameter 
		// The animation listener is used to trigger the next animation 
		AnimationSet set = new AnimationSet(false);
		// ---------------------------------------------------------------------------------------------------------------------------------------------------------------> 
		// <-------------------------------------------------------------------------------------------------------------------------------------------------------------- 
		Animation animScale = getScaleAnimation(0.6f);
 
		// ---------------------------------------------------------------------------------------------------------------------------------------------------------------> 
		// <-------------------------------------------------------------------------------------------------------------------------------------------------------------- 
		Animation rotation = getRotateAnimation(start, end, centerX, centerY,
				310.0f, true, true); 
		// anim3.setStartOffset(1100 + anim.getDuration()); 
		rotation.setAnimationListener(new AnimationListener() {
 
			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub 
 
			} 
 
			public void onAnimationRepeat(Animation animation) {
				// TODO Auto-generated method stub 
 
			} 
 
			public void onAnimationEnd(Animation animation) {
				// TODO Auto-generated method stub 
				// try { 
				// Thread.sleep(800); 
				// } catch (InterruptedException e) { 
				// // TODO Auto-generated catch block 
				// e.printStackTrace(); 
				// } 
				setLayoutVisibility(); 
			} 
		}); 
 
		// ---------------------------------------------------------------------------------------------------------------------------------------------------------------> 
		// <-------------------------------------------------------------------------------------------------------------------------------------------------------------- 
		Animation anim = null;
 
		anim = getTranslateAnimation(0, -distance, 0, 0);
		anim.setAnimationListener(new AnimationListener() {
 
			public void onAnimationStart(Animation animation) {
 
			} 
 
			public void onAnimationRepeat(Animation animation) {
 
			} 
 
			public void onAnimationEnd(Animation animation) {
 
			} 
		}); 
 
		set.setFillAfter(true);
		set.addAnimation(rotation);
		// set.addAnimation(animScale); 
		set.addAnimation(anim);
		mContainer.startAnimation(set);
		mContainer.setAnimationCacheEnabled(true);
		// if (position == 0) { 
		// anim = getTranslateAnimation(0, -170, 0, 0); 
		// set.addAnimation(anim); 
		// mContainer.startAnimation(set); 
		// mContainer.setAnimationCacheEnabled(true); 
Contextual code suggestions in your IDE  Get Codota for Java