Java Code Examples for com.android.messaging.ui.ListEmptyView

Following code examples demonstrate how to use com.android.messaging.ui.ListEmptyViewfrom android. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use com.android.messaging.ui.ListEmptyViewand various code implementation of this class.

    public Dialog onCreateDialog(final Bundle bundle) {
        final Activity activity = getActivity();
        final LayoutInflater inflater = activity.getLayoutInflater();
        View view = inflater.inflate(R.layout.share_intent_conversation_list_view, null);
        mEmptyListMessageView = (ListEmptyView) view.findViewById(R.id.no_conversations_view);
        mEmptyListMessageView.setImageHint(R.drawable.ic_oobe_conv_list);
        final LinearLayoutManager manager = new LinearLayoutManager(activity) {
            @Override
            public RecyclerView.LayoutParams generateDefaultLayoutParams() {
                return new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                        ViewGroup.LayoutParams.WRAP_CONTENT);
            }
        };
        mListBinding.getData().init(getLoaderManager(), mListBinding);
        mAdapter = new ShareIntentAdapter(activity, null, this);
        mRecyclerView = (RecyclerView) view.findViewById(android.R.id.list);
        mRecyclerView.setLayoutManager(manager);
        mRecyclerView.setHasFixedSize(true);
        mRecyclerView.setAdapter(mAdapter);
        final Builder dialogBuilder = new AlertDialog.Builder(activity)
                .setView(view)
                .setTitle(R.string.share_intent_activity_label);

        final Bundle arguments = getArguments();
        if (arguments == null || !arguments.getBoolean(HIDE_NEW_CONVERSATION_BUTTON_KEY)) {
            dialogBuilder.setPositiveButton(R.string.share_new_message, new OnClickListener() {
                        @Override
                    public void onClick(DialogInterface dialog, int which) {
                            mDismissed = true;
                            mHost.onCreateConversationClick();
                    }
                });
        }
        return dialogBuilder.setNegativeButton(R.string.share_cancel, null)
                .create();
    } 


Advertisement
Javadoc
A common reusable view that shows a hint image and text for an empty list view.
Advertisement