https://github.com/bitvale/pacbutton
Android implementation of switch animation https://dribbble.com/shots/5487871-Video-Photo-Switcher-Exploration from Oleg Frolov https://dribbble.com/Volorf
https://github.com/bitvale/pacbutton
Last synced: 19 days ago
JSON representation
Android implementation of switch animation https://dribbble.com/shots/5487871-Video-Photo-Switcher-Exploration from Oleg Frolov https://dribbble.com/Volorf
- Host: GitHub
- URL: https://github.com/bitvale/pacbutton
- Owner: bitvale
- Created: 2018-11-05T17:26:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-03T19:17:54.000Z (over 6 years ago)
- Last Synced: 2025-04-08T21:23:01.983Z (about 2 months ago)
- Language: Kotlin
- Homepage:
- Size: 299 KB
- Stars: 60
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PacButton
[](https://opensource.org/licenses/Apache-2.0)
[](http://developer.android.com/index.html)
[](https://android-arsenal.com/api?level=19)Created this cool [video/photo switch animation](https://dribbble.com/shots/5487871-Video-Photo-Switcher-Exploration) from [Oleg Frolov](https://dribbble.com/Volorf) as android library.
USAGE
-----Just add PacButton view in your layout XML and PacButton library in your project via Gradle:
```gradle
dependencies {
implementation 'com.bitvale:pacbutton:1.0.0'
}
```XML
-----```xml
```
You must use the following properties in your XML to change your PacButton.
##### Properties:
* `app:topIcon` (drawable) -> default none
* `app:bottomIcon` (drawable) -> default none
* `app:iconHeight` (dimension) -> default none
* `app:iconWidth` (dimension) -> default none
* `app:pacColor` (color) -> default none
* `app:pacGradientColor_1` (color) -> default #7651F8
* `app:pacGradientColor_2` (color) -> default #E74996You can use solid color with pacColor property or gradient with pacGradientColor properties.
Kotlin
-----```kotlin
pac_button.setSelectAction {
if (it) some_image.setImageResource(R.drawable.ic_video_cam)
else some_image.setImageResource(R.drawable.ic_photo_cam)
}pac_button.setAnimationUpdateListener { progress ->
some_image.alpha = 1 - progress
}
```LICENCE
-----PacButton by [Alexander Kolpakov](https://play.google.com/store/apps/dev?id=7044571013168957413) is licensed under an [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).