GithubHelp home page GithubHelp logo

jangocheng / diooto Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mikaelzero/mojito

0.0 1.0 0.0 627 KB

微博,微信图库效果,微信视频拖放效果,适配状态栏 、屏幕旋转 、全屏 、长图、GIF、视频

Java 100.00%

diooto's Introduction

DragDiooto

微博,微信图库效果,微信视频拖放效果,适配状态栏 、屏幕旋转 、全屏 、长图、GIF、视频

  • 自动更新图片大小
  • 可定制LoadingView
  • 可定制Indicator
  • 适配状态栏
  • 适配屏幕旋转
  • 适配全屏
  • 适配长图
  • 适配GIF
  • 适配视频
使用
allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

dependencies {
	 implementation 'com.github.moyokoo:Diooto:${version}'
}
//图片模式
Diooto diooto = new Diooto(context)
        .urls(normalImageUlr)
        //图片或者视频
        .type(DiootoConfig.PHOTO)
        //点击的位置
        .position(holder.getAdapterPosition())
        //可以传recylcerview自动识别(需要传在item布局中的viewId)  也可以手动传view数组
        .views(mRecyclerView,R.id.srcImageView)
        //设置选择器 默认CircleIndexIndicator  可实现IIndicator接口自定义
        .setIndicator(new CircleIndexIndicator())
        //设置进度条样式  默认DefaultProgress 可实现IProgress接口自定义
        .setProgress(new DefaultProgress())
        //在显示原图之前显示的图片  如果你列表使用Glide加载  这里也使用Glide加载
        .loadPhotoBeforeShowBigImage((sketchImageView, position12) -> sketchImageView.displayImage(normalImageUlr[holder.getAdapterPosition()]))
        .start();
视频播放本身不提供自动识别大小的功能,视频部分全有开发者自己决定
//视频模式
Diooto diooto = new Diooto(context)
        .urls(normalImageUlr[position])
        .position(holder.getAdapterPosition())
        .views(holder.srcImageView)
        .type(DiootoConfig.VIDEO)
        //提供视频View 注意这里只需要提供对象
        .onProvideVideoView(() -> new VideoView(context))
        //显示视频加载之前的缩略图
        .loadPhotoBeforeShowBigImage((sketchImageView, position13) -> sketchImageView.displayImage(normalImageUlr[holder.getAdapterPosition()]))
        //动画到最大化时的接口
        .onVideoLoadEnd(dragDiootoView -> {
            VideoView videoView = (VideoView) dragDiootoView.getContentView();
            ControlPanel simpleControlPanel = new ControlPanel(context);
            simpleControlPanel.setOnClickListener(v -> dragDiootoView.backToMin());
            videoView.setControlPanel(simpleControlPanel);
            videoView.setUp("http://bmob-cdn-982.b0.upaiyun.com/2017/02/23/266454624066f2b680707492a0664a97.mp4");
            videoView.start();
            dragDiootoView.notifySize(1920, 1080);
            MediaPlayerManager.instance().setScreenScale(ScaleType.SCALE_CENTER_CROP);
        })
        //到最小状态的接口
        .onFinish(dragDiootoView -> MediaPlayerManager.instance().releasePlayerAndView(context))
        .start();

长图/gif 等图片处理方案来自 sketch

diooto's People

Contributors

mikaelzero avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.