All Projects → ronghao → AutoScrollTextView

ronghao / AutoScrollTextView

Licence: Apache-2.0 License
android 上下滚动播放与走马灯效果结合

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to AutoScrollTextView

Yjbannerview
【抱歉,暂时不提供开源】A very popular and highly customized banner view, 无限循环滚动轮播图BannerView、焦点图, 支持Cocoapods 及 Carthage. 支持完全自定义
Stars: ✭ 506 (+1774.07%)
Mutual labels:  banner, scrollview
Txscrolllabelview
🌭TXScrollLabelView, the best way to show & display information such as adverts / boardcast / onsale e.g. with a customView.
Stars: ✭ 714 (+2544.44%)
Mutual labels:  marquee, scrollview
ScrollViewProxy
ScrollViewProxy for SwiftUI on iOS 13 and up
Stars: ✭ 135 (+400%)
Mutual labels:  scrollview
safe-string-interpolation
A type driven approach to string interpolation, aiming at consistent, secure, and only-human-readable logs and console outputs !
Stars: ✭ 14 (-48.15%)
Mutual labels:  automatic
RGBDCameraExtrinsicCalibration
RGB-D extrinsic parameter automatic calibration based on plane detection
Stars: ✭ 32 (+18.52%)
Mutual labels:  automatic
CocosCreator-ScrollVIewPlus
Cocos Creator ScrollVIew 优化系列
Stars: ✭ 83 (+207.41%)
Mutual labels:  scrollview
BannerView
Android BannerView 图片轮播控件,支持无限循环,可设置显示各种样式,支持添加banner切换动画。调用简单,代码稳定,体积小。
Stars: ✭ 23 (-14.81%)
Mutual labels:  banner
simplebanner
(最简单的广告轮播)the most simple banner
Stars: ✭ 18 (-33.33%)
Mutual labels:  banner
angular2-cookie-law
Angular2+ component that provides a banner to inform users about cookie law
Stars: ✭ 38 (+40.74%)
Mutual labels:  banner
RecyclerViewCardGallery
RecyclerView实现循环banner,替代ViewPager方案。能够快速滑动并最终定位到居中位置(相比于原库支持了循环滑动)
Stars: ✭ 610 (+2159.26%)
Mutual labels:  banner
SPKeyBoardAvoiding
It's a smart KeyBoard manager with active text field using Scroll View along with Constraints in Objective C & Swift 4
Stars: ✭ 22 (-18.52%)
Mutual labels:  scrollview
SPPhotoViewer
A customisable smart photoviewer of your photos!!!
Stars: ✭ 14 (-48.15%)
Mutual labels:  scrollview
beautiful-capi
Beautiful Capi is a tool which automates the creation of compiler-independent and binary compatible C++ libraries across different C++ compilers
Stars: ✭ 31 (+14.81%)
Mutual labels:  automatic
marquee widget
A Flutter widget that scrolls text widget and other widget
Stars: ✭ 21 (-22.22%)
Mutual labels:  marquee
react-easy-marquee
A highly customisable `marquee` package for React built using CSS. Renders anything given between the tags, be it an image, text or a custom JSX element!
Stars: ✭ 25 (-7.41%)
Mutual labels:  marquee
DefVideoAds
UnityAds native extension for Defold engine.
Stars: ✭ 37 (+37.04%)
Mutual labels:  banner
FadingEdgesCollectionView
A UICollectionView that fades it's edges to hint about more content
Stars: ✭ 82 (+203.7%)
Mutual labels:  scrollview
EmbeddedScrollView
Embedded UIScrollView for iOS.
Stars: ✭ 55 (+103.7%)
Mutual labels:  scrollview
cordova-plugin-apkupdater
This plugin allows your Android app to download and install compressed updates without the Google Play Store.
Stars: ✭ 46 (+70.37%)
Mutual labels:  automatic
react-native-dual
ScrollView, FlatList, SectionList and ListView with dual background
Stars: ✭ 28 (+3.7%)
Mutual labels:  scrollview

AutoScrollTextView GitHub license

android 上下滚动播放与走马灯效果结合,暂时只支持textview

实现原理

  • 实现上下滚动
  • 使用scrollTo(x,y)和runable循环调用,移动textview,形成走马灯效果
  • 单个页面多个滚动效果会卡顿问题:由于handler的消息队列机制,导致滚动需要等待上一个message处理完成,现改为线程池ScheduledExecutorService

演示

例子

项目添加方法

在根 build.gradle中添加

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

在项目build.gradle中添加

dependencies {
    compile 'com.github.ronghao:AutoScrollTextView:1.0.3'
}

使用

只有左右滚动

<com.haohaohu.autoscrolltextview.MarqueeTextView
        android:id="@+id/main_marguee_text"
        android:layout_width="match_parent"
        android:layout_height="20dp"
        />

左右滚动加上下滚动

<com.haohaohu.autoscrolltextview.AutoScrollTextView
        android:id="@+id/main_autoscroll_text1"
        android:layout_width="match_parent"
        android:layout_height="20dp"
        />

自定义文本样式

继承BaseScrollTextView,在继承类中实现makeTextView()方法中,自定义效果

@Override
public MarqueeTextView makeTextView() {
    MarqueeTextView textView = new MarqueeTextView(getContext());
    textView.setTextColor(getResources().getColor(R.color.colorAccent));
    return textView;
}

一些方法

方法 解释
startAutoScroll AutoScrollTextView 开始滚动
stopAutoScroll AutoScrollTextView 停止滚动
makeTextView AutoScrollTextView 创建一个内部可横向滚动的textview
setOnItemClickListener AutoScrollTextView 设置点击事件回调
setTextList AutoScrollTextView 设置数据源
startScroll MarqueeTextView 开始滚动
postStartScroll MarqueeTextView 延迟开始滚动
stopScroll MarqueeTextView 停止滚动
setSpeed MarqueeTextView 设置速度
setMarqueeListener MarqueeTextView 设置单个走马灯的开始和结束回调

版本更新说明

  • 1.0.3
    • 添加MarqueeTextViewForViewPager类,临时解决Jars-of-jam-Scheduler的问题
  • 1.0.2
    • 解决单个页面多个滚动效果会卡顿问题

关于

  • 个人博客:www.haohaohu.com
  • 如果你也喜欢这个库,Star一下吧,欢迎Fork

License

Copyright 2016 haohaohu

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].