2017-03-24 5 views
0

私の質問をお読みいただきありがとうございます。 私が持っている問題は、唯一のAndroid 7.0(ヌガー)で発生し、何が起こっていることは、それがアニメーションで回転するとカード(画像ビューのフラグメント)は、それが突然、画像の一部をトリミングということです、見て:カードフリップAndroid 7でうまくいかないアニメーションNougat

アンドロイド7ヌガーScreenshoot

Card in rotation

アンドロイド4.4キットカットScreenshoot

Card in rotation

@Override 
protected void applyTransformation(float interpolatedTime, Transformation t) { 
    // Angle around the y-axis of the rotation at the given time 
    // calculated both in radians and degrees. 
    final double radians = Math.PI * interpolatedTime; 
    float degrees = (float) (180.0 * radians/Math.PI); 

    Log.d(LOG_TAG," "+interpolatedTime); 

    // Once we reach the midpoint in the animation, we need to hide the 
    // source view and show the destination view. We also need to change 
    // the angle by 180 degrees so that the destination does not come in 
    // flipped around 
    if (interpolatedTime >= 0.5f) { 
     degrees -= 180.f; 
     fromView.setVisibility(View.GONE); 
     toView.setVisibility(View.VISIBLE); 

    } 

    if (forward) 
     degrees = -degrees; //determines direction of rotation when flip begins 


    //computing 
    final Matrix matrix = t.getMatrix(); 
    camera.save(); 
    camera.translate(0, 0, Math.abs(degrees) * 3f); 
    camera.rotateY(degrees); 
    camera.getMatrix(matrix); 
    camera.restore(); 
    matrix.preTranslate(-centerX, -centerY); 
    matrix.postTranslate(centerX, centerY); 
} 

はあなたにあなたのアイデアを共有するためのそんなにありがとう:私はアニメーション(ないobjectAnimatorまだ)を使用してい

は、ここに私のコードです。 :)

+0

私はobjectAnimatorを使用しています。それは少し収穫しますが、私は2つの基本的なイメージ(別のもの)を使用するとうまくいきます。私のカードでは、画像ビューの代わりにSimpleDraweeViewを使用しているため、ビューが多く含まれている可能性があります。 –

答えて

0

は、あなたがカメラの距離を設定する必要がhttps://developer.android.com/reference/android/view/View.html#setCameraDistance(float)

をお読みください。 私はこの質問は古いことを知っていますが、私は誰かを助けることを願っています。

+0

解決策へのリンクは大歓迎ですが、答えが無ければ便利です。 //meta.stackexchange.com/a/8259)あなたの仲間のユーザーは、それが何であるか、なぜそれがあるのか​​をいくつか考えて、ターゲットページが利用できない場合にリンクしているページの最も関連性の高い部分を引用します。 [リンクよりも少しだけ回答が削除される可能性があります](// stackoverflow.com/help/deleted-answers) – LW001

+0

アドバイスをいただきありがとうございます。この場合、リンクのすべてのコンテンツをコピーして貼り付ける必要がありますか?私は役に立つと思う単一の引用が存在しないと思うので。 – barotia

関連する問題