Существует много способов сделать это.
Я могу объяснить здесь с PopupWindow
Шаг 1:
your_main_imageview.setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View anchorView) {
View popupView = getLayoutInflater().inflate(
R.layout.popup_layout, null);
//Note: Add an imageView in this popup_layout.
ImageView image_button = (ImageView) popupView
.findViewById(R.id.your_imageview);
//Set image for imageView here
PopupWindow popupWindow = new PopupWindow(popupView,
LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT);
// If the PopupWindow should be focusable
popupWindow.setFocusable(false);
popupWindow.setOutsideTouchable(false);
// If you need the PopupWindow to dismiss when when
// touched outside
popupWindow
.setBackgroundDrawable(new ColorDrawable());
final int location[] = new int[2];
// Get the View's(the one that was clicked in the
// Fragment) location
anchorView.getLocationOnScreen(location);
anchorView.post(new Runnable() {
@Override
public void run() {
// Using location, the PopupWindow will be
// displayed right under anchorView
popupWindow.showAtLocation(
anchorView,
Gravity.NO_GRAVITY,
location[0],
location[1]
+ anchorView.getHeight());
}
});
}
Это не полный код. Спросите любые сомнения, я объясню в комментариях
Его работа частично. Когда я нажимаю на Изображение в это время, изображение скрывается, а другая часть отображается во всплывающем окне. –
Затем вам нужно внести изменения в popup_layout. Это в моем коде для раздувания – Amsheer