Я хочу открыть изображение, например анимацию WhatsApp. В моем случае у меня есть список изображений.когда я нажимаю на определенное изображение в списке, я хочу увеличить изображение с анимацией, такой как Whatsapp, открыть профильФото в этом чате. Список
Я использовал Alert Dialog, чтобы открыть увеличенное изображение.и добавить анимацию.но я не могу управлять эффектом наподобие whatsapp.
final AlertDialog.Builder builder;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
builder = new AlertDialog.Builder(Objects.requireNonNull(context), android.R.style.Theme_Material_Light_Dialog_NoActionBar);
} else {
builder = new AlertDialog.Builder(Objects.requireNonNull(context));
}
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View dialogLayout = inflater.inflate(R.layout.profile_layout, null);
ImageView ivProfile = dialogLayout.findViewById(R.id.ivProfileImage);
ivProfile.getLayoutParams().height = (int) (width / 1.2);
ivProfile.getLayoutParams().width = (int) (width / 1.2);
Glide.with(context).load(url)
.apply(RequestOptions.centerInsideTransform().diskCacheStrategy(DiskCacheStrategy.ALL).placeholder(R.drawable.ic_profile_fill)).into(ivProfile);
builder.setView(dialogLayout);
AlertDialog alertDialog = builder.create();
Objects.requireNonNull (alertDialog.getWindow ()). setWindowAnimations (R.style.ProfileImageAnimation);
alertDialog.setCancelable(true);
alertDialog.show();
// Файл анимации:
<!--<translate
android:fromXDelta="-100%p"
android:fromYDelta="0"
android:duration="500"/>-->
<scale
android:fromXScale="0.3"
android:fromYScale="0.3"
android:pivotX="50%"
android:pivotY="50%"
android:duration="150"
android:toXScale="1.0"
android:toYScale="1.0" />