本文整理汇总了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]);
}
}
}
示例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;
}
};
}
示例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);
}
示例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();
}
示例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());
}
}
示例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);
}
示例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;
}
示例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());
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
}
});
}
示例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);
}
示例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));
}
示例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;
}
示例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);
}