use of android.support.design.widget.Snackbar in project android by owncloud.
the class RenameFileDialogFragment method showSnackMessage.
/**
* Show a temporary message in a Snackbar bound to the content view of the parent Activity
*
* @param messageResource Message to show.
*/
private void showSnackMessage(int messageResource) {
Snackbar snackbar = Snackbar.make(getActivity().findViewById(android.R.id.content), messageResource, Snackbar.LENGTH_LONG);
snackbar.show();
}
use of android.support.design.widget.Snackbar in project android by owncloud.
the class CreateFolderDialogFragment method showSnackMessage.
/**
* Show a temporary message in a Snackbar bound to the content view of the parent Activity
*
* @param messageResource Message to show.
*/
private void showSnackMessage(int messageResource) {
Snackbar snackbar = Snackbar.make(getActivity().findViewById(android.R.id.content), messageResource, Snackbar.LENGTH_LONG);
snackbar.show();
}
use of android.support.design.widget.Snackbar in project android by owncloud.
the class ShareActivity method onCreateShareViaLinkOperationFinish.
private void onCreateShareViaLinkOperationFinish(CreateShareViaLinkOperation operation, RemoteOperationResult result) {
if (result.isSuccess()) {
updateFileFromDB();
// Create dialog to allow the user choose an app to send the link
Intent intentToShareLink = new Intent(Intent.ACTION_SEND);
String link = ((OCShare) (result.getData().get(0))).getShareLink();
intentToShareLink.putExtra(Intent.EXTRA_TEXT, link);
intentToShareLink.setType("text/plain");
String username = AccountUtils.getUsernameForAccount(getAccount());
if (username != null) {
intentToShareLink.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.subject_user_shared_with_you, username, getFile().getFileName()));
} else {
intentToShareLink.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.subject_shared_with_you, getFile().getFileName()));
}
String[] packagesToExclude = new String[] { getPackageName() };
DialogFragment chooserDialog = ShareLinkToDialog.newInstance(intentToShareLink, packagesToExclude);
chooserDialog.show(getSupportFragmentManager(), FTAG_CHOOSER_DIALOG);
} else {
// Detect Failure (403) --> maybe needs password
String password = operation.getPassword();
if (result.getCode() == RemoteOperationResult.ResultCode.SHARE_FORBIDDEN && (password == null || password.length() == 0) && getCapabilities().getFilesSharingPublicEnabled().isUnknown()) {
// Was tried without password, but not sure that it's optional.
// Try with password before giving up; see also ShareFileFragment#OnShareViaLinkListener
ShareFileFragment shareFileFragment = getShareFileFragment();
if (shareFileFragment != null && shareFileFragment.isAdded()) {
// only if added to the view hierarchy!!
shareFileFragment.requestPasswordForShareViaLink(true);
}
} else {
Snackbar snackbar = Snackbar.make(findViewById(android.R.id.content), ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), Snackbar.LENGTH_LONG);
snackbar.show();
}
}
}
use of android.support.design.widget.Snackbar in project android by owncloud.
the class OCFileListFragment method showSnackMessage.
/**
* Show a temporary message in a Snackbar bound to the content view of the parent Activity
*
* @param messageResource Message to show.
*/
private void showSnackMessage(int messageResource) {
Snackbar snackbar = Snackbar.make(getActivity().findViewById(android.R.id.content), messageResource, Snackbar.LENGTH_LONG);
snackbar.show();
}
use of android.support.design.widget.Snackbar in project android by owncloud.
the class AuthenticatorActivity method showSnackMessage.
private void showSnackMessage(int messageResource) {
Snackbar snackbar = Snackbar.make(findViewById(android.R.id.content), messageResource, Snackbar.LENGTH_LONG);
snackbar.show();
}
Aggregations