GithubHelp home page GithubHelp logo

hhy5277 / autoverticaltextview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paradoxie/autoverticaltextview

0.0 1.0 0.0 100 KB

垂直滚动的textview,继承自TextSwitcher,抽出一个依赖库供以后备用

License: Apache License 2.0

Java 100.00%

autoverticaltextview's Introduction

AutoVerticalTextview

垂直滚动的textview,继承自TextSwitcher,抽出一个依赖库供以后备用

配置方法

项目build.gradle文件内:

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

module内build.gradle添加依赖:

dependencies {
  	        compile 'com.github.paradoxie:AutoVerticalTextview:0.1'
  	}

使用方法

xml文件里:

    <com.paradoxie.autoscrolltextview.VerticalTextview
            android:id="@+id/text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
           />

activity里:

        TextView.setTextList(titleList);//加入显示内容,集合类型
        TextView.setText(26, 5, Color.RED);//设置属性,具体跟踪源码
        TextView.setTextStillTime(3000);//设置停留时长间隔
        TextView.setAnimTime(300);//设置进入和退出的时间间隔
        //对单条文字的点击监听
        TextView.setOnItemClickListener(new VerticalTextview.OnItemClickListener() {
                    @Override
                    public void onItemClick(int position) {
                    // TO DO
                    }
                });

    //开始滚动
    @Override
        protected void onResume() {
            super.onResume();
            TextView.startAutoScroll();
        }
    //停止滚动
    @Override
        protected void onPause() {
            super.onPause();
            TextView.stopAutoScroll();
        }

autoverticaltextview's People

Contributors

paradoxie avatar yourzeromax 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.