EPForumL/androidApp

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

Summary

Maintainability
Test Coverage
<androidx.cardview.widget.CardView 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="wrap_content"
    android:orientation="vertical"
    android:background="@color/courseColor"
    android:layout_marginBottom="16dp"
    android:id="@+id/course_card"
    app:cardCornerRadius="3dp"
    android:backgroundTint="@color/medium"
    app:cardElevation="5dp"
    android:layout_margin="5dp">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
        <TextView
            android:id="@+id/courseTitleTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="25sp"
            android:textStyle="bold"
            android:text="course"
            android:textColor="@color/textColor"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="10sp"
            android:layout_marginBottom="10sp"/>

        <LinearLayout
            android:id="@+id/switch_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:visibility="gone"
            android:layout_marginLeft="50sp"
            android:layout_marginRight="50sp"
            android:layout_marginBottom="15sp">

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

                <TextView
                    android:id="@+id/subscription_text"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:textColor="@color/textColor"
                    android:textSize="18sp"
                    android:text="@string/subscribe"/>

                <Switch
                    android:id="@+id/subscriptionSwitch"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"/>

            </LinearLayout>


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

                <TextView
                    android:id="@+id/notification_text"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:textColor="@color/textColor"
                    android:textSize="18sp"
                    android:text="@string/notify"/>

                <Switch
                    android:id="@+id/notificationSwitch"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"/>
            </LinearLayout>

        </LinearLayout>

    </LinearLayout>

</androidx.cardview.widget.CardView>