Git Product home page Git Product logo

bookloadingview's Introduction

BookLoadingView

不知道有什么用的加载页面

起因

有一天设计拿了一张gif

给前端的说实现这么一个加载动画,要求代码实现,不能用gif。前端当时那个一脸不爽的表情我记忆犹新←_← 由于最近app开发也完成了本人也是比较爱好动画之类的东西,所以我就想实现一个android端的加载图。在经过1个上午与2个下午的时间终于做出来了一个不知道有什么用的加载动画第一版本。文字动画使用的是[JumpingBeans](https://github.com/frakbot/JumpingBeans)

如何使用

使用起来也是非常的方便快捷
在xml中:

<com.wang.bookloading.widget.BookLoadingView
    android:id="@+id/book_loading_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    app:blv_tickColor="@color/light_green500"
    app:blv_tickStrokeWidth="4dp"
    app:blv_lineColor="@color/grey500"
    app:blv_lineStrokeWidth="8dp">

</com.wang.bookloading.widget.BookLoadingView>  

java中只要:

@OnClick(R.id.show_btn)
public void onMShowBtnClicked() {
    //start loading
    mBookLoadingView.setVisibility(View.VISIBLE, 0);
}

@OnClick(R.id.hide_btn)
public void onMHideBtnClicked() {
    //stop loading
    mBookLoadingView.setVisibility(View.GONE);
}

Styleable

name format description
blv_delay integer 动画开始的延迟
blv_firstDuration integer path动画的时间
blv_textDuration integer 文字动画的时间
blv_pageDuration integer 翻页动画的时间
blv_startColor color 被翻页面的开始时和结束时的颜色
blv_endColor color 被翻页面的中间时的颜色
blv_tickColor color 左边√的颜色
blv_tickStrokeWidth dimension 左边√的粗细
blv_lines float 右边线条书
blv_lineColor color 右边线条颜色
blv_lineStrokeWidth dimension 右边线条的粗细
blv_linePadding dimension 右边线条的间隔大小
blv_textSize dimension 底部文字大小
blv_textColor color 底部文字颜色
blv_text string 底部文字内容

TODO

  1. 底部文字动画的修改(现有的想法是一个文字就是一个view,然后进行动画处理。但是个人感觉这样很蠢。有好的想法可提issue给我。thanks)

DONE

  1. 翻页时被翻页面厚度增加
  2. 宽度自定义

bookloadingview's People

Contributors

kingwang666 avatar

Watchers

 avatar  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.