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


Java ImageViewTouch.setDisplayType方法代码示例

本文整理汇总了Java中it.sephiroth.android.library.imagezoom.ImageViewTouch.setDisplayType方法的典型用法代码示例。如果您正苦于以下问题:Java ImageViewTouch.setDisplayType方法的具体用法?Java ImageViewTouch.setDisplayType怎么用?Java ImageViewTouch.setDisplayType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在it.sephiroth.android.library.imagezoom.ImageViewTouch的用法示例。


在下文中一共展示了ImageViewTouch.setDisplayType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入方法依赖的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

示例2: onViewCreated

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入方法依赖的package包/类
@Override
public void onViewCreated( View v, Bundle savedInstanceState ) {

	super.onViewCreated( v, savedInstanceState );

	ImageViewTouch view = (ImageViewTouch) v.findViewById( R.id.image_viewer );

	view.setDisplayType( DisplayType.FIT_TO_SCREEN );

	view.setSingleTapListener( new OnImageViewTouchSingleTapListener() {

		@Override
		public void onSingleTapConfirmed() {
			ActionBar bar = getActivity().getActionBar();
			if( bar.isShowing() ) {
				bar.hide();
			} else {
				bar.show();
			}
		}

	} );

	createBitmap();

}
 
开发者ID:SilentCircle,项目名称:silent-text-android,代码行数:27,代码来源:ImageViewerFragment.java

示例3: onViewCreated

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入方法依赖的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

示例4: onCreateView

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入方法依赖的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

示例5: onViewCreated

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入方法依赖的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

示例6: addViewItem

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入方法依赖的package包/类
private void addViewItem()
{
	View layout = mInflater.inflate(R.layout.view_pager_layout, new LinearLayout(this), false);
	ImageViewTouch zoomableImageView = (ImageViewTouch) layout.findViewById(R.id.zoomableImageView);
	zoomableImageView.setDisplayType(DisplayType.FIT_TO_SCREEN);// 设置图片的大小模式
	mListViews.add(layout);
}
 
开发者ID:michaelye,项目名称:DoubanOnline,代码行数:8,代码来源:PhotoDetailActivity.java

示例7: onContentChanged

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入方法依赖的package包/类
@Override
public void onContentChanged() {
	super.onContentChanged();
	
    Intent intent = getIntent();
    String imageUrl = intent.getStringExtra(PageViewActivity.IMG_MSG);

	mImage = (ImageViewTouch) findViewById( R.id.image );
	
	// set the default image display type
	mImage.setDisplayType( DisplayType.NONE );
	
	new AQuery(this).id(R.id.image).image(imageUrl);
}
 
开发者ID:pele1,项目名称:AgendaSESC,代码行数:15,代码来源:ShowImageActivity.java


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