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

[둘리] 뷰 챌린지 미션 2단계 제출합니다. #38

Merged
merged 28 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
dc16a7d
feat: button bindingAdapter로 isSelected 생성
hyemdooly Oct 9, 2023
dee7ae1
feat: 선택된 버튼 색깔 생성
hyemdooly Oct 9, 2023
74f09cb
feat: 브러쉬 요소 추가
hyemdooly Oct 9, 2023
4e324fd
feat: 브러쉬 선택 기능 UI 추가
hyemdooly Oct 9, 2023
2e8ae10
feat: 함수 일부 네이밍 변경 및 Circle, Rectangle 그리기 기능 추가
hyemdooly Oct 9, 2023
4c813d6
refactor: 함수 분리 및 중복 코드 삭제
hyemdooly Oct 9, 2023
c56475f
feat: 지우개 기능 구현
hyemdooly Oct 9, 2023
dc53032
refactor: Drawing 클래스에서 Path, Paint 복사하도록 수정
hyemdooly Oct 9, 2023
7da23af
feat: 전체 삭제, undo, redo 구현
hyemdooly Oct 9, 2023
e22dfd6
refactor: 함수 순서 수정
hyemdooly Oct 9, 2023
87daa31
refactor: SettingState sealed class -> enum class로 변경, 상수 위치 이동
hyemdooly Oct 9, 2023
0b210df
refactor: width로 굵기 네이밍 통일
hyemdooly Oct 9, 2023
943e72c
refactor: Brush -> Tool로 네이밍 변경
hyemdooly Oct 10, 2023
1cf3673
refactor: enum class 상수 네이밍 변경
hyemdooly Oct 10, 2023
316933e
refactor: Drawing 클래스 세분화
hyemdooly Oct 10, 2023
2d10fa3
refactor: tool이 drawing 객체를 리턴하도록 수정
hyemdooly Oct 10, 2023
f67b8ac
refactor: CanvasView가 하던 일을 Drawing 클래스로 이동
hyemdooly Oct 11, 2023
ee553e0
refactor: undo, redo 코드 줄 수 줄이기
hyemdooly Oct 11, 2023
cd6ff78
design: 도구에 따른 설정 화면 변경
hyemdooly Oct 11, 2023
dd8e201
refactor: 도구에 따라 버튼 동적 생성
hyemdooly Oct 11, 2023
26e18fe
refactor: brushes -> tools로 네이밍 수정
hyemdooly Oct 11, 2023
f412171
refactor: 함수명 수정
hyemdooly Oct 11, 2023
acb317f
refactor: tool 바꿀 때 설정창 닫도록 수정
hyemdooly Oct 11, 2023
f55275e
fix: Rectangle 버그 수정
hyemdooly Oct 11, 2023
b10fda7
refactor: 도구 모음 일치
hyemdooly Oct 11, 2023
d4a46c4
refactor: tool -> drawingTool로 네이밍 변경
hyemdooly Oct 11, 2023
1d90521
refactor: Drawings 일급컬렉션 생성
hyemdooly Oct 11, 2023
1264668
refactor: 팩토리 함수 삭제
hyemdooly Oct 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: brushes -> tools로 네이밍 수정
  • Loading branch information
hyemdooly committed Oct 11, 2023
commit 26e18fe98142c9433b09cafcb5d28e95a7b37810
4 changes: 2 additions & 2 deletions app/src/main/java/woowacourse/paint/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class MainActivity : AppCompatActivity() {
}
}
viewModel.selectedTool.observe(this) { tool ->
canvasView.setupBrush(tool)
canvasView.setupTools(tool)
changeSelectedTool(tool)
}
}
Expand All @@ -73,7 +73,7 @@ class MainActivity : AppCompatActivity() {

private fun setupTools() {
viewModel.tools.forEach { toolAssigned ->
val toolButtonBinding = ItemToolBinding.inflate(layoutInflater, binding.llBrushes, true)
val toolButtonBinding = ItemToolBinding.inflate(layoutInflater, binding.llTools, true)
with(toolButtonBinding) {
onClick = viewModel::pickTool
tool = toolAssigned
Expand Down
12 changes: 0 additions & 12 deletions app/src/main/java/woowacourse/paint/utils/BindingAdapter.kt

This file was deleted.

6 changes: 3 additions & 3 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
android:onClick="@{() -> viewModel.setSettingState(PaintChangingState.COLOR_CHANGING)}"
android:text="@string/main_change_color"
android:visibility="@{viewModel.selectedTool.hasColor ? View.VISIBLE : View.GONE}"
app:layout_constraintBottom_toTopOf="@id/ll_brushes"
app:layout_constraintBottom_toTopOf="@id/ll_tools"
app:layout_constraintEnd_toStartOf="@id/btn_change_width"
app:layout_constraintStart_toStartOf="parent" />

Expand All @@ -109,12 +109,12 @@
android:onClick="@{() -> viewModel.setSettingState(PaintChangingState.WIDTH_CHANGING)}"
android:text="@string/main_change_thickness"
android:visibility="@{viewModel.selectedTool.hasWidth ? View.VISIBLE : View.GONE}"
app:layout_constraintBottom_toTopOf="@id/ll_brushes"
app:layout_constraintBottom_toTopOf="@id/ll_tools"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/btn_change_color" />

<LinearLayout
android:id="@+id/ll_brushes"
android:id="@+id/ll_tools"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
Expand Down