Android Transformation - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Transformation class.

This code example shows how to use the following methods:getAlpha, getMatrix
        private void loadCurrentTransformation(View view) {
            Animation animation = view.getAnimation();
            if (animation == null)
                return; 
 
            Transformation transformation = new Transformation();
            float[] matrix = new float[9];
 
            animation.getTransformation(AnimationUtils.currentAnimationTimeMillis(), transformation);
            transformation.getMatrix().getValues(matrix);
 
            mAlpha = transformation.getAlpha();
            mTranslationX = matrix[Matrix.MTRANS_X];
            mTranslationY = matrix[Matrix.MTRANS_Y];
        } 
 
        private void prepareForUpdate() { 
            View view = mViewRef.get();
            if (view != null)
                computeRect(mBefore, view);
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:applyTransformation
   */ 
  public void invokeEnd() { 
    if (listener != null) {
      listener.onAnimationEnd(realAnimation);
    } 
    new ShadowAnimationBridge(realAnimation).applyTransformation(1.0f, new Transformation());
  } 
 
  public void setLoadedFromResourceId(int loadedFromResourceId) {
    this.loadedFromResourceId = loadedFromResourceId;
  } 
 
  public int getLoadedFromResourceId() { 
    if (loadedFromResourceId == -1) {
      throw new IllegalStateException("not loaded from a resource");
    } 
    return loadedFromResourceId;
  } 
 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMatrix, setAlpha
 
    @Override 
    protected void applyTransformation(float interpolatedTime, Transformation t) {
        View view = mView.get();
        if (view != null) {
            t.setAlpha(mAlpha);
            transformMatrix(t.getMatrix(), view);
        } 
    } 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMatrix
This code example shows how to use the following methods:clear, getMatrix, setTransformationType
 
	protected boolean getChildStaticTransformation(View child, Transformation t) {
		final int childCenter = getCenterOfView(child);
		final int childWidth = child.getWidth();
		int rotationAngle = 0;
		t.clear();
		t.setTransformationType(Transformation.TYPE_MATRIX);
		if (childCenter == mCoveflowCenter) {
			transformImageBitmap((RelativeLayout) child, t, 0);
		} else { 
			rotationAngle = (int) (((float) (mCoveflowCenter - childCenter) / childWidth) * mMaxRotationAngle);
			System.out.println("rotationAngle:" + rotationAngle);
			if (Math.abs(rotationAngle) > mMaxRotationAngle) {
				rotationAngle = (rotationAngle < 0) ? -mMaxRotationAngle : mMaxRotationAngle;
			} 
			transformImageBitmap((RelativeLayout) child, t, rotationAngle);
		} 
		return true; 
	} 
 

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:clear, setAlpha
            setStaticTransformationsEnabled(true); 
        } 
 
        @Override 
        protected boolean getChildStaticTransformation(View child, Transformation t) {
            t.clear();
            t.setAlpha(.35f);
 
            return true; 
        } 
    } 
} 
 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMatrix
This code example shows how to use the following methods:clear, getMatrix, setTransformationType
 
	protected boolean getChildStaticTransformation(View child, Transformation t) {
		final int childCenter = getCenterOfView(child);
		final int childWidth = child.getWidth();
		int rotationAngle = 0;
		t.clear();
		t.setTransformationType(Transformation.TYPE_MATRIX);
		if (childCenter == mCoveflowCenter) {
			transformImageBitmap((RelativeLayout) child, t, 0);
		} else { 
			rotationAngle = (int) (((float) (mCoveflowCenter - childCenter) / childWidth) * mMaxRotationAngle);
			System.out.println("rotationAngle:" + rotationAngle);
			if (Math.abs(rotationAngle) > mMaxRotationAngle) {
				rotationAngle = (rotationAngle < 0) ? -mMaxRotationAngle : mMaxRotationAngle;
			} 
			transformImageBitmap((RelativeLayout) child, t, rotationAngle);
		} 
		return true; 
	} 
 

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMatrix, setAlpha
 
    @Override 
    protected void applyTransformation(float interpolatedTime, Transformation t) {
        View view = mView.get();
        if (view != null) {
            t.setAlpha(mAlpha);
            transformMatrix(t.getMatrix(), view);
        } 
    } 
 
    @Override 
    public void reset() { 
        /* Do nothing. */ 
    } 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:applyTransformation
     */ 
    public void invokeEnd() { 
        if (listener != null) {
            listener.onAnimationEnd(realAnimation);
        } 
        new ShadowAnimationBridge(realAnimation).applyTransformation(1.0f, new Transformation());
    } 
 
    public void setLoadedFromResourceId(int loadedFromResourceId) {
        this.loadedFromResourceId = loadedFromResourceId;
    } 
 
    public int getLoadedFromResourceId() { 
        if (loadedFromResourceId == -1) {
            throw new IllegalStateException("not loaded from a resource");
        } 
        return loadedFromResourceId;
    } 
 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Android Transformation Questions & Answers:

See Code Examples for Android Transformation Methods: