I am trying to add full screen image viewer functionality for an image when clicked, it should include zoom in/out with sliding left right. i successfully added that functionality with TouchImageView and ViewPager but on Zoom or slide images are getting redrawn and stacked(attached image).
i tried it without viewpager, and even by using library like photoview, still the problem persist. Please Help! any help would be greatly appreciable.
code layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/imgDisplay"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
oncreate method of fullscreeActivity, this activity started when user clicks an image on GalleryActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fullscreen);
ButterKnife.bind(this);
/*viewPager = (ViewPager) findViewById(R.id.pager);*/
Intent i = getIntent();
int position = i.getIntExtra("position", 0);
ArrayList<String> imageUrls = new ArrayList<String>(3);
imgDisplay.setImageResource(R.drawable.amv6);
tried using this code https://github.com/Baseflow/PhotoView/blob/master/sample/src/main/java/com/github/chrisbanes/photoview/sample/SimpleSampleActivity.java
still problem persist.
Now I have resolved the above error, As it was coming due to the wrong theme i was using in Android_menifest.xml file which is causing this error.
old file
new content in file after removing theme and using default theme for my fullscreenactivity