I'm trying to create a page that looks like the contribution page of GitHub (like each square represents a day, and the transparency of the square represents the number of commits). I want the page to look something like this:
So, I made a horizontal scroll view because I want the section of squares can be scrolled horizontally. And I tried to add the squares into the HSV. Here's the code:
<HorizontalScrollView
android:id="@+id/scrollView"
android:layout_width="0dp"
android:layout_height="295dp"
android:layout_marginTop="10dp"
android:layout_marginRight="60dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/time">
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="20dp" <!-- the problem -->
android:layout_height="35dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/square" />
</HorizontalScrollView>
The problem is, I cannot set the layout_width of the image button, no matter what I change it to, the design always remain like this:
As you can see, the height is correct, but the width is fixed at a weird place. Is there anyway I can change it?
Any help would be appreciated.

