stock-news-app / app / src / main / res / layout / fragment_favorite.xml
fragment_favorite.xml
Raw
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".ui.FavoriteFragment">

    <androidx.cardview.widget.CardView
        android:id="@+id/searchSection"
        xmlns:card_view="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="8dp"
        android:divider="@android:color/transparent"
        android:dividerHeight="0.0px"
        android:clipToPadding="false"
        android:clipChildren="false"
        card_view:cardCornerRadius="0dp"
        card_view:cardElevation="10dp">
        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <LinearLayout
                android:id="@+id/searchBox"
                card_view:layout_constraintTop_toTopOf="parent"
                card_view:layout_constraintStart_toStartOf="parent"
                card_view:layout_constraintEnd_toEndOf="parent"
                card_view:layout_constraintBottom_toTopOf="@id/notice"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_margin="8dp"
                android:paddingBottom="8dp">
                <ImageView
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:contentDescription="search icon"
                    android:src="@drawable/ic_baseline_search_24"
                    android:layout_gravity="bottom|end"
                    android:layout_marginBottom="4dp">
                </ImageView>
                <EditText
                    android:id="@+id/searchET"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:hint="Search symbol"
                    android:textSize="18sp"
                    android:layout_gravity="bottom"
                    android:maxLines="1"
                    android:inputType="text"
                    android:imeOptions="actionDone">
                </EditText>
                <Button
                    android:id="@+id/addBut"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="2dp"
                    android:text="Add"
                    android:backgroundTint="@color/gray"
                    android:textSize="14sp">
                </Button>
            </LinearLayout>
            <TextView
                android:id="@+id/notice"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingBottom="8dp"
                card_view:layout_constraintStart_toStartOf="parent"
                card_view:layout_constraintEnd_toEndOf="parent"
                card_view:layout_constraintTop_toBottomOf="@+id/searchBox"
                android:text="@string/important_notice"
                android:textStyle="italic"
                android:textSize="12sp">
            </TextView>
        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.cardview.widget.CardView>

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/favRV"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/searchSection"
        android:layout_marginTop="4dp"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="8dp"/>

</RelativeLayout>

    <!--
    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/fab_margin"
        android:layout_marginBottom="16dp"
        android:contentDescription="TODO"
        app:srcCompat="@android:drawable/ic_dialog_email"
        app:layout_constraintTop_toBottomOf="@+id/favRV"
        app:layout_constraintEnd_toEndOf="parent"
        />
        -->