Git Product home page Git Product logo

verticalmarqueetextview's Introduction

This is an Android class to create a vertical textview marquee e.g. vertical autoscrolling textview. It may not be the best but it is what I came up with after several tries to get something working. Modify it as needed.

Usage:

Add VerticalMarqueeTextView.java (VMTV) to your project.
Change the VMTV package to that of your project.
Create an instance of the VMTV class.
In the onCreate() method instantiate your instance of the VMTV class using findViewByID().
 optional: call the pauseMarquee() method to pause it until Activity starts.
           use the setDuration() and or setPixelYOffset() method(s) to adjust the speed and scrolling of your VMTV.
           
In your xml layout use the full package name to create your VMTV within the view as you would with any other TextView and set your properties.
	NOTE: It will error in the Graphical Layout. You can try using View.isInEditMode() if you wish but it isn't needed.
 
You should make a call to the resumeMarquee() method in the Activities onResume() method. Likewise a call to pauseMarquee() should be made in the Activities onPause() method.

There should be a call to stopMarquee() in the Activities onDestroy() method.
NOTE: Once the marquee has been stopped it cannot be restarted. This is due to the behavior of the AsynTask within the VMTV class.

NOTE: If you add additional padding to the TextView being passed to the VMTV then you may need to modify the textViewNotDrawn() method within the subclassed AsynTask of the VMTV class in order to get the proper pixel height of your TextView.

See Example.java, main.xml, strings.xml, and VerticalMarqueeTextView.java. 

verticalmarqueetextview's People

Contributors

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