OnTouchListner不适用于图像缩放

时间:2015-08-18 11:00:07

标签: android ontouchlistener image-zoom

我使用viewpager创建了Image滑块,我想对这些图像进行缩放缩放,但是图像缩放不适用于OnTouchListner事件。此事件正在处理没有滑块的单个图像,但我不明白在ImageAdapter中使用以下代码进行图像缩放时出了什么问题。这是我的代码。

FullscreenImage.java

Function<Car, Key> mapper = car -> new Key(car.getId(), 
                                           car.getCompanyId(), 
                                           car.isConvertible());
cars.stream().collect(Collectors.toMap(mapper, Function.identity());

ImageAdapter1.java

public class FullscreenImage extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_fullscreen_image);

    ViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);
    ImageAdapter1 adapter = new ImageAdapter1(getApplicationContext()    ,FullscreenImage.this);
    viewPager.setAdapter(adapter);
  }
}

0 个答案:

没有答案