本文整理汇总了Java中uk.co.senab.photoview.PhotoViewAttacher.setOnMatrixChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java PhotoViewAttacher.setOnMatrixChangeListener方法的具体用法?Java PhotoViewAttacher.setOnMatrixChangeListener怎么用?Java PhotoViewAttacher.setOnMatrixChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uk.co.senab.photoview.PhotoViewAttacher
的用法示例。
在下文中一共展示了PhotoViewAttacher.setOnMatrixChangeListener方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.iv_photo);
mCurrMatrixTv = (TextView) findViewById(R.id.tv_current_matrix);
Drawable bitmap = getResources().getDrawable(R.drawable.spine_crescent);
mImageView.setImageDrawable(bitmap);
// The MAGIC happens here!
mAttacher = new PhotoViewAttacher(mImageView);
// Lets attach some listeners, not required though!
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
}
示例2: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.iv_photo);
mCurrMatrixTv = (TextView) findViewById(R.id.tv_current_matrix);
Drawable bitmap = getResources().getDrawable(R.drawable.ashland);
mImageView.setImageDrawable(bitmap);
// The MAGIC happens here!
mAttacher = new PhotoViewAttacher(mImageView);
// Lets attach some listeners, not required though!
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
}
示例3: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.iv_photo);
mCurrMatrixTv = (TextView) findViewById(R.id.tv_current_matrix);
Drawable bitmap = getResources().getDrawable(R.drawable.iron_delta);
mImageView.setImageDrawable(bitmap);
// The MAGIC happens here!
mAttacher = new PhotoViewAttacher(mImageView);
// Lets attach some listeners, not required though!
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
}
示例4: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.iv_photo);
mCurrMatrixTv = (TextView) findViewById(R.id.tv_current_matrix);
Drawable bitmap = getResources().getDrawable(R.drawable.manus_peak);
mImageView.setImageDrawable(bitmap);
// The MAGIC happens here!
mAttacher = new PhotoViewAttacher(mImageView);
// Lets attach some listeners, not required though!
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
}
示例5: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.iv_photo);
mCurrMatrixTv = (TextView) findViewById(R.id.tv_current_matrix);
Drawable bitmap = getResources().getDrawable(R.drawable.skim_junction);
mImageView.setImageDrawable(bitmap);
// The MAGIC happens here!
mAttacher = new PhotoViewAttacher(mImageView);
// Lets attach some listeners, not required though!
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
}
示例6: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.iv_photo);
mCurrMatrixTv = (TextView) findViewById(R.id.tv_current_matrix);
Drawable bitmap = getResources().getDrawable(R.drawable.line_harvest);
mImageView.setImageDrawable(bitmap);
// The MAGIC happens here!
mAttacher = new PhotoViewAttacher(mImageView);
// Lets attach some listeners, not required though!
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
}
示例7: instantiateItem
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
@SuppressWarnings("NewApi")
public Object instantiateItem(ViewGroup container, int position) {
View v = inflater.inflate(R.layout.view_pdf_page, container, false);
ImageView iv = (ImageView) v.findViewById(R.id.imageView);
if (renderer == null || getCount() < position) {
return v;
}
PdfRenderer.Page page = getPDFPage(renderer, position);
Bitmap bitmap = bitmapContainer.get(position);
page.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);
page.close();
PhotoViewAttacher attacher = new PhotoViewAttacher(iv);
attacher.setScale(scale.getScale(), scale.getCenterX(), scale.getCenterY(), true);
attacher.setOnMatrixChangeListener(this);
attachers.put(position, new WeakReference<PhotoViewAttacher>(attacher));
iv.setImageBitmap(bitmap);
attacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
@Override
public void onPhotoTap(View view, float x, float y) {
if (pageClickListener != null) {
pageClickListener.onPageTap(view, x, y);
}
}
});
attacher.update();
container.addView(v, 0);
return v;
}
示例8: instantiateItem
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
@SuppressWarnings("NewApi")
public Object instantiateItem(ViewGroup container, int position) {
View v = inflater.inflate(R.layout.view_pdf_page, container, false);
ImageView iv = (ImageView) v.findViewById(R.id.imageView);
if (renderer == null || getCount() < position) {
return v;
}
PdfRenderer.Page page = getPDFPage(renderer, position);
Bitmap bitmap = bitmapContainer.get(position);
page.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);
page.close();
PhotoViewAttacher attacher = new PhotoViewAttacher(iv);
attacher.setScale(scale.getScale(), scale.getCenterX(), scale.getCenterY(), true);
attacher.setOnMatrixChangeListener(this);
attachers.put(position, new WeakReference<PhotoViewAttacher>(attacher));
iv.setImageBitmap(bitmap);
attacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
@Override
public void onPhotoTap(View view, float x, float y) {
pageClickListener.onClick(view);
}
});
attacher.update();
((ViewPager) container).addView(v, 0);
return v;
}
示例9: onCreate
import uk.co.senab.photoview.PhotoViewAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.imageview);
Intent intent = getIntent(); //인텐트 받아오고
String url = intent.getStringExtra("url"); //인텐트로 부터 데이터 가져오고
mImageView = (ImageView) findViewById(R.id.iv_photo);
new ImageDownloader()
.execute(url);
// The MAGIC happens here!
mAttacher = new PhotoViewAttacher(mImageView);
// Lets attach some listeners, not required though!
mAttacher.setOnMatrixChangeListener(new MatrixChangeListener());
mAttacher.setOnPhotoTapListener(new PhotoTapListener());
}