All Projects → MikaelZero → Mojito

MikaelZero / Mojito

微信、bilibili大图、长图、gif、视频、自定义view的转场效果,The transition effect of wechat, bilibili large image, long image, GIF, video and custom view

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Mojito

Dragscroll
micro library for drag-n-drop scrolling style
Stars: ✭ 989 (-7.4%)
Mutual labels:  drag
Aimage
An animated gif & apng engine for iOS in Swift. Have a great performance on memory and cpu usage.
Stars: ✭ 1,014 (-5.06%)
Mutual labels:  gif
Uploader
A lightweight and very configurable jQuery plugin for file uploading using ajax(a sync); includes support for queues, progress tracking and drag and drop.
Stars: ✭ 1,042 (-2.43%)
Mutual labels:  drag
Sockeye
Sequence-to-sequence framework with a focus on Neural Machine Translation based on Apache MXNet
Stars: ✭ 990 (-7.3%)
Mutual labels:  transformer
Vue Drag Resize
Vue Component for resize and drag elements
Stars: ✭ 1,007 (-5.71%)
Mutual labels:  drag
Uiutil
UIUtil for Android, Lyrics, Tick animations, Comparisons, Satellite menus, Praise, Slide buttons, TAB indicators, Contact sorting, Drag sorting, Skidding deletes, Shadow effects, RecyclerView nesting RecyclerView, Map list Poi/Drawer effects, Progress settings, Clock set, Damping, Progress, Album, Snap, Progress, CircleDownload, AdvertSwitcher, Carousel ad, FlowLayout, Tag...; 歌词控件、打勾动画、对比、卫星菜单、点赞、滑动按钮、TAB指示器、联系人排序、拖曳排序、侧滑删除、阴影效果.、RecyclerView嵌套RecyclerView.、地图列表Poi/抽屉效果、进度设置、时钟设置、滑动阻尼、相册媒体快照、圆形下载进度,轮播广告, 流式布局,标签...
Stars: ✭ 1,018 (-4.68%)
Mutual labels:  drag
Jazz transformer
Transformer-XL for Jazz music composition. Paper: "The Jazz Transformer on the Front Line: Exploring the Shortcomings of AI-Composed Music through Quantitative Measures", ISMIR 2020
Stars: ✭ 36 (-96.63%)
Mutual labels:  transformer
Machine Translation
Stars: ✭ 51 (-95.22%)
Mutual labels:  transformer
Vue Slicksort
A set of vue mixins to turn any list into an animated, touch-friendly, sortable list ✌️
Stars: ✭ 1,010 (-5.43%)
Mutual labels:  drag
Gpt2 French
GPT-2 French demo | Démo française de GPT-2
Stars: ✭ 47 (-95.6%)
Mutual labels:  transformer
Gifmagic
💈 Gif maker and extractor in Swift
Stars: ✭ 38 (-96.44%)
Mutual labels:  gif
Gif rain code
生成gif数字雨动态头像
Stars: ✭ 40 (-96.25%)
Mutual labels:  gif
Bentools Etl
PHP ETL (Extract / Transform / Load) library with SOLID principles + almost no dependency.
Stars: ✭ 45 (-95.79%)
Mutual labels:  transformer
Moel
MoEL: Mixture of Empathetic Listeners
Stars: ✭ 38 (-96.44%)
Mutual labels:  transformer
Gifsee.js
A modern, vanilla JavaScript gif previewer and loader.
Stars: ✭ 48 (-95.51%)
Mutual labels:  gif
Openap
Open Aircraft Performance Model and Python Toolkit
Stars: ✭ 37 (-96.54%)
Mutual labels:  drag
Vue Drag Drop Sort Demo
Vue demo for drag drop sort (for Vue.js 2.x see https://github.com/kenberkeley/vue2-drag-and-drop-demo)
Stars: ✭ 42 (-96.07%)
Mutual labels:  drag
Ar Gif
Easy to use augmented reality web components
Stars: ✭ 52 (-95.13%)
Mutual labels:  gif
Vue Data Board
A Data Analysis Board in Vue.
Stars: ✭ 1,046 (-2.06%)
Mutual labels:  drag
Format parser
file metadata parsing, done cheap
Stars: ✭ 46 (-95.69%)
Mutual labels:  gif

mojito Language Language Version Size

English

二维码下载体验

通过视频查看效果

SAMPLE VIDEO LINK

动图效果

开始


添加 dependencies

allprojects {
    repositories {
        maven { url 'https://dl.bintray.com/mikaelzero/maven'}
    }
}

implementation 'net.mikaelzero.mojito:core:VERSION'

//support long image and gif with Sketch
implementation 'net.mikaelzero.mojito:SketchImageFactory:VERSION'

//load with fresco
implementation 'net.mikaelzero.mojito:FrescoImageLoader:VERSION'
//load with glide
implementation 'net.mikaelzero.mojito:GlideImageLoader:VERSION'

初始化

// in your application
Mojito.initialize(
            GlideImageLoader.with(this),
            SketchImageLoadFactory()
        )

//or

//YourMojitoConfig:IMojitoConfig
Mojito.initialize(
            GlideImageLoader.with(this),
            SketchImageLoadFactory(),
            YourMojitoConfig()
        )

开始使用

Mojito.with(context)
    .urls(SourceUtil.getSingleImage())
    .views(singleIv)
    .start()

使用

RecyclerView

Mojito.with(context)
    .urls(SourceUtil.getNormalImages())
    .position(position)
    .views(recyclerView, R.id.srcImageView)
    .autoLoadTarget(false)
    .setProgressLoader(object : InstanceLoader<IProgress> {
        override fun providerInstance(): IProgress {
            return DefaultPercentProgress()
        }
    })
    .setOnMojitoListener(object : SimpleMojitoViewCallback() {
        override fun onLongClick(fragmentActivity: FragmentActivity?, view: View, x: Float, y: Float, position: Int) {
            Toast.makeText(context, "long click", Toast.LENGTH_SHORT).show()
        }

        override fun onClick(view: View, x: Float, y: Float, position: Int) {
            Toast.makeText(context, "tap click", Toast.LENGTH_SHORT).show()
            }
        })
    .setIndicator(NumIndicator())
    .start()

单个 View

 Mojito.with(context)
    .urls(SourceUtil.getSingleImage())
    .views(singleIv)
    .start()

无 View

 Mojito.with(context)
    .urls(SourceUtil.getNormalImages())
    .start()

视频 View or 视频/图片 混合View

Mojito.with(context)
    .urls(SourceUtil.getVideoImages(), SourceUtil.getVideoTargetImages())
    .setMultiTargetEnableLoader(object : MultiTargetEnableLoader {
        override fun providerEnable(position: Int): Boolean {
            return position != 1
        }
    })
    .setMultiContentLoader(object : MultiContentLoader {
        override fun providerLoader(position: Int): ImageViewLoadFactory {
            return if (position == 1) {
                ArtLoadFactory()
            } else {
                SketchImageLoadFactory()
            }
        }
    })
    .position(position)
    .views(recyclerView, R.id.srcImageView)
    .start()

Callback回调

 abstract class SimpleMojitoViewCallback : OnMojitoListener {
    // image click
    override fun onClick(view: View, x: Float, y: Float, position: Int) {

    }

    //image long press
    override fun onLongClick(fragmentActivity: FragmentActivity?, view: View, x: Float, y: Float, position: Int) {
    }

    //end of min image to max image 
    override fun onShowFinish(mojitoView: MojitoView, showImmediately: Boolean) {
    }

    //activity finish,backToMin,single click
    override fun onMojitoViewFinish() {
    }

    //when you drag your image 
    override fun onDrag(view: MojitoView, moveX: Float, moveY: Float) {
    }

    //the ratio of long image when you scroll
    override fun onLongImageMove(ratio: Float) {
    }
}

API

Name desc
url(src,target) 设置缩略图和原图url数据
position 点击的位置
views 1. recylclerView,imageViewId
2. single view
3. multi views
autoLoadTarget 默认为true,如果你设置了原图的url并且设置了autoLoadTarget(false)
你需要使用setFragmentCoverLoader来自定义view
setProgressLoader 当你设置了 autoLoadTarget false 才会生效
setIndicator 可以选择 NumIndicator 或者 CircleIndexIndicator
setActivityCoverLoader 自定义Activity的覆盖层view
setMultiContentLoader 如果使用视频和图片混合模式,需要设置 ImageViewLoadFactory

Thanks

sketch

BigImageViewer

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].