LGSnackbar alternatives and similar packages
Based on the "Other Widget" category.
Alternatively, view LGSnackbar alternatives based on common mentions on social networks and blogs.
-
AndroidSlidingUpPanel
This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano. -
BottomBar
(Deprecated) A custom view component that mimics the new Material Design Bottom Navigation pattern. -
ShortcutBadger
An Android library supports badge notification like iOS in Samsung, LG, Sony and HTC launchers. -
SystemBarTint
[DEPRECATED] Apply background tinting to the Android system UI when using KitKat translucent modes -
TapTargetView
An implementation of tap targets from the Material Design guidelines for feature discovery. -
android-viewbadger
[DEPRECATED] A simple way to "badge" any given Android view at runtime without having to cater for it in layout -
android-stackblur
Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. The library is based on the code of Mario Klingemann. -
android-iconify
Android integration of multiple icon providers such as FontAwesome, Entypo, Typicons,... -
DraggablePanel
DISCONTINUED. Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component. -
aFileChooser
DISCONTINUED. [DEPRECATED] Android library that provides a file explorer to let users select files on external storage. -
Swipecards
A Tinder-like Android library to create the swipe cards effect. You can swipe left or right to like or dislike the content. -
TourGuide
TourGuide is an Android library that aims to provide an easy way to add pointers with animations over a desired Android View -
StickyGridHeaders
DISCONTINUED. An Android Library that makes it easy to make grid views with sectioned data and headers that stick to the top. -
FloatingView
FloatingView can make the target view floating above the anchor view with cool animation -
TileView
TileView is a subclass of android.view.ViewGroup that asynchronously displays, pans and zooms tile-based images. Plugins are available for features like markers, hotspots, and path drawing. -
Bubbles for Android
Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your development. -
RippleView
View that imitates Ripple Effect on click which was introduced in Android L (for Android 2.3+) -
Android-ActionItemBadge
This library offers a simple method to add a small badge icon to your ActionBar-MenuItem -
android-sliding-layer-lib
DISCONTINUED. Highly customizable SlidingLayer as you have seen in Wunderlist -
SortableTableView
An Android library containing a simple TableView and an advanced SortableTableView providing a lot of customisation possibilities to fit all needs. -
ScratchView
ScratchView repo is UX Design involving scratch cards like views which are scratched to reveal the information they conceal. -
FabricView
A new canvas drawing library for Android. Aims to be the Fabric.js for Android. Supports text, images, and hand/stylus drawing input. The library has a website and API docs, check it out
WorkOS - The modern identity platform for B2B SaaS
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of LGSnackbar or a related project?
README
[logo](media/header_logo.png)
An easy to use wrapper of the native Android Snackbar which stays visible across multiple activities. It provides different themes to start with, and allows you to easily manage common scenarios like success, warning, error, info.
Preview
Demo video:
[logo](media/demo.gif)
Try it on Appetize:
[appetize](media/appetize.png)
Install
In your root/build.gradle:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
In your app/build.gradle
dependencies {
compile 'com.github.loregr:lgsnackbar:1.0.2'
}
Preparing
Setup with a default theme
Define your default theme using LGSnackbarManager.prepare(...)
, in your Application
class in the #onCreate()
method.
@Override
public void onCreate() {
super.onCreate();
LGSnackbarManager.prepare(getApplicationContext(),
LGSnackBarThemeManager.LGSnackbarThemeName.SHINE);
//....
}
You can check the available themes [here](./themes.md).
Note: You can simply call LGSnackbarManager.prepare(getApplicationContext())
, in this case SHINE
theme will be automatically applied.
Setup with a custom theme
Create your own LGSnackbarTheme
by passing 4 LGSnackBarStyle
instances (one for each scenario of the theme) and the minHeight
and the duration
values that you want to apply to the Snackbar.
@Override
public void onCreate() {
super.onCreate();
LGSnackbarManager.prepare(getApplicationContext(),
customTheme());
//....
}
//...
LGSnackBarTheme customTheme() {
LGSnackBarStyle successStyle = new LGSnackBarStyle(successCustomColor,
Color.WHITE,
actionSuccessCustomColor,
R.drawable.ic_done_white);
LGSnackBarStyle warningStyle = new LGSnackBarStyle(warningCustomColor,
Color.WHITE,
actionWarningCustomColor,
R.drawable.ic_warning_white);
LGSnackBarStyle errorStyle = new LGSnackBarStyle(errorCustomColor,
Color.WHITE,
actionErrorCustomColor,
R.drawable.ic_error_outline_white);
LGSnackBarStyle infoStyle = new LGSnackBarStyle(infoCustomColor,
Color.WHITE,
actionInfoCustomColor,
R.drawable.ic_info_outline_white);
return new LGSnackBarTheme(successStyle, warningStyle, errorStyle, infoStyle, 60, Snackbar.LENGTH_LONG);
}
Usage
After preparing is done, in order to show a snackbar you can simply call:
LGSnackbarManager.show(SUCCESS, "Everything is looking good! Awesome!");
Woooo, done! :-)
Callbacks and actions
You can add a callback and/or an action to your snackbar by calling:
Callback:
LGSnackbarManager.show(SUCCESS, "Everything is looking good! Awesome!",
new Snackbar.Callback() {
@Override
public void onShown(Snackbar sb) {
super.onShown(sb);
// LGSnackbar is now visible
}
@Override
public void onDismissed(Snackbar transientBottomBar, int event) {
super.onDismissed(transientBottomBar, event);
// LGSnackbar is now hidden
}
});
Action:
LGSnackbarManager.show(SUCCESS, "Everything is looking good! Awesome!",
new LGSnackbarAction("Action", new View.OnClickListener() {
@Override
public void onClick(View view) {
// Action fired
}
}));
Custom snackbar
If for any reason you may need to display a custom snackbar without setting a whole new theme, you can use an LGSnackbarBuilder
new LGSnackbar.LGSnackbarBuilder(getApplicationContext(), "This is a custom bar")
.duration(Snackbar.LENGTH_LONG)
.actionTextColor(Color.GREEN)
.backgroundColor(Color.GRAY)
.minHeightDp(50)
.textColor(Color.WHITE)
.iconID(R.drawable.ic_info_outline_white)
.callback(null)
.action(null)
.show();
Supported Attributes
Attribute | Description | Default value |
---|---|---|
style | An LGSnackBarStyle instance | Native Android snackbar style |
duration | How long to display the message. Either LENGTH_SHORT or LENGTH_LONG | LENGTH_LONG |
backgroundColor | The color of the snackbar | Native Android color |
actionTextColor | The color of the text of an action | Native Android color |
textColor | The color of the text | white |
minHeightDp | The height of the snackbar when only one line if text is displayed | 48 |
iconID | The drawable id of the icon | NO_ICON_ID (-1) |
callback | The snackbar callback | null |
action | The snackbar action | null |
Issues
Feel free to submit issues and features requests.
Contributing
Contributions are more then welcome. Your contribution may include bug fixing, new features or just new themes.
Please follow the "fork-and-pull" Git workflow (check [here](./CONTRIBUTING.md) for more).
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request so that I can review your changes
If you contribute with a new theme, please update also the themes.md
file.
NOTE: Be sure to merge the latest from "upstream" before making a pull request!
Author
Lorenzo Greco
License
MIT License
Copyright (c) 2017 Lorenzo Greco
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 all licence references and agreements mentioned in the LGSnackbar README section above
are relevant to that project's source code only.