Update position of swatch when color is selected

This commit is contained in:
Moez Bhatti
2018-03-24 03:11:12 -04:00
parent 65a8a51c8a
commit e9232c639c
5 changed files with 36 additions and 21 deletions
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:parentTag="feature.themepicker.HSVPickerView">
<View
android:id="@+id/saturation"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:background="@drawable/color_picker_gradient"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:backgroundTint="@color/tools_theme" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/color_picker_gradient"
android:rotation="90"
app:layout_constraintBottom_toBottomOf="@id/saturation"
app:layout_constraintEnd_toEndOf="@id/saturation"
app:layout_constraintStart_toStartOf="@id/saturation"
app:layout_constraintTop_toTopOf="@id/saturation" />
<FrameLayout
android:id="@+id/swatch"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_margin="18dp"
android:background="@drawable/circle"
android:padding="1dp"
app:layout_constraintBottom_toBottomOf="@id/saturation"
app:layout_constraintEnd_toEndOf="@id/saturation"
app:layout_constraintStart_toStartOf="@id/saturation"
app:layout_constraintTop_toTopOf="@id/saturation">
<View
android:id="@+id/swatchPreview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@drawable/circle"
android:backgroundTint="@color/tools_theme" />
</FrameLayout>
</merge>