Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

仿网易星球浮动小球、仿蚂蚁森林动效

Notifications You must be signed in to change notification settings

lufan0820/StarFloatView

Repository files navigation

StarFloatView

示例:

截图

支持自定义背景,自定义小球颜色、大小、以及默认小球文字

使用方法:

在工程目录的build.gradle中添加JitPack.io的代码仓库地址

allprojects {
 repositories {
 ...
 maven { url 'https://jitpack.io' }
 }
}

项目目录中的build.gradle中添加依赖

ependencies {
 compile 'com.github.ErChenZhang:StarFloatView:v1.1'
}

在布局文件中使用

  1. childTextColor:小球文字颜色大小,默认白色

  2. defaultViewText:默认小球显示文字

  3. parentViewBackground:整体背景

  4. childViewBackground:小球背景

  5. chidTextSize:小球文字大小,默认6sp

    设置数据

    当前数据支持int、long、float、double

     List<Float> list = new ArrayList<>();
     list.add((float) 1.245);
     list.add((float) 1.567);
     list.add((float) 0.261);
     floatview.setList(list);
    

小球点击回调(value.floatValue()对应传入的list类型)

 floatview.setOnItemClickListener(new FloatView.OnItemClickListener() {
 @Override
 public void itemClick(int position, Number value) {
 Toast.makeText(MainActivity.this, "当前是第"+position+"个,其值是"+value.floatValue(), Toast.LENGTH_SHORT).show();
 }
 });

About

仿网易星球浮动小球、仿蚂蚁森林动效

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%

AltStyle によって変換されたページ (->オリジナル) /