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