BlindlyTeam/Blindly

View on GitHub
app/src/main/res/layout/activity_edit_sexual_orientations.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="match_parent"
    tools:context=".edit.EditSexualOrientations">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        android:minHeight="?attr/actionBarSize"
        android:theme="?attr/actionBarTheme"
        app:title="@string/sexual_orientations" />

    <TextView
        android:id="@+id/select_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/toolbar"
        android:layout_marginTop="@dimen/margin_small"
        android:layout_marginStart="@dimen/margin_small"
        android:text="@string/edit_select_up_to_3"
        android:textColor="@color/blindly_purple_secondary"
        android:textSize="16sp"
        android:textAllCaps="true"
        android:textStyle="bold" />

    <View
        android:id="@+id/divider"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_below="@id/select_text"
        android:background="?android:attr/listDivider" />

    <com.google.android.material.chip.ChipGroup
        android:id="@+id/sexual_orientations_chip_group"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/select_text"
        android:layout_marginStart="@dimen/margin"
        android:layout_marginEnd="@dimen/margin"
        android:layout_marginTop="@dimen/margin_extra_small"
        android:layout_centerHorizontal="true"
        app:chipSpacing="30dp"
        app:chipSpacingHorizontal="30dp"
        app:chipSpacingVertical="20dp">

        <com.google.android.material.chip.Chip
            android:id="@+id/straight_chip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checkable="true"
            android:checked="false"
            android:text="@string/straight"
            app:checkedIconVisible="false"
            app:chipBackgroundColor="@color/chip_state_colors" />

        <com.google.android.material.chip.Chip
            android:id="@+id/lesbian_chip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checkable="true"
            android:checked="false"
            android:text="@string/lesbian"
            app:checkedIconVisible="false"
            app:chipBackgroundColor="@color/chip_state_colors" />

        <com.google.android.material.chip.Chip
            android:id="@+id/gay_chip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checkable="true"
            android:checked="false"
            android:text="@string/gay"
            app:checkedIconVisible="false"
            app:chipBackgroundColor="@color/chip_state_colors" />

        <com.google.android.material.chip.Chip
            android:id="@+id/bisexual_chip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checkable="true"
            android:checked="false"
            android:text="@string/bisexual"
            app:checkedIconVisible="false"
            app:chipBackgroundColor="@color/chip_state_colors" />

        <com.google.android.material.chip.Chip
            android:id="@+id/asexual_chip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checkable="true"
            android:checked="false"
            android:text="@string/asexual"
            app:checkedIconVisible="false"
            app:chipBackgroundColor="@color/chip_state_colors" />

        <com.google.android.material.chip.Chip
            android:id="@+id/demisexual_chip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checkable="true"
            android:checked="false"
            android:text="@string/demisexual"
            app:checkedIconVisible="false"
            app:chipBackgroundColor="@color/chip_state_colors" />

        <com.google.android.material.chip.Chip
            android:id="@+id/pansexual_chip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checkable="true"
            android:text="@string/pansexual"
            app:checkedIconVisible="false"
            app:chipBackgroundColor="@color/chip_state_colors" />

        <com.google.android.material.chip.Chip
            android:id="@+id/queer_chip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checkable="true"
            android:text="@string/queer"
            app:checkedIconVisible="false"
            app:chipBackgroundColor="@color/chip_state_colors" />

        <com.google.android.material.chip.Chip
            android:id="@+id/questionning_chip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checkable="true"
            android:text="@string/questioning"
            app:checkedIconVisible="false"
            app:chipBackgroundColor="@color/chip_state_colors" />
    </com.google.android.material.chip.ChipGroup>


    <TextView
        android:id="@+id/at_least_1_warning"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/sexual_orientations_chip_group"
        android:layout_marginTop="@dimen/margin"
        android:layout_centerHorizontal="true"
        android:text="@string/please_select_at_least_one"
        android:textColor="#FF0000"
        android:visibility="invisible" />

    <TextView
        android:id="@+id/no_more_than_3_warning"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/sexual_orientations_chip_group"
        android:layout_marginTop="@dimen/margin"
        android:layout_centerHorizontal="true"
        android:text="@string/you_can_t_select_more_than_3"
        android:textColor="#FF0000"
        android:visibility="invisible" />
</RelativeLayout>