Skip to content

Android running text library that is easy to customize and easy to set up.

License

Notifications You must be signed in to change notification settings

eriffanani/RunningTextView

Repository files navigation

Runnning TextView

A running text library that is easy to customize and easy to set up.

Installation

settings.gradle.kts

dependencyResolutionManagement {
    repositories {
        maven { url = uri("https://jitpack.io") }
    }
 }

build.gradle(Module: app)

implementation 'com.github.eriffanani:RunningTextView:1.1.0'

build.gradle.kts(Module: app)

implementation("com.github.eriffanani:RunningTextView:1.1.0")

How To Use

layout.xml

<com.erif.library.RunningTextView
    android:id="@+id/txtRunning"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textColor="@android:color/black"
    android:background="#ECDE68"
    android:paddingTop="5dp"
    android:paddingBottom="5dp"
    android:text="@string/loremIpsum"
    android:textSize="24sp"
    app:scrollDuration="20000" // Default is 10 seconds
    app:scrollAutoPlay="true" // Default is false
    />

Main.java

RunningTextView runningText = findViewById(R.id.txtRunning);
runningText.setDuration(1); // 1 Minutes (Integer)
runningText.setDuration(10.0); // 10 Seconds (Double)
runningText.setDuration(10000L); // 10 Seconds (Long)

// Actions 
runningText.start();
runningText.pause();
runningText.resume();

Main.kt (Kotlin)

val runningText: RunningTextView = findViewById(R.id.txtRunning);
runningText.setDuration(1) // 1 Minutes (Integer)
runningText.setDuration(10.0) // 10 Seconds (Double)
runningText.duration = 10000L // 10 Seconds (Long)

// Actions 
runningText.start()
runningText.pause()
runningText.resume()

Licence

Copyright 2023 Mukhammad Erif Fanani
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.