Coder Social home page Coder Social logo

chayanforyou / marqueetextview-android Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.54 MB

A marquee view supporting both RTL and LTR.

License: Apache License 2.0

Kotlin 100.00%
horizontal-scrolling marquee marqueetext marqueeview scrolling-text android library

marqueetextview-android's Introduction

MarqueeTextView

Use MarqueeTextView to display rtl (or ltr) text with proper movement direction.

Based on open source lib: https://github.com/shachar-oren/android-rtlmarqueeview

Preview

preview_dark

Integration

Add the dependency:

dependencies {
    implementation 'io.github.chayanforyou:marquee:1.0.0'
}

Usage

Example usage in XML:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="16dp"
    tools:context=".MainActivity">

    <io.github.chayanforyou.marquee.MarqueeTextView
        android:id="@+id/rmv_marquee"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scrollbars="none"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:marqueeEndWaitTicks="30"
        app:marqueeFadeToColor="?android:windowBackground"
        app:marqueeFontFamily="@font/ubuntu_regular"
        app:marqueeIsLooping="true"
        app:marqueeLoops="0"
        app:marqueeStartWaitTicks="50"
        app:marqueeText="@string/sample_text"
        app:marqueeTextColor="?android:colorAccent"
        app:marqueeTextSize="18sp" />

</androidx.constraintlayout.widget.ConstraintLayout>

Layout direction is checked internally. To manually update it, call updateRtl().

Public methods

void setText(String text)
String getText()

void setTextColor(int color)
int getTextColor()

void setTextSize(float size)
float getTextSize()

void setTypeface()
Typeface getTypeface()

void setFadeToColor(int color)
int getFadeToColor()

void setLooping(boolean looping)
boolean getLooping()

void setLoops(int loops)
int getLoops()

void setStartWaitTicks(int ticks)
int getStartWaitTicks()

void setEndWaitTicks(int ticks)
int getEndWaitTicks()

License

Copyright 2024 Chayan Mistry

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

marqueetextview-android's People

Contributors

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