diff --git a/README.md b/README.md index 7e8c8e1..845750d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Restaurant An extension to the Snackbar view available at the Android Design Support Library. -Restaurant wraps the `Snackbar` implementation to easily allow more customization. With Restaurant you can change the text and background color of the `Snackbar` just calling a method. Restaurant can also detect the correct view to attach the Snackbar just receiving the activity. +Restaurant wraps the `Snackbar` implementation to easily allow more customization. With Restaurant you can change the text and background color of the `Snackbar` just calling a method. Restaurant can also detect the correct view to attach the Snackbar just receiving the activity. # Gradle Dependency @@ -24,7 +24,7 @@ dependencies { // ... other dependencies here. // Set the transitive = false if you already have the Design Support Library dependency. - compile('com.github.SandroMachado.restaurant:0.1.0@aar') { + compile('com.github.SandroMachado.restaurant:0.2.0@aar') { transitive = true } } @@ -52,6 +52,19 @@ new Restaurant(MainActivity.this, "Snackbar with custom text color", Snackbar.LE .show(); ``` +Show a Snackbar with a custom text colors: + +![Snackbar with custom text colors](screenshots/custom_text_colors.png) + +```Java +new Restaurant(MainActivity.this, "", Snackbar.LENGTH_LONG) + .appendText("RED", Color.RED) + .appendText("GREEN", Color.GREEN) + .appendText("BLUE", Color.BLUE) + .appendText("WHITE", Color.WHITE) + .show(); +``` + Show a custom Snackbar: ![Snackbar with custom](screenshots/custom.png) diff --git a/Sample/RestaurantSample/app/src/main/java/com/sandro/restaurantesample/MainActivity.java b/Sample/RestaurantSample/app/src/main/java/com/sandro/restaurantesample/MainActivity.java index 0d04ca6..6531225 100644 --- a/Sample/RestaurantSample/app/src/main/java/com/sandro/restaurantesample/MainActivity.java +++ b/Sample/RestaurantSample/app/src/main/java/com/sandro/restaurantesample/MainActivity.java @@ -46,5 +46,18 @@ public void onClick(View v) { .show(); } }); + + Button snackbarMultipleCustomTextColor = (Button) findViewById(R.id.button_snackbar_multiple_custom_text_color); + snackbarMultipleCustomTextColor.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + new Restaurant(MainActivity.this, "", Snackbar.LENGTH_LONG) + .appendText("RED", Color.RED) + .appendText("GREEN", Color.GREEN) + .appendText("BLUE", Color.BLUE) + .appendText("WHITE", Color.WHITE) + .show(); + } + }); } } diff --git a/Sample/RestaurantSample/app/src/main/res/layout/activity_main.xml b/Sample/RestaurantSample/app/src/main/res/layout/activity_main.xml index d9e327f..272683b 100644 --- a/Sample/RestaurantSample/app/src/main/res/layout/activity_main.xml +++ b/Sample/RestaurantSample/app/src/main/res/layout/activity_main.xml @@ -29,5 +29,10 @@ android:layout_height="wrap_content" android:text="Show a Snackbar with custom text color and background"/> +