Skip to content

Commit

Permalink
SnackbarManager now in lib
Browse files Browse the repository at this point in the history
  • Loading branch information
William Mora committed Dec 18, 2014
1 parent 9bdff85 commit 374f8cf
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.nispok.sample.snackbar;

import com.nispok.sample.snackbar.utils.SnackbarManager;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;

import android.graphics.Color;
import android.os.Bundle;
Expand Down Expand Up @@ -41,7 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
SnackbarManager.getInstance().show(
SnackbarManager.show(
Snackbar.with(SnackbarListViewSampleActivity.this)
.text(String.format("Item %d pressed", (position + 1)))
.actionLabel("Close")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.nispok.sample.snackbar;

import com.nispok.sample.snackbar.utils.SnackbarManager;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;

import android.content.Context;
import android.graphics.Color;
Expand Down Expand Up @@ -61,7 +61,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
finish();
return true;
case R.id.action_add_snackbar:
SnackbarManager.getInstance().show(
SnackbarManager.show(
Snackbar.with(SnackbarRecyclerViewSampleActivity.this)
.text("Woo, snackbar!")
.actionLabel("Close")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import android.widget.Button;
import android.widget.Toast;

import com.nispok.sample.snackbar.utils.SnackbarManager;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import com.nispok.snackbar.enums.SnackbarType;
import com.nispok.snackbar.listeners.ActionClickListener;
import com.nispok.snackbar.listeners.EventListener;
Expand All @@ -32,7 +32,7 @@ protected void onCreate(Bundle savedInstanceState) {
singleLineButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SnackbarManager.getInstance().show(
SnackbarManager.show(
Snackbar.with(SnackbarSampleActivity.this)
.text("Single-line snackbar"));
}
Expand All @@ -42,7 +42,7 @@ public void onClick(View v) {
singleLineWithActionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SnackbarManager.getInstance().show(
SnackbarManager.show(
Snackbar.with(SnackbarSampleActivity.this)
.text("Something has been done")
.actionLabel("Undo")
Expand All @@ -61,7 +61,7 @@ public void onActionClicked(Snackbar snackbar) {
multiLineButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SnackbarManager.getInstance().show(
SnackbarManager.show(
Snackbar.with(SnackbarSampleActivity.this)
.type(SnackbarType.MULTI_LINE)
.text("This is a multi-line snackbar. Keep in mind that snackbars" +
Expand All @@ -73,7 +73,7 @@ public void onClick(View v) {
multiLineWithActionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SnackbarManager.getInstance().show(
SnackbarManager.show(
Snackbar.with(SnackbarSampleActivity.this)
.type(SnackbarType.MULTI_LINE)
.text("This is a multi-line snackbar with an action button. Note " +
Expand All @@ -94,7 +94,7 @@ public void onActionClicked(Snackbar snackbar) {
noAnimationButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SnackbarManager.getInstance().show(
SnackbarManager.show(
Snackbar.with(SnackbarSampleActivity.this)
.text("No animation :(")
.animation(false)
Expand All @@ -106,7 +106,7 @@ public void onClick(View v) {
eventListenerButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SnackbarManager.getInstance().show(
SnackbarManager.show(
Snackbar.with(SnackbarSampleActivity.this)
.text("I'm showing a toast on exit")
.eventListener(new EventListener() {
Expand Down Expand Up @@ -150,7 +150,7 @@ public void onDismissed(Snackbar snackbar) {
customColorsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SnackbarManager.getInstance().show(
SnackbarManager.show(
Snackbar.with(SnackbarSampleActivity.this)
.text("Different colors!!!")
.textColor(Color.parseColor("#ff9d9d9c"))
Expand All @@ -171,7 +171,7 @@ public void onActionClicked(Snackbar snackbar) {
unswipeableButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SnackbarManager.getInstance().show(
SnackbarManager.show(
Snackbar.with(SnackbarSampleActivity.this)
.text("Try to swipe me off the screen")
.swipeToDismiss(false));
Expand Down

This file was deleted.

0 comments on commit 374f8cf

Please sign in to comment.