use of android.support.design.widget.Snackbar in project android by owncloud.
the class FileActivity method showSnackMessage.
/**
* Show a temporary message in a Snackbar bound to the content view
*
* @param message Message to show.
*/
public void showSnackMessage(String message) {
Snackbar snackbar = Snackbar.make(findViewById(android.R.id.content), message, Snackbar.LENGTH_LONG);
snackbar.show();
}
use of android.support.design.widget.Snackbar in project android-advancedrecyclerview by h6ah4i.
the class SwipeableWithButtonExampleActivity method onItemButtonClicked.
/**
* This method will be called when a "button placed under the swipeable view" is clicked
*
* @param position The position of the item within data set
*/
public void onItemButtonClicked(int position) {
String text = getString(R.string.snack_bar_text_button_clicked, position);
Snackbar snackbar = Snackbar.make(findViewById(R.id.container), text, Snackbar.LENGTH_SHORT);
snackbar.show();
}
use of android.support.design.widget.Snackbar in project android-advancedrecyclerview by h6ah4i.
the class SwipeOnLongPressExampleActivity method onItemRemoved.
/**
* This method will be called when a list item is removed
*
* @param position The position of the item within data set
*/
public void onItemRemoved(int position) {
Snackbar snackbar = Snackbar.make(findViewById(R.id.container), R.string.snack_bar_text_item_removed, Snackbar.LENGTH_LONG);
snackbar.setAction(R.string.snack_bar_action_undo, new View.OnClickListener() {
@Override
public void onClick(View v) {
onItemUndoActionClicked();
}
});
snackbar.setActionTextColor(ContextCompat.getColor(this, R.color.snackbar_action_color_done));
snackbar.show();
}
use of android.support.design.widget.Snackbar in project android-advancedrecyclerview by h6ah4i.
the class ExpandableDraggableSwipeableExampleActivity method onGroupItemRemoved.
/**
* This method will be called when a group item is removed
*
* @param groupPosition The position of the group item within data set
*/
public void onGroupItemRemoved(int groupPosition) {
Snackbar snackbar = Snackbar.make(findViewById(R.id.container), R.string.snack_bar_text_group_item_removed, Snackbar.LENGTH_LONG);
snackbar.setAction(R.string.snack_bar_action_undo, new View.OnClickListener() {
@Override
public void onClick(View v) {
onItemUndoActionClicked();
}
});
snackbar.setActionTextColor(ContextCompat.getColor(this, R.color.snackbar_action_color_done));
snackbar.show();
}
use of android.support.design.widget.Snackbar in project android-advancedrecyclerview by h6ah4i.
the class DraggableSwipeableExampleActivity method onItemRemoved.
/**
* This method will be called when a list item is removed
*
* @param position The position of the item within data set
*/
public void onItemRemoved(int position) {
Snackbar snackbar = Snackbar.make(findViewById(R.id.container), R.string.snack_bar_text_item_removed, Snackbar.LENGTH_LONG);
snackbar.setAction(R.string.snack_bar_action_undo, new View.OnClickListener() {
@Override
public void onClick(View v) {
onItemUndoActionClicked();
}
});
snackbar.setActionTextColor(ContextCompat.getColor(this, R.color.snackbar_action_color_done));
snackbar.show();
}
Aggregations