private void renderRecyclerView(RecyclerView.LayoutManager layoutManager) {
    recyclerView.removeAllViews();

    recyclerView.setLayoutManager(layoutManager);

    boxAdapter = new BoxAdapter(DummyDataGenerator.generateBoxes(30));
    recyclerView.setAdapter(boxAdapter);
  }
Exemplo n.º 2
0
  /** Releases all resource of this view */
  public void release() {
    if (mSubjectScrollView != null) mSubjectScrollView.removeAllViews();
    mSubjectScrollView = null;
    if (mSubjectWrapper != null) mSubjectWrapper.removeAllViews();
    mSubjectWrapper = null;
    mCurrentSubject = null;
    if (mContentWrapper != null) mContentWrapper.removeAllViews();
    mContentWrapper = null;

    if (mContentAdapter != null) mContentAdapter.release();
    mContentAdapter = null;

    if (mSubjectList != null) mSubjectList.clear();
    if (mSubjectRecordMap != null) mSubjectRecordMap.clear();
    mOnClickListener = null;

    removeAllViews();
  }