-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86069cb
commit 586a2f0
Showing
32 changed files
with
435 additions
and
176 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,30 @@ | ||
# About ScrollTextView | ||
|
||
## 由于Jcenter 已经停止使用,现在repo 托管更改到 mavenCentral | ||
Class ScrollTextView extends SurfaceView implements SurfaceHolder.Callback | ||
|
||
# 关于提Issues | ||
本库一直在持续维护中,但是能投入的时间不多,有issues 的同学说明一下以下内容 | ||
- 1.使用场景: 比如ViewPager+fragment 滑动切换 | ||
- 2.Android系统信息: 手机品牌,Android版本号 | ||
Android 滚动字幕,如新闻联播下面的,可以使用在广告机,滚动新闻信息,机场地铁等信息发布系统。 | ||
以前是在信息发布系统上使用过,作为动态布局的一部分,题外话,如果有想做像分众传媒或者类似的 | ||
电梯广告的可以参考一下. | ||
|
||
动态布局专利:http://www.google.com/patents/CN103336691A?cl=zh (科学上网打开) | ||
|
||
继承SurfaceView 实现,CPU 占用低,无内存抖动,以Nexus5X,Android 7.0 上测试流畅度很好, | ||
大部分品牌手机测试兼容性良好。(下面gif图看起来卡是为了图像质量和大小的平衡减低帧率) | ||
|
||
Any questions,please contact me at: [email protected] | ||
|
||
![image](https://github.com/AnyLifeZLB/ScrollTextView/raw/master/GIF.gif) | ||
|
||
# How to use | ||
|
||
## Gradle 集成使用 (2.1.0 以后所有support库变为了AndroidX,并且Target SDK=33) | ||
|
||
``` | ||
implementation 'io.github.anylifezlb:ScrollTextviewLib:2.1.0' | ||
``` | ||
|
||
## 基础设置代码概要 | ||
|
||
``` | ||
<anylife.scrolltextview.ScrollTextView | ||
android:id="@+id/textView2" | ||
|
@@ -36,40 +53,11 @@ | |
``` | ||
|
||
# 关于提Issues | ||
|
||
# Gradle 集成使用 | ||
``` | ||
implementation 'io.github.anylifezlb:ScrollTextviewLib:2.0.0' | ||
``` | ||
|
||
# Maven 集成使用 | ||
``` | ||
<dependency> | ||
<groupId>io.github.anylifezlb</groupId> | ||
<artifactId>ScrollTextView</artifactId> | ||
<version>2.0.0</version> | ||
<type>aar</type> | ||
</dependency> | ||
``` | ||
|
||
# About ScrollTextView | ||
Class ScrollTextView extends SurfaceView implements SurfaceHolder.Callback | ||
|
||
|
||
Android 滚动字幕,如新闻联播下面的,可以使用在广告机,机顶盒,电视App等信息发布系统。 | ||
以前是在信息发布系统上使用过,作为动态布局的一部分,题外话,如果有想做像分众传媒或者 | ||
类似的电梯门口广告的可以参考一下. | ||
|
||
动态布局专利:http://www.google.com/patents/CN103336691A?cl=zh (科学上网) | ||
|
||
|
||
继承SurfaceView 实现,CPU 占用低,无内存抖动,在Nexus5X,Android 7.0 上测试流畅 | ||
Gif 图看起来卡是为了图像质量和大小的平衡减低帧率。 | ||
|
||
Any questions,please contact me at:anylife.[email protected] | ||
|
||
|
||
![image](https://github.com/AnyLifeZLB/ScrollTextView/raw/master/GIF.gif) | ||
本库一直在持续维护中,但是能投入的时间不多,有issues 的同学说明一下以下内容 | ||
|
||
- 1.使用场景: 比如ViewPager+fragment 滑动切换出现XX和YY 问题 | ||
- 2.Android系统信息: 手机品牌或特殊设备描述,Android系统版本号等信息 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
package anylife.scrolltextview; | ||
|
||
import android.content.Context; | ||
import android.content.res.ColorStateList; | ||
import android.content.res.Resources; | ||
import android.content.res.TypedArray; | ||
import android.graphics.Canvas; | ||
import android.graphics.Color; | ||
import android.graphics.Paint; | ||
import android.graphics.Paint.FontMetrics; | ||
import android.graphics.PixelFormat; | ||
import android.graphics.PorterDuff.Mode; | ||
import android.support.annotation.ColorInt; | ||
import androidx.annotation.ColorInt; | ||
import android.util.AttributeSet; | ||
import android.util.Log; | ||
import android.util.TypedValue; | ||
import android.view.MotionEvent; | ||
import android.view.SurfaceHolder; | ||
import android.view.SurfaceView; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.TextView; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.concurrent.Executors; | ||
|
@@ -31,7 +26,7 @@ | |
* Android auto Scroll Text,like TV News,AD devices | ||
* | ||
* | ||
* Basic knowledge:https://www.jianshu.com/p/918fec73a24d | ||
* Basic knowledge:https://www.jianshu.com/p/918fec73a24d------- unable | ||
* | ||
* @author [email protected] 2013/09/02 | ||
*/ | ||
|
@@ -100,6 +95,10 @@ public ScrollTextView(Context context, AttributeSet attrs) { | |
paint.setColor(textColor); | ||
paint.setTextSize(textSize); | ||
|
||
paint.setFlags(Paint.ANTI_ALIAS_FLAG); | ||
paint.setAntiAlias(true); | ||
paint.setFilterBitmap(true); | ||
|
||
setZOrderOnTop(true); //Control whether the surface view's surface is placed on top of its window. | ||
getHolder().setFormat(PixelFormat.TRANSLUCENT); | ||
|
||
|
@@ -278,7 +277,7 @@ public void setTextSize(float textSizeTem) { | |
this.textSize=sp2px(getContext(), textSizeTem); | ||
//重新设置Size | ||
paint.setTextSize(textSize); | ||
//试图区域也要改变 | ||
//视图区域也要改变 | ||
measureVarious(); | ||
|
||
//实际的视图高,thanks to WG | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.