App에서 사용되는 자원들을 저장하고 App에서 접근하는 디렉터리
drawable
이미지
layout
view 컴포넌트 정의 문서
values
하드 코딩을 피하고 key-value로 원하는 값들을 저장해 놓고 사용하거나, 관리-수정도 가능하다.
colors.xml
컬러명과 컬러를 선언해 놓는다.
다른 뷰(xml) 에서는 @color/col_name 으로 불러올 수 있고, 나중에 변경도 쉽게 할 수 있다.
strings.xml
string 이름과 내용을 선언해 놓는다.
@string/string_name 으로 불러와서 사용할 수 있다.
theme
app에 적용할 theme를 지정해놓을 수 있다.
theme는 primary color나 secondert color 등을 지정할 수 있다.
mainfests에서 적용할 theme를 선택해서 적용할 수 있다.
// 주로 추가하는 att는 app 상단 title을 숨긴다. <item name="windowNoTitle">true</item>
코드상에서 resource 접근
R.drawable.<drawable_name> R.color.<color_name> R.string.<string_name> //deprecated resources.getColor(R.color.<color_name>) resources.getString(R.string.<string_name>)
코드상에서 view component 값 변경
//finViewById findViewById<type>(R.id.<component_id>).setBackgroundColor(<color>) //Binding binding.component_id.text = "_text"
'Android > Android기본' 카테고리의 다른 글
Fragment (0) | 2021.11.24 |
---|---|
Binder, Binding (0) | 2021.11.24 |
Context (0) | 2021.11.24 |
Thread (0) | 2021.11.24 |
Permission (0) | 2021.11.24 |
Uploaded by Notion2Tistory v1.1.0