1

私のアプリでは、手段によって3D変換を行っていますandroid.graphics.Camera。Nexus を試すまでは問題なく動作しているように見えました。

Nexus 7 (4.2.1) と Galaxy Nexus (4.1.2) にアプリをインストールしましたが、どちらもカメラ変換をまったく実行しません。私はカメラで 2 つの異なるビューを持っており、どちらも標準的なアニメーションを表示し、カメラの変換を適用しません。

そのような行動を誰が説明できますか?

UPD: カメラコード

transformation.clear();     
transformation.setTransformationType(Transformation.TYPE_MATRIX);   
mCamera.save();     
final Matrix matrix = transformation.getMatrix();         
mCamera.translate(x,y,z);  
mCamera.getMatrix(matrix);  
matrix.preTranslate(-centerX, -centerY);        
matrix.postTranslate(centerX, centerY);         
mCamera.restore();

UPD2: Galaxy S3 (4.2) と同じですが、S2 (4.0.4) とは異なります

4

2 に答える 2

0

ミハイルによって提供された解決策は、の終わりに私のために働きgetChildStaticTransformationます。

唯一の問題は、getChildStaticTransformationメソッドが常に呼び出されることです。

私の解決策は、各アイテムの更新されたx、y、z値の直後にコードを配置することです。

// items is a ArrayList of ControlItem for example
// x,y,z are custom property of ControlItem class

items.get(0).x = 250;
items.get(0).y = 100;
items.get(0).z = 0;

for ( ControlItem item : items )
{
    // Item must be invalidate with JellyBean and superior
    if ( android.os.Build.VERSION.SDK_INT >= 16 ) item.invalidate();
}

// getChildStaticTransformation() will be called after, transformation will be applied
于 2013-02-19T15:55:13.800 に答える