zovjqfm.zip

  • 5V7S80
    了解作者
  • C51
    开发工具
  • 2KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2018-10-16 22:42
    上传日期
以前的一个HTML练手作品,主要是学习交互以及布局处理
zovjqfm.zip
  • StatusMentionPresent.java
    140B
  • DraftPresentModule.java
    806B
  • PreImageInfo.java
    172B
  • QueryFavoritesResponse.java
    660B
  • BigImageView.java
    4.3KB
内容介绍
package com.caij.emore.widget.subsampling; import android.content.Context; import android.graphics.Bitmap; import android.graphics.PointF; import android.util.AttributeSet; import android.view.View; import android.widget.FrameLayout; import com.caij.emore.R; import com.davemorrissey.labs.subscaleview.ImageSource; import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; /** * Created by Ca1j on 2017/1/18. */ public class BigImageView extends FrameLayout implements SubsamplingScaleImageView.OnImageEventListener { public static final int INIT_SCALE_TYPE_CENTER_INSIDE = 1; public static final int INIT_SCALE_TYPE_CENTER_CROP = 2; public static final int INIT_SCALE_TYPE_TOP_CROP = 4; private int mScaleType; private SubsamplingScaleImageView mSubsamplingScaleImageView; public BigImageView(Context context, AttributeSet attr) { super(context, attr); init(context); } public BigImageView(Context context) { this(context, null); } private void init(Context context) { inflate(context, R.layout.view_big_image, this); mSubsamplingScaleImageView = (SubsamplingScaleImageView) findViewById(R.id.ssiv); mSubsamplingScaleImageView.setOrientation(SubsamplingScaleImageView.ORIENTATION_USE_EXIF); mSubsamplingScaleImageView.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_CUSTOM); mSubsamplingScaleImageView.setOnImageEventListener(this); setInitScaleType(INIT_SCALE_TYPE_CENTER_INSIDE); } public void setInitScaleType(int initScaleType) { mScaleType = initScaleType; invalidate(); } @Override public void onReady() { if (mScaleType == INIT_SCALE_TYPE_TOP_CROP) { float scale = getWidth() * 1f / mSubsamplingScaleImageView.getSWidth(); mSubsamplingScaleImageView.setScaleAndCenter(scale, new PointF(mSubsamplingScaleImageView.getSWidth() / 2, 0)); }else if (mScaleType == INIT_SCALE_TYPE_CENTER_CROP) { float scale = Math.max(getWidth() * 1f / mSubsamplingScaleImageView.getSWidth(), getHeight() * 1f / mSubsamplingScaleImageView.getSHeight()); mSubsamplingScaleImageView.setScaleAndCenter(scale, new PointF(mSubsamplingScaleImageView.getSWidth() / 2, mSubsamplingScaleImageView.getSHeight() / 2)); }else if (mScaleType == INIT_SCALE_TYPE_CENTER_INSIDE) { float scale = Math.min(getWidth() * 1f / mSubsamplingScaleImageView.getSWidth(), getHeight() * 1f / mSubsamplingScaleImageView.getSHeight()); mSubsamplingScaleImageView.setScaleAndCenter(scale, new PointF(mSubsamplingScaleImageView.getSWidth() / 2, mSubsamplingScaleImageView.getSHeight() / 2)); } float scale = getWidth() * 1f / mSubsamplingScaleImageView.getSWidth(); mSubsamplingScaleImageView.setMaxScale(Math.max(1, scale) * 2F); } @Override public void onImageLoaded() { } @Override public void onPreviewLoadError(Exception e) { } @Override public void onImageLoadError(Exception e) { } @Override public void onTileLoadError(Exception e) { } @Override public void onPreviewReleased() { } public void setDebug(boolean debug) { mSubsamplingScaleImageView.setDebug(debug); } public void setImage(String uri) { mSubsamplingScaleImageView.setImage(ImageSource.uri(uri)); } public void setImage(Bitmap bitmap, int orientation) { mSubsamplingScaleImageView.setOrientation(orientation); mSubsamplingScaleImageView.setImage(ImageSource.bitmap(bitmap)); } public void recycle() { mSubsamplingScaleImageView.recycle(); } @Override public void setOnClickListener(final OnClickListener l) { mSubsamplingScaleImageView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { l.onClick(BigImageView.this); } }); } @Override public void setOnLongClickListener(final OnLongClickListener l) { mSubsamplingScaleImageView.setOnLongClickListener(new OnLongClickListener() { @Override public boolean onLongClick(View v) { l.onLongClick(BigImageView.this); return true; } }); } }
评论
    相关推荐
    • Visual C++课件
      Visual C++ 面向对象程序设计课件,现在上课用的,很适合自学哦
    • visual c++课件
      一套关于visual c++的完整课件,通过阅读该课件可以较为容易的了解该知识。
    • Visual C++ Visual C++ Visual C++
      Visual C++ Visual C++ Visual C++ Visual C++
    • Visual C++6.0
      内有资源的网盘下载连接和密码,Visual C++6.0 win7兼容版
    • visual c++精华
      visual c++实践的一些精华 包括所有的ppt都在上面了。非常好的资料哦
    • Visual c++
      Visual c++ Visual c++ 课程设计Visual c++ 课程设计
    • visual C++mfc
      visual c++_mfc专题讲座.chm Visual C++ MFC入门教程.chm vc++ 编程指南.chm mfc深入浅出.chm
    • VISUAL C++
      VISUAL C++你值得拥有 计算机编程必备软件
    • Visual C++6.0
      Visual C++6.0是一款简单的C语言编程环境。初学者可以在这个软件中编辑一些简单的软件,从而对C语言进行初步的学习。
    • Visual c++
      人民邮电出版社:Visual C++应用教程例题代码