gyrodraw/GyroDraw

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

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorGrey"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:gravity="center"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/pencilButton"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"
            android:layout_weight="1"
            android:onClick="toolClickHandler"
            android:rotation="180"
            app:srcCompat="@drawable/pencil_selected" />

        <ImageView
            android:id="@+id/eraserButton"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"
            android:layout_weight="1"
            android:onClick="toolClickHandler"
            app:srcCompat="@drawable/eraser" />

        <ImageView
            android:id="@+id/bucketButton"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"
            android:layout_weight="1"
            android:onClick="toolClickHandler"
            app:srcCompat="@drawable/bucket" />

        <ImageView
            android:id="@+id/mysteryModeButton"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"
            android:layout_weight="1"
            android:onClick="toggleMysteryMode"
            app:srcCompat="@drawable/mystery_mode" />

        <TextView
            android:id="@+id/exit"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"
            android:layout_weight="1"
            android:gravity="center"
            android:text="@string/cross"
            android:textColor="@color/colorDrawYellow"
            android:textSize="30sp"
            android:textStyle="bold" />

    </LinearLayout>

    <RelativeLayout
        android:id="@+id/paintViewHolder"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="10">

        <ch.epfl.sweng.GyroDraw.game.drawing.PaintView
            android:id="@+id/paintView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

    </RelativeLayout>

    <SeekBar
        android:id="@+id/brushWidthBar"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.5"
        android:max="100"
        android:minHeight="30dp"
        android:progress="50" />

    <HorizontalScrollView
        android:id="@+id/colorScrollView"
        android:layout_width="wrap_content"
        android:layout_gravity="center"
        android:layout_height="0dp"
        android:layout_weight="1">

        <LinearLayout
            android:id="@+id/colorLayout"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="horizontal">

            <ImageView
                android:id="@+id/blackButton"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_marginStart="5dp"
                android:layout_marginEnd="5dp"
                android:layout_marginBottom="10dp"
                android:adjustViewBounds="true"
                android:onClick="colorClickHandler"
                android:scaleType="centerInside"
                app:srcCompat="@drawable/color_circle_selected" />

        </LinearLayout>
    </HorizontalScrollView>
</LinearLayout>