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

13장 Todo 리스트, 405페이지: FAB visibility 오류 #5

Open
experien opened this issue Jan 10, 2019 · 2 comments
Open

13장 Todo 리스트, 405페이지: FAB visibility 오류 #5

experien opened this issue Jan 10, 2019 · 2 comments

Comments

@experien
Copy link

experien commented Jan 10, 2019

13장, 405페이지
EditActivity.kt

insertMode() {
    deleteFab.visibility = View.GONE
    ....
}

오류 메시지:
VisibilityAwareImageButton.setVisibility can only be called from within the same library group (groupId=com.android.support) less... (Ctrl+F1)
This API has been flagged with a restriction that has not been met. Examples of API restrictions: * Method can only be invoked by a subclass * Method can only be accessed from within the same library (defined by the Gradle library group id) * Method can only be accessed from tests. You can add your own API restrictions with the @RestrictTo annotation. Issue id: RestrictedApi

검색 결과:
https://stackoverflow.com/questions/50343634/android-p-visibilityawareimagebutton-setvisibility-can-only-be-called-from-the-s

fab에 setVisibility() 가 안 먹네요. 편집창에서는 오류를 보여주는데 빌드는 잘 됩니다;;
해결은 간단히 했습니다만 원인은 잘 모르겠습니다. import 문제인지?

해결:

insertMode() {
    //deleteFab.visibility = View.GONE
    deleteFab.hide()
    ...
}

사족) 책 구성이 아주 세심합니다. 도움이 많이 되었습니다.

@experien experien reopened this Jan 10, 2019
@junsuk5
Copy link
Owner

junsuk5 commented Jan 10, 2019

@experien 제보 감사합니다. 저도 지금 열어보니 컴파일 에러가 뜨는군요. 분명 책 쓸 시점에는 잘 되었던 예제인데 그 사이 뭐가 바뀌었나 봅니다.

@junsuk5
Copy link
Owner

junsuk5 commented Jan 10, 2019

코드는 반영했습니다. 다른 분들도 확인할 수 있도록 이슈는 Reopen 해 둡니다

@junsuk5 junsuk5 reopened this Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants