Search in sources :

Example 6 with Snackbar

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();
}
Also used : Snackbar(android.support.design.widget.Snackbar)

Example 7 with Snackbar

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();
}
Also used : Snackbar(android.support.design.widget.Snackbar)

Example 8 with Snackbar

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();
        }
    }
}
Also used : OCShare(com.owncloud.android.lib.resources.shares.OCShare) DialogFragment(android.support.v4.app.DialogFragment) Intent(android.content.Intent) ShareFileFragment(com.owncloud.android.ui.fragment.ShareFileFragment) Snackbar(android.support.design.widget.Snackbar)

Example 9 with Snackbar

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();
}
Also used : Snackbar(android.support.design.widget.Snackbar)

Example 10 with Snackbar

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();
}
Also used : Snackbar(android.support.design.widget.Snackbar)

Aggregations

Snackbar (android.support.design.widget.Snackbar)94 View (android.view.View)50 TextView (android.widget.TextView)23 RecyclerView (android.support.v7.widget.RecyclerView)14 Intent (android.content.Intent)13 BaseTransientBottomBar (android.support.design.widget.BaseTransientBottomBar)9 ListView (android.widget.ListView)8 DialogInterface (android.content.DialogInterface)7 ImageView (android.widget.ImageView)7 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)5 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)5 ViewGroup (android.view.ViewGroup)5 AdapterView (android.widget.AdapterView)5 LinearLayout (android.widget.LinearLayout)5 File (java.io.File)5 ArrayList (java.util.ArrayList)5 Bitmap (android.graphics.Bitmap)4 Nullable (android.support.annotation.Nullable)4 LayoutInflater (android.view.LayoutInflater)4 RemindyDAO (ve.com.abicelis.remindy.database.RemindyDAO)4