私は次のとAndroidの中で活動遷移を使用しています:活動トランジション+ ImageViewの(アンドロイド)
ActivityOptionsCompat options = ActivityOptionsCompat
.makeSceneTransitionAnimation(activity, view, "image");
activity.startActivity(intent, options.toBundle());
そして、私は2つのImageViewの共有しています:
活動Aでは:
<android.support.v7.widget.AppCompatImageView android:id="@+id/iv_image"
android:transitionName="image"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="150dp"/>
をアクティビティB:
<android.support.v7.widget.AppCompatImageView android:id="@+id/fullscreen_content"
android:transitionName="image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"/>
問題は、私は私のアクティビティBを起動したとき、私はビットマップとImageViewのを埋めるために持っていることである。
String name = getIntent().getStringExtra(IMAGE_NAME_EXTRA);
ImageStorageManagement imageStorageManagement = new ImageStorageManagement(this);
Bitmap image = imageStorageManagement.decodeImage(name, 640, 480);
mContentView.setImageBitmap(image);
マイ'decodeImage'方法は、次のようになります。
public Bitmap decodeImage(String name, int reqWidth, int reqHeight) {
File f = new File(getImagesDirectory(), name);
String path = f.getAbsolutePath();
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(path, options);
options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);
options.inJustDecodeBounds = false;
return BitmapFactory.decodeFile(path, options);
}
そしてもちろん、それアプリを1秒ほど凍らせ、流体の動きを壊します。私はPicassoを使用しようとしましたが、ビットマップを非同期にロードするので、画像セットがまだ作成されていないため、トランジションは再生されません。
これらのことをすべて持ち、内部ストレージからイメージをどのように読み込むのですか?私はこれらのアニメーションのものすべてにかなり新しいので、私はそれを正しくやっているかどうかについては考えていません。
+情報: 私が言わなければならない、画像が元のサイズ(ビッグ)を持って、私は彼らを小さくする復号方法で試してみましたが、私はそれはかなり良いアイデアだことを確認していません。