PacButton


Source link: https://github.com/bitvale/PacButton

PacButton

sample

License Platform API

Created this cool video/photo switch animation from Oleg Frolov as android library.

Design on Dribbble

USAGE

Just add PacButton view in your layout XML and PacButton library in your project via Gradle:

dependencies {

implementation 'com.bitvale:pacbutton:1.0.0' 
}

XML

<com.bitvale.pacbutton.PacButton
  android:id="@+id/pac_button"
  android:layout_width="@dimen/pac_size"
  android:layout_height="@dimen/pac_size"
  app:topIcon="@drawable/ic_video"
  app:bottomIcon="@drawable/ic_photo"
  app:iconHeight="@dimen/icon_size"
  app:iconWidth="@dimen/icon_size"
  app:pacGradientColor_1="@color/gradient_color_1"
  app:pacGradientColor_2="@color/gradient_color_2" />

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 #E74996

You can use solid color with pacColor property or gradient with pacGradientColor properties.

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 is licensed under an Apache License 2.0.

Resources

A simple library that creates BottomSheets according to the Material Design specs.

A sample project with the new BottomSheet classes from the android support library.

A simple helper library to separate navigation logic from your MainActivity and reduce boilerplate.

A view that arranges it's children in the form of a stack.

A Job Queue specifically written for Android to easily schedule jobs (tasks) that run in the background, improving UX and application stability.

The best room chat system for Android. Real-time, IRC Style using firebase as database.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes