From d523d45a90d737e9545e4433e4a11984962017b8 Mon Sep 17 00:00:00 2001 From: Moez Bhatti Date: Sat, 24 Mar 2018 01:58:56 -0400 Subject: [PATCH] Correctly name saturation gradient --- .../feature/themepicker/ThemePickerActivity.kt | 8 ++++---- .../src/main/res/layout/theme_picker_hsl.xml | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/presentation/src/main/java/feature/themepicker/ThemePickerActivity.kt b/presentation/src/main/java/feature/themepicker/ThemePickerActivity.kt index 6c5a2edc..075ce03f 100644 --- a/presentation/src/main/java/feature/themepicker/ThemePickerActivity.kt +++ b/presentation/src/main/java/feature/themepicker/ThemePickerActivity.kt @@ -71,7 +71,7 @@ class ThemePickerActivity : QkThemedActivity(), ThemePicke var dX = 0f var dY = 0f - hue.setOnTouchListener { _, event -> + saturation.setOnTouchListener { _, event -> when (event.action) { MotionEvent.ACTION_DOWN -> { dX = event.x - event.rawX @@ -79,8 +79,8 @@ class ThemePickerActivity : QkThemedActivity(), ThemePicke } MotionEvent.ACTION_MOVE -> { - val min = hue.x - swatch.width / 2 - val max = min + hue.width + val min = saturation.x - swatch.width / 2 + val max = min + saturation.width swatch.x = (event.rawX + dX + swatchPadding).within(min, max) swatch.y = (event.rawY + dY + swatchPadding).within(min, max) @@ -96,7 +96,7 @@ class ThemePickerActivity : QkThemedActivity(), ThemePicke themeAdapter.threadId = state.threadId themeAdapter.selectedColor = state.selectedColor - hue.setBackgroundTint(state.hue) + saturation.setBackgroundTint(state.hue) swatchPreview.setBackgroundTint(state.selectedColor) } } \ No newline at end of file diff --git a/presentation/src/main/res/layout/theme_picker_hsl.xml b/presentation/src/main/res/layout/theme_picker_hsl.xml index 1f90524c..19243d22 100644 --- a/presentation/src/main/res/layout/theme_picker_hsl.xml +++ b/presentation/src/main/res/layout/theme_picker_hsl.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent"> + app:layout_constraintBottom_toBottomOf="@id/saturation" + app:layout_constraintEnd_toEndOf="@id/saturation" + app:layout_constraintStart_toStartOf="@id/saturation" + app:layout_constraintTop_toTopOf="@id/saturation" /> + app:layout_constraintBottom_toBottomOf="@id/saturation" + app:layout_constraintEnd_toEndOf="@id/saturation" + app:layout_constraintStart_toStartOf="@id/saturation" + app:layout_constraintTop_toTopOf="@id/saturation">