All Projects → HaowenLee → TextBanner

HaowenLee / TextBanner

Licence: Apache-2.0 license
搜索栏文字轮播切换控件,京东淘宝头条资讯轮播

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to TextBanner

google streetview
A command line tool and module for Google Street View Image API
Stars: ✭ 77 (+120%)
Mutual labels:  view
SMDiagramView
Diagram View for iOS
Stars: ✭ 44 (+25.71%)
Mutual labels:  view
SignatureView
【Android View】:好用的Android电子签名板,能保存所签名的图片
Stars: ✭ 89 (+154.29%)
Mutual labels:  view
pine-script-mode
GNU Emacs Major mode for Trading View pine script
Stars: ✭ 18 (-48.57%)
Mutual labels:  view
view
Yii view rendering library
Stars: ✭ 42 (+20%)
Mutual labels:  view
android-animations
Perform tweened animations such as Attention, Bounce, Fade, Flip, Rotate, Slide and Zoom on Views
Stars: ✭ 118 (+237.14%)
Mutual labels:  view
RMGradientView
A Custom Gradient View Control for iOS with inspectable properties.
Stars: ✭ 24 (-31.43%)
Mutual labels:  view
table-layout
Styleable plain-text table generator. Useful for formatting console output.
Stars: ✭ 18 (-48.57%)
Mutual labels:  view
yii2-presenter
Yii2 View Presenter
Stars: ✭ 13 (-62.86%)
Mutual labels:  view
KVSpinnerView
KVSpinnerView is highly customizable progress HUD
Stars: ✭ 37 (+5.71%)
Mutual labels:  view
ChatVoicePlayer
An Android library to make the implementation of voice/audio messages' playing easier
Stars: ✭ 157 (+348.57%)
Mutual labels:  view
simple-analog-clock
Simple clock view for displaying uh...time?
Stars: ✭ 24 (-31.43%)
Mutual labels:  view
credit-card-view
A fully customizable Android view that can display credit card's informations
Stars: ✭ 25 (-28.57%)
Mutual labels:  view
XRadarView
A highly customizable radar view for Android
Stars: ✭ 106 (+202.86%)
Mutual labels:  view
TicTacToe
No description or website provided.
Stars: ✭ 40 (+14.29%)
Mutual labels:  view
Coroutines-Animations
Use the power of kotlin coroutines to execute your android animations
Stars: ✭ 31 (-11.43%)
Mutual labels:  view
TimelineView
A customizable and easy-to-use Timeline View library for Android. Works as a RecyclerView decorator (ItemDecoration)
Stars: ✭ 169 (+382.86%)
Mutual labels:  view
react-native-masonry-brick-list
Staggered Or Masonary List View For React Native Written in pure js
Stars: ✭ 24 (-31.43%)
Mutual labels:  view
SPConfetti
Show the confetti only when the user is having fun, and if not having fun, don't show it.
Stars: ✭ 187 (+434.29%)
Mutual labels:  view
prax
Experimental rendering library geared towards hybrid SSR+SPA apps. Focus on radical simplicity and performance. Tiny and dependency-free.
Stars: ✭ 18 (-48.57%)
Mutual labels:  view

TextBanner

License JCenter JitPack MinSdk

文字轮播切换控件

应用截图

TextBanner效果图

步骤 1. 在module的build.gradle添加依赖项

dependencies {
        implementation 'com.haowen:textbanner:1.0.4'
}

步骤 2. 在布局文件中添加TextBanner,可以设置自定义属性

<me.haowen.textbanner.TextBanner
    android:id="@+id/textBanner"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginLeft="12dp"
    android:layout_marginRight="12dp"
    app:delayTime="5000"
    app:duration="800" />

步骤 3. 在Activity或者Fragment中配置Adapter

  • 简单布局SimpleTextBannerAdapter
/**
 * 简单的TextBanner适配器(只含有一个TextView)
 *
 * @param context     上下文
 * @param layoutResId 布局资源ID
 * @param data        字符串列表数据源
 */
SimpleTextBannerAdapter simpleAdapter = new SimpleTextBannerAdapter(this,
        R.layout.item_text_banner_simple, Arrays.asList(hotWordArray));
textBanner.setAdapter(simpleAdapter);
  • 自定义布局

继承BaseAdapter实现自己的Adapter

步骤 4. 增加体验(可选)

/**
 * 体验优化
 */
@Override
protected void onStart() {
    super.onStart();
    textBanner.startAutoPlay();
    customTextBanner.startAutoPlay();
}

@Override
protected void onStop() {
    super.onStop();
    textBanner.stopAutoPlay();
    customTextBanner.stopAutoPlay();
}

属性说明

名称 格式 描述 示例
duration integer 切换动画的时长(单位毫秒) 800
delayTime integer 停留时长(单位毫秒) 5000
animIn reference View进入动画资源ID @anim/anim_in
animOut reference View消失动画资源ID @anim/anim_out
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].