Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

constraintlayout Placeholder :The previous view is always visible. #863

@qhyuan

Description

@qhyuan
 public void setContentId(int id) {
    if (mContentId == id) {
      return;
    }
    if (mContent != null) {
      mContent.setVisibility(VISIBLE); // ???----------------> Why VISIBLE???<-----------------------------
      ConstraintLayout.LayoutParams layoutParamsContent = (ConstraintLayout.LayoutParams) mContent
          .getLayoutParams();
      layoutParamsContent.isInPlaceholder = false;
      mContent = null;
    }
    mContentId = id;
    if (id != ConstraintLayout.LayoutParams.UNSET) {
      View v = ((View) getParent()).findViewById(id);
      if (v != null) {
        v.setVisibility(GONE);
      }
    }
  }

How about add a function:
fun setContentId(id: Int, @Visibility preViewVisibility: Int = View.GONE)
Thanks~!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions