forked from upstream-mirrors/quik
Correctly name saturation gradient
This commit is contained in:
@@ -71,7 +71,7 @@ class ThemePickerActivity : QkThemedActivity<ThemePickerViewModel>(), ThemePicke
|
|||||||
var dX = 0f
|
var dX = 0f
|
||||||
var dY = 0f
|
var dY = 0f
|
||||||
|
|
||||||
hue.setOnTouchListener { _, event ->
|
saturation.setOnTouchListener { _, event ->
|
||||||
when (event.action) {
|
when (event.action) {
|
||||||
MotionEvent.ACTION_DOWN -> {
|
MotionEvent.ACTION_DOWN -> {
|
||||||
dX = event.x - event.rawX
|
dX = event.x - event.rawX
|
||||||
@@ -79,8 +79,8 @@ class ThemePickerActivity : QkThemedActivity<ThemePickerViewModel>(), ThemePicke
|
|||||||
}
|
}
|
||||||
|
|
||||||
MotionEvent.ACTION_MOVE -> {
|
MotionEvent.ACTION_MOVE -> {
|
||||||
val min = hue.x - swatch.width / 2
|
val min = saturation.x - swatch.width / 2
|
||||||
val max = min + hue.width
|
val max = min + saturation.width
|
||||||
|
|
||||||
swatch.x = (event.rawX + dX + swatchPadding).within(min, max)
|
swatch.x = (event.rawX + dX + swatchPadding).within(min, max)
|
||||||
swatch.y = (event.rawY + dY + swatchPadding).within(min, max)
|
swatch.y = (event.rawY + dY + swatchPadding).within(min, max)
|
||||||
@@ -96,7 +96,7 @@ class ThemePickerActivity : QkThemedActivity<ThemePickerViewModel>(), ThemePicke
|
|||||||
themeAdapter.threadId = state.threadId
|
themeAdapter.threadId = state.threadId
|
||||||
themeAdapter.selectedColor = state.selectedColor
|
themeAdapter.selectedColor = state.selectedColor
|
||||||
|
|
||||||
hue.setBackgroundTint(state.hue)
|
saturation.setBackgroundTint(state.hue)
|
||||||
swatchPreview.setBackgroundTint(state.selectedColor)
|
swatchPreview.setBackgroundTint(state.selectedColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/hue"
|
android:id="@+id/saturation"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
@@ -24,10 +24,10 @@
|
|||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:background="@drawable/color_picker_gradient"
|
android:background="@drawable/color_picker_gradient"
|
||||||
android:rotation="90"
|
android:rotation="90"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/hue"
|
app:layout_constraintBottom_toBottomOf="@id/saturation"
|
||||||
app:layout_constraintEnd_toEndOf="@id/hue"
|
app:layout_constraintEnd_toEndOf="@id/saturation"
|
||||||
app:layout_constraintStart_toStartOf="@id/hue"
|
app:layout_constraintStart_toStartOf="@id/saturation"
|
||||||
app:layout_constraintTop_toTopOf="@id/hue" />
|
app:layout_constraintTop_toTopOf="@id/saturation" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/swatch"
|
android:id="@+id/swatch"
|
||||||
@@ -36,10 +36,10 @@
|
|||||||
android:background="@drawable/circle"
|
android:background="@drawable/circle"
|
||||||
android:padding="1dp"
|
android:padding="1dp"
|
||||||
android:layout_margin="18dp"
|
android:layout_margin="18dp"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/hue"
|
app:layout_constraintBottom_toBottomOf="@id/saturation"
|
||||||
app:layout_constraintEnd_toEndOf="@id/hue"
|
app:layout_constraintEnd_toEndOf="@id/saturation"
|
||||||
app:layout_constraintStart_toStartOf="@id/hue"
|
app:layout_constraintStart_toStartOf="@id/saturation"
|
||||||
app:layout_constraintTop_toTopOf="@id/hue">
|
app:layout_constraintTop_toTopOf="@id/saturation">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/swatchPreview"
|
android:id="@+id/swatchPreview"
|
||||||
|
|||||||
Reference in New Issue
Block a user