BitmapView Android 开源库, 支持显示任意尺寸JPG PNG图片
特性 - 缩放 - 滚动和Fling - 旋转
Gradle 依赖
dependencies { compile 'org.qiibeta.views:bitmapview:1.0.1' }
Demo 下载 sample.apk
使用说明
public class YourApplication extends Application { @Override public void onTrimMemory(int level) { super.onTrimMemory(level); TileImage.clearBitmapRecyclePool(); } }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String path=""; //the actual file path Bitmap thumbnailBitmap=null; GestureBitmapView bitmapView=(GestureBitmapView)findViewById(R.id.bv); bitmapView.setBitmapSource(BitmapSource.newInstance(Uri.parse(path),thumbnailBitmap)); }
ViewPager的bug,要这样修正 ```java
public class FixViewPager extends ViewPager { public FixViewPager(Context context) { super(context); } public FixViewPager(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { try { return super.onInterceptTouchEvent(ev); } catch (Exception ignored) { } return false; } }