Example #1
0
  @Override
  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    LogUtil.i(TAG, "onViewCreated");
    String handpickLoadMoreOverText = getString(R.string.load_more_over_text_handpick);

    listGroup = new VideoTopicPullWaterGroup(getActivity());
    listGroup.setFooterLoadMoreOverText(handpickLoadMoreOverText);
    listGroup.setGroupConfig(GroupConfig.create(GroupConfig.GROUP_VIDEO_ESSENCE));

    listGroup.setListAdapter(essenseAdapter);
    listGroup.setListManager(essenseManager);

    listGroup.onCreateView();
    ViewGroup viewGroup = (ViewGroup) view;
    viewGroup.removeAllViews();
    viewGroup.addView(listGroup.getRoot());
  }
Example #2
0
  @Override
  protected void dispatchDraw(Canvas canvas) {
    // 捕获可能的java.lang.RuntimeException: Canvas: trying to use a recycled bitmap异常
    try {
      super.dispatchDraw(canvas);
      if (mShadowDrawable != null && mContentView != null) {

        int left = mContentView.getLeft() - mShadowDrawable.getIntrinsicWidth();
        int right = left + mShadowDrawable.getIntrinsicWidth();
        int top = mContentView.getTop();
        int bottom = mContentView.getBottom();

        mShadowDrawable.setBounds(left, top, right, bottom);
        mShadowDrawable.draw(canvas);
      }
    } catch (Exception e) {
      LogUtil.printStackTrace(e);
    }
  }