Skip to content
CookieBar is a lightweight library for showing a brief message at the top or bottom of the screen.
Branch: master
Clone or download
Latest commit baefe5e May 28, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app upgrade build tools version. Nov 16, 2017
arts
gradle update README May 28, 2018
library upgrade build tools version. Nov 16, 2017
.gitignore first commit Mar 3, 2017
.travis.yml Can change the default style by set the Theme's attributes. Mar 21, 2017
README.md update README May 28, 2018
build.gradle update README May 28, 2018
gradle.properties The action button could be replaced by a icon. Aug 31, 2017
gradlew first commit Mar 3, 2017
gradlew.bat first commit Mar 3, 2017
settings.gradle Move the all core code to a library. Mar 6, 2017

README.md

Cookie Build Status

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

Screenshot

Usage

Gradle

dependencies {
   	compile 'com.liuguangqiang.cookie:library:1.0'
}

Maven

<dependency>
  <groupId>com.liuguangqiang.cookie</groupId>
  <artifactId>library</artifactId>
  <version>1.0</version>
  <type>aar</type>
</dependency>

A simple CookieBar.

 new CookieBar.Builder(MainActivity.this)
                        .setTitle("TITLE")
                        .setMessage("MESSAGE")
                        .show();

A CookieBar with a icon and a action button.

 new CookieBar.Builder(MainActivity.this)
                        .setTitle("TITLE")
                        .setIcon(R.mipmap.ic_launcher)
                        .setMessage("MESSAGE")
                        .setAction("ACTION", new OnActionClickListener() {
                            @Override
                            public void onClick() {
                            }
                        })
                        .show();

You can change the default style by set the Theme's 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>
</style>

Or dynamically change the style with a cookie builder.

  • layoutGravity
  • backgroundColor
  • titleColor
  • messageColor
  • actionColor
  • duration

New Features

1.0.0

  • The action button could be replaced by a icon.

License

Copyright 2017 Eric Liu

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.
You can’t perform that action at this time.