/** * Append footer to the rear of the mFooterLayout. * * @param footer */ public void addFooterView(View footer) { addFooterView(footer, -1, LinearLayout.VERTICAL); }
public void addFooterView(View footer, int index) { addFooterView(footer, index, LinearLayout.VERTICAL); }
private void addFooterView() { View footerView = getLayoutInflater().inflate(R.layout.rv_footer, null); footerView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); mAdapter.addFooterView(footerView); footerView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "your click footerView", Snackbar.LENGTH_SHORT).show(); } }); }