AutoScrollTextView | 垂直滚动TextView

 by   jingle1267 Java Version: Current License: Apache-2.0

kandi X-RAY | AutoScrollTextView Summary

kandi X-RAY | AutoScrollTextView Summary

AutoScrollTextView is a Java library. AutoScrollTextView has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. However AutoScrollTextView build file is not available. You can download it from GitHub.

垂直滚动TextView
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

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

            kandi-Quality Quality

              AutoScrollTextView has 0 bugs and 7 code smells.

            kandi-Security Security

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

            kandi-License License

              AutoScrollTextView 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

              AutoScrollTextView releases are not available. You will need to build from source code and install.
              AutoScrollTextView has no build file. You will be need to create the build yourself to build the component from source.
              AutoScrollTextView saves you 87 person hours of effort in developing the same functionality from scratch.
              It has 224 lines of code, 13 functions and 8 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed AutoScrollTextView and discovered the below as its top functions. This is intended to give you an instant insight into AutoScrollTextView implemented functionality, and help decide if they suit your requirements.
            • Initialize the activity with the activity
            • Initialize auto scroll text view
            • Set text list
            • Set the OnItemClick listener
            • Stop the auto scroll view
            • Stop auto scroll
            • Starts auto scroll
            • Start auto scroll
            • Initialize the handler
            • Makes a view that implements TextView
            Get all kandi verified functions for this library.

            AutoScrollTextView Key Features

            No Key Features are available at this moment for AutoScrollTextView.

            AutoScrollTextView Examples and Code Snippets

            No Code Snippets are available at this moment for AutoScrollTextView.

            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 AutoScrollTextView

            You can download it from GitHub.
            You can use AutoScrollTextView 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 AutoScrollTextView 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/jingle1267/AutoScrollTextView.git

          • CLI

            gh repo clone jingle1267/AutoScrollTextView

          • sshUrl

            git@github.com:jingle1267/AutoScrollTextView.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

            Consider Popular Java Libraries

            CS-Notes

            by CyC2018

            JavaGuide

            by Snailclimb

            LeetCodeAnimation

            by MisterBooo

            spring-boot

            by spring-projects

            Try Top Libraries by jingle1267

            android-utils

            by jingle1267Java

            AndroidSchemeDemo

            by jingle1267HTML

            OriginBlog

            by jingle1267CSS

            OneKeyShareWifi

            by jingle1267Java

            AutoScrollPageView

            by jingle1267Java