I'm rosenpin
I make stuff
Many of my older projects moved to @rosenpin-deprecated so check it out if you're looking for something that used to be here
A TextView that changes its content automatically every few seconds
I'm rosenpin
I make stuff
Many of my older projects moved to @rosenpin-deprecated so check it out if you're looking for something that used to be here
I miss a function to fade into text of a specific position in the array
For example .setShuffle
or app:shuffle="true"
then the strings will appear in a random order
List of textviews are not displaying for same period of time. some are fading slowly and some are fast, The last text of the list faded quickly.
Hello do you have this nuGet package for xamarin apps?
java.lang.NullPointerException at com.tomer.fadingtextview.FadingTextView.startAnimation(FadingTextView.java:269) at com.tomer.fadingtextview.FadingTextView.resume(FadingTextView.java:59) at com.tomer.fadingtextview.FadingTextView.onAttachedToWindow(FadingTextView.java:101)
The setTimeout in java doesn't display and i can't also use the app:timeout on xml, kindly advise
If you implement TimeUnits
FTV.setTimeout(1,TimeUnit.SECONDS);
https://developer.android.com/reference/java/util/concurrent/TimeUnit.html
<androidx.drawerlayout.widget.DrawerLayout 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:orientation="vertical"
android:layout_height="match_parent"
android:id="@+id/drawerid"
android:background="@color/background"
tools:context=".MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Main content -->
<FrameLayout
android:id="@+id/framelayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/action_bar"
android:layout_marginTop="60dp"
android:layout_marginBottom="48dp"
>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom">
<include layout="@layout/bottom_navigation"
android:id="@+id/bottom_view"
android:layout_height="wrap_content"
android:layout_width="match_parent" />
</FrameLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toStartOf="@id/d_layout"
android:layout_alignParentStart="true"
android:layout_alignBottom="@id/d_layout"
android:layout_marginBottom="5dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout2"
android:layout_width="0dp"
android:layout_height="40dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ProgressBar
android:id="@+id/progress_bar"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10sp"
android:indeterminateDrawable="@drawable/bg_progress_bar_green"
android:max="100"
android:progress="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/clicks"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/step1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginVertical="5dp"
android:background="@drawable/radius_button_bg"
android:gravity="center"
android:text="1"
android:textColor="@color/whiteTextColor"
app:layout_constraintBottom_toBottomOf="@id/progress_bar"
app:layout_constraintStart_toStartOf="@id/progress_bar"
app:layout_constraintTop_toTopOf="@id/progress_bar" />
<TextView
android:id="@+id/step2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="5dp"
android:background="@drawable/radius_button_bg"
android:gravity="center"
android:text="25"
android:textColor="@color/whiteTextColor"
app:layout_constraintBottom_toBottomOf="@id/progress_bar"
app:layout_constraintStart_toEndOf="@id/step1"
app:layout_constraintEnd_toStartOf="@id/step3"
app:layout_constraintTop_toTopOf="@id/progress_bar" />
<TextView
android:id="@+id/step3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="5dp"
android:background="@drawable/radius_button_bg"
android:gravity="center"
android:text="50"
app:layout_constraintEnd_toStartOf="@id/step4"
android:textColor="@color/whiteTextColor"
app:layout_constraintBottom_toBottomOf="@id/progress_bar"
app:layout_constraintStart_toEndOf="@id/step2"
app:layout_constraintTop_toTopOf="@id/progress_bar" />
<TextView
android:id="@+id/step4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="5dp"
android:background="@drawable/radius_button_bg"
android:gravity="center"
android:text="100"
app:layout_constraintEnd_toEndOf="@id/progress_bar"
android:textColor="@color/whiteTextColor"
app:layout_constraintBottom_toBottomOf="@id/progress_bar"
app:layout_constraintTop_toTopOf="@id/progress_bar" />
<com.tomer.fadingtextview.FadingTextView
app:timeout="2000"
android:layout_width="65dp"
android:layout_height="wrap_content"
android:id="@+id/clicks"
android:text="@array/hello"
android:gravity="center"
app:layout_constraintBottom_toBottomOf="@id/progress_bar"
app:layout_constraintStart_toEndOf="@id/progress_bar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/progress_bar"
android:textStyle="bold"
android:textColor="#311B92"
android:textSize="16sp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:id="@+id/d_layout"
android:elevation="5dp"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="15dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="40dp"
android:layout_height="wrap_content"
android:background="@drawable/coin_outline_view_bg"
android:elevation="15dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="3dp"
android:paddingEnd="17dp"
android:paddingStart="5dp"
android:paddingTop="3dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:text="💰"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:textStyle="bold"
/>
<ProgressBar
android:id="@+id/process_bar"
android:layout_width="40dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="@+id/coin_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="0"
android:textColor="@color/darkTextColor"
android:textSize="18sp"
android:textStyle="bold"
android:visibility="gone"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="43dp"
android:layout_height="43dp"
android:layout_marginBottom="15dp"
android:layout_marginTop="8dp"
android:background="@drawable/bg_fab"
android:elevation="15dp"
android:layout_marginEnd="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/drawer_icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="3dp"
android:clickable="true"
android:focusable="true"
android:src="@drawable/person"
app:civ_border_color="@color/colorAccent"
app:civ_border_width="1dp"
app:civ_circle_background_color="@color/whiteTextColor" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/coinButton"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="65dp"
android:clickable="true"
android:theme="@style/MyMaterialTheme"
app:fabCustomSize="50dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:scaleType="center"
android:visibility="gone"
app:tint="@null"
app:srcCompat="@drawable/coin_white"
android:backgroundTint="@color/gradientLightBlue"
android:focusable="true"
android:contentDescription="Survey Offer" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:id="@+id/view"
android:orientation="vertical" />
</RelativeLayout>
<com.rom4ek.arcnavigationview.ArcNavigationView
android:id="@+id/nav_view_right"
android:layoutDirection="ltr"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:background="@android:color/white"
android:fitsSystemWindows="true"
app:arc_cropDirection="cropOutside"
app:arc_width="52dp"
app:itemBackground="@android:color/white"
app:menu="@menu/main_activity_actions"/>
</androidx.drawerlayout.widget.DrawerLayout>
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.curiousminds.ytcreatorszone/com.curiousminds.ytcreatorszone.MainActivity}: android.view.InflateException: Binary XML file line #2 in com.curiousminds.ytcreatorszone:layout/activity_main: Attempt to read from null array
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3704)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3871)
at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5809)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5712)
at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:140)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:100)
at android.app.ClientTransactionHandler.executeTransaction(ClientTransactionHandler.java:58)
at android.app.ActivityThread.handleRelaunchActivityLocally(ActivityThread.java:5765)
at android.app.ActivityThread.access$3400(ActivityThread.java:292)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2318)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:257)
at android.app.ActivityThread.main(ActivityThread.java:8239)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006)
Caused by: android.view.InflateException: Binary XML file line #2 in com.curiousminds.ytcreatorszone:layout/activity_main: Attempt to read from null array
Caused by: java.lang.NullPointerException: Attempt to read from null array
at com.tomer.fadingtextview.FadingTextView.startAnimation(FadingTextView.java:289)
at com.tomer.fadingtextview.FadingTextView.resume(FadingTextView.java:62)
at com.tomer.fadingtextview.FadingTextView.onAttachedToWindow(FadingTextView.java:104)
at android.view.View.dispatchAttachedToWindow(View.java:20731)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3516)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3516)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3516)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3516)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3516)
at android.view.ViewGroup.addViewInner(ViewGroup.java:5359)
at android.view.ViewGroup.addView(ViewGroup.java:5137)
at android.view.ViewGroup.addView(ViewGroup.java:5109)
at android.view.LayoutInflater.inflate(LayoutInflater.java:689)
at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:699)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195)
at com.curiousminds.ytcreatorszone.MainActivity.onCreate(MainActivity.java:131)
at android.app.Activity.performCreate(Activity.java:8146)
at android.app.Activity.performCreate(Activity.java:8130)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3673)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3871)
at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5809)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5712)
at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:140)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:100)
2021-11-19 16:20:11.849 30665-30665/com.curiousminds.ytcreatorszone E/AndroidRuntime: at android.app.ClientTransactionHandler.executeTransaction(ClientTransactionHandler.java:58)
at android.app.ActivityThread.handleRelaunchActivityLocally(ActivityThread.java:5765)
at android.app.ActivityThread.access$3400(ActivityThread.java:292)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2318)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:257)
at android.app.ActivityThread.main(ActivityThread.java:8239)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006)
Hello,
First of all thank you for this easy to use library :)
I found a little bug on your library. When i use fadingTextView.setTimeout(1500) after sometime it just do not wait 1500 ( or whatever i set ) just flick around the array.
Fortunately, when i set timeout in xml as app:timeout="1500" it did not skip too fast.
I hope you will fix it, when you have time :)
Enjoy!
Hi! Your project saved me! But i need to stop the fading text view loop, how do you do that?
Hello,
I saw your source, I feel that the effect of using ViewFlipper to do, may be more convenient
setTimeout
to use Kotlin's durationAndroidView
You have startAnimation() in onAttachedToWindow and in handleAttrs() which make animations too fast. In my case it was: first text OK, second much too fast, third OK, fourth many too fast.
在stopAnimation的时候调用的removeCallbacksAndMessages,这个会把所有在排队的任务都给remove掉,可能导致一些问题使用者还不知道是怎么回事。
Is there any way to setStartOffset() to the fade effect in textview?
If Android Leanback library is added along side with your project, app build will fail with this error:
Resource compilation failed (Failed to compile values resource file Q:\Projects\Libs\android\fading-text-view\app\build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml. Cause: java.nio.file.InvalidPathException: Illegal char <:> at index 59: com.tomerrosenfeld.fadingtextview.app-mergeDebugResources-2:/values/values.xml). Check logs for more details.
This is due to a conflict with a declared style:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="FadingTextView">
<attr name="texts" format="reference" />
<attr name="timeout" format="integer" />
<attr name="shuffle" format="boolean" />
</declare-styleable>
</resources>
The problem is with the shuffle attribute, it is already declared in the Leanback library.
I knew that setting empty text array is not allowed. But, what if we want to set it during runtime only, instead of initially setting it with app:texts="@array/my_texts"
?
We can show an empty text if the array is empty. Throwing IllegalArgumentException
directly is not a good action.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.