All Projects → danimahardhika → Cafebar

danimahardhika / Cafebar

Licence: apache-2.0
An upgraded Snackbar for Android that provides more options and easy to use

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Cafebar

Light
🍭 The usual Snackbar, but elegant
Stars: ✭ 542 (+281.69%)
Mutual labels:  material-design, ui-components, material-components, snackbar
Material Backdrop
A simple solution for implementing Backdrop pattern for Android
Stars: ✭ 221 (+55.63%)
Mutual labels:  material-design, ui-components, material-components
Smart Webcomponents
Web Components & Custom Elements for Professional Web Applications
Stars: ✭ 110 (-22.54%)
Mutual labels:  material-design, ui-components, material-components
Material
A lightweight Material Design library for Angular based on Google's Material Components for the Web.
Stars: ✭ 143 (+0.7%)
Mutual labels:  material-design, ui-components, material-components
Svelte Materialify
A Material UI Design Component library for Svelte heavily inspired by vuetify.
Stars: ✭ 351 (+147.18%)
Mutual labels:  material-design, ui-components, material-components
Snacky
Snacky is a small library to help you adding a Snackbar to your android project.
Stars: ✭ 482 (+239.44%)
Mutual labels:  material-design, ui-components, snackbar
Vuetify
🐉 Material Component Framework for Vue
Stars: ✭ 33,085 (+23199.3%)
Mutual labels:  material-design, ui-components, material-components
Blazormaterial
Blazor components implementing Google's Material components for web - https://material.io/components/web
Stars: ✭ 136 (-4.23%)
Mutual labels:  material-design, material-components
Android Art
🎄 Android™ 设计相关的在线工具: 图标制作、配色方案、尺寸修改、截图加壳等,持续更新...
Stars: ✭ 95 (-33.1%)
Mutual labels:  material-design, ui-components
Material Design Dimens
Default colors and dimens per Material Design guidelines and Android Design guidelines inside one library.
Stars: ✭ 1,378 (+870.42%)
Mutual labels:  material-design, material-components
Ct Material Kit Pro
Premium Bootstrap 4 UI Kit based on Google's Material Design
Stars: ✭ 123 (-13.38%)
Mutual labels:  material-design, ui-components
Cyanea
A theme engine for Android
Stars: ✭ 1,319 (+828.87%)
Mutual labels:  material-design, material-components
Togglebuttons
Android toggle buttons that adhere to the Material Design documentation.
Stars: ✭ 88 (-38.03%)
Mutual labels:  material-design, ui-components
Datingapp
Dating UI kit is used for online meet up with girls and boys . The screen contains more than 30 icons and most of all required elements required to design an application like this. The XML and JAVA files contains comments at each and every point for easy understanding. Everything was made with a detail oriented style and followed by today's web trends. Clean coded & Layers are well-organized, carefully named, and grouped.
Stars: ✭ 97 (-31.69%)
Mutual labels:  material-design, ui-components
Material Components Web Elm
Material Components for Elm
Stars: ✭ 73 (-48.59%)
Mutual labels:  material-design, material-components
Snackbarbuilder
[ARCHIVED] Builder pattern for support library Snackbars, that makes them easier to customise and use
Stars: ✭ 71 (-50%)
Mutual labels:  material-design, snackbar
Mediapicker
Easy customizable picker for all your needs in Android application
Stars: ✭ 105 (-26.06%)
Mutual labels:  material-design, material-components
Material Ui Time Picker
A time picker for Material-UI.
Stars: ✭ 126 (-11.27%)
Mutual labels:  material-design, ui-components
React Native Snackbar Component
A snackbar component for Android and iOS
Stars: ✭ 137 (-3.52%)
Mutual labels:  material-design, snackbar
Balm Ui
♦️ A modular and customizable UI library based on Material Design and Vue
Stars: ✭ 133 (-6.34%)
Mutual labels:  material-design, material-components

CafeBar

Build Status Codacy Badge License

An upgraded Snackbar for Android that provides more options and easy to use. Download sample apk from here.

Gradle Dependency

The minimum API level supported by this library is API 14

Add JitPack repository to root build.gradle

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

Add the dependency

dependencies {
    implementation 'com.github.danimahardhika:cafebar:1.3.1'
}

Usage

Old release 1.0.0 - 1.2.0 take a look here

Show simple CafeBar

CafeBar.make(context, R.string.text, CafeBar.Duration.SHORT).show();

Show simple CafeBar with action

CafeBar.make(context, R.string.text, CafeBar.Duration.SHORT)
    .setAction(actionText, actionColor, callback)
    .show();

Using builder

CafeBar.builder(context)
    .theme(CafeBarTheme.LIGHT)
    .duration(CafeBar.Duration.MEDIUM)
    .content(R.string.text)
    .neutralText("Action")
    //You can parse string color
    .neutralColor(Color.parseColor("#EEFF41"))
    //Or use color resource
    .neutralColor(R.color.neutralText)
    .show();

Retrieve CafeBar view

CafeBar.Builder builder = new CafeBar.Builder(context);
...
CafeBar cafeBar = builder.build();

View v = cafeBar.getView();
//Do something
cafeBar.show();

Floating CafeBar

 CafeBar.builder(context)
    .content("some text")
    .floating(true)
    .show();

CafeBar above Translucent NavigationBar

CafeBar.builder(context)
    .content(R.string.text)
    //automatically determine if device has soft navigation bar and translucent navigation bar
    .fitSystemWindow()
    .show();

Custom Theme

CafeBar.builder(context)
    //Text color (content and buttons) automatically set
    .theme(CafeBarTheme.Custom(Color.parseColor("#F44336")));
    .content(R.string.text)
    .show();

Custom Font

CafeBar.builder(context)
    .content(R.string.text)
    //You must place your font inside assets/fonts/ folder
    .contentTypeface("RobotoMono-Regular.ttf")
    //Or
    .contentTypeface(Typeface.createFromAsset(context.getAssets(), "fonts/RobotoMono-Regular.ttf");
    .show();

Customization

Builder

  • customView() → Use custom view
  • to() → Set target view, it should be CoordinatorLayout
  • content() → Content text
  • contentTypeface() → Custom typeface for content
  • maxLines() → Max content lines, must be between 1 to 6.
  • duration() → Show duration
  • theme() → CafeBar theme, there are 3 choices available DARK (default), LIGHT, and CLEAR_BLACK. You can use custom theme CafeBarTheme.Custom(int).
  • icon() → Icon shown on left side of content
  • showShadow() → Enable or disable shadow
  • autoDismiss() → Enable or disable auto dismiss, default is true
  • swipeToDismiss() → Enable or disable swipe to dismiss, only works with target view CoordinatorLayout.
  • floating() → Set CafeBar style to floating
  • gravity() → Set CafeBar view gravity, only works for tablet and floating
  • fitSystemWindow() → Show CafeBar above translucent navigation bar
  • neutralText() → Neutral action text
  • neutralColor() → Neutral action text color
  • neutralTypeface() → Custom typeface for neutral text
  • onNeutral() → Neutral action callback
  • positiveText() → Positive action text
  • positiveColor() → Positive action text color
  • positiveTypeface() → Custom typeface for positive text
  • onPositive() → Positive action callback
  • negativeText() → Negative action text
  • negativeColor() → Negative action text color
  • negativeTypeface() → Custom typeface for negative text
  • onNegative() → Negative action callback
  • buttonColor() → Set all buttons color
  • buttonTypeface() → Set all buttons typeface
  • typeface() → Set content and button typeface
  • show() → Show CafeBar directly from builder
  • build() → Create CafeBar

CafeBar

  • make() → Create CafeBar
  • setAction() → It's the same with neutral action from builder, if neutralText() already set from builder setAction() will be ignored.
  • getView() → Get root view of CafeBar
  • show() → Show CafeBar
  • dismiss() → Dismiss CafeBar

License

Copyright (c) 2017 Dani Mahardhika

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.
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].