本文整理汇总了Java中it.sephiroth.android.library.imagezoom.ImageViewTouchBase类的典型用法代码示例。如果您正苦于以下问题:Java ImageViewTouchBase类的具体用法?Java ImageViewTouchBase怎么用?Java ImageViewTouchBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ImageViewTouchBase类属于it.sephiroth.android.library.imagezoom包,在下文中一共展示了ImageViewTouchBase类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onShow
import it.sephiroth.android.library.imagezoom.ImageViewTouchBase; //导入依赖的package包/类
@Override
public void onShow() {
bitmap = BitmapUtil.decodeBitmapFromFile(
getContext(),
SceneryUtil.getSceneryFilePath(scenery),
FinalConstants.pic_minSideLength_4m,
FinalConstants.pic_maxNumOfPixels_4m);
if(bitmap != null){
//final int size = -1; // use the original image size
ivMedia.setImageBitmap(bitmap,
new Matrix(),
ImageViewTouchBase.ZOOM_INVALID,
ImageViewTouchBase.ZOOM_INVALID );
}
}
示例2: onCreate
import it.sephiroth.android.library.imagezoom.ImageViewTouchBase; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_photo);
ButterKnife.bind(this);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) actionBar.setDisplayHomeAsUpEnabled(true);
url = getIntent().getStringExtra("url");
photo.setDisplayType(ImageViewTouchBase.DisplayType.FIT_TO_SCREEN);
Glide.with(this)
.load(url)
.asBitmap()
.format(DecodeFormat.PREFER_ARGB_8888)
.into(photo);
}
示例3: onCreate
import it.sephiroth.android.library.imagezoom.ImageViewTouchBase; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Window
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
// Intent
Intent intent = getIntent();
int image = intent.getIntExtra("scale", 0);
// Layout
setContentView(R.layout.activity_scale);
// Picture
ImageViewTouch imageViewTouch = findViewById(R.id.scale_image);
imageViewTouch.setDisplayType(ImageViewTouchBase.DisplayType.FIT_TO_SCREEN);
imageViewTouch.setImageResource(image);
// Toast
mTools.showToast(getString(R.string.scale_guide), 1);
}
示例4: onViewCreated
import it.sephiroth.android.library.imagezoom.ImageViewTouchBase; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
final Item item = getArguments().getParcelable(ARGS_ITEM);
if (item == null) {
return;
}
View videoPlayButton = view.findViewById(R.id.video_play_button);
if (item.isVideo()) {
videoPlayButton.setVisibility(View.VISIBLE);
videoPlayButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(item.uri, "video/*");
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
Toast.makeText(getContext(), R.string.error_no_video_activity, Toast.LENGTH_SHORT).show();
}
}
});
} else {
videoPlayButton.setVisibility(View.GONE);
}
ImageViewTouch image = (ImageViewTouch) view.findViewById(R.id.image_view);
image.setDisplayType(ImageViewTouchBase.DisplayType.FIT_TO_SCREEN);
Point size = PhotoMetadataUtils.getBitmapSize(item.getContentUri(), getActivity());
if (item.isGif()) {
SelectionSpec.getInstance().imageEngine.loadGifImage(getContext(), size.x, size.y, image,
item.getContentUri());
} else {
SelectionSpec.getInstance().imageEngine.loadImage(getContext(), size.x, size.y, image,
item.getContentUri());
}
}
示例5: onCreateView
import it.sephiroth.android.library.imagezoom.ImageViewTouchBase; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
mImageView = new ImageViewTouch(getActivity(), null);
mImageView.setOnTouchListener(this);
mImageView.setSingleTapListener(this);
mImageView.setDisplayType(ImageViewTouchBase.DisplayType.FIT_TO_SCREEN);
mImageView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
return mImageView;
}
示例6: onViewCreated
import it.sephiroth.android.library.imagezoom.ImageViewTouchBase; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
final MediaInfo mediaInfo = getArguments().getParcelable(ARGS_ITEM);
if (mediaInfo == null) {
return;
}
View videoPlayButton = view.findViewById(R.id.video_play_button);
if (mediaInfo.isVideo()) {
videoPlayButton.setVisibility(View.VISIBLE);
videoPlayButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(mediaInfo.uri, "video/*");
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
VanConfig.getInstance().toastListener.display(R.string.error_no_video_activity);
}
}
});
} else {
videoPlayButton.setVisibility(View.GONE);
}
ImageViewTouch image = (ImageViewTouch)view.findViewById(R.id.image_view);
image.setDisplayType(ImageViewTouchBase.DisplayType.FIT_TO_SCREEN);
Point size = PhotoMetadataUtils.getBitmapSize(mediaInfo.getContentUri(), getActivity());
if (mediaInfo.isGif()) {
VanConfig.getInstance().imageLoader.loadAnimatedGifImage(getContext(), size.x, size.y, image,
mediaInfo.getContentUri());
} else {
VanConfig.getInstance().imageLoader.loadImage(getContext(), size.x, size.y, image,
mediaInfo.getContentUri());
}
}
示例7: onCreate
import it.sephiroth.android.library.imagezoom.ImageViewTouchBase; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Shot shot = (Shot) getBundle().getSerializable(BundleKeys.SHOT);
imageView.setDisplayType(ImageViewTouchBase.DisplayType.FIT_TO_SCREEN);
DribbblePicasso.with(this, shot.getImageUrl()).into(imageView);
}
示例8: displayInfo
import it.sephiroth.android.library.imagezoom.ImageViewTouchBase; //导入依赖的package包/类
private void displayInfo()
{
((ImageViewTouch) viewById(R.id.process_diagram_view))
.setDisplayType(ImageViewTouchBase.DisplayType.FIT_TO_SCREEN);
// Icon
((MainActivity) getActivity()).getPicasso()
.load(Uri.parse(getAPI().getProcessService().getProcessDiagramUrl(processId, tenantId)))
.into((ImageView) viewById(R.id.process_diagram_view));
}
示例9: selectRandomImage
import it.sephiroth.android.library.imagezoom.ImageViewTouchBase; //导入依赖的package包/类
public void selectRandomImage() {
Cursor c = getContentResolver().query( Images.Media.EXTERNAL_CONTENT_URI, null, null, null, null );
if ( c != null ) {
int count = c.getCount();
int position = (int) ( Math.random() * count );
if ( c.moveToPosition( position ) ) {
long id = c.getLong( c.getColumnIndex( Images.Media._ID ) );
Uri imageUri = Uri.parse( Images.Media.EXTERNAL_CONTENT_URI + "/" + id );
// imageUri = Uri.parse( "content://media/external/images/media/7993" ); // test
Log.d( "image", imageUri.toString() );
final int size = -1; // use the original image size
Bitmap bitmap = DecodeUtils.decode( this, imageUri, size, size );
if( null != bitmap )
{
// calling this will force the image to fit the ImageView container width/height
if( null == imageMatrix ) {
imageMatrix = new Matrix();
} else {
// get the current image matrix, if we want restore the
// previous matrix once the bitmap is changed
// imageMatrix = mImage.getDisplayMatrix();
}
mImage.setImageBitmap( bitmap, imageMatrix.isIdentity() ? null : imageMatrix, ImageViewTouchBase.ZOOM_INVALID, ImageViewTouchBase.ZOOM_INVALID );
} else {
Toast.makeText( this, "Failed to load the image", Toast.LENGTH_LONG ).show();
}
}
c.close();
c = null;
return;
}
}
示例10: onSuccess
import it.sephiroth.android.library.imagezoom.ImageViewTouchBase; //导入依赖的package包/类
@Override
public void onSuccess() {
mImageView.setDisplayType(ImageViewTouchBase.DisplayType.FIT_TO_SCREEN);
}