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

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

Merged
merged 7 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
fix: 버그 수정
  • Loading branch information
hyemdooly committed Oct 11, 2023
commit fbca273a4ebb08cba754d96e159065b51e445fcd
27 changes: 13 additions & 14 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,34 +60,33 @@
android:id="@+id/cv_canvas"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/tb_paint"
app:layout_constraintBottom_toTopOf="@id/ll_tools"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tb_paint" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_start"
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintGuide_percent="@dimen/drawing_options_start_margin_percent"
/>
app:layout_constraintGuide_percent="@dimen/drawing_options_start_margin_percent" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_end"
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintGuide_percent="@dimen/drawing_options_end_margin_percent"
/>
app:layout_constraintGuide_percent="@dimen/drawing_options_end_margin_percent" />

<com.google.android.material.slider.RangeSlider
android:id="@+id/rs_width_changer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:visibility="@{viewModel.paintChangingState == PaintChangingState.WIDTH_CHANGING &amp;&amp; viewModel.selectedDrawingTool.hasWidth ? View.VISIBLE : View.GONE}"
app:layout_constraintBottom_toTopOf="@id/btn_change_width"
app:layout_constraintEnd_toEndOf="@id/gl_end"
app:layout_constraintStart_toStartOf="@id/gl_start" />
app:layout_constraintEnd_toStartOf="@id/gl_end"
app:layout_constraintStart_toEndOf="@id/gl_start" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_colors"
Expand All @@ -97,8 +96,8 @@
android:visibility="@{viewModel.paintChangingState == PaintChangingState.COLOR_CHANGING &amp;&amp; viewModel.selectedDrawingTool.hasColor ? View.VISIBLE : View.GONE}"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toTopOf="@id/btn_change_color"
app:layout_constraintEnd_toEndOf="@id/gl_end"
app:layout_constraintStart_toStartOf="@id/gl_start"
app:layout_constraintEnd_toStartOf="@id/gl_end"
app:layout_constraintStart_toEndOf="@id/gl_start"
tools:listitem="@layout/item_color_palette" />

<Button
Expand All @@ -111,7 +110,7 @@
android:visibility="@{viewModel.selectedDrawingTool.hasColor ? View.VISIBLE : View.GONE}"
app:layout_constraintBottom_toTopOf="@id/ll_tools"
app:layout_constraintEnd_toStartOf="@id/btn_change_width"
app:layout_constraintStart_toStartOf="@id/gl_start"/>
app:layout_constraintStart_toEndOf="@id/gl_start" />

<Button
android:id="@+id/btn_change_width"
Expand All @@ -122,7 +121,7 @@
android:text="@string/main_change_thickness"
android:visibility="@{viewModel.selectedDrawingTool.hasWidth ? View.VISIBLE : View.GONE}"
app:layout_constraintBottom_toTopOf="@id/ll_tools"
app:layout_constraintEnd_toEndOf="@id/gl_end"
app:layout_constraintEnd_toStartOf="@id/gl_end"
app:layout_constraintStart_toEndOf="@id/btn_change_color" />

<LinearLayout
Expand All @@ -132,8 +131,8 @@
android:gravity="center_horizontal"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/gl_end"
app:layout_constraintStart_toStartOf="@id/gl_start" />
app:layout_constraintEnd_toStartOf="@id/gl_end"
app:layout_constraintStart_toEndOf="@id/gl_start" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
1 change: 1 addition & 0 deletions app/src/main/res/layout/item_tool.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:textSize="12sp"
android:backgroundTint="@color/brush_selected"
android:onClick="@{() -> onClick.invoke(drawingTool)}"
android:text="@{name}" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="color_item_size">70dp</dimen>
<dimen name="drawing_options_start_margin_percent">0</dimen>
<dimen name="drawing_options_end_margin_percent">0</dimen>
<dimen name="drawing_options_start_margin_percent">0.0</dimen>
<dimen name="drawing_options_end_margin_percent">1.0</dimen>
</resources>