本文整理匯總了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());
}