Git Product home page Git Product logo

starfloatview's Introduction

StarFloatView

示例:

截图

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

使用方法:

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

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

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

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

在布局文件中使用

     <com.smoke.zhangchen.floatviewlib.FloatView
        android:id="@+id/float_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content
        app:childTextColor="#ff0000"
        app:defaultViewText="正在生成中"
        app:chidTextSize="6sp"
        app:parentViewBackground="@mipmap/star_bg"
        app:childViewBackground="@drawable/shape_circle">
  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();
        }
    });

starfloatview's People

Contributors

erchenzhang avatar

Watchers

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