ParticleTextView
????
ParticleTextView ??? Android ?????? view ????????????????????????????????????????????
????
1. ????
compile 'yasic.library.ParticleTextView:particletextview:0.0.6'
2. ????????
<com.yasic.library.particletextview.View.ParticleTextView
android:id="@+id/particleTextView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
3. ???????? ParticleTextViewConfig
ParticleTextView particleTextView = (ParticleTextView) findViewById(R.id.particleTextView);
RandomMovingStrategy randomMovingStrategy = new RandomMovingStrategy();
ParticleTextViewConfig config = new ParticleTextViewConfig.Builder()
.setRowStep(8)
.setColumnStep(8)
.setTargetText("Random")
.setReleasing(0.2)
.setParticleRadius(4)
.setMiniDistance(0.1)
.setTextSize(150)
.setMovingStrategy(randomMovingStrategy)
.instance();
particleTextView.setConfig(config);
4. ????
particleTextView.startAnimation();
5. ????
particleTextView1.stopAnimation();
??API??
???????? MovingStrategy
???????????? MovingStrategy????????????? setMovingPath ??????????????????
- RandomMovingStrategy
- CornerStrategy
- HorizontalStrategy
- BidiHorizontalStrategy
- VerticalStrategy
- BidiVerticalStrategy
????? ParticleTextViewConfig
?????????????????????????
- ???????
setTargetText(String targetText)
- ??????
setTextSize(int textSize)
- ??????
setParticleRadius(float radius)
- ?????????????
?????????????????????????????????????????????
setColumnStep(int columnStep) setRowStep(int rowStep)
- ????????
setReleasing(double releasing)
?????????????????????? Vx ? Vy ??? X ? Y ?????????target ? source ???????????????
Vx = (targetX - sourceX) * releasing Vy = (targetY - sourceY) * releasing
- ????????
???????????????????????????????????????????
setMiniDistance(double miniDistance)
- ???????
????????????
setParticleColorArray(String[] particleColorArray)
- ??????????
???????????
setMovingStrategy(MovingStrategy movingStrategy)
- ??????????????
delay < 0 ??????
setDelay(Long delay)
ParticleTextView?
- ???????
setConfig(ParticleTextViewConfig config)
- ????
void startAnimation()
- ????
void stopAnimation()
- ????????
???????????????????
boolean isAnimationPause()
- ????????
?????????????????????
boolean isAnimationStop()
ParticleTextSurfaceView ?
??? SurfaceView ????????? Canvas ???????????????????? API ? ParticleTextView ????
License
Copyright 2017 Yasic 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.