EPForumL/androidApp

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

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_marginHorizontal="30dp"
    android:layout_marginVertical="10dp"
    android:id="@+id/qdetails_answer_item">

    <androidx.cardview.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/answer_card"
        app:cardCornerRadius="6dp"
        android:backgroundTint="@color/background"
        app:cardElevation="5dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:paddingTop="5dp"
            android:paddingBottom="10dp"
            android:paddingHorizontal="10dp">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
                    android:textSize="18sp"
                    android:textStyle="bold"
                    android:textColor="@color/textColor"
                    android:id="@+id/qdetails_answer_username"
                    android:maxLength="20"
                    android:ellipsize="end"
                    android:text="@string/username"
                    android:layout_weight="2"/>

                <TextView
                    android:id="@+id/likeCount"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_marginTop="12.5sp"
                    android:layout_weight="1"
                    android:gravity="end"
                    android:text="@string/_0" />

                <ImageButton
                    android:id="@+id/likeButton"
                    android:layout_width="30sp"
                    android:layout_height="30sp"
                    android:layout_margin="8dp"
                    android:background="@color/fui_transparent"
                    android:clickable="true"
                    android:src="@drawable/endorment_heart"
                    app:tint="@color/even_more_background" />

                <ImageButton
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/chatWithUser"
                    android:src="@drawable/nav_chat"
                    android:layout_gravity="center"
                    android:visibility="gone"
                    android:background="@color/fui_transparent" />


            </LinearLayout>

            <!--
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/answer"
                android:textColor="@color/textColor"
                android:textSize="19sp"
                android:id="@+id/qdetails_answer_text"/> -->

            <com.github.ybecker.epforuml.features.latex.MathView
                android:id="@+id/qdetails_answer_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:scrollbars="none"
                app:setTextSize="11sp"
                app:setTextColor="@color/textColor"
                app:setText="@string/answer" />

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_gravity="end">

                <TextView
                    android:id="@+id/endorsementText"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text=""
                    android:visibility="gone" />

                <ImageButton
                    android:id="@+id/endorsementButton"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:background="@color/fui_transparent"
                    android:clickable="true"
                    android:src="@drawable/endorse_answer"
                    app:tint="@color/highlight"
                    android:visibility="gone"/>


            </LinearLayout>

        </LinearLayout>

    </androidx.cardview.widget.CardView>

</LinearLayout>