All Projects β†’ AviranAbady β†’ Cookiebar2

AviranAbady / Cookiebar2

Licence: apache-2.0
Android library for displaying text messages, notifications and alerts at the top or bottom of the screen. A great alternative for toast and snackbar alerts.

Programming Languages

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

Projects that are alternatives of or similar to Cookiebar2

Expenso
πŸ“Š A Minimal Expense Tracker App built to demonstrate the use of modern android architecture component with MVVM Architecture
Stars: ✭ 325 (-34.87%)
Mutual labels:  material-design, android-development, android-ui
Mediapicker
Easy customizable picker for all your needs in Android application
Stars: ✭ 105 (-78.96%)
Mutual labels:  material-design, android-development, android-ui
Slidetoact
A simple 'Slide to Unlock' Material widget for Android, written in Kotlin πŸ“±πŸŽ¨πŸ¦„
Stars: ✭ 783 (+56.91%)
Mutual labels:  material-design, android-development, android-ui
Music Player Go
🎢🎼 Very slim music player πŸ‘¨β€πŸŽ€ 100% made in Italy πŸ•πŸŒ³πŸŒžπŸπŸŒ„
Stars: ✭ 654 (+31.06%)
Mutual labels:  material-design, android-development, android-ui
Notzz App
πŸ“ A Simple Note-Taking App built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, State Flow, Hilt-Dependency Injection, Jetpack DataStore, Architecture Components, MVVM, Room, Material Design Components).
Stars: ✭ 158 (-68.34%)
Mutual labels:  material-design, android-development, android-ui
Motiontoast
🌈 A Beautiful Motion Toast Library for Kotlin Android
Stars: ✭ 767 (+53.71%)
Mutual labels:  material-design, android-development, android-ui
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 (-80.56%)
Mutual labels:  material-design, android-development, android-ui
Android Customtoast
Easy to use Custom Toast Library for Android
Stars: ✭ 24 (-95.19%)
Mutual labels:  material-design, android-development, android-ui
Materialdrawer
The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.
Stars: ✭ 11,498 (+2204.21%)
Mutual labels:  material-design, android-development, android-ui
Ibackdrop
A library to simply use Backdrop in your project (make it easy). Read more ->
Stars: ✭ 137 (-72.55%)
Mutual labels:  material-design, android-development, android-ui
Alerter
An Android Alerting Library
Stars: ✭ 5,213 (+944.69%)
Mutual labels:  material-design, android-development, android-ui
Bottomsheet
BottomSheet dialog library for Android
Stars: ✭ 219 (-56.11%)
Mutual labels:  material-design, android-development, android-ui
Glidetoast
GlideToast is a android library to implement flying Toast Animation
Stars: ✭ 162 (-67.54%)
Mutual labels:  android-development, android-ui, toast
Tableview
TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
Stars: ✭ 2,928 (+486.77%)
Mutual labels:  material-design, android-development, android-ui
Fancyshowcaseview
An easy-to-use customisable show case view with circular reveal animation.
Stars: ✭ 1,662 (+233.07%)
Mutual labels:  material-design, android-development, android-ui
Awesomedialog
A Beautiful Dialog Library for Kotlin Android
Stars: ✭ 163 (-67.33%)
Mutual labels:  material-design, android-development, android-ui
Customfloatingactionbutton
This view is for replacement of standard Floating Action Button from Google Support Library. It is easy to use, customizable and you can also add text to button
Stars: ✭ 222 (-55.51%)
Mutual labels:  material-design, android-development, android-ui
Slidingrootnav
DrawerLayout-like ViewGroup, where a "drawer" is hidden under the content view, which can be shifted to make the drawer visible.
Stars: ✭ 2,939 (+488.98%)
Mutual labels:  android-development, android-ui
Sequent
A simple continuous animation library for Android UI.
Stars: ✭ 263 (-47.29%)
Mutual labels:  material-design, android-ui
Android Ecosystem Cheat Sheet
πŸ€–Android Ecosystem Cheatsheet 2020
Stars: ✭ 488 (-2.2%)
Mutual labels:  android-development, android-ui

Android Arsenal Codacy Badge AndroidWeekly335

CookieBar 2

CookieBar is a lightweight library for showing a brief message at the top or bottom of the screen.

implementation 'org.aviran.cookiebar2:cookiebar2:1.1.4'

Screenshot

Main differences from the original Cookiebar library are:

  • Swipe to dismiss has been added.
  • Programmatic dismiss functionality added.
  • Only one Cookie can be displayed at a time (New top cookie will dismiss the current top one if exists).
  • Message view captures clicks, blocks downward propagation.
  • Slightly different build interface.
  • Icon animator support.
  • Custom layout can be applied to a cookie.
  • Colors presets added.
  • Root view can be overridden and customized.
  • Removed supportRtl / allowBackup from library scope (Set at app level when necessary).

Create a simple cookie

Using Kotlin

CookieBar.build(activity)           // Provide activity, using [email protected] / getActivity() or otherwise
         .setTitle("TITLE")         // String resources are also supported
         .setMessage("MESSAGE")     // i.e. R.string.message
         .show()                    // Cookies are displayed at the top by default

Using Java

CookieBar.build(getactivty())
         .setTitle("TITLE")
         .setMessage("MESSAGE")
         .setCookiePosition(CookieBar.BOTTOM)  // Cookie will be displayed at the bottom
         .show();                              // of the screen

Customize colors, icon, icon animation, call to action button, display duration

CookieBar.build(activity)
         .setTitle(R.string.title)
         .setTitleColor(R.color.green)
         .setIcon(R.drawable.icon)
         .setIconAnimation(R.animator.spin)
         .setMessage(R.string.message)
         .setAction(R.string.action_text) { 
              // Action code - Do something
         }
         .setDuration(5000) // 5 seconds
         .show()

Customize in/out animation

CookieBar.build(activity)
         .setTitle(R.string.title)
         .setMessage(R.string.message)
         .setAnimationIn(android.R.anim.slide_in_left, android.R.anim.slide_in_left)
         .setAnimationOut(android.R.anim.slide_out_right, android.R.anim.slide_out_right)
         .show()

Programmatically dismiss cookies currently being displayed

CookieBar.dismiss(activity)

Create a cookie with a custom layout - Create a dialog!

CookieBar.build(activity)
         .setCustomView(R.layout.custom_cookie)
         .setCustomViewInitializer { view ->
             val btnNew = view.findViewById<Button>(R.id.custom_cookie_btn_new)
             val btnOpen = view.findViewById<Button>(R.id.custom_cookie_btn_open)
             val btnSave = view.findViewById<Button>(R.id.custom_cookie_btn_save)
             val btnListener = View.OnClickListener { view ->
                 val button = view as Button
                 button.setText(R.string.clicked)
             }
             btnNew.setOnClickListener(btnListener)
             btnOpen.setOnClickListener(btnListener)
             btnSave.setOnClickListener(btnListener)
         }
         .setAction("Close") { CookieBar.dismiss(activity) }
         .setTitle(R.string.custom_view_cookie_title)
         .setMessage(R.string.custom_view_cookie_message)
         .setEnableAutoDismiss(false)
         .setSwipeToDismiss(false)
         .setCookiePosition(Gravity.BOTTOM)
         .show()
/* setCustomView -  Set the layout resource for your custom cookie view.
   setCustomViewInitializer - Called after layout inflation, for subview setup. */

CookieBar.build(MainActivity.this)
         .setCustomView(R.layout.custom_cookie)
         .setCustomViewInitializer(new CookieBar.CustomViewInitializer() {
                  @Override
                  public void initView(View view) {

                           Button btnNew = view.findViewById(R.id.custom_cookie_btn_new);
                           Button btnOpen = view.findViewById(R.id.custom_cookie_btn_open);
                           Button btnSave = view.findViewById(R.id.custom_cookie_btn_save);

                           View.OnClickListener btnListener = new View.OnClickListener() {

                                    @Override
                                    public void onClick(View view) {
                                             Button button = (Button) view;
                                             button.setText(R.string.clicked);
                                    }
                                };

                           btnNew.setOnClickListener(btnListener);
                           btnOpen.setOnClickListener(btnListener);
                           btnSave.setOnClickListener(btnListener);
                  }
         })
         .setAction("Close", new OnActionClickListener() {
                  @Override
                  public void onClick() {
                           CookieBar.dismiss(MainActivity.this);
                  }
         })
         .setTitle(R.string.title)
         .setMessage(R.string.message)
         .setEnableAutoDismiss(false) // Cookie will stay on display until manually dismissed
         .setSwipeToDismiss(false)    // Deny dismiss by swiping off the view
         .setCookiePosition(CookieBar.BOTTOM)
         .show();

Change default cookie style by setting theme attributes

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
   <item name="cookieTitleColor">@color/default_title_color</item>
   <item name="cookieMessageColor">@color/default_message_color</item>
   <item name="cookieActionColor">@color/default_action_color</item>
   <item name="cookieBackgroundColor">@color/default_bg_color</item>
   <item name="cookiePadding">24dp</item>
   <item name="cookieTitleSize">24sp</item>
   <item name="cookieMessageSize">16sp</item>
   <item name="cookieActionSize">18sp</item>
</style>

Dynamically set cookie properties

  • Cookie position (Top/Bottom)
  • Display duration
  • Title text color
  • Body text color
  • Action text color
  • Background color
  • Icon resource
  • Icon animation
  • In/Out animations for the entire view
  • View layout

Attribution

Forked from the early code base of CookieBar, by Eric Liu.

License

Copyright 2018, Aviran Abady.

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