Git Product home page Git Product logo

scaleruler's Introduction

#博客: http://blog.csdn.net/zbjdsbj/article/details/51180011 ScaleRuler 身高、体重横向滚动刻度尺选择器

更新: 1、增加体重支持小数点的选择方式的自定义View; 2、增加一个倾斜的TextView的自定义View实现; 3、增加一些辅助工具类

使用:

更新:

<com.lost.zou.scaleruler.view.DecimalScaleRulerView
            android:id="@+id/ruler_weight"
            android:layout_width="match_parent"
            android:layout_height="58dp"
            android:layout_alignParentBottom="true" />
            
            
mWeightRulerView.setParam(DrawUtil.dip2px(10), DrawUtil.dip2px(32), DrawUtil.dip2px(24),
                DrawUtil.dip2px(14), DrawUtil.dip2px(9), DrawUtil.dip2px(12));
        mWeightRulerView.initViewParam(mWeight, 20.0f, 200.0f, 1);
        mWeightRulerView.setValueChangeListener(new DecimalScaleRulerView.OnValueChangeListener() {
            @Override
            public void onValueChange(float value) {
                mWeightValueTwo.setText(value + "kg");
                mWeight = value;
            }
        });
<com.lost.zou.scaleruler.view.SlantedTextView
            android:layout_width="48dp"
            android:layout_height="48dp"
            app:slantedBackgroundColor="@color/colorPrimary"
            app:slantedLength="28dp"
            app:slantedMode="left"
            app:slantedText="体重"
            app:slantedTextColor="#ffffff"
            app:slantedTextSize="14sp" />
<com.lost.zou.scaleruler.view.ScaleRulerView
        android:id="@+id/scaleWheelView_height"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:layout_marginTop="36dp"
        android:background="@android:color/white"
        android:paddingLeft="30dp"
        android:paddingRight="30dp" />

效果图如下: image

image

image

image

image

scaleruler's People

Contributors

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