Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
qhyuan opened this issue Nov 6, 2024 · 0 comments
Open

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

qhyuan opened this issue Nov 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@qhyuan
Copy link

qhyuan commented Nov 6, 2024

 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~!

@qhyuan qhyuan added the enhancement New feature or request label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant