0

On clicking image, image should open in full screen in android. I am using flip view pager from GitHub. I got all the layout and functionality same as in the GitHub link. But I want to add further function to open image in full screen as dialog over the same screen.

    final ListView friends = (ListView) inflater.inflate(R.layout.activity_friends,container,false);
    FlipSettings settings=new FlipSettings.Builder().defaultPage(1).build();
    friends.setAdapter(new FriendsAdapter(getActivity(), Utils.friends,settings));
    friends.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Friend friend = (Friend) friends.getAdapter().getItem(position);

                    final Dialog nagDialog = new Dialog(getActivity(),android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
                    nagDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                    nagDialog.setCancelable(false);
                    nagDialog.setContentView(R.layout.preview_image);
                    Button btnClose = (Button)nagDialog.findViewById(R.id.btnIvClose);
                   //ImageView ivPreview = (ImageView)nagDialog.findViewById(R.id.first);
                    //ivPreview.setBackground(dd);

                    btnClose.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View arg0) {

                            nagDialog.dismiss();
                        }
                    });
                    nagDialog.show();

            Toast.makeText(getContext(), friend.getNickname(), Toast.LENGTH_SHORT).show();
        }
    });
     return friends;

https://github.com/Yalantis/FlipViewPager.Draco

Please find the above link for the whole code.

lost_in_the_source
  • 10,998
  • 9
  • 46
  • 75
Abhishek Kumar
  • 747
  • 1
  • 5
  • 13
  • And what is your problem? Please be more specific. – Divers Jul 23 '16 at 11:31
  • my issue is that I want to open the image in fullscreen on click in flip view pager android!!!but its not working thathow to do that. – Abhishek Kumar Jul 23 '16 at 11:58
  • You need to pass your image in that dialog and show image inside dialog. In order to make it full screen - http://stackoverflow.com/questions/6329360/how-to-set-dialog-to-show-with-full-screen – Divers Jul 23 '16 at 12:58

0 Answers0