Giter Club home page Giter Club logo

Comments (5)

yeoncheong avatar yeoncheong commented on July 20, 2024 2

안녕하세요. Compose Camp 비기너코스 캠핑지기 황연진입니다.

Compose가 출시되기 전에는 문자열 로딩을 위해 getString() 메소드를 사용했습니다. 그러나 context의 getString() 메소드로 문자열을 로딩할 경우, context 속의 resource가 있어야 로딩이 가능하기 때문에 context에 대한 관리가 별도로 필요한데요. 이 때, context를 외부로 넘길 경우 메모리가 누수되는 문제가 발생할 수 있습니다.

@Composable
@ReadOnlyComposable
fun stringResource(@StringRes id: Int): String {
    val resources = resources()
    return resources.getString(id)
}

따라서 Compose에서는 getString() 메소드를 감싼 문자열 로딩 메소드 stringResource() 를 사용합니다. resources() 라는 메소드가 resources라는 객체 안에서 context를 관리해주기 때문에 사용하는 사람이 context를 신경쓰지 않아도 됩니다.

라벨은 오른쪽 Labels 단에서 필요없는 라벨을 x로 지우고 다른 라벨을 선택하시면 되겠습니다.

from composecamp2022-for-beginners.

hr4861-park avatar hr4861-park commented on July 20, 2024

추가로 label이 question, unit1 로 고정되어 수정할수가 없네요. 확인부탁드리겠습니다.

from composecamp2022-for-beginners.

hr4861-park avatar hr4861-park commented on July 20, 2024

안녕하세요. Compose Camp 비기너코스 캠핑지기 황연진입니다.

Compose가 출시되기 전에는 context의 getString() 메소드로 문자열을 로딩할 경우, context 속의 resource가 있어야 로딩이 가능하기 때문에 context에 대한 관리가 별도로 필요한데요. 이 때, context를 외부로 넘길 경우 메모리가 누수되는 문제가 발생할 수 있습니다.

@Composable
@ReadOnlyComposable
fun stringResource(@StringRes id: Int): String {
    val resources = resources()
    return resources.getString(id)
}

따라서 Compose에서는 getString() 메소드를 감싼 문자열 로딩 메소드 stringResource() 를 사용합니다. resources() 라는 메소드가 resources라는 객체 안에서 context를 관리해주기 때문에 사용하는 사람이 context를 신경쓰지 않아도 됩니다.

라벨은 오른쪽 Labels 단에서 필요없는 라벨을 x로 지우고 다른 라벨을 선택하시면 되겠습니다.

@yeoncheong 자세한 설명 감사드립니다.

라벨의 경우 collaborator 들만 수정가능한 상태가 아닌가 싶은데요.
저 외에 다른분들 보고 계시다면 확인좀 부탁드리겠습니다.

질문에 대한 궁금증은 해소되어 이슈는 close 하겠습니다.

from composecamp2022-for-beginners.

Sanghun-Lee avatar Sanghun-Lee commented on July 20, 2024

저도 이슈업하려고하는데 라벨 수정이 안되네요 ㅠㅠ

from composecamp2022-for-beginners.

yeoncheong avatar yeoncheong commented on July 20, 2024

라벨 관련해서 답변 드립니다.
라벨은 Admin 권한이 있는 사람들만 변경이 가능합니다.
그래서 방금 이슈 템플릿에서 라벨 관련 문항을 삭제했습니다.
이슈 작성하실 때 라벨은 신경 쓰지 않으셔도 될 것 같습니다. 😄

from composecamp2022-for-beginners.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.