ellipsize end not showing the three dots at the end of text view in android

36 Views Asked by At

I am adding my xml layout below. In that I need to show the addressLine text as ellipsized, i tried maxLines=1, and singleLine = true but none of them are working.

`<?xml version="1.0" encoding="utf-8"?>
<layout 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">

    <data>

        <import type="android.text.TextUtils" />
        
    </data>

    <LinearLayout
        android:id="@+id/layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        
        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/textInputBillingAddressLineOne"
            style="@style/AddressFormTextInputLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <com.google.android.material.textfield.TextInputEditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/addressLine"
                style="@style/DefaultEditText"
                android:focusable="false"
                android:hint="@string/address_line_1"
                tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"
                android:ellipsize="end"
                android:maxLines="1"/>
        </com.google.android.material.textfield.TextInputLayout>
    </LinearLayout>


</layout>



    <style name="DefaultEditText">
        <item name="android:maxLines">1</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_width">match_parent</item>
        <item name="android:textSize">@dimen/_12sdp</item>
        <item name="android:fontFamily">@font/montserrat_regular</item>
        <item name="android:inputType">text|textCapSentences</item>
        <item name="android:textColor">@color/colorBlack</item>
        <item name="android:textColorHint">@color/colorGray</item>
        <item name="android:imeOptions">actionNext</item>

    </style>`

Kindly advise possible solutions to fix this problem

0

There are 0 best solutions below