All Projects → sunfusheng → Marqueeview

sunfusheng / Marqueeview

俗名:可垂直跑、可水平跑的跑马灯;学名:可垂直翻、可水平翻的翻页公告

Programming Languages

java
68154 projects - #9 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to Marqueeview

Marquee
A powerful implementation of Marquee(scrolling text or label) in SwiftUI, which supports any content view, including text(label), image, video, etc.
Stars: ✭ 44 (-98.78%)
Mutual labels:  marquee, marqueeview
react-native-marquee
React Native Marquee Text Component
Stars: ✭ 101 (-97.19%)
Mutual labels:  marquee
Vue Marquee Tips
基于Vue的横向跑马灯提示
Stars: ✭ 73 (-97.97%)
Mutual labels:  marquee
vue-text-marquee
A Vue component to Marquee. Just used CSS3 animation.
Stars: ✭ 24 (-99.33%)
Mutual labels:  marquee
React Native Text Ticker
React Native Text Ticker/Marquee Component
Stars: ✭ 212 (-94.11%)
Mutual labels:  marquee
dynamic-marquee
A small library for creating marquees.
Stars: ✭ 64 (-98.22%)
Mutual labels:  marquee
Skautoscrolllabel
Automatically scrolling UILabel with both horizontal/vertical MARQUEE effects and gradient gradients on the edges. Gradient fading is used on the edge of the scroll to solve the problem of the hard edges of the rolling edge. The overall effect is a natural and easy to use.
Stars: ✭ 64 (-98.22%)
Mutual labels:  marquee
Uumarqueeview
[iOS]Customizable marquee view. #Marquee,MarqueeView,跑马灯,滚屏,上翻,左滑,多行,自定义
Stars: ✭ 295 (-91.81%)
Mutual labels:  marquee
AutoScrollTextView
android 上下滚动播放与走马灯效果结合
Stars: ✭ 27 (-99.25%)
Mutual labels:  marquee
marquee-ora
A tool to create an ora compatible spinner object that behaves like a scrolling marquee
Stars: ✭ 73 (-97.97%)
Mutual labels:  marquee
react-marquee
react无缝滚动组件
Stars: ✭ 27 (-99.25%)
Mutual labels:  marquee
Xmarqueeview
💥【MarqueeView】类似淘宝头条、京东头条的跑马灯效果,上下轮播,支持单行/多行显示、自定义轮播布局
Stars: ✭ 224 (-93.78%)
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 (-99.31%)
Mutual labels:  marquee
Marqueeviewlibrary
一个帮您快速实现跑马灯效果的library
Stars: ✭ 2,249 (-37.53%)
Mutual labels:  marquee
flutter vertical marquee
flutter vertical marquee
Stars: ✭ 15 (-99.58%)
Mutual labels:  marquee
React Marquee Slider
The marquee slider of your deepest dreams. Only for React.js ⛺
Stars: ✭ 73 (-97.97%)
Mutual labels:  marquee
alokmenghrajani.github.com
Alok Menghrajani's Blog
Stars: ✭ 64 (-98.22%)
Mutual labels:  marquee
Jxmarqueeview
A powerful and easy to use marquee view.
Stars: ✭ 324 (-91%)
Mutual labels:  marquee
react-native-lahk-marquee-label
A react-native marquee label component.
Stars: ✭ 49 (-98.64%)
Mutual labels:  marquee
marquee widget
A Flutter widget that scrolls text widget and other widget
Stars: ✭ 21 (-99.42%)
Mutual labels:  marquee

MarqueeView MarqueeView

俗名:可垂直跑、可水平跑的跑马灯
学名:可垂直翻、可水平翻的翻页公告

效果图

Gradle:

compile 'com.sunfusheng:MarqueeView:<latest-version>'

属性

Attribute 属性 Description 描述
mvAnimDuration 一行文字动画执行时间
mvInterval 两行文字翻页时间间隔
mvTextSize 文字大小
mvTextColor 文字颜色
mvGravity 文字位置:left、center、right
mvSingleLine 单行设置
mvDirection 动画滚动方向:bottom_to_top、top_to_bottom、right_to_left、left_to_right
mvFont 设置字体

XML

<com.sunfusheng.marqueeview.MarqueeView
    android:id="@+id/marqueeView"
    android:layout_width="match_parent"
    android:layout_height="30dp"
    app:mvAnimDuration="1000"
    app:mvDirection="bottom_to_top"
    app:mvInterval="3000"
    app:mvTextColor="@color/white"
    app:mvTextSize="14sp"
    app:mvSingleLine="true"
    app:mvFont="@font/huawenxinwei"/>

设置字符串列表数据,或者设置自定义的Model数据类型

MarqueeView marqueeView = (MarqueeView) findViewById(R.id.marqueeView);

List<String> messages = new ArrayList<>();
messages.add("1. 大家好,我是孙福生。");
messages.add("2. 欢迎大家关注我哦!");
messages.add("3. GitHub帐号:sunfusheng");
messages.add("4. 新浪微博:孙福生微博");
messages.add("5. 个人博客:sunfusheng.com");
messages.add("6. 微信公众号:孙福生");
marqueeView.startWithList(messages);

// 或者设置自定义的Model数据类型
public class CustomModel implements IMarqueeItem {
    @Override
    public CharSequence marqueeMessage() {
        return "...";
    }
}

List<CustomModel> messages = new ArrayList<>();
marqueeView.startWithList(messages);

// 在代码里设置自己的动画
marqueeView.startWithList(messages, R.anim.anim_bottom_in, R.anim.anim_top_out);

设置字符串数据

String message = "心中有阳光,脚底有力量!心中有阳光,脚底有力量!心中有阳光,脚底有力量!";
marqueeView.startWithText(message);

// 在代码里设置自己的动画
marqueeView.startWithText(message, R.anim.anim_bottom_in, R.anim.anim_top_out);

设置事件监听

marqueeView.setOnItemClickListener(new MarqueeView.OnItemClickListener() {
    @Override
    public void onItemClick(int position, TextView textView) {
        Toast.makeText(getApplicationContext(), String.valueOf(marqueeView1.getPosition()) + ". " + textView.getText(), Toast.LENGTH_SHORT).show();
    }
});

重影问题可参考以下解决方案

在 Activity 或 Fragment 中

@Override
public void onStart() {
    super.onStart();
    marqueeView.startFlipping();
}

@Override
public void onStop() {
    super.onStop();
    marqueeView.stopFlipping();
}

在 ListView 或 RecyclerView 的 Adapter 中

@Override
public void onViewDetachedFromWindow(@NonNull ViewHolder holder) {
    super.onViewDetachedFromWindow(holder);
    holder.marqueeView.stopFlipping();
}

扫一扫Fir.im二维码下载APK


个人微信公众号


打点赏给作者加点油^_^


关于我

GitHub: sunfusheng

个人邮箱: [email protected]

个人博客: sunfusheng.com

简书主页

新浪微博

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].