Auto scrolling (horizontal running) TextView

Auto scrolling (horizontal running) TextView - Hello Friend GENERAL INFO FOR ANDROID DEVELOPMENT, In the article you read this time with the title Auto scrolling (horizontal running) TextView, We have prepared this article for you to read and retrieve information there in. Hopefully the contents of postings Artikel TextView, We write this you can understand. Alright, good read.

The Title : Auto scrolling (horizontal running) TextView
link : Auto scrolling (horizontal running) TextView

Read also


Auto scrolling (horizontal running) TextView


It's follow-up post about my old post of "Implement auto-running TextView", to make a TextView horizontal scrolling automatically.

This video show how it tested on Android emulator running Android 7.0 Nougat API 24, in Multi-Window Mode also.


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:orientation="vertical"
tools:context="com.blogspot.android_er.androidautotextview.MainActivity">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:layout_gravity="center_horizontal"
android:autoLink="web"
android:text="http://android-er.blogspot.com/"
android:textStyle="bold"/>

<TextView
android:id="@+id/scrollingtext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="40dp"
android:background="#D0D0D0"
android:text="http://android-er.blogspot.com/"

android:focusable="true"
android:focusableInTouchMode="true"
android:singleLine="true"
android:scrollHorizontally="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit ="marquee_forever"
/>

</LinearLayout>


And set it selected in Java code.
package com.blogspot.android_er.androidautotextview;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

TextView scrollingText;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
scrollingText = (TextView)findViewById(R.id.scrollingtext);
scrollingText.setSelected(true);

}
}





Thus Article Auto scrolling (horizontal running) TextView

The End Article Auto scrolling (horizontal running) TextView This time, hopefully can give benefits to all of you. well, see you in posting other articles.

You are now reading the article Auto scrolling (horizontal running) TextView with the link address http://xorislogo.blogspot.com/2016/08/auto-scrolling-horizontal-running.html

0 Response to "Auto scrolling (horizontal running) TextView"

Post a Comment