Search in sources :

Example 1 with ImageViewPagerAdapter

use of app.insti.adapter.ImageViewPagerAdapter in project IITB-App by wncc.

the class FileComplaintFragment method showImage.

private void showImage(List<String> uploadedImagesUrl) {
    if (viewPager != null) {
        try {
            imageViewPagerAdapter = new ImageViewPagerAdapter(getActivity(), uploadedImagesUrl);
            place_holder_image.setVisibility(View.GONE);
            image_holder_view.setVisibility(View.VISIBLE);
            viewPager.setAdapter(imageViewPagerAdapter);
            indicator.setViewPager(viewPager);
            imageViewPagerAdapter.registerDataSetObserver(indicator.getDataSetObserver());
            viewPager.getAdapter().notifyDataSetChanged();
            synchronized (viewPager) {
                viewPager.notifyAll();
            }
            imageViewPagerAdapter.notifyDataSetChanged();
            progressDialog.dismiss();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Also used : ImageViewPagerAdapter(app.insti.adapter.ImageViewPagerAdapter) ApiException(com.google.android.gms.common.api.ApiException) ResolvableApiException(com.google.android.gms.common.api.ResolvableApiException)

Example 2 with ImageViewPagerAdapter

use of app.insti.adapter.ImageViewPagerAdapter in project IITB-App by wncc.

the class ComplaintDetailsFragment method initViewPagerForImages.

private void initViewPagerForImages(Venter.Complaint detailedComplaint) {
    ViewPager viewPager = mView.findViewById(R.id.complaint_image_view_pager);
    if (viewPager != null) {
        try {
            ImageViewPagerAdapter imageFragmentPagerAdapter = new ImageViewPagerAdapter(getActivity(), detailedComplaint);
            viewPager.setAdapter(imageFragmentPagerAdapter);
            circleIndicator.setViewPager(viewPager);
            imageFragmentPagerAdapter.registerDataSetObserver(circleIndicator.getDataSetObserver());
            Objects.requireNonNull(viewPager.getAdapter()).notifyDataSetChanged();
            synchronized (viewPager) {
                viewPager.notifyAll();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Also used : ImageViewPagerAdapter(app.insti.adapter.ImageViewPagerAdapter) ViewPager(androidx.viewpager.widget.ViewPager)

Aggregations

ImageViewPagerAdapter (app.insti.adapter.ImageViewPagerAdapter)2 ViewPager (androidx.viewpager.widget.ViewPager)1 ApiException (com.google.android.gms.common.api.ApiException)1 ResolvableApiException (com.google.android.gms.common.api.ResolvableApiException)1