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


Java ImageViewTouch类代码示例

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


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

示例1: onPostExecute

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入依赖的package包/类
protected void onPostExecute(String result){
    ImageViewTouch image1view = (ImageViewTouch) view.findViewById(R.id.image1);
    ViewGroup.LayoutParams vp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);

    //setting up imageviewtouch with parameters to be able to input image
    if(urlarraylist.size() >= 1 ) {
        System.out.println(urlarraylist.get(0));
        ImageViewTouch[] imageviewtoucharray = new ImageViewTouch[urlarraylist.size() - 1];
        for (int j = 0; j < (urlarraylist.size() - 1); j++) {
            imageviewtoucharray[j] = new ImageViewTouch(getActivity(), null);
            imageviewtoucharray[j].setLayoutParams(vp);
        }

        //adding the imageviewtouch to the viewflipper
        for (int k = 0; k < (urlarraylist.size() - 1); k++) {
            ECCFlipper.addView(imageviewtoucharray[k]);
        }

        //setting up imageloader to input the images from the urls to the imageviewtouch views
        ImageLoader imageLoader = ImageLoader.getInstance();
        imageLoader.displayImage(urlarraylist.get(0), image1view);
        for (int i = 1; i < urlarraylist.size(); i++) {
            imageLoader.displayImage(urlarraylist.get(i), imageviewtoucharray[i - 1]);
        }
    }
}
 
开发者ID:emgroves,项目名称:ECC-Android,代码行数:27,代码来源:Map.java

示例2: getGestureListener

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入依赖的package包/类
@Override
protected GestureDetector.OnGestureListener getGestureListener() {
    return new ImageViewTouch.GestureListener() {
        @Override
        public boolean onDoubleTap(MotionEvent e) {
            mUserScaled = true;

            float scale = getScale();
            float targetScale = onDoubleTapPost(scale, getMaxScale(), getMinScale());
            targetScale = Math.min(getMaxScale(), Math.max(targetScale, getMinScale()));
            zoomTo(targetScale, e.getX(), e.getY(), (long) mDefaultAnimationDuration);

            if (null != mDoubleTapListener) {
                mDoubleTapListener.onDoubleTap();
            }

            return false;
        }
    };
}
 
开发者ID:oxoooo,项目名称:touch-image-view,代码行数:21,代码来源:TouchImageView.java

示例3: 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

示例4: 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

示例5: 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

示例6: canScroll

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入依赖的package包/类
@Override
protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
    if (v instanceof ImageViewTouch) {
        return ((ImageViewTouch) v).canScroll(dx) || super.canScroll(v, checkV, dx, x, y);
    }
    return super.canScroll(v, checkV, dx, x, y);
}
 
开发者ID:sathishmscict,项目名称:Matisse-Image-and-Video-Selector,代码行数:8,代码来源:PreviewViewPager.java

示例7: 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

示例8: 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

示例9: initView

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入依赖的package包/类
private void initView(Context context){
	
	View v = LayoutInflater.from(context).inflate(R.layout.itemview_scenery_image, 
			this, 
			true);
	
	ivMedia = (ImageViewTouch) v.findViewById(R.id.ivMedia);
	ivMedia.setDisallowInterceptParent(mDisallowInterceptParent);
}
 
开发者ID:jp1017,项目名称:TheSceneryAlong,代码行数:10,代码来源:ScenenryImageItemView.java

示例10: canScroll

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入依赖的package包/类
@Override
protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
	if (v instanceof ImageViewTouch) {
		return ((ImageViewTouch) v).canScroll(dx);
	} else {
		return super.canScroll(v, checkV, dx, x, y);
	}
}
 
开发者ID:michaelye,项目名称:DoubanOnline,代码行数:9,代码来源:ImageViewTouchViewPager.java

示例11: init

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入依赖的package包/类
private void init() {
	previousPosition = getCurrentItem();
	
	setOnPageChangeListener(new SimpleOnPageChangeListener() {
		@Override
		public void onPageSelected(int position) {
			if (onPageSelectedListener != null) {
				onPageSelectedListener.onPageSelected(position);
			}
		}
		
		@Override
		public void onPageScrollStateChanged(int state) {
			if (state == SCROLL_STATE_SETTLING && previousPosition != getCurrentItem()) {
				try {
					ImageViewTouch imageViewTouch = (ImageViewTouch)
						findViewWithTag(VIEW_PAGER_OBJECT_TAG + getCurrentItem());
					if (imageViewTouch != null) {
						imageViewTouch.zoomTo(1f, 300);
					}
					
					previousPosition = getCurrentItem();
				} catch (ClassCastException ex) {
					Log.e(TAG, "This view pager should have only ImageViewTouch as a children.", ex);
				}
			}
		}
	});
}
 
开发者ID:michaelye,项目名称:DoubanOnline,代码行数:30,代码来源:ImageViewTouchViewPager.java

示例12: 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

示例13: displayInfo

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

示例14: onCreateView

import it.sephiroth.android.library.imagezoom.ImageViewTouch; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
    // Inflate and locate the main ImageView
    final View v = inflater.inflate(R.layout.image_detail_fragment, container, false);
    mImageView = (ImageViewTouch) v.findViewById(R.id.imageView);
    mImageDescription = (TextView) v.findViewById(R.id.imageDescription);
    mImageCredit = (TextView) v.findViewById(R.id.imageCredit);
    imageDetailsLayout = (RelativeLayout) v.findViewById(R.id.imageDetailsLayout); 
    return v;
}
 
开发者ID:museumsvictoria,项目名称:mv-fieldguide-android,代码行数:12,代码来源:ImageDetailFragment.java

示例15: 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类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。