Code Monkey home page Code Monkey logo

floating-bubble-library-android's Introduction

Floating Bubble Library

Simple library for adding a floating bubble in your application!

Installation

compile 'com.github.bijoysingh.floating-bubble:3.0.0'

// compile 'com.github.bijoysingh.floating-bubble:2.0.0' for Android Support v27
// compile 'com.github.bijoysingh.floating-bubble:1.2.0' for Android Support v26

Demos

Demo

Usage

Setup

Let's start with a simple setup for the Service

public class FloatingService extends FloatingBubbleService {
    ...
}

Adding your library in the manifest

<service android:name="<YOUR_PACKAGE>.FloatingService" />

Start the service

startService(new Intent(context, FloatingService.class));

Customising the Service

public class FloatingService extends FloatingBubbleService {

  @Override
  protected FloatingBubbleConfig getConfig() {
    return new FloatingBubbleConfig.Builder()
        // Set the drawable for the bubble
        .bubbleIcon(bubbleDrawable)

        // Set the drawable for the remove bubble
        .removeBubbleIcon(removeIconDrawable)

        // Set the size of the bubble in dp
        .bubbleIconDp(64)

        // Set the size of the remove bubble in dp
        .removeBubbleIconDp(64)

        // Set the padding of the view from the boundary
        .paddingDp(4)

        // Set the radius of the border of the expandable view
        .borderRadiusDp(4)

        // Does the bubble attract towards the walls
        .physicsEnabled(true)

        // The color of background of the layout
        .expandableColor(Color.WHITE)

        // The color of the triangular layout
        .triangleColor(Color.WHITE)

        // Horizontal gravity of the bubble when expanded
        .gravity(Gravity.END)

        // The view which is visible in the expanded view
        .expandableView(yourViewAfterClick)

        // Set the alpha value for the remove bubble icon
        .removeBubbleAlpha(0.75f)

        // Building
        .build();
  }
}

Override the onGetIntent function. It will return true if the intent is valid, else false

  @Override
  protected boolean onGetIntent(@NonNull Intent intent) {
    // your logic to get information from the intent
    return true;
  }

You can change the state of the expanded view at runtime by

// To expand
setState(true);

// To compress
setState(false);

License

Copyright 2016 Bijoy Singh Kochar

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.

floating-bubble-library-android's People

Contributors

bijoysingh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

floating-bubble-library-android's Issues

Using editTexts have many issues

I am trying to use editText in the floating layout but I first keyboard doesn't open (solve it already) second even when the keyboard is opened can't type in these editTexts

Can't display activity in floating view

I wanted to konw if it was possible to display data in a recycleView in the floatingView, I want to be able to display an activity in the expandable view and it seems that it is not possible

Multiple Bubbles at Same time??

Is there anyway to launch multiple bubbles?

Suppose I click the button (Start Bubble), I launch the floating bubble.
Is there anyway if I click the button again to launch one more bubble. ?

Dynamic text not working

Hi,
when i start the FlotingService, the textview.settext(); not working.
Can you fix please?
Thanks

Not working on Android Q

I fixed all bugs shown during, but not worked after changing the build tool,target sdk etc to 29.
build.graddle both library and project.

compileSdkVersion 29
buildToolsVersion "28.0.3"

defaultConfig {
    minSdkVersion 19
    targetSdkVersion 29
    versionCode 1
    versionName "1.0"
}

Not working

Cannot add library to my project dependencies !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.