Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ro.holdone:bubblegum

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ro.holdone:bubblegum

Gradient animation library, that provides Animated drawable resources and views for enhancing user interfaces.

  • 1.0.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

BubbleGum - Sweet Android Gradients

Download

BubbleGum was designed to quickly apply gradients into different UI elements of an android app. The overhead and performance impact is minimal, as BubbleGum is based on Android drawables.

Features
  • Apply gradient to a view with an animation effect or transition between 2 gradients.
  • Created an animated view with a set of gradients that interchange at the specified amount of time.
  • It applies a vignetting effect over the gradient to enhance the view. (will become optional in the future)
  • Control gradient angle
  • Apply the gradient colors at custom positions. If custom positions are not specified, they will be distributed equally.
Demo

IMAGE ALT TEXT HERE

Or give it a try with the sample app: https://play.google.com/store/apps/details?id=com.hold1.bubblegum

Installation

Add the following line in your build.gradle file

implementation 'com.hold1:bubblegum:0.0.1'
Usage

BubbleGum can be used in 3 ways, depending of your needs:

1. Embed a BubbleView into your layout and use it as a canvas for displaying other views on top of it. This is the easiest way if you are trying to achieve immediate results from your xml layout.
    <com.hold1.bubblegum.BubbleView
        android:id="@+id/headerBackground"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:bbStartColor="@color/demoStartColor"
        app:bbEndColor="@color/demoEndColor"
        app:bbAngle="45"/>

You can always change the applied gradient of a BubbleView programatically. Please refer to SlideFragment in Demo app.

2. Create an GradientDrawable and use it.
    val g1 = Gradient(intArrayOf(Color.RED, Color.GREEN))
    val g2 = Gradient(intArrayOf(Color.DKGRAY, Color.BLUE))
    val g3 = Gradient(intArrayOf(Color.CYAN, Color.MAGENTA))
    
    val animation = GradientDrawable(arrayOf(g2, g1, g3))
    baseView.background = animation
        
    animation.start()
3. Use the BubbleBuilder class to apply a gradient as a background to an existing view

    BubbleBuilder()
            .withStartColor(Color.RED)
            .withEndColor(Color.BLUE)
            .withAngle(35)
            .intoView(exampleView)

FAQs

Package last updated on 06 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc