Coder Social home page Coder Social logo

superlike's Introduction

SuperLike

仿今日头条点赞喷射表情动画

主要用于点赞防抖事件的交互提示,这里只提供交互View 防抖功能可以根据Rx自行实现

演示

image image

使用

compile 'com.sum.slike:library:0.2.1'

参数含义

自定义属性名字 参数含义
eruption_element_amount 一次喷射的element数量
max_eruption_total 最大同时喷射次数
show_emoji 是否显示Emoji表情喷射动画
show_text 是否显示Combo文字

代码演示

1.基础样式(666 + 文字)

    BitmapProvider.Provider provider = new BitmapProvider.Builder(this).build();
    superLikeLayout.setProvider(provider);
    superLikeLayout.launch(x, y);

image

2.自定义样式(随机emoji + 自定义文字)

  • DrawableArray是喷射Emoji的Drawable。
  • NumberDrawableArray是连续点赞数字Drawable(0~10)
  • LevelDrawableArray是连续点赞等级Drawable(目前分为3个等级 010, 1020, 20~30+)
	BitmapProvider.Provider provider = new BitmapProvider.Builder(this)
                        .setDrawableArray(new int[]{R.mipmap.emoji_1, R.mipmap.emoji_2, R.mipmap.emoji_3, R.mipmap.emoji_4, R.mipmap.emoji_5, R.mipmap.emoji_6,
                                R.mipmap.emoji_7, R.mipmap.emoji_8, R.mipmap.emoji_9, R.mipmap.emoji_10, R.mipmap.emoji_11, R.mipmap.emoji_12, R.mipmap.emoji_13,
                                R.mipmap.emoji_14, R.mipmap.emoji_15, R.mipmap.emoji_16, R.mipmap.emoji_17, R.mipmap.emoji_18, R.mipmap.emoji_19, R.mipmap.emoji_20})
                        .setNumberDrawableArray(new int[]{R.mipmap.multi_digg_num_0, R.mipmap.multi_digg_num_1, R.mipmap.multi_digg_num_2, R.mipmap.multi_digg_num_3,
                                R.mipmap.multi_digg_num_4, R.mipmap.multi_digg_num_5, R.mipmap.multi_digg_num_6, R.mipmap.multi_digg_num_7,
                                R.mipmap.multi_digg_num_8, R.mipmap.multi_digg_num_9})
                        .setLevelDrawableArray(new int[]{R.mipmap.multi_digg_word_level_1, R.mipmap.multi_digg_word_level_2, R.mipmap.multi_digg_word_level_3})
                        .build();
    superLikeLayout.setProvider(provider);
    superLikeLayout.launch(x, y);

image

联系方式

superlike's People

Contributors

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