GithubHelp home page GithubHelp logo

lyricindicator's Introduction

lyricindicator

仿今日头条颜色渐变导航栏指示器 本控件是对lyricTextView的封装应用
详解:自定义View之仿今日头条颜色渐变指示器导航栏
代码很少,建议直接复制

效果图

image

使用方法

第一步:

<com.example.lyricindicator.LyricIndicator
        android:id="@+id/indicator"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#11000000"
        app:item_padding="7dp"
        app:text_size="20sp"
        app:default_color="#000000"
        app:changed_color="#ff0000">
        </com.example.lyricindicator.LyricIndicator>
可使用的属性有:
        text_size 字体大小
        default_color默认颜色
        changed_color渐变颜色
        字体的左右上下padding:
        item_padding_l
        item_padding_r
        item_padding_t
        item_padding_b
        item_padding

      '注意':IDE可能还会列出text、progress、direction这些属性,这些属性属于lyricTextView,设置了也是无效的。
      第二步:与viewpager进行关联:

 lyricIndicator = (LyricIndicator) findViewById(R.id.indicator);
 lyricIndicator.setupWithViewPager(mViewPager);

注意:ViewPager的adapter要实现 public CharSequence getPageTitle(int position)作为每一页对应的title

lyricindicator's People

Contributors

ccy0122 avatar

Stargazers

天譩-倾仙 avatar Forget avatar Bad leadership avatar  avatar MAY3AM avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

msdgwzhy6

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.