当前位置: 首页>>代码示例>>Java>>正文


Java ImageViewTouchBase类代码示例

本文整理汇总了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 );
       }
}
 
开发者ID:jp1017,项目名称:TheSceneryAlong,代码行数:17,代码来源:ScenenryImageItemView.java

示例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);
}
 
开发者ID:Alluretears,项目名称:ImageLoaders,代码行数:22,代码来源:PhotoActivity.java

示例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);
}
 
开发者ID:olejon,项目名称:mdapp,代码行数:25,代码来源:ScaleActivity.java

示例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());
    }
}
 
开发者ID:sathishmscict,项目名称:Matisse-Image-and-Video-Selector,代码行数:40,代码来源:PreviewItemFragment.java

示例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;
}
 
开发者ID:mecid,项目名称:robird-reborn,代码行数:12,代码来源:ImageFragment.java

示例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());
    }
}
 
开发者ID:GitPhoenix,项目名称:VanGogh,代码行数:40,代码来源:VanPreviewFragment.java

示例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);
}
 
开发者ID:clertonleal,项目名称:Simple-Dribbble,代码行数:8,代码来源:ShotViewActivity.java

示例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));
}
 
开发者ID:Alfresco,项目名称:activiti-android-app,代码行数:11,代码来源:ProcessDiagramFoundationFragment.java

示例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;
	}
}
 
开发者ID:SilentCircle,项目名称:silent-text-android,代码行数:40,代码来源:ImageViewTestActivity.java

示例10: onSuccess

import it.sephiroth.android.library.imagezoom.ImageViewTouchBase; //导入依赖的package包/类
@Override
public void onSuccess() {
    mImageView.setDisplayType(ImageViewTouchBase.DisplayType.FIT_TO_SCREEN);
}
 
开发者ID:Trolldad,项目名称:Reddit-Headlines,代码行数:5,代码来源:ImgurImageFragment.java


注:本文中的it.sephiroth.android.library.imagezoom.ImageViewTouchBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。