Giter Site home page Giter Site logo

hitblockrefresh's Introduction

HitBlockRefresh

有趣好玩的下拉刷新库, 你还记得小时候打的黑白掌上游戏机么?

Preview

Usage

布局文件中:
<com.zuck.swipe.hitblockrefresh.view.HitBlockRefreshView
    android:id="@+id/refresh_hit_block"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:block_horizontal_num="3"
    app:ball_speed="medium">

    <ListView
        android:id="@+id/list_view"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:scrollbars="none" >
    </ListView>
</com.zuck.swipe.hitblockrefresh.view.HitBlockRefreshView>

Activity中:
    refreshView = (HitBlockRefreshView) findViewById(R.id.refresh_hit_block);

    listView = (ListView) findViewById(R.id.list_view);

    arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, createDate());

    listView.setAdapter(arrayAdapter);
    refreshView.setOnRefreshListener(new HitBlockRefreshView.HitBlockRefreshListener() {
        @Override
        public void onRefreshing() {
            try {
                // 模拟网络请求耗时动作
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            mHandler.sendEmptyMessage(0);
        }
    });

当刷新完毕后需要在主线程中调用:
    refreshView.finishRefreshing();

Attributes

block_horizontal_num :矩形块列数
ball_speed : 小球弹射速度
block_color : 矩形块颜色
ball_color : 小球颜色
racket_color : 挡板颜色

#Thanks UI设计来自于:https://github.com/dasdom/BreakOutToRefresh

#Licence Hitomis

hitblockrefresh's People

Contributors

hitomis avatar

Watchers

James Cloos avatar Nikhil 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.