-1

I am new to android development please help me in creating this type design I want to add text in the center of the top borders in the card enter image description here

please help me or guide me to achive the same view

3 Answers3

1

in TextView

android:hint="@string/name"

Example

<com.google.android.material.textfield.TextInputLayout
        android:id="@+id/editTextLayout"
        style="@style/Widget.Material3.TextInputLayout.OutlinedBox.Dense"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/editText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:autofillHints="none"
            android:hint="@string/name"
            android:inputType="textPersonName" />
    </com.google.android.material.textfield.TextInputLayout>
0

Take a look at he reference code available here

CountDownTimerView

Make changes according to your need.

Happy Coding

Ajay Makwana
  • 161
  • 1
  • 5
0
<RelativeLayout
    android:layout_width="300dp"
    android:layout_height="100dp"
    android:background="@drawable/bg_border_offer"
    >   
  <androidx.appcompat.widget.AppCompatTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Offer ends in"
    android:layout_centerHorizontal="true"
    android:background="@drawable/bg_white"
    android:textColor="@color/black_text_color"
      android:layout_marginTop="-8dp"
    />
</RelativeLayout>