Monday, March 18, 2013

Re: [android-developers] Text dissapears when view is rotated in getChildStaticTransformation (4.x / maybe also honeycomb)



Romain Guy <romainguy@android.com> wrote:

Does it happen on all 4.x versions? (4.0, 4.1 and 4.2?) If so, please file a bug at b.android.com.


On Sun, Mar 17, 2013 at 4:38 PM, user123 <ivanschuetz@gmail.com> wrote:
I'm rotating a custom view, which contains a textview, using getChildStaticTransformation:

@Override
protected boolean getChildStaticTransformation(View child, Transformation t) {
  t.clear();
  t.setTransformationType(Transformation.TYPE_MATRIX);
  camera.save();
  final Matrix imageMatrix = t.getMatrix();

  float transX = (textView.getWidth() / 2.0f);
  float transY = (textView.getHeight() / 2.0f);

  camera.rotateY(rot);
  camera.getMatrix(imageMatrix);
  imageMatrix.preTranslate(-transX, -transY);
  imageMatrix.postTranslate(transX, transY);
  camera.restore();
  //...
}

This works very well on all 2.x devices I have tested, but in 4.x devices, on angle != 0, the text dissapears. Rotation works well, but the text dissapears. It appears again if rotation is 0.

What can I do to solve this? Thanks in advance!

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Romain Guy
Android framework engineer
romainguy@android.com

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment