Code Monkey home page Code Monkey logo

interlude's Introduction

Interlude

提供Loading动画的DialogFragment.主要目的是用于替代ProgressDialog
动画由AVLoadingIndicatorView实现

使用方法

compile 'com.twisty:interlude:1.0.2'

//construct
var interlude: Interlude = Interlude(supportFragmentManager)

//config
with(interlude) {
           dim = 0.1F                                            //dialog弹出时背景变暗程度
           indicatorColorResource = android.R.color.darker_gray  //progress的颜色
           backgroundResource = android.R.color.transparent      //dialog的背景 color或者drawable
           indicatorType = IndicatorType.BallPulseIndicator      //progress的类型
           isCancelable = true                                   //是否可以取消
           canceledOnTouchOutside = false                        //点击界外是否取消
           cancelCallback = {
               Log.i(localClassName, "Cancel")
           }                                                     //取消回调
           dismissCallback = {
               Log.i(localClassName, "Dismiss")
           }                                                     //消失回调,cancel也会执行dismiss
       }

//show
interlude.show()


//dismiss
interlude.dismiss()

IndicatorType 对应AVLoadingIndicatorView的各个Indicator

enum class IndicatorType {
            BallPulseIndicator,
            BallGridPulseIndicator,
            BallClipRotateIndicator,
            BallClipRotatePulseIndicator,

            SquareSpinIndicator,
            BallClipRotateMultipleIndicator,
            BallPulseRiseIndicator,
            BallRotateIndicator,

            CubeTransitionIndicator,
            BallZigZagIndicator,
            BallZigZagDeflectIndicator,
            BallTrianglePathIndicator,

            BallScaleIndicator,
            LineScaleIndicator,
            LineScalePartyIndicator,
            BallScaleMultipleIndicator,

            BallPulseSyncIndicator,
            BallBeatIndicator,
            LineScalePulseOutIndicator,
            LineScalePulseOutRapidIndicator,

            BallScaleRippleIndicator,
            BallScaleRippleMultipleIndicator,
            BallSpinFadeLoaderIndicator,
            LineSpinFadeLoaderIndicator,

            TriangleSkewSpinIndicator,
            PacmanIndicator,
            BallGridBeatIndicator,
            SemiCircleSpinIndicator,
}

interlude's People

Contributors

twisty1988 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

yuritam

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.