EPForumL/androidApp

View on GitHub
app/src/main/res/layout/activity_question_details.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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:layout_margin="20dp"
    android:id="@+id/question_details_layout"
    tools:context=".basicEntities.questions.QuestionDetailsActivity">

    <LinearLayout
        android:id="@+id/buttons_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        tools:context=".basicEntities.questions.QuestionDetailsActivity">

        <TextView
            android:id="@+id/notificationCount"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:gravity="right"
            android:layout_weight="1"
            android:text="0" />

        <ImageButton
            android:id="@+id/addFollowButton"
            android:layout_width="30sp"
            android:layout_height="30sp"
            android:layout_margin="8dp"
            android:src="@drawable/notif_bell"
            android:background="@color/fui_transparent"/>

        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/toggle_save_question"
            android:clickable="true"
            android:layout_gravity="center_vertical|end"
            android:visibility="visible"
            app:tint="@color/gray"
            android:background="@color/fui_transparent"/>

    </LinearLayout>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text=""
        android:textSize="20sp"
        android:id="@+id/qdetails_question_username"/>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/new_question_title"
        android:textSize="40sp"
        android:textStyle="bold"
        android:id="@+id/qdetails_title"/>


    <Button
        android:id="@+id/play_note_button"
        android:layout_width="257dp"
        android:layout_height="wrap_content"
        android:layout_margin="16dp"
        android:background="@drawable/button_bg"
        android:drawableStart="@drawable/ic_microphone"
        android:drawablePadding="8dp"
        android:text="@string/play_voice_note"
        android:layout_gravity="center"/>

    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
        android:id="@+id/swipe_refresh_layout"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/answers_recycler"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            tools:listitem="@layout/question_details_answer_item" />
    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

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

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:id="@+id/not_loggedin_text"
            android:text="@string/please_login_to_post_answers"
            android:layout_marginVertical="5dp"
            android:textColor="@color/red"
            android:textSize="13sp"
            android:layout_gravity="center"
            android:visibility="gone"/>

        <androidx.cardview.widget.CardView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            app:cardUseCompatPadding="true"
            android:id="@+id/write_reply_card"
            app:cardCornerRadius="3dp"
            android:visibility="visible"
            app:cardElevation="5dp"
            android:paddingVertical="5dp"
            android:layout_weight="2">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:layout_gravity="center"
                android:layout_weight="2">

                <EditText
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:id="@+id/write_reply_box"
                    android:hint="@string/write_an_answer"
                    android:layout_gravity="center"
                    android:background="@color/fui_transparent"
                    android:textColorHint="@color/courseColor"
                    android:textSize="20sp"
                    android:layout_weight="2"
                    android:paddingStart="15dp"
                    android:layout_margin="8dp"
                    android:paddingEnd="5dp"
                    android:autofillHints="@string/write_an_answer"
                    android:inputType="text">

                </EditText>

            </LinearLayout>
        </androidx.cardview.widget.CardView>

        <ImageButton
            android:id="@+id/question_details_latex"
            android:layout_width="45dp"
            android:layout_height="45dp"
            android:clickable="true"
            android:visibility="visible"
            android:layout_gravity="center"
            android:scaleType="fitCenter"
            android:src="@drawable/latex_logo"
            android:background="@drawable/round_corner"
            android:layout_margin="8dp"
            android:padding="4dp"
            app:tint="@color/white" />

        <ImageButton
            android:layout_width="45dp"
            android:layout_height="45dp"
            android:id="@+id/post_reply_button"
            android:clickable="true"
            android:visibility="visible"
            android:layout_gravity="center"
            android:src="@drawable/send_icon"
            android:background="@drawable/round_corner"
            app:tint="@color/white"
            android:layout_margin="8dp"
            android:contentDescription="@string/send" />

    </LinearLayout>

</LinearLayout>