The usual Snackbar with more 🍫 and colours :tada:

Overview

ChocoBar

ChocoBar Download API AwesomeAndroid Android Arsenal

The usual Snackbar with more 🍫 and colours 🎉 . Inspired by Light.

GIF

AndroidPub Post

You can read the AndroidPub post about this library, the reason of it's existence, the perks it provides and other details, here.

Versions

Version name Tag What's new
Version 1.0 V1.0 First release of ChocoBar
Version 1.1 V1.1 Minor bug fixes and performance improvements
Version 1.2 V1.2 New good gray and bad gray ChocoBar additions and RTL languages support
Version 1.3 V1.3 New addition of Black ChocoBar and minor bug fixes
Version 1.4 V1.4 New addition of Love ChocoBar, bug fixes and addition of github actions for master branch
Version 1.5 V1.5 Update of in built Chocobars to have default text (editable)

Screenshots

Preview of Different kinds of ChocoBars you can use

screenshot 2018-12-31 at 4 26 25 am screenshot 2018-12-31 at 4 24 32 am screenshot 2018-12-31 at 4 25 38 am screenshot 2018-12-31 at 4 25 09 am screenshot 2018-12-31 at 4 26 00 am screenshot 2018-12-31 at 4 26 00 am screenshot 2018-12-31 at 4 26 00 am Love Chocobar

Prerequisites

Add this in your root build.gradle file (not your module build.gradle file):

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

Dependency

Add this to your module's build.gradle file (make sure the version matches the JitPack badge above):

dependencies {
	        implementation 'com.github.Pradyuman7:ChocoBar:V1.0'
}

Usage

Each method always returns a Snackbar object, so you can customize the Snackbar and much more. Check out the following examples:

  • To display a green ChocoBar:
ChocoBar.builder().setActivity(MainActivity.this)
		  .setText("GREEN")
		  .setDuration(ChocoBar.LENGTH_SHORT)
		  .green()  // in built green ChocoBar
		  .show();
  • To display a red ChocoBar:
ChocoBar.builder().setView(v)
		  .setText("RED")
	 	  .setDuration(ChocoBar.LENGTH_INDEFINITE)
		  .setActionText(android.R.string.ok)
		  .red()   // in built red ChocoBar
		  .show();
  • To display a gray ChocoBar:
ChocoBar.builder().setView(v)
                  .setText("GRAY_GOOD")
		  .centerText()
		  .setDuration(ChocoBar.LENGTH_LONG)
		  .good()
		  .show();
		  
ChocoBar.builder().setView(v)
	          .setText("GRAY_BAD")
		  .centerText()
		  .setDuration(ChocoBar.LENGTH_LONG)
		  .bad()
		  .show();
  • To display a love ChocoBar:
ChocoBar.builder().setView(v)
		  .setText("Love")
	 	  .setDuration(ChocoBar.LENGTH_INDEFINITE)
		  .setActionText(android.R.string.ok)
		  .love()   // in built red ChocoBar
		  .show();
  • To display a simple ChocoBar with a button and some action on clicking the button.
ChocoBar.builder().setActivity(MainActivity.this).setActionText("ACTION")
		.setActionClickListener(new View.OnClickListener() {
                	@Override
                	public void onClick(View v) {
                     		Toast.makeText(MainActivity.this,"You clicked",Toast.LENGTH_LONG).show();
                	}
                	})
		.setText("This is a normal ChocoBar")
		.setDuration(ChocoBar.LENGTH_INDEFINITE)
		.build()
		.show();
  • You can also create custom ChocoBars with tons of customizations like this:
ChocoBar.builder().setBackgroundColor(Color.parseColor("#00bfff"))
		  .setTextSize(18)
		  .setTextColor(Color.parseColor("#FFFFFF"))
		  .setTextTypefaceStyle(Typeface.ITALIC)
	          .setText("This is a custom Chocobar")
		  .setMaxLines(4)
		  .centerText()
		  .setActionText("ChocoBar")
		  .setActionTextColor(Color.parseColor("#66FFFFFF"))
	  	  .setActionTextSize(20)
		  .setActionTextTypefaceStyle(Typeface.BOLD)
		  .setIcon(R.mipmap.ic_launcher)
		  .setActivity(MainActivity.this)
		  .setDuration(ChocoBar.LENGTH_INDEFINITE)
		  .build()
	  	  .show();
            

Pull Request

Have some new ideas or found a bug? Do not hesitate to open an issue and make a pull request.

License

ChocoBar is under License: MIT. See the LICENSE file for more info.

Comments
  • Added New Icon Tint Feature

    Added New Icon Tint Feature

    Description

    Added New Icon Tinting option as per #32

    Related issues and discussion

    #32

    Checklist

    Please make sure these boxes are checked before submitting your pull request - thanks!

    • [Done ] If you have multiple commits please combine them into one commit by squashing them.

    • [Done ] Read and understood the fun contribution guidelines at CONTRIBUTING.md.

    opened by istiakshihab 3
  • Add Icon Tint mode when calling the snackbar.

    Add Icon Tint mode when calling the snackbar.

    Add option to use custom tint for different icons when calling snackbar like this.

    ChocoBar.builder().setView(v)
            .setText("CYAN")
            .setDuration(ChocoBar.LENGTH_INDEFINITE)
            .setActionText(android.R.string.ok)
            .setIconTint(Color.white)
            .cyan() // built-in cyan ChocoBar
            .show();
    
    opened by istiakshihab 3
  • Kotlin port of Chocobar

    Kotlin port of Chocobar

    Is your feature request related to a problem? Please describe. New feature request

    Describe the solution you'd like Kotlin port of Chocobar

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Upgrading the project to java 8

    Additional context I would like to work this

    enhancement Hacktoberfest-accepted 
    opened by JamesEllerbee 3
  • Improve documentation

    Improve documentation

    Currently, the documentation is included in the main ReadMe. Please separate it from there and create a new Documentation.md for it

    • Add documentation for the missing Chocobars (newly added)
    • Make the documentation look nice and good
    • Add the documentation file link to main ReadMe
    enhancement help wanted Hacktoberfest-accepted 
    opened by Pradyuman7 2
  • Fix #16 - Lack of default text

    Fix #16 - Lack of default text

    Description

    • Added default text to the already existing types without affecting the current implementation.
    • Made some of the default texts meaningful (warning, success, error)

    Related issues and discussion

    #16

    opened by OussEmaDevCode 2
  • Add Black ChocoBar

    Add Black ChocoBar

    Hello,

    I added Black ChocoBar related to notification.

    This does not harm the functionality of the application.

    If I'm wrong, please leave a comment below.

    I really want to contribute to your project.

    Thank you.

    opened by LeeJiHyeong 2
  • Add snackbar of good and bad emotion, gray color (enhance function)

    Add snackbar of good and bad emotion, gray color (enhance function)

    closed #8 Hi I've actually used your library on my project and I really appreciate it.

    I am taking software classes at school and I need to contribute to open source.

    I added a toast message function related to emotion so as not to damage your function.

    If you accept it and needed to fix README.md about this function , I'll fix README.md related it.

    Thank you.

    opened by mtjin 2
  • chocobar instrumented tests, modified gradle scripts.

    chocobar instrumented tests, modified gradle scripts.

    Description

    Added ChocoBar instrumented tests to test chocobar types. Modified gradle scripts. Set java 8 as compile options and update minor version numbers. Replace JCenter with MavenCentral. Replaced on click listeners in main activity with lambas.

    Related issues and discussion

    #20

    Screenshots, if any

    N/A

    Checklist

    Please make sure these boxes are checked before submitting your pull request - thanks!

    • [x] If you have multiple commits please combine them into one commit by squashing them.

    • [x] Read and understood the fun contribution guidelines at CONTRIBUTING.md.

    opened by JamesEllerbee 1
  • Minimum SDK

    Minimum SDK

    Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 15 declared in library [com.github.Pradyuman7:ChocoBar:V1.0] C:\Users\Cool.gradle\caches\transforms-1\files-1.1\jetified-ChocoBar-V1.0.aar\2df20e04cd68d6f9490200ae77845214\AndroidManifest.xml as the library might be using APIs not available in 14 Suggestion: use a compatible library with a minSdk of at most 14, or increase this project's minSdk version to at least 15, or use tools:overrideLibrary="com.pd.chocobar" to force usage (may lead to runtime failures)

    So is the minimum sdk requirement 14 or 15?

    opened by coolmyll 1
  • InfoGray notification type added

    InfoGray notification type added

    Description

    Added new Semi-Transparent InfoGray Snackbar with a blue icon.

    Screenshots, if any

    Added with Readme

    Checklist

    Please make sure these boxes are checked before submitting your pull request - thanks!

    • [ Done] If you have multiple commits please combine them into one commit by squashing them.

    • [ Done] Read and understood the fun contribution guidelines at CONTRIBUTING.md.

    opened by istiakshihab 0
  • create chocobar kotlin module, create new activity with content example

    create chocobar kotlin module, create new activity with content example

    Description

    Added Kotlin port of chocobar library and added new content example.

    I accidentally version controlled changes to .idea files so I have removed them, wasn't sure the best way to deal with that.

    Related issues and discussion

    #25

    Screenshots, if any

    Demonstraction

    Checklist

    Please make sure these boxes are checked before submitting your pull request - thanks!

    • [x] If you have multiple commits please combine them into one commit by squashing them.

    • [x] Read and understood the fun contribution guidelines at CONTRIBUTING.md.

    opened by JamesEllerbee 0
  • Add checkstyle to CI

    Add checkstyle to CI

    The project needs to be fixed using a checkstyle, which also needs to be added to CI. The build should fail when the PR code does not follow the checkstyle

    enhancement good first issue Hacktoberfest-accepted hacktoberfest 
    opened by Pradyuman7 0
  • Add new ChocoBars of your choice

    Add new ChocoBars of your choice

    • There are already a lots of inbuilt snackbars (ChocoBars), but having even more unique ChocoBars will help
    • Please add ChocoBars that you think are unique and cool
    • Please also add a screenshot of the ChocoBar in the ReadMe along with the other screenshots
    enhancement Hacktoberfest-accepted hacktoberfest 
    opened by Pradyuman7 0
Releases(V2.0)
Owner
Pradyuman Dixit
I code.
Pradyuman Dixit
Snacky is a small library to help you adding a Snackbar to your android project.

Snacky Snacky is a small library to help you adding a Snackbar to your layout with ease. It was created because of my own needs and is inspired by Toa

Mate 492 Dec 7, 2022
MaterialDesignColorPalette 4.2 0.0 L3 Java This is a dev tool to visualize the colours of Material design defined on

MaterialDesignColorPalette This is a dev tool to visualize the colours of Material design defined on http://www.google.com/design/spec/style/color.htm

Guillaume Imbert 256 Oct 2, 2022
The usual Toast, but with steroids 💪

Toasty The usual Toast, but with steroids. Prerequisites Add this in your root build.gradle file (not your module build.gradle file): allprojects { r

null 6.4k Jan 9, 2023
Android Snackbar from the Top (similar to Crouton)

Top Snackbar Sadly, I don't have time to maintain this. If you'd like to be a maintainer, drop me a message in an issue Show a Snackbar from the top.

Dan Ξ 1.1k Dec 17, 2022
Snacky is a small library to help you adding a Snackbar to your android project.

Snacky Snacky is a small library to help you adding a Snackbar to your layout with ease. It was created because of my own needs and is inspired by Toa

Mate 492 Dec 7, 2022
a Custom Snackbar Library for Jetpack Compose 🚀🎨

?? Snackie is a custom snackbar library for jetpack compose built without using the built in snackbar component ?? Implementation repositories { ma

MathRoda 10 Dec 24, 2022
Another-read-more-lib - Another read more library for android

another-read-more-lib ?? Another read more library. Add it in your root build.gr

Geovani Amaral 9 Nov 2, 2022
Binding your extras more easier, more simpler for your Android project

Ktan Ktan make your intent / arguments more easier and readable. And most important, will help you bind all extras for your activity / fragment. And a

Ade Fruandta 3 Jan 7, 2023
A nicer-looking, more intuitive and highly customizable alternative for radio buttons and dropdowns for Android.

SwipeSelector Undergoing for some API changes for a 2.0 major version, see example usage in the sample module! What and why? Bored of dull looking rad

Iiro Krankka 1.1k Dec 9, 2022
A nicer-looking, more intuitive and highly customizable alternative for radio buttons and dropdowns for Android.

SwipeSelector Undergoing for some API changes for a 2.0 major version, see example usage in the sample module! What and why? Bored of dull looking rad

Iiro Krankka 1.1k Dec 30, 2022
A RecyclerView(advanced and flexible version of ListView in Android) with refreshing,loading more,animation and many other features.

UltimateRecyclerView Master branch: Dev branch: Project website:https://github.com/cymcsg/UltimateRecyclerView Description UltimateRecyclerView is a R

MarshalChen 7.2k Jan 2, 2023
Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Provides easy means to validate with dependencies.

android-formidable-validation Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Pr

Linden 147 Nov 20, 2022
An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices

KOReader is a document viewer primarily aimed at e-ink readers. Download • Wiki • Developer docs Main features portable: runs on embedded devices (Cer

KOReader Community 12k Jan 4, 2023
Is an All in One app for Muslims with lots of features such as Prayer Times & Adhan, Collections of Dhikr and Prayer sourced from Authentic Hadith, The Holy Qur'an, Qibla, Notes and many more!

Is an All in One app for Muslims with lots of features such as Prayer Times & Adhan, Collections of Dhikr and Prayer sourced from Authentic Hadith, The Holy Qur'an, Qibla, Notes and many more!

DzikirQu 112 Dec 26, 2022
Is an All in One app for Muslims with lots of features such as Prayer Times & Adhan, Collections of Dhikr and Prayer sourced from Authentic Hadith, The Holy Qur'an, Qibla, Notes and many more!

DzikirQu Is an All in One app for Muslims with lots of features such as Prayer Times & Adhan, Collections of Dhikr and Prayer sourced from Authentic H

DzikirQu 112 Dec 26, 2022
Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more.

Stetho Stetho is a sophisticated debug bridge for Android applications. When enabled, developers have access to the Chrome Developer Tools feature nat

Facebook 12.6k Jan 7, 2023
AwesomeSwitch is a replacement for the standard Switch(View) android offers, and it offers much more customization than the standard switch component.

AwesomeSwitch AwesomeSwitch is a replacement for the standard Switch(View) android offers, and it offers much more customization than the standard swi

Anoop S S 29 Jun 2, 2022
Material Design implementation for Android 4.0+. Shadows, ripples, vectors, fonts, animations, widgets, rounded corners and more.

Carbon Material Design implementation for Android 4.0 and newer. This is not the exact copy of the Lollipop's API and features. It's a custom implemen

null 3k Dec 30, 2022
Over 1600 customizable icons for Android including 750+ Google Material Design icons, 25 ready-made social badges, and more!

droidicon - Over 1600 icons for Android! Icons From... Google Material Design FontAwesome Iconic Entypo Meteocons Unicode Icons Your own custom icons

Devon Guinane 2.2k Dec 19, 2022
A beautiful material calendar with endless scroll, range selection and a lot more!

CrunchyCalendar A light, powerful and easy to use Calendar Widget with a number out of the box features: Infinite vertical scrolling in both direction

CleverPumpkin 483 Dec 25, 2022