MarqueeTextView | A reliable , lightweight , scrolling textview for Android | Android library

 by   deano2390 Java Version: 1.0.9 License: Apache-2.0

kandi X-RAY | MarqueeTextView Summary

kandi X-RAY | MarqueeTextView Summary

MarqueeTextView is a Java library typically used in Mobile, Android applications. MarqueeTextView has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

A reliable, lightweight scrolling textview for Android.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              MarqueeTextView has a low active ecosystem.
              It has 13 star(s) with 8 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              MarqueeTextView has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of MarqueeTextView is 1.0.9

            kandi-Quality Quality

              MarqueeTextView has 0 bugs and 0 code smells.

            kandi-Security Security

              MarqueeTextView has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              MarqueeTextView code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              MarqueeTextView is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              MarqueeTextView releases are available to install and integrate.
              Build file is available. You can build the component from source.
              MarqueeTextView saves you 184 person hours of effort in developing the same functionality from scratch.
              It has 454 lines of code, 26 functions and 16 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed MarqueeTextView and discovered the below as its top functions. This is intended to give you an instant insight into MarqueeTextView implemented functionality, and help decide if they suit your requirements.
            • Helper method to draw the text
            • Pauses the pause
            • Removes the callback after the specified delay
            • Initialize the text area
            • Read attributes
            • Sets the text to be displayed
            • Sets the text color
            • Renew paints
            • Set the edge effect color
            • Sets the edge effect color
            • Override this to customize the view size
            • Initializes the activity
            • Sets the text size
            Get all kandi verified functions for this library.

            MarqueeTextView Key Features

            No Key Features are available at this moment for MarqueeTextView.

            MarqueeTextView Examples and Code Snippets

            No Code Snippets are available at this moment for MarqueeTextView.

            Community Discussions

            QUESTION

            TextView in ViewPager fragments randomly crashes the app NullPointerException: Attempt to invoke virtual method void View.sendAccessibilityEventUnchec
            Asked 2020-Apr-07 at 09:45
            Summary
            1. First I describe the context, i.e. what I'm trying to do

            2. Second I explain you in which cases I encounter the bug and what is it (it's the current behavior)

            3. Third, I explain you the expected behavior

            4. Then I explain you how to reproduce the bug

            5. Finally I show you the minimal and executable code that can lead to the bug

            Context

            I am using the widget AutoScrollTextView available between others in the API https://github.com/ronghao/AutoScrollTextView. AutoScrollTextView is a TextView that can automatically autoscroll vertically and moreover, if the text is too long, horizontally. So an AutoScrollTextView can contain at least one text to be automatically scrolled (see the illustration in the GitHub repository).

            Current behavior: the error
            1. If I use one AutoScrollTextView in the main activity, I don't see any bug. If I use it in the fragment of the main activity, I think it would be the case too (I didn't test it).
            2. If I use one AutoScrollTextView in each of at least two fragments of a ViewPager (2 instances of this same fragment class are used for the Viewpager), with at least one text to be automatically scrolled by each AutoScrollTextView, the app crashes with the following error (NB: this ViewPager belongs to the main activity):

            E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.myapplication, PID: 2814 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.sendAccessibilityEventUnchecked(android.view.accessibility.AccessibilityEvent)' on a null object reference at android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.run(ViewRootImpl.java:9304) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

            The error, however, is difficult to trigger:

            1. Sometimes, it's triggered as soon as the fragment of the main activity is started
            2. Sometimes, there is a random delay before it's triggered in the fragment of the main activity
            3. Sometimes, maybe it's not triggered (or I close the app before it would)

            As you can see, there isn't any indication of the line that causes this crash.

            What I've done to debug
            1. I have taken the library, and isolated the minimal part of it that lead to this bug.

            2. I have set up the minimal executable app with only the main activity, the ViewPager, and the fragment (2 instances of this same fragment class are used for the Viewpager).

            3. I have set up this minimal executable app with the isolated part of the library. You will find the sources below (even if there are "many" files, each one has been minimalized and contains only the strict minimal lines in order to make you able to reproduce the bug). Also: with the sources I give you, it's totally normal that you don't see text scrolling (nor text at all). It's because I've completely isolated the part of the API that triggers the bug, and the scrolling text wasn't related to this error, so it's not part of my isolated sources.

            4. I have tried to use Android's Timer instead of an Handler but the error still occurres.

            5. MarqueeTextView::scrollTo(currentScrollPos, 0); seems to trigger this error.

            Expected behavior

            Normally, the app of course should not crash. In other words, there shouldn't be any triggered error (especially the one I've quoted above). With the sources I give you, it's totally normal that you don't see text scrolling (nor text at all). It's because I've completely isolated the part of the API that triggers the bug, and the scrolling text wasn't related to this error, so it's not part of my isolated sources.

            How to reproduce this bug

            Below, I provide you all the minimal and executable sources you need (even if there are "many" files, each one has been minimalized and contains only the strict minimal lines in order to make you able to reproduce the bug). After having created the corresponding files and copy/paste these sources in them, run this minimal and executable app several times. Even if the error will or won't be shown for each run, normally you would see it at least one time after 5 runs max. You can use your smartphone to test this app, or maybe an Android Studio's emulator (but I didn't test on an emulator).

            NB: with the sources I give you, it's totally normal that you don't see text scrolling (nor text at all). It's because I've completely isolated the part of the API that triggers the bug, and the scrolling text wasn't related to this error, so it's not part of my isolated sources.

            My question

            Could you tell me why this bug occures (I was unable to debug it) and why it seems so random? How could I correct it?

            Minimal and executable app's sources Short presentation
            1. First, I will give you the sources of the isolated part of the library

            2. Then, I will give you the sources of the app with the ViewPager, etc.

            3. Even if there are "many" files, each one has been minimalized and contains only the strict minimal lines in order to make you able to reproduce the bug. With the sources I give you, it's totally normal that you don't see text scrolling (nor text at all). It's because I've completely isolated the part of the API that triggers the bug, and the scrolling text wasn't related to this error, so it's not part of my isolated sources.

            Isolated part of the library that triggers the bug com.example.myapplication.libs.autoscrolling_text_view.MarqueeTextView.java ...

            ANSWER

            Answered 2020-Apr-07 at 09:45

            I think I have solved the problem by using runOnUiThread in the method MarqueeTextView::TimerTask::run. Since this change, I didn't see any bug. But I still don't know why this bug occurred, and why this modification solved it (I know it's better to use runOnUiThread in this situation since scrollTo is used, but I don't know what is the relationship between this call and the bug). If someone could comment my answer, to explain me, please :-) .

            You can compare the changes (presented below) with the original file in my question.

            So the only changes I've made are contained in the following file (com.example.myapplication.libs.autoscrolling_text_view.MarqueeTextView):

            Source https://stackoverflow.com/questions/61061130

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install MarqueeTextView

            You can download it from GitHub.
            You can use MarqueeTextView like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the MarqueeTextView component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/deano2390/MarqueeTextView.git

          • CLI

            gh repo clone deano2390/MarqueeTextView

          • sshUrl

            git@github.com:deano2390/MarqueeTextView.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link