All Projects → igalata → Bubble Picker

igalata / Bubble Picker

An easy-to-use animation which can be used for content picking for Android

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Bubble Picker

React Native Bubble Select
An easy-to-use customizable bubble animation picker, similar to the Apple Music genre selection
Stars: ✭ 78 (-94.07%)
Mutual labels:  picker, bubble
Magnetic
SpriteKit Floating Bubble Picker (inspired by Apple Music) 🧲
Stars: ✭ 1,252 (-4.86%)
Mutual labels:  picker, bubble
Sildurs Shaders.github.io
Sildurs shaders website
Stars: ✭ 84 (-93.62%)
Mutual labels:  opengl
Light Propagation Volumes
Master's thesis implementing real-time global illumination method.
Stars: ✭ 88 (-93.31%)
Mutual labels:  opengl
Gifcompressor
An Android tool to compresses your GIFs into lightweight MP4 video using fast, hardware-accelerated encoders. Supports cropping, rotation, GIF concatenation and much more.
Stars: ✭ 85 (-93.54%)
Mutual labels:  opengl
Mobilenet Ssd
MobileNet-SSD(MobileNetSSD) + Neural Compute Stick(NCS) Faster than YoloV2 + Explosion speed by RaspberryPi · Multiple moving object detection with high accuracy.
Stars: ✭ 84 (-93.62%)
Mutual labels:  opengl
Opengl Renderer
Modern OpenGL renderer written in C++17
Stars: ✭ 85 (-93.54%)
Mutual labels:  opengl
Glfw.jl
Julia interface to GLFW, a multi-platform library for creating windows with OpenGL contexts and managing input and events.
Stars: ✭ 82 (-93.77%)
Mutual labels:  opengl
Bgfx
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Stars: ✭ 10,252 (+679.03%)
Mutual labels:  opengl
Dgame
A 2D framework for the D programming Language
Stars: ✭ 84 (-93.62%)
Mutual labels:  opengl
Ninaselectionview
Way to select your buttons.
Stars: ✭ 87 (-93.39%)
Mutual labels:  selection
Graphicsprogramming
Demos related to OpenGL, Qt/QML, OpenCV and other X technologies.
Stars: ✭ 83 (-93.69%)
Mutual labels:  opengl
Tcpickerview
Picker view popup with multiply rows selection written in Swift
Stars: ✭ 84 (-93.62%)
Mutual labels:  picker
Dhewm3
dhewm 3 main repository
Stars: ✭ 1,261 (-4.18%)
Mutual labels:  opengl
Angular Bootstrap Datetimepicker
Native Angular date/time picker component styled by Twitter Bootstrap
Stars: ✭ 1,289 (-2.05%)
Mutual labels:  picker
Rust Game Development Frameworks
List of curated frameworks by the **Game Development in Rust** community.
Stars: ✭ 81 (-93.84%)
Mutual labels:  opengl
2012sourcepack
The sources for our intros up to and including Chaos Theory
Stars: ✭ 84 (-93.62%)
Mutual labels:  opengl
Rc Datetime Picker
React component for datetime picker by Moment.js
Stars: ✭ 85 (-93.54%)
Mutual labels:  picker
Assortedwidgets
OpenGL GUI library
Stars: ✭ 92 (-93.01%)
Mutual labels:  opengl
Cubicsdr
Cross-Platform Software-Defined Radio Application
Stars: ✭ 1,294 (-1.67%)
Mutual labels:  opengl

Bubble-Picker

License

Get it on Google Play

Check this project on dribbble

Read how we did it on Medium

Requirements

  • Android SDK 16+

Usage

Add to your root build.gradle:

allprojects {
	repositories {
	...
	maven { url "https://jitpack.io" }
	}
}

Add the dependency:

dependencies {
	compile 'com.github.igalata:Bubble-Picker:v0.2.4'
}

How to use this library

Add BubblePicker to your xml layout

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.igalata.bubblepicker.rendering.BubblePicker
        android:id="@+id/picker"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:backgroundColor="@android:color/white" />

</FrameLayout>

Override onResume() and onPause() methods to call the same methods from the BubblePicker

Kotlin

override fun onResume() {
      super.onResume()
      picker.onResume()
}

override fun onPause() {
      super.onPause()
      picker.onPause()
}

Java

@Override
protected void onResume() {
      super.onResume();
      picker.onResume();
}

@Override
protected void onPause() {
      super.onPause();
      picker.onPause();
}

Pass the PickerItem list to the BubblePicker

Kotlin

val titles = resources.getStringArray(R.array.countries)
val colors = resources.obtainTypedArray(R.array.colors)
val images = resources.obtainTypedArray(R.array.images)

picker.adapter = object : BubblePickerAdapter {

            override val totalCount = titles.size

            override fun getItem(position: Int): PickerItem {
                return PickerItem().apply {
                    title = titles[position]
                    gradient = BubbleGradient(colors.getColor((position * 2) % 8, 0),
                            colors.getColor((position * 2) % 8 + 1, 0), BubbleGradient.VERTICAL)
                    typeface = mediumTypeface
                    textColor = ContextCompat.getColor(this@DemoActivity, android.R.color.white)
                    backgroundImage = ContextCompat.getDrawable(this@DemoActivity, images.getResourceId(position, 0))
                }
            }
}

Java

final String[] titles = getResources().getStringArray(R.array.countries);
final TypedArray colors = getResources().obtainTypedArray(R.array.colors);
final TypedArray images = getResources().obtainTypedArray(R.array.images);

picker.setAdapter(new BubblePickerAdapter() {
            @Override
            public int getTotalCount() {
                return titles.length;
            }

            @NotNull
            @Override
            public PickerItem getItem(int position) {
                PickerItem item = new PickerItem();
                item.setTitle(titles[position]);
                item.setGradient(new BubbleGradient(colors.getColor((position * 2) % 8, 0),
                        colors.getColor((position * 2) % 8 + 1, 0), BubbleGradient.VERTICAL));
                item.setTypeface(mediumTypeface);
                item.setTextColor(ContextCompat.getColor(DemoActivity.this, android.R.color.white));
                item.setBackgroundImage(ContextCompat.getDrawable(DemoActivity.this, images.getResourceId(position, 0)));
                return item;
            }
});

Specify the BubblePickerListener to get notified about events

Kotlin

picker.listener = object : BubblePickerListener {
            override fun onBubbleSelected(item: PickerItem) {

            }

            override fun onBubbleDeselected(item: PickerItem) {

            }
}

Java

picker.setListener(new BubblePickerListener() {
            @Override
            public void onBubbleSelected(@NotNull PickerItem item) {
                
            }

            @Override
            public void onBubbleDeselected(@NotNull PickerItem item) {

            }
});

To get all selected items use picker.selectedItems variable in Kotlin or picker.getSelectedItems() method in Java.

For more usage examples please review the sample app

Changelog

Version: 0.2.4

  • Added a possibility to setup the BubblePicker using BubblePickerAdapter

Version: 0.2.3

  • Fixed black textures issue on some devices

Version: 0.2.1

  • BubblePicker.centerImmediately veriable added, so it's possible to place the bubbles in the center of the view immediately

Version: 0.2

  • icon parameter added to place an image on a bubble along with the title
  • iconOnTop parameter added to control position of the icon on a bubble
  • textSize parameter added
  • BubblePicker.bubbleSize variable now can be changed from 1 to 100

Known iOS versions of the animation

License

MIT License

Copyright (c) 2017 Irina Galata

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].