GithubHelp home page GithubHelp logo

irmobydick / metaballs-lib-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danielzeller/metaballs-lib-android

0.0 1.0 0.0 30.66 MB

A library that simulates a liquid effect for various UI widgets.

Kotlin 98.57% GLSL 1.43%

metaballs-lib-android's Introduction

MetaBalls-LIB-Android

Various UI components that simulate a liquid(metaball) effect.

See demo on youtube

Did you mean meatball?

Nope -> metaball! This is a popular effect often used to simulate fluids. Try searching for metaball on Dribbble and you'll find countless concepts mostly made in After Effects. This library contains 3 different Widgets: MetaballMenu, MetaBallProgressBar and MetaBallPageIndicator.

Download

Via Gradle

compile 'no.danielzeller:metaballslib:1.0.1'

or Maven

<dependency>
  <groupId>no.danielzeller</groupId>
  <artifactId>metaballslib</artifactId>
  <version>1.0.1</version>
  <type>pom</type>
</dependency>

Metaball Circular Menu

From XML:

<no.danielzeller.metaballslib.menu.CircularMenu
        android:id="@+id/metaBallMenu"
        android:layout_width="match_parent"
        android:layout_height="match_parent"

        app:radius="90dp"
        app:angle_between_menu_items = "45"
        app:delay_between_items_animation="40"
        app:open_animation_duration = "1300"
        app:close_animation_duration = "1000" 
        app:open_interpolator_resource="@anim/overshoot_interpolator"
        app:close_interpolator_resource="@anim/overshoot_interpolator"
        app:position_gravity = "center"
        app:main_button_icon = "@drawable/ic_share_black_24dp"
        app:main_button_color = "@color/pastel_pink"
        app:main_button_icon_color = "@color/white"
        />

Then you need to setup an Adapter for the menu

       metaBallMenu.adapter = myAdapter

Adapter example:

class MetaBallMenuAdapter(val menuItems: List<MenuItem>) : MetaBallAdapter {

    override fun menuItemIconTint(index: Int): Int {
        return menuItems[index].drawableTint
    }

    override fun menuItemBackgroundColor(index: Int): Int {
        return menuItems[index].backgroundColor
    }

    override fun menuItemIcon(index: Int): Drawable? {
        return menuItems[index].drawable
    }

    override fun itemsCount(): Int {
        return menuItems.count()
    }
}

class MenuItem(val backgroundColor: Int, val drawable: Drawable, val drawableTint: Int)

Metaball Directional Menu

 <no.danielzeller.metaballslib.menu.DirectionalMenu
        android:id="@+id/metaBallMenu"
        android:layout_width="match_parent"
        android:layout_height="match_parent" 

        app:expand_direction="horizontal"
        app:main_button_color="@color/metal"
        app:main_button_icon="@drawable/ic_share_black_24dp"
        app:main_button_icon_color="@color/white"
        app:open_animation_duration="1300"
        app:close_animation_duration="1300"
        app:delay_between_items_animation="80"
        app:open_interpolator_resource="@anim/overshoot_interpolator"
        app:close_interpolator_resource="@anim/overshoot_interpolator"
        app:position_gravity="bottom_left" />

Metaball Page Indicator

   <no.danielzeller.metaballslib.MetaBallPageIndicator
        android:id="@+id/metaBallPageIndicator"
        android:layout_width="match_parent"
        android:layout_height="80dp"
       
        app:dot_colors_override_array_id="@array/viewpager_page_indicator_colors"
        app:selected_dot_color="@color/white"
        app:dot_size="30dp"
        app:dot_margin="10dp"
        app:selected_indicator_is_drop_drawable="true"/>

Then you need to attach the ViewPager to the MetaBallPageIndicator

 metaBallPageIndicator.attachToViewPager(bottomViewPager)

Metaball Progress Bar

      <no.danielzeller.metaballslib.progressbar.MBProgressBar
          android:id="@+id/mbProgressBar"
          android:layout_width="80dp"
          android:layout_height="80dp"
  
          app:progressbar_type="circular"
          app:colors_array_id="@array/gradient_green"
          app:rotate="true" />

ProgressBar Type

Set app:progressbar_type to one of the following: circular, blobs, dots, eight, square or long_path for a different look.

Contact

You can reach me on Twitter as @zellah or email.

Who's behind this?

Developed by Daniel Zeller - danielzeller.no, a freelance developer situated in Oslo, Norway.

metaballs-lib-android's People

Contributors

danielzeller avatar

Watchers

 avatar

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.