项目作者: mckrpk

项目描述 :
Custom ProgressBar view for Android.
高级语言: Kotlin
项目地址: git://github.com/mckrpk/AnimatedProgressBar.git
创建时间: 2019-12-03T11:29:01Z
项目社区:https://github.com/mckrpk/AnimatedProgressBar

开源协议:Apache License 2.0

下载


AnimatedProgressBar

Animated determinate horizontal Progress Bar for Android.

License

line style

snake style

snakes

💻 Installation

Your app’s build.gradle:

  1. dependencies {
  2. implementation 'io.github.mckrpk:AnimatedProgressBar:1.0.0'
  3. }

Minimum required SDK version is 14.

❔ Usage

  1. <com.mckrpk.animatedprogressbar.AnimatedProgressBar
  2. android:id="@+id/animatedProgressBar"
  3. android:layout_width="match_parent"
  4. android:layout_height="wrap_content"
  5. android:layout_marginTop="8dp"
  6. app:animationDurationInMs="1600"
  7. app:animationStyle="snake"
  8. app:lineWidth="6dp"
  9. app:max="1000"
  10. app:progress="750"
  11. app:progressColor="@color/colorPrimary"
  12. app:progressTipColor="@color/colorAccent"
  13. app:progressTipEnabled="true"
  14. app:trackColor="@color/colorGray" ></com.mckrpk.animatedprogressbar.AnimatedProgressBar>

or programmaticaly

  1. val progressBar = AnimatedProgressBar(this)
  2. progressBar.setMax(100)
  3. progressBar.setProgress(75)
  4. progressBar.setTrackColor(Color.GRAY)
  5. progressBar.setProgressColor(Color.GREEN)
  6. progressBar.setProgressTipEnabled(true)
  7. progressBar.setProgressTipColor(Color.RED)
  8. progressBar.setAnimDuration(1200)
  9. progressBar.setProgressStyle(AnimatedProgressBar.ProgressStyle.SNAKE)
  10. progressBar.setLineWidth(dpToPx(5, this).toInt())

🎨 Attributes

name type default example
max Int 100 100
progress Int 0 75
style Enum: Line, Snake Line styles
trackColor Int GREY track
progressColor Int Theme’s primary progress
progressTipColor Int Theme’s accent progressTipColor
progressTipEnabled Boolean true progressTip
animDuration Int 1200ms animDuration
lineWidth Int 4dp lineWidth

📃 License

  1. Copyright 2019 Michał Karpiuk
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.

Please don’t hesitate to star the library if you find it useful or interesting. 😊