私は配列を持つviewPageに3つの画像があり、そのうちの1つをズームするときにviewPagerをロックしたいのですが、右側にスクロールすると次の写真が表示されます! ここに私のコードがあります
enter code here
public class ExploreImageAdapter extends PagerAdapter {
Context context;
boolean touchEvent;
private int[] exploreImages = new int[] {
R.drawable.carfourele,
R.drawable.carfourele2,
R.drawable.carfourele3,
R.drawable.carfourele4
};
private LayoutInflater inflater;
ExploreImageAdapter(Context context){
this.context=context;
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
for (int i=1 ; i<=exploreImages.length ; i++){
} }
@Override
public int getCount() {
return exploreImages.length;
}
@Override
public boolean isViewFromObject(View view, Object object) {
return view == ((View) object);
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
View topImageLayout = inflater.inflate(R.layout.item_pager_images, container, false);
int padding = context.getResources().getDimensionPixelSize(R.dimen.padding_medium);
TouchImageView imageView= (TouchImageView)topImageLayout.findViewById(R.id.image);
imageView.setFocusable(true);
imageView.setPadding(padding, padding, padding, padding);
imageView.setImageResource(exploreImages[position]);
imageView.setMaxZoom(4f);
((ViewPager) container).addView(topImageLayout, 0);
return topImageLayout;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
((ViewPager) container).removeView((View) object);
}
}